Reusable Object Templates

First of all thanks for putting up a very well thought-through proposal! You went into everything from mockups to looking at existing functionality and relevant code and finally the data storage format. I think it will guide us well.

Some feedback from my side:

Updating a saved template

The “Template Editor” you show basically only shows a property editor. This works well for custom properties, but not for visual things like size, rotation, polygons or the tile of tile objects.

Personally, I kind of fear we may need a rather full-blown editor view for editing templates, similar to the Tile Collision Editor (but in addition it may need the Tilesets view). Possibly the TemplateEditor should get its own tab alongside other documents like maps and tilesets.

Collections format

The proposal proposes the following format:

 <template name="Old Tree" gid="30">
  <properties>
   <property name="type" value="tree"/>
   <property name="width" value="32" locked="true"/>
   <property name="height" value="32" locked="true"/>
  </properties>
 </template>

I think it is too different from how objects are stored in the TMX format. My suggestion would be to keep it largely the same:

 <template name="Old Tree" id="1">
  <object type="tree" width="32" height="32" gid="30">
   <properties>
    <property name="custom-property" value="tree" type="string" locked="true"/>
   </properties>
  </object>
 </template>

I understand this doesn’t immediately allow for storing the “locked” status for built-in properties like size and rotation, and I would suggest to consider these ‘overridable’ by default and maybe eventually introduce another XML element for storing the locked state of these things if considered useful.

Wrapping the object element inside of a template element is done to enable more code re-use and well as in order to make the format more flexible for the future. We may want to support multi-object templates or layer templates eventually.

I would say the top-level element should be templates rather than collection, as should be the element used to refer to the templates from the map file. Similarly, in the code I would call the new dock TemplatesDock instead of CollectionsDock.

That’s it for now, just let me know what you think. Thanks again for joining us and I’m looking forward to see this project through!