Making it work

Creating Entities

Entity creation can happen in two circonstances: during game design within the Entity Editor and during the actual gameplay (character, animal, plant birth, Item production, building construction, etc.).

For the game engine, the entity creation process will always look the same. Obviously at the design stage all parameters will be free of constraints, unlike during gameplay. We will describe examples for Items, Characters and Places in these two cases.

Entity creation in the Editor

The editor will allow to create an Entity from scratch or according to a template. Note that a Template is an editor concept and Type is a game framework concept. The template concept can contain more information than what defines a Type (think clothing, initial inventory, the way the name of the NPC is computed). Here the interest is on the entity framework, so we will do everything from scratch.

Example 25. Some food

We want to create an Item of type "Food". We go to Entity Creation. Select a name "Magic Mushroom". Choose a type in a tree. Select Food in the Item branch. No subtype. Two forms appear: one for the Property defined by "Item", which are exactly the ones of the Common Influence, shared by all Entities. It leaves all of them to default. The second form allows me to choose the value of the energy contained in the Item. It is the single Property defined by the subtype "Food". Type, name and field of the Property are defined by the subtype and I cannot change them at all. I change the default value and give a larger one. I come back to the first form, and choose generate. The form closes and another opens up. The Entity has been created: I see that the entity I just created with the name and the Property value I just created has been given an EntityID.

But the Entity still does not belong to the game because it does not exist anywhere. Then I choose the original location of the entity: I choose a place, and a position inside this place.

Example 26. A weapon

I want to create a weapon. I am back in the Entity Creation dialog. The name I choose for it is "kitchen knife". The Type will be Item, weapon, blade. Weapon and blade are basic Influences, not subtypes: They do not define any new Properties. I choose the values of the standard Item Attributes so that the kitchen knife will be a bad quality weapon. And then I confirm, The Entity is generated and I read its Entity ID. I want to use this Item as decoration in a vampire's castle. So I change its charisma to a very low level. And I influence it with "Blood". In fact this is a subtype which defines the "bloody" Property. I leave the default value for "bloody". The fact that the knife is bloody and cursed will be automatically added to the blade description.

Example 27. A Character

I want to create a Character I would like to create peasants for my middle age area. I will need quite a number of them, so I will start by defining a template in the editor and then derive(clone) identities from it. I open the template creation dialog. I name it "MyPeasants". The type will be Creature, Character, Civilian, Farmer. Civilian and Farmer do not define any Properties, they exist solely to define the community of civilians and farmers. Then I have to define the default inventory of these Characters, which must contains their clothes, tools, and gold. Money is defined by choosing an amount. All other Items in the inventory are created by cloning existing Items or template.

Entity creation inside the game

All sorts of events can lead to Entity creation in the game:

  • Character, god, animal reproduction (individual outside Populations) creates new Characters

  • Many actions can change an entity into a new one. For example, death has for consequences the creation of a dead body. The baker uses wood, water, salt and flour to bake bread. A craftsman uses wood and metal to create Items.

  • Building cities, roads, and houses leads to the creation of new places

These new entities are influenced by the context in which they were created. For example newborns will be influenced by their genetic heritage (depending on their parents' properties at the time), the place they were born, their zodiacal sign... These influence are not essential and will not define any new Properties by themselves. The action responsible for the creation of the entity will have complete control on how these influences are taken into account. It is possible to get rid of all of them.

Example 28. A birth

Birth of a child in a sorcerer guild. By default the type of the new character is choosen among the type of the parents. The new entity be influenced by:

  • the Common influence

  • the character influence, and all influence in the branch which leads to its individual type

  • an influence corresponding to his/her gender

  • an influence corresponding to his family (facultative)

  • an influence corresponding to his birth place (facultative)

  • an influence corresponding to his zodical sign (..)