Vanilla's filename standardization

Things that we aren't going to implement
Post Reply
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2904
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Vanilla's filename standardization

Post by darkfrei »

Hi devs!

It's partially a bugreport, but primarily the request.

TLDR: Make all vanilla filenames with the same mask, replace all uppercase letters with lowercase letters, don't use underscores, but dashes.


Situation: I've got the message that my mod doesn't work by the Linux system, however it was no error on my Windows.

The problem was that after a lot of copypasting I've write in the prototype this filename:
data.raw["offshore-pump"]["offshore-pump"].graphics_set.animation.north.layers[1].filename =
"__base__/graphics/entity/offshore-pump/offshore-pump_north.png"
See the problem? In this case the vanilla has "North", but not "north". This filename that was actually needed:
data.raw["offshore-pump"]["offshore-pump"].graphics_set.animation.north.layers[1].filename =
"__base__/graphics/entity/offshore-pump/offshore-pump_North.png"
Another prototypes have another filename mask:
data.raw["assembling-machine"]["chemical-plant"].working_visualisations[2].north_animation.filename =
"__base__/graphics/entity/chemical-plant/chemical-plant-foam-north.png"
data.raw["assembling-machine"]["assembling-machine-2"].fluid_boxes[1].pipe_covers.north.layers[1].filename =
"__base__/graphics/entity/pipe-covers/pipe-cover-north.png"
No underscores, no capital letters, no problem with Linux-based machines.

Maybe the same for numbers, if your first counting index is "1", don't start another counting with "0" or "01", please leave the same pattern as by another prototypes.

posila
Factorio Staff
Factorio Staff
Posts: 5202
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: Vanilla's filename standardization

Post by posila »

Have you considered doing table deepcopy of base sprite definitions and transforming the copy instead of hard-copying the base spritesheet definitions?

For the same reason you request the file rename, it is unrealistic it will happen - mods have hardcoded references to base filenames and the change would needlessly break lot of mods.

Linux having case sensitive and Windows case insensitive filesystem is unfortunate complication, and it would be nice if the game was able to help with prevention of this issue.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2904
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Vanilla's filename standardization

Post by darkfrei »

posila wrote:
Sun May 24, 2020 1:31 pm
Have you considered doing table deepcopy of base sprite definitions and transforming the copy instead of hard-copying the base spritesheet definitions?
I've made a "hardcopy" of spritesheet definitions, but my mod has uppercase letters only. After some changings I've made the error, that was not recognized from my side.
posila wrote:
Sun May 24, 2020 1:31 pm
For the same reason you request the file rename, it is unrealistic it will happen - mods have hardcoded references to base filenames and the change would needlessly break lot of mods.

Linux having case sensitive and Windows case insensitive filesystem is unfortunate complication, and it would be nice if would be able to help with prevention of this issue.
Here was actually a lot of prototype renaming or resizing of graphics, every such changings break some hardcoded mods. Almost(?) all prototypes with "basic-" prefix was renamed in few years.

In the last few months the graphic definition "data.raw["offshore-pump"]["offshore-pump"].graphics_set.animation" was changed too, all mods must be adjusted and updated to use new graphics.

Why we can change sprite dimensions, amount of sprites in the spritesheet but not file renaming?

Rseding91
Factorio Staff
Factorio Staff
Posts: 13265
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Vanilla's filename standardization

Post by Rseding91 »

darkfrei wrote:
Sun May 24, 2020 1:58 pm
Why we can change sprite dimensions, amount of sprites in the spritesheet but not file renaming?
Because they are different: Changes made months ago are already done with the knowledge they would break some mods. Changes made months ago also had reasons other than "it sounded nice" to do them; graphical updates for entities, or even older still - a major update with graphical updates and bugfixes fixes/features.

Changing filenames now does literally nothing except change the file names. To the player there's zero difference except their mod broke when they update their game. To most mod developers there's zero benefit and only negative (their mod broke). To us, there's only negative: mods breaking.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Won't implement”