![]() |
Our aim is to put as much as possible design parameters in config files. These prop-files will tell the Evolution application which classes the game will use -- these classes are then dynamically loaded -- and will tell the application which rules are to be applied in the game.
For this aim we will be working with KnowledgeCatalog's. We have several of them:
Together with the different prop-files, the behavior is implemented in classes. For example a new type of Construction, a Church, can be created as follows:
public class Church extends Construction {
...
}
Evolution will use the Church just as any other construction and will know the rules by which a Church behaves both by running template functions in Construction as by querying the ConstructionKnowledgeCatalog.
The filenames used are just defaults. By the creation of a new World the main configuration file must be passed as an argument to the constructor. In the main file the names of the other files are listed.
This is the main configuration file.
Key | Description | Example |
---|---|---|
ResourcesFile | The name of the ResourceKnowledgeCatalog prop-file. | ResourcesFile = resources.prop |
LandsFile | The name of the LandsKnowledgeCatalog prop-file. | LandsFile = lands.prop |
ActionsFile | The name of the ActionsKnowledgeCatalog prop-file. | ActionsFile = actions.prop |
ConstructionsFile | The name of the ConstructionsKnowledgeCatalog prop-file. | ConstructionsFile = constructions.prop |
CreationPower | The initial creation power the player has | CreationPower = 500 |
Goal | Formula to calculate the goal of the game, this is in function of the resources (Resource.getValue()). For every resource which influences the goal you must specify its weight. | Goal = Happiness(2) Energy(4) |
Key | Description | Example |
---|---|---|
Resources | A list of resources involved in the game. | Resources = Happiness Food ChoppedWood |
The fact that a NormalHuman can only stand on explored land is not configurable.
Key | Description | Example |
---|---|---|
LandTypes | A list of landtypes involved in the game. | LandTypes = PlainLand Water Forest Roots |
InitLandTypes | A list of landtypes which may be used to create the initial map. | InitLandTypes = PlainLand Water Forest |
Type.resourceName | An image representation for the landtype Type. | Forest.resourceName = forest |
Type.contains | List of the resources wich may be on or under this landtype. If the amount is not specified the actual amount of the resource will be resolved by asking this to the Resource (Resource.putAmount(LandType)). This means that a certain landtype keeps an associative list of resources it contains, the amount of each resource is assigned in the constructor. | Forest.contains = Coals Cherries(30) |
Type1-Type2.resourceName | Defines that a transition is possible from Type1 to Type2 and that the given image is used to show this to the player. | Forest-Roots.resourceName = forest-roots.gif |
At this time only NormalHumans can perform actions.
Key | Description | Example |
---|---|---|
Actions | A list of actions possible in the game. | Actions = Resting Fishing PlantingTrees |
DefaultAction | The default action of a NormalHuman when he is not performing a specific task. | DefaultAction = Resting |
NoFoodActions | The actions which can be performed when there's no more food. | NoFoodActions = Resting Fishing Hunting |
Action.resourceName | An image representation for the action. | Fishing.resourceName = fishing.gif |
Action.usesResources | A list of resources the action uses. | Fishing.usesResources = Food(2) |
Action.producesResources | A list of resources the action produces. | Fishing.producesResources = Food(10) |
Action.influencedBy | A list of resources by which the action is influenced. | Fishing.influencedBy = Happiness |
Action.lands | A list of land types on which the action is possible. | Fishing.lands = Water |
Action.transformsLand | A list of land transformations and there speed | PlantingTrees.transformsLand = PlainLand-Trees(30) |
Action.reveals | A list of resources the action reveales from LandType.contains and the speed at which this happens | GeologicalInvestigation.reveals = Coal(30) |
Constructing is a special kind of action and only has an resourceName line in actions.prop. The rest of the info is contained in this file.
For constructions there are two stages: the constructing stage and the production stage. The constructing stage is similar to the properties listed in actions.prop but is defined in this file to keep things together.
Key | Description | Example |
---|---|---|
Constructions | A list of constructions possible in the game. | Constructions = CoalMine Farm PowerPlant Theatre |
Construction.constructing.<...> | The same properties as in actions.prop | CoalMine.constructing.usesResources = Energy(5) |
Construction.resourceName | An image representation for the construction. | CoalMine.resourceName = coalmine.gif |
Construction.forms | The possible sizes and forms for this construction. | CoalMine.forms = 2x2:1101 2x2:0111 2x2:1111 |
Construction.usesResources | A list of resources the construction uses. The amount must not be specified, in which case the implementation of the construction must calculate this. | PowerPlant.usesResources = Energy(5) Coals |
Construction.producesResources | A list of resources the construction produces. The amount must not be specified, in which case the implementation of the construction must calculate this. | CoalMine.producesResources = Coals |