Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefab Library #4681

Open
iampremo opened this issue Feb 9, 2024 · 12 comments
Open

Prefab Library #4681

iampremo opened this issue Feb 9, 2024 · 12 comments
Assignees
Labels
documentation Improvements or additions to documentation are required by this issue feature request New feature (or a request for one)
Milestone

Comments

@iampremo
Copy link
Member

iampremo commented Feb 9, 2024

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.

@iampremo iampremo added the feature request New feature (or a request for one) label Feb 9, 2024
@iampremo iampremo added this to the 2024.4 milestone Feb 9, 2024
@iampremo iampremo moved this to In Progress in GameMaker Roadmap Mar 28, 2024
@iampremo iampremo modified the milestones: 2024.4, 2024.6 Mar 28, 2024
@gnysek
Copy link
Contributor

gnysek commented Apr 18, 2024

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.

@stuckie stuckie moved this from Todo to In Progress in Team Workload May 23, 2024
@iampremo iampremo modified the milestones: 2024.6, 2024.8 Jun 7, 2024
@Alkapivo
Copy link

Alkapivo commented Jul 16, 2024

Package Manager in gamemaker? WOW 😮A few questions :)

  1. Question regarding the New format brief explanation: Does loading prefabs result in modifying the project's *.yyp file? Will there still be one file, or will the list of prefabs be in a separate file?
  2. How will encapsulation be ensured, and will naming collisions be prohibited by throwing an exception during the import of prefabs?
  3. 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?
  4. 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"

@iampremo iampremo modified the milestones: 2024.8, 2024.10 Aug 2, 2024
@jonathan-markland
Copy link

jonathan-markland commented Oct 4, 2024

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.

@gurpreetsinghmatharoo gurpreetsinghmatharoo added the documentation Improvements or additions to documentation are required by this issue label Nov 5, 2024
@yerumaku
Copy link

yerumaku commented Nov 7, 2024

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!
🥳

@yerumaku

This comment has been minimized.

@gnysek
Copy link
Contributor

gnysek commented Nov 13, 2024

@yerumaku it works on Linux already?
Image

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.

@yerumaku

This comment has been minimized.

@gnysek
Copy link
Contributor

gnysek commented Nov 13, 2024

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.

@yerumaku

This comment has been minimized.

@gnysek
Copy link
Contributor

gnysek commented Nov 13, 2024

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

@stuckie
Copy link

stuckie commented Nov 13, 2024

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.

@gurpreetsinghmatharoo
Copy link

Initial docs for what's currently functional: https://manual.gamemaker.io/beta/en/#t=IDE_Tools%2FPrefab_Library.htm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation are required by this issue feature request New feature (or a request for one)
Projects
Status: In Progress
Status: In Progress
Development

No branches or pull requests

9 participants