CE: Ambient Spawner – DayZ
Summary
Ambient spawner is one of the dynamic event spawners, which we are using to spawn living entities on demand (ambient animals in this case). 'On demand' means mainly when players are approaching a place where these, usually animals, live (zone configured in CE Tool). Ambient animals are small animals (e.g. chicken, hare ... ). These animals lack sophisticated AI and only exist within the boundaries of their respective spawn location. Main functions of the ambient spawner are to spawn the animals at the right time and place, so that players can notice them.
Functionality
The combination of zones and events setup allows us to define necessary apects of the entity spawning. These are parameters like where, how many, how far and how often. Ambient spawner uses parameters already established as part of our events.xml setup. Zone data is defined in the animal territory, using the CE tool.
- The zones are activated when players enters the Distance Radius of a zone.
- All the entities (children of the zone) are spawned at once according to the dmin/dmax (territories.xml).
- random number between these two values
- inclusive of set values
- Amount of entities spawned by the event is limited by event max on a global level.
- To control the variety of entity types, the zone uses children min as weight between the types (percentage distribution).
- All the entities (children of the zone) are spawned at once according to the dmin/dmax (territories.xml).
- A zone is deactivated when all players leave its Cleanup Radius.
- Once zone is deactivated it goes on "cooldown". (event Restock)
- The zone will never spawn any entities again until it is deactivated and its cooldown ends.
- Spawned living entities are deleted from the map when the zone is deactivated, unless a player is near the entity. At that point, cleanup avoidance (global.xml) comes into effect.
Setup
Zone (territory XML files)
- Radius of zone - Determines where the entities can spawn
- Count of entities per zone - Limits amount of entities per zone
Zone "cooldown" (cfgenvironment.xml)
- zoneTouchDisableEditPeriodSec - Time when zone can be activated again once it has been deactivated.
Dynamic event (db\events.xml)
Parameter | Description |
---|---|
Active | Turn on/off spawning of entities. |
Max | Maximum count all entities spawned by this event across the entire map |
Restock | Time between spawning of inidividual entities. (deafult is turned off) |
Distance Radius | Distance between zone and player. When player steps into the radius, zone is allowed to spawn entities. |
Cleanup Radius | Distance between zone and player. As long as player is within this radius or a normal item cleanup radius, zone will never despawn its entities. |
Children
Parameter | Description |
---|---|
Min | Weight of the type particular type. All together should be 100 (%). |
Event
<event name="AmbientFox">
<nominal>0</nominal>
<min>0</min>
<max>25</max>
<lifetime>33</lifetime>
<restock>25</restock>
<saferadius>0</saferadius>
<distanceradius>80</distanceradius>
<cleanupradius>120</cleanupradius>
<flags deletable="0" init_random="0" remove_damaged="0"/>
<position>fixed</position>
<limit>mixed</limit>
<active>1</active>
<children>
<child lootmax="0" lootmin="0" max="0" min="100" type="Animal_VulpesVulpes"/>
</children>
</event>
Territory
<territory color="4294945280">
<zone name="Zone_fox" smin="0" smax="0" dmin="0" dmax="2" x="5996.25" z="11621.3" r="50"/>
</territory>