Sign in to follow this  
  • entries
    7
  • comments
    3
  • views
    10423

The Entity

Sign in to follow this  
retroip

1061 views

Project NN is about characters which will behave autonomously. Many inputs, crunched by their "minds" will lead to acting. I called entity everything, what is placed in to the world except lights. Currently my entities are:
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.

Entity manager
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.

The Brain
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
Processing perceptions
Collections of entities (characters, buildings, nature) are stored in to Memories
Acting on terrain and entity changes.

The Memories
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.

Visualization:
1_MemoriesWorldPoints.png 2_IslandDiscovering.png

Start
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.
Sign in to follow this  


1 Comment


Recommended Comments

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now