GameMaker-Bugs
GameMaker-Bugs copied to clipboard
Prefab Library
The Prefab library is a window within which is listed the available prefabs to users.
Specific version of a prefab can be added to rooms or sequences directly. These prefabs will not be added to the project but a reference to them is kept allowing only the used assets to be added to a build.
This might be outdated, but on Discord it was said that prefabs phases might be ordered this way:
Phase 1 - file format changes
Phase 2 - Prefab Library and Package Manager integration
Phase 3 - UI creation prefabs
Phase 4 - User created prefabs
Sounds like this issue is about Phase 2.
Package Manager in gamemaker? WOW 😮A few questions :)
- Question regarding the New format brief explanation: Does loading prefabs result in modifying the project's
*.yypfile? Will there still be one file, or will the list of prefabs be in a separate file? - How will encapsulation be ensured, and will naming collisions be prohibited by throwing an exception during the import of prefabs?
- How will the synchronization of prefabs be ensured? Will it be possible to specify a specific repository, SHA, or branch name and file path, and then synchronize these files?
- Will the Package Manager be available as a CLI tool as well, or only through the GUI? E.g.:
- JavaScript:
npm install example-dependency - Python:
pip install example-dependency - Ruby:
gem install example-dependency - PHP:
composer require example/dependency - C#:
dotnet add package Example.Dependency - Go:
go get example.com/dependency - Swift:
swift package add-dependency https://github.com/example/dependency - Rust:
cargo add example-dependency - Kotlin:
implementation "com.example:example-dependency:1.0.0"
Some answers thus far.
This must be treated as preliminary until official release announcements are made.
"Does loading prefabs result in modifying the project's *.yyp file?"
Prefab Library Projects are entire GameMaker projects themselves, and will be located outside your game's folders. You don't consume any space in your file set by using the resources within Prefab Library Projects (resources are linked, not copied), but your final build artefacts will, of course, be larger by the amount of prefab resources you use.
Current format
Recap: Currently, the YYP and YY files contain links comprising name and path:
{"name":"SecretBase","path":"rooms/SecretBase/SecretBase.yy",}
Everything is simple, as here, we're always referring to resources within the user's game.
What happens with Prefab Projects
Firstly, Prefab Library Projects are to be known by URL-style names, for example: com.jurassicsoft.dinos-1.0.0
The Prefab Library Project itself has a new, separate, file that specifies the exported resources. Only these can be linked to. This is like public and private in OO.
If your YY file needs to connect to a resource exported from a Prefab Library Project, an additional field is introduced:
{"link":"com.jurassicsoft.dinos-1.0.0","name":"Triceratops","path":"sprites/Triceratops/Triceratops.yy",}
- No other changes would be made to any of your game's files in order to establish the above link. The above is sufficient.
- If the "link" field is omitted, like the original syntax, this will be a project self-reference. Prefab Library Projects need to use the 'name and path only' syntax to refer to resources within themselves, of course.
"Will there still be one file, or will the list of prefabs be in a separate file?"
There is no list stored anywhere as such, only the "link" fields at the point of reference, as described above. If none of your YY files mention that Prefab Library Project name, you are not using that prefab!
"How will encapsulation be ensured, and will naming collisions be prohibited by throwing an exception during the import of prefabs?"
(Name collisions refers to the "name" field illustrated above.) There are no naming collisions with resource references in the YY files because the "link" field distinctly identifies the Prefab Library Project. GML does have an issue, and we're working on that problem.
"How will the synchronization of prefabs be ensured? Will it be possible to specify a specific repository, SHA, or branch name and file path, and then synchronize these files?"
The only URL-like scheme we have at present is the package name and version. You must use this, but you can develop and link to your own prefab libraries locally, without publishing them.
Providers will sometimes re-issue their libraries, and increase the version numbers. No updates will be forced on end-users, so this will work like package management for programming languages: You aren't forced, but sometimes you might need to upgrade.
- Whether updated prefab libraries will be backwards-compatible is an issue for the provider and their user base.
- Whether prefab libraries are withdrawn will also be an issue for the provider and their user base.
We're designing tooling to manage links. The UI is likely to be an on-going exercise, as we discover how users use the software, and what they most commonly need to do when upgrading prefabs.
"Will the Package Manager be available as a CLI tool as well, or only through the GUI?"
Preliminary idea is: Both.
You use a lot of package managers ;)
Again, all this must be treated as preliminary until official release.
Please message in this issue when the Prefabs documentation appears, I also hope for a succinct article with an analysis of all the subtleties in the blog, it will be very useful to the community! 🥳
Do you have an understanding when Prefab Library will work on MacOS and Linux?
Is this included in the November 2024 version or only in future 2025 releases?
@yerumaku it works on Linux already?
It's automatic updates which is Windows-only. There was no info about prefabs being Windows only for prefabs. Only limitations is that they're for now YYG-bundles only.
-
IDE Plugins feature is closed, that is, it has been released. You can add new plugins via GMPM (when they appear).
-
Prefab Library works via GMPM too.
-
GMPM not work on Linux/MacOS
Updates (optimizations) were announced only for Windows (I draw conclusions due to the connection with GMPM)
it works on Linux already?
@gnysek
This shell does not work on Linux and Mac OS, and if it works for you, tell me what are the environment settings?
Can you at least download any package via GMPM?
I have no idea, but both GMPM and Prefabs are working for me on latest public beta on Ubuntu - Beta IDE v2024.1100.0.674 Runtime v2024.1100.0.700.
I have no idea, but both GMPM and Prefabs are working for me on latest public beta on Ubuntu - Beta IDE v2024.1100.0.674 Runtime v2024.1100.0.700.
NodeJS / vnm or something else related to NPM?
- It seems that on some systems GameMaker cannot work with the disk (there are not enough rights to write to the directory).
node and npm that GM uses should be in:
/home/<YOUR_UBUNTU_USER>/.config/GameMakerStudio2-Beta/<YOUR_GM_USER>/node/node/bin/
You can check there.
In my case permissions and ownerships are:
drwxrwxr-x 3 gnysek gnysek 4096 jan 18 2024 node
This is not the ticket to discuss issues you are having with GameMaker. The issue being discussed is #8345 - please keep the conversation there please. This issue is to track the overall Prefab Library going into the IDE, not plugins, GMPM or anything else.
Thanks.
Initial docs for what's currently functional: https://manual.gamemaker.io/beta/en/#t=IDE_Tools%2FPrefab_Library.htm
We're going to mark this as closed now, as the Prefab Library is now available for use, with a selection of Prefabs to use it with!
There may still be bugs, but these will be tracked separately as usual.
Closing as per comment, thanks!
Hello! Is there a time estimation for phase 4? Couldn't find any refs for it on gh
Not yet, we are still working on various bits of architecture with a controlled set of Prefabs ( our own ) to iron out the bugs. Which is where the current UI Prefabs have come from; more complicated logic driving Prefabs, rather than the original Asset Packs, so we can catch as many of the issues now, before the system is relied upon by everyone.