Deep Dive into an entity


I have talked about what entities are and its associated config in general terms but actually deep diving into an example config may make things more apparent as to what all this looks like. First off is the tag – tags are concepts which essentially allow groups of similar entities share configuration. Remember, everything is an entity and share the same basic configuration structure. Tags allow reusable parts which apply to a bunch of entities. The main ones that are easy to imagine are for example player controlled units, terrain, buildings etc. As well as sub tags such as infantry or tanks which are set on a subset of units. Here is a basic ‘Unit’ tag configuration:

{
    "Name": "Unit",
    "Description": "A controllable unit",
    "Defaults": {
        "Layer": 5,
        "Selectable": true,
        "Attack": {
            "CanBeAttacked": true
        },
        "Defence": {
            "CanUseDefence": true
        },
        "EntityAbility": {
            "AbilityPoints": 2
        }
    }
}

All values in the defaults are applied to any entity which it is associated with. Most of this is fairy self explanatory and keep it in mind until the end where we do a more in depth description in association with our ‘Archer’ unit:

{
    "Name": "Archer",
    "Description": "Mobile range unit",
    "Sprite": {
        "FilePath": "units/archer.png",
        "PixelsPerUnit": 210
    },
    "Tags": [
        "Unit"
    ],
    "Movement": {
        "Movement": 2,
        "AbilityConfig": {
            "PointCost": 1,
            "UsesPerTurn": 1
        }
    },
    "Attack": {
        "RangeAttacks": [
            {
                "Name": "Fire",
                "MinRange": 2,
                "MaxRange": 3,
                "Detail": {
                    "CanMoveAndAttack": true,
                    "BasePower": 0.2,
                    "Selector": {
                        "AllowTags": [
                            "Unit"
                        ]
                    },
                    "AbilityConfig": {
                        "PointCost": 1,
                        "UsesPerTurn": 1,
                        "EndsTurn": false
                    }
                }
            }
        ]
    }
}

Again this should be fairly self descriptive. On the root of the config we have:

Name and descriptionShould be fairly obvious
SpriteDefines the image used for the entity. There are plans to expand this to consume sprite sheets and allow animations to be added. Currently all units are static images.
TagsA list of associated tags. They get applied from start to finish so any later tags will overtire. For example, an archer could have tags ‘Unit’,’Infantry’ where it uses the base unit tag but then infantry features get applied after and overwrite if any features match.

After those fields, we have all of the Entity Abilities. Abilities are basically anything which dictates a particular feature of an entity. Abilities so far include:

AttackThe bread and butter of a combat based game mode. Currently supports direct and range attacks with the option of a splash effect. In plan is a ‘chess style’ attack where you land on another entity.
CaptureChanges the team of an entity to your team. Currently works when you are on the target entity (e.g a building) and can take a configurable number of points to capture.
ConstructIn development – This may just be superseded by Purchase.
DefenceAllows the entity to both supply and receive a defensive bonus.
HealIn development – Restores life. May be superseded by Modifications.
ModificationsIn development – Allows ‘status effects’ to be applied. These could include things that effect any of the other abilities. E.g ‘Injured’ which could effect movement range.
MovementDefines both the self entity movement and also how other entities move through this entity. E.g a Wall entity could prevent enemies moving through it but allow your entities to move through it at a cost of 1, and not allowed to move itself.
PurchaseAllows additional entities to be purchased using the money/transaction system. Defines the cost to purchase this entity and also what entities this unit can purchase and under what conditions. For example a barracks can produce infantry.
MoneyDefines the passive income that this entity generates per turn. This can also be used to add a cost of an entity per turn. Linked with the network concept
NetworkDefines if the entity can be used as a node in a network. This allows the concept of connected zones which currently may share resources. Future plans are the network can be given features if specific entities are included or a certain size. E.g a hacking game where you have to connect things with cables that the enemy can sever.

As you can see, there are a fair few abilities which can be applied to make each entity unique. I also plan to add to this list over time to add more abilities and add new features to existing ones (the list is endless!). And when used in different combinations can create some quite interesting ideas. Note: Any entity can use any ability! So get creative! I want to see lots of walking cities which produce flying scouts; or a fragile telepathic unit which can dominate the minds of its opponents and capture them!

Finally there are two more structures which are interesting which can be applied to each ability in various ways and allow quite a lot of specificity to each ability:

SelectorAllows each ability to target a specific type of entity. Can define them explicitly by list of entity names or tags. For example, a dockyard can purchase entities with a selector of tag allow boats. A mountain can allow movement with a selector of tag allow infantry and planes but disallow tanks.
AbilityConfigThis defines when and how much an ability can be used. Each entity has a certain number of action points per turn and each action can cost a certain number of actions, can be used a certain number of times and if it ends the entities turn when used.

I am in the process of writing some actual documentation as with a proper structure as there is a lot of different concepts here and can be used in a lot of different combinations. However as a taster I hope that you can see that there are a lot different combinations that are possible and this generic structure can allow a lot of different game modes.


Leave a Reply

Your email address will not be published. Required fields are marked *