# .go .collection File Specification?

**URL:** <https://forum.defold.com/t/go-collection-file-specification/2818>\
**Category:** Questions\
**Created:** [September 3, 2016, 11:36am UTC](https://forum.defold.com/t/go-collection-file-specification/2818 "2016-09-03T11:36:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![NSCharles](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/n/e274bd/32.png) [@NSCharles](https://forum.defold.com/u/NSCharles)\
**Post date:** [September 3, 2016, 11:36am UTC](https://forum.defold.com/t/go-collection-file-specification/2818/1 "2016-09-03T11:36:34Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Ragnar\_Svensson](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/r/b5ac83/32.png) [@Ragnar\_Svensson](https://forum.defold.com/u/Ragnar_Svensson)\
**Post date:** [September 3, 2016, 9:17pm UTC](https://forum.defold.com/t/go-collection-file-specification/2818/2 "2016-09-03T21:17:34Z")

</div>

No sorry, nothing published or something we have planned to do.

---

<div class="post-metadata">

**Author:** ![Pkeod](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/pkeod/32/606_2.png) [@Pkeod](https://forum.defold.com/u/Pkeod)\
**Post date:** [September 4, 2016, 12:54am UTC](https://forum.defold.com/t/go-collection-file-specification/2818/3 "2016-09-04T00:54:44Z")

</div>

You could share your documentation of the internals of the formats to help others in similar future situations.

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [September 5, 2016, 6:11am UTC](https://forum.defold.com/t/go-collection-file-specification/2818/4 "2016-09-05T06:11:01Z")

</div>

I’m curious, what kind of things are your doing to the files and why?

---

<div class="post-metadata">

**Author:** ![NSCharles](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/n/e274bd/32.png) [@NSCharles](https://forum.defold.com/u/NSCharles)\
**Post date:** [September 6, 2016, 5:16pm UTC](https://forum.defold.com/t/go-collection-file-specification/2818/5 "2016-09-06T17:16:35Z")

</div>

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:

> [@Endless Runner - segment generation](https://forum.defold.com/t/endless-runner-segment-generation/801/4):
>
> 15-20 collections shouldn’t be a problem. You are correct that there is no way to get the child objects. You could in your main collection let the segment designer create one game object per collection and in each game object attach the collection factory plus a script. The purpose of the script would be in the init function to register the contained factory with the main collection by doing a msg.post(): msg.post("game:/game", "register\_segment", { url = msg.url("#collectionfactory") }) Mayb…

(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.
