YoYoGames / GameMaker-Bugs

Public tracking for GameMaker bugs
24 stars 8 forks source link

Give sprite image files more natural names instead of GUIDs #5104

Open Alphish opened 7 months ago

Alphish commented 7 months ago

Is your feature request related to a problem?

Currently, a sprite frames will be called by some seemingly random GUID identifiers, with those identifiers changing when the sprite is re-imported. This makes a bit of mess with a version control, where effectively replacing a frame instead results in files being deleted and re-added. Also, it makes it seem like there's some potential pattern to the naming here (whether image hashes or something), which could make one hesitant to change things around, e.g. with an automated sprite replacement tool.

Describe the solution you'd like

Give the sprite frames more natural names, e.g. spr_Something_img00, spr_Something_img01, spr_Something_img02, etc. Layers may be called something like "layer00", "layer01" and so on.

Thus, the complete frame images would be called like "spr_Something_img00.png", "spr_Something_img01.png" etc. Layer-specific images would be saved as "layers/spr_Something_img00/layer00.png", "layers/spr_Something_img00/layer01.png", "layers/spr_Something_img01/layer00.png" and so on.

It will make it easier to figure out which image means what, and also reduce remove/add operations in the version control. Also, more predictable names might make it easier for potential sprite replacement tools (e.g. a single-frame spr_Splash could replace sprites/spr_Splash/spr_Splash_img01.png and sprites/spr_Splash/layers/spr_Splash_img01/layer00.png).

Describe alternatives you've considered

No response

Additional context

No response

gnysek commented 7 months ago

Since @stuckie self-assigned this one, I suspect we can close my FR which seems to be a duplicate of above: https://github.com/YoYoGames/GameMaker-Bugs/issues/3238 .

stuckie commented 7 months ago

This is a bit of a can of worms. Technically, as long as they are unique identifiers ( hence the use of GUID ) the system works fine... the problem actually comes down to the expectation that if something is now named Bob_frame0_layer1 that if that image is moved to a different frame and/or layer, that frameX and layerX also updates appropriately, rather than just the content within. It was also kept as a bit of compatibility with 2.2.5.. but we are now so very far from 2.2.5 that that no longer matters.

It needs more thought, rather than just a yes/no, hence why it was assigned.

gnysek commented 7 months ago

Wouldn't be that bad, if replacing images/frames wouldn't mean new filenames...

Also, something in middle, like sprite_name + GUID wouldn't be that bad too. With proper prefixes (like sprite, frame and layer) it would be also easier to automate external tools to replace images.