Building – Will include houses, public places, towers,monuments which have different attributes based on their subtype.
Nature – Trees, mushrooms, bushes, which will have also food attributes, some of them will be as food source, some of them will increase stealth value for hidden characters inside them.
Characters – Main actors of this project, which are moveable, they have personality attributes, will include also RPG stats, and so on.
Entities are handled by Entity manager, which is taking care about creating and deleting entities in world, and also optimizing performance. Entities are rendered and updated by main game loop. Of course, I should not render entities which you cant see, or update entity which have static position for long time, or perform AI operations often when entity is sleeping. Entity manager collects and try to adapt on entities needs to gain best performance for the game. Entity’s thinking (entities which have brain) is launched in separate shared thread, which is executed at 4 FPS. For thinking is this enough.
This is the main class for “thinking”. How many perceptions per one execution are handled, or how far can character see, will depend on attributes which will be implemented later. Characters are currently:
Collecting things around them (Perceptions)
Checking entities in their cone of vies (distance and FOV), including building positions,characters last position, and so on…
Collecting terrain information, like if position is passable, or reachable by pathfinding
Sounds (will be implemented), act on what character hears
Smells (will be implemented), tracking entities by smell
Collections of entities (characters, buildings, nature) are stored in to Memories
Acting on terrain and entity changes.
Handles all processed perceptions which we want store for character, because acting and decision making will be based on memories and perceptions. Also here, character attributes will affect, how much can each Character remember, how will relationships change when there are no/is interaction with other characters.
When character is spawned in to the world, it knows nothing about world. It starts to collect terrain data in his “territory”, till it finds group of entities or Settlement Point which will be home for Character. It will try to explore world around it’s home. Currently is also implemented situation, when Character accidentaly falls from high hill, or slides down and it cant reach previous targets, it continues of exploration but with flag, that it needs to find new home, because it is lost and home is no more reachable.