Summary
Ambient Civilians for Arma Reforger
This version of the mod currently only works for game master and conflict out of the box, but can be manually added to any game mode.
Description
Automatically populates towns, villages, settlements, ports, farms, landmarks and monuments with wandering civilian AI. No manual zone placement required, the mod discovers every location on the map at game start using the terrain's built-in location data/labels and should be plug and play.
Civilians spawn when players come within 1km of a location and despawn when they move away, hopefully keeping server performance in check. Each civilian wanders independently within the zone, picking a new random destination within the spawn zone every two minutes. Spawn positions are validated against terrain and geometry to avoid placing civilians in water, inside buildings, or under objects as much as possible.
Civilian vehicles also drive between towns on roads. The mod finds nearby roads and builds routes between locations automatically. Vehicles spawn outside your line of sight and despawn once they're far enough away. If a vehicle reaches its destination while you're nearby it'll turn around and drive back instead of vanishing in front of you. Stuck vehicles are cleaned up automatically.
GMs can place entities to disable individual zones or all ambient civilians, vehicles or both for their scenarios. Once removed the mod will renable core functionality without any problems.
---For Mission/Mod Developers---
Add the AC_CivilianManager to your GameMode entity. All settings are tunable per location type directly in the component attributes, including spawn radius, civilian count, and a prefab override for locations where you want a specific character type. A global prefab pool handles all other zones, picking randomly from whatever characters you add to it.
If you wish for the locations and numbers of civilians to be persistent between zone activation and deactivation you can enable persistence within the component. (this is turned off by default)
Community made terrains may use different type integers for locations. To discover them:
1. Set Log Level to 3
2. Load your mission on the terrain
3. Search the server log for "[AC] Found location" every location entity prints its name and type integer:
[AC] Found location 'MyTown' type=42 at <1234, 56, 789>
4. Note the integers for the location types you want to populate
5. Add entries to Location Configs in the component with those integers
6. Set Log Level back to 1 for normal play
To add ambient vehicles just add the AC_VehicleManager component and configure as required.
Take a look at GameMode_Editor_Full prefab within the mod for an example of the default settings, tweak until your heart or server is content!
---Future Plans---
Figure out a better way to stop civs spawning in water.
Write some better documentation
Have all settings editable via a custom .json for server operators to configure the component values
License
Arma Public License Share Alike (APL-SA)