The Building Configuration File

The different types of Buildings are configured in a Building Configuration File which is referenced by the BuildingManager. To configure your own game you can update this XML file (or create a new one) to define new buildings, costs, activities and more.


The configuration file uses an XML format to store the data. The XML is a serialised representation of a List of BuildingTypeData.


 The following table lists the elements of the XML file. 





Unique identifier for this building. Note that the ID should be unique across buildings AND occupants.




Human readable name of the building.



Human readable description of the building. 

 <description>Used to gather resources from forests. Required for most other buildings.</description>


Name of the sprite to use for this building. Looked up in the NGUI Atlas by this name so it muct match exactly.



Set this to true if the building is an obstacle that is cleared instead of being built.



Cost to build (or clear if this is an obstacle).



Time to build (or clear if this is an obstacle). Measured in seconds.



A list of strings containing ids of the buildings and occupants that this building allows. Note that allowIds is used for UI only, it is the requireIds field that prevents things being built.



A list of strings containing ids of the buildings and occupants required before this building can be built.





The shape of the building defined by grid offsets from 0,0 that are occupied by this building.

Entries of (0,0), (1,0), (0,1), (1,1) would define a small square building.

  <GridPosition x="-2" y="-2"/>
  <GridPosition x="-1" y="-2"/>
  <GridPosition x="-2" y="-1"/>
  <GridPosition x="0" y="-2"/>
  <GridPosition x="-2" y="0"/>    
  <GridPosition x="-1" y="-1"/>
  <GridPosition x="0" y="-1"/>
  <GridPosition x="-1" y="0"/>
  <GridPosition x="0" y="0"/>


List of custom activities (defined by ID and loaded by the ActivityManager) that this building can do.



Type of reward automatically generated by this building. Ignored if generation amount = 0.

For obstacles this is reward type for clearing.



Time it takes to generate the reward (in seconds).



Amount of reward to generate each time interval.


For obstacles this is reward amount for clearing.



Maximum amount of generated reward to store in this building.

The acknowledgement indicator will appear once this value is reached.



The space for holding occupants.

Note that occupants size can be variable (for example a building could hold two tigers with a size of 1, but only one elephant which has a size of 2).

Have more questions? Submit a request


  • 0
    John Williams

    Hey mate, I am using your template to create a city builder and I am having a little trouble with the resource generation. I can get building to generate ‘resource’ and ‘gold’ just fine but when I try to generate a custom resource it doesn’t link with the stored resource amounts. I can get the building to generate the custom resource but when I collect it it doesn’t add to the number of stores resources. I was wondering where I could find the data that links the collection to the stored resource amount? Thanks.

Please sign in to leave a comment.
Powered by Zendesk