vegastrike / Assets-Masters

Vega Strike Upon The Coldest Sea Original Game Data Art Sources (e.g. hi-poly/hi-res source models/images)
8 stars 6 forks source link

Rename Files for their actual formats #35

Open BenjamenMeyer opened 3 years ago

BenjamenMeyer commented 3 years ago

There are a number of files that have the incorrect file extension so the filename can be misleading.

There may be others too.

BenjamenMeyer commented 3 years ago

@ermo did a tool for PWCU to help with some of this. He's a good resource for some of these changes. We may also need to change some hard coded stuff in the assets/engine too.

ermo commented 3 years ago

As I said in the main gitter channel, the various image libraries in the VS engine already know how to decode based on the actual content of the files regardless of their extension. To wit, if this hadn't worked, then none of the current assets that are actually DDS encoded would've been able to load as their extension is currently .png.

Hence, it may make more sense to simply rename all image files foo.image and then update all sprites to reference the relevant foo.image files?

@ministerofinformation called this virtualised file types FWIW.

In the future, @ministerofinformation also suggested that we might tack on extra .image prefixes such as bar.stereo.image to provide more context in the file name.

BenjamenMeyer commented 3 years ago

So my main objection to just .image is support tooling outside VS - GIMP, etc - that might not like using .image.

  1. It's not as intuitive
  2. Some programs make it harder to open if not using their recognized naming patterns
  3. Some operating systems (Windows) and even desktop environments use file extensions to register applications

So while VS itself may be fine; we do also need to consider the tooling and environments that contributors will be using.

Also, bar.stereo.dds is just as good as bar.stereo.image and will be recognized by tooling easier to recognize or filter via their Open Dialog filters.

ermo commented 3 years ago

All fair points.

In that case, I think the sanest approach is to build a small python-tool (for distribution with the engine), which can take a look at a known list of (image) extensions, check their magic type and rename the extension to the proper format and update sprites accordingly? Possibly with a --report or --dry-run flag that allows asset maintainers to check and verify that no booboos have crept in unnoticed.

This is predicated on the idea that having to manually edit and change stuff which can be trivially machine checked/verified/changed is not a good use of maintainer time.