Each map may have different conditions applied to it. The simplest version of this is when all enemy entities are destroyed then the remaining team wins. However, this game is all about being generic so the Conditions section has been added to the map configuration. Currently there is only one type of condition allowed; the WinCondition. There are various other condition types in plan:
Type | Description |
WinCondition (Implemented) | Defines what conditions are applied to each team to win the game |
MessageCondition (In Plan) | Defines what messages are presented to the user under what conditions, time and position |
CampaignCondition (Ideas Board) | Allows events and results in other maps to effect the current map |
Currently only the WinCondition has been implemented. A detailed example for a win condition is:
"WinConditions": [
{ // A team can win by destroyin all enemy units
"TeamIds": ["TEAM_1", "TEAM_2"]
"EnemyEntitiesRemaining": 0,
"EnemyEntitiesRemainingTagFilter": "Unit",
"TurnNumber": 0
},
{ // Team 2 will win if turn 20 is reached
"TeamId": "TEAM_2",
"TurnNumber": 20
},
{ // Team 1 will win if they capture the enemy's 'Origin' entity type
"TeamId": "TEAM_1",
"EntityCaptured": {
"Position": {"X": 9,"Y": 6},
"EntityType": "Origin"
}
},
{ // Team 2 will win if they destroy the enemy's 'HQ' entity type
"TeamId": "TEAM_2",
"EntityDestroyed": {
"Position": {"X": 3,"Y": 3},
"EntityType": "HQ"
}
}
]
Additional fields can be easily added to the WinCondition to allow different win types. With the framework, these different types of winning conditions can be added to any map. The EntityCaptured and EntityDestroyed fields creates an EntitySelector object which is created at the start of a map and gets attached to the specific entity. Therefore even if say the entity moves or otherwise the condition can still track it.
In the same way, additional condition types are planned to be created and will have a similar format. will allow a flexible and easily configurable way to add variety to a map.
The current work started is the MessageCondition. This will contain the conditions in a similar structure of the win conditions – and will also contain many of the same fields. This will be linked to a new Message object or a collection of Message objects which will have various fields such as [Text, Position, Team]. This is a basic structure and could get a lot more complex with intertwined conditions and messages. But as a start it will allow basic messages to be sent i.e a simple tutorial or story.