Is there a specification for the contents of defold file types? (.go, .collection, etc)
I find myself writing lots of scripts to generate and manipulate these files and it would be very helpful if I didn’t need to discover their structure experimentally.
Mostly workflow things. I recently wrote a script to take a folder filled with game objects and creates a .collection that has a factory for each of those objects.
For specifics: our game features robots with customization parts, so we have hundreds and hundreds of these “robot part” game objects that we need to be able to create/display dynamically. So I wrote a script which essentially generated this solution:
(thanks for that by the way! )
Which meant I needed to inspect the contents of .go .collection and .factory files to generate a .collection with the appropriate setup.
To give you another example in the same vein: eventually we moved away from the factory solution, mostly because our game needed to send ~1 thousand messages at startup and that is probably not a good thing.
We ended up using the “play_animation” message on sprites to switch images in a part atlas, but, the reason we set up .go’s for each part individually in the first place was because they needed to have different pivots.
So I wrote a script which read the .go files and created mappings in Lua data for those pivots, so that the part display component can read from that table when receiving a “display part” message.
There have been a couple more instances, but you get the point. Mostly it’s processing stuff since we have a ton of game data.