-
Notifications
You must be signed in to change notification settings - Fork 3
FormulaEngine Concepts Archetypes
Archetypes can be thought of like templates or stencils that you use to stamp out "real" game objects. The only way to interact with an archetype during simulation is to create an entity of that archetype. Typically these entities will go into a list someplace.
Archetypes can have a handful of things attached to them:
- A name
- Bindings
- Event handlers
- Lists
The name is how an archetype is looked up when it comes time to make use of it. Names must be unique among all other archetypes in the world.
Bindings are special connections between the game engine code and the FormulaEngine scripts. See the separate treatment on Bindings for more details.
Event handlers are sequences of actions which are carried out in response to certain occurrences in the simulation.
Lists are simply named containers of other entities in the simulation.
Normal scriptable entities can be created in the data that feeds the simulation. However, they cannot be created dynamically at simulation run-time. If you'd like to create world objects that need to come and go during the simulation, or if you don't know how many objects to create up front, archetypes are the solution.