Building Dependent Heros

As of now, we do not include examples for building dependent heros in your game - but the following brief summary will help developers interested in making this game feature and how we perceive it to be done.

What are Heros?

Some games use specalized units, or heros, that come with a special building. For example a "Giant Knight" or a "Giant Archer" that you can only get when you build a certain type of building.

How can I make building a Unit dependent on a building?

First you need some graphics add-on/reassign of existing buildings to match the economy structure of battle games that feature heros (otherwise you can't even visualize it, and it will be difficult enough as it is):

Buildings:
Home Town
Production/Storage
Barracks
Spell Factory
Laboratory for Unit/Spell upgrades.
Each with say 12 levels of upgrades

Dependencies:

  • each HomeTown level allows you to build a certain number of production military defense decorations structures;
  • each HomeTown level corresponds to an hourly/daily production and maximum upgraded storage that will determine the average/maximum prices for everything in that level
  • each building upgrade level depends on HomeTown
  • each unit/spell upgrade level depends on Laboratory level
  • each upgrade has an evolving price/time required

Upgrades

  • for economy buildings hourly production storage hitpoints, time to upgrade
  • for defenses/units damage range hitpoints
  • for military buildings - how many units it can store/train in a queue.

Long story short, this feature is built on a massive data structure of entries, not to mention making a difference in-game - calculate properly damage, loot per character - what we have is an extreme over-simplification, even at this point.

You can find the dependencies in Evolution.XML, and they are processed by Stats.cs (although the function may probably be passed to a specialized module in future kit releases):

<MaxBuildings>2,2,2,1,1,1,1,1,1,1,1,1</MaxBuildings>
        <MaxWeapons>2,2,2,1,1,1</MaxWeapons>
        <MaxWalls>50,50</MaxWalls>
        <MaxAmbients>2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</MaxAmbients>

The only thing that is processed right now in the existing kit is the number of elements allowed to be built, for 11 levels. This was necessary to display the menus properly. Each of these arrays has the exact number of elements displayed in the menus. For instance here, the first 2 is the maximum number of builder huts, the second 2 is the maximum number of gold forges you can build at level 1, and it goes on through the list of structures. Each structure from the array is one of the items in this list.

<MaxBuildings>2,2,2,1,1,1,1,1,1,1,1,1</MaxBuildings>

Now, for example - at level 11 you can build 100 of each - to let the player build whatever he wants:

<MaxBuildings>100,100,100,100,100,100,100,100,100,100,100,100</MaxBuildings>

We made the existing Evolution.XML file like this for developers to easily test without limits - just set the player level to 11 in the Stats GameManager and you'll have unrestricted building abilities.

1426

Changing Stats GameManager in the Game scene to the development unrestricted test Level 11. Click to view larger