Skip to content

AcresAgents.h#

Acres/Source/Acres/AcresAgents.h Generated

Which vehicles a session drives, and each one's own settings (single- and multi-agent sessions).

A session has one or more agents. Agent 0 is the player's first pawn, spawned by the game mode (AAcresShellGameMode, -VehicleDemo); it spawns the others in its BeginPlay (AAcresVehiclePawn::SpawnAgents), and they share its world, farm and weather. The list comes from the command line, first match wins:

-Agents=<file.json>              {"agents": [{"name": "maxxum", "vehicle": "maxxum", ...}, {...}]}
-Vehicles=maxxum,polaris         one agent per entry; an entry may carry a pose: polaris@533:470:-90 (survey
                                 grid u, v and Unreal yaw, deg) or polaris@utm:505012.3:4478120.9:270 (UTM 16N
                                 easting, northing, m, and heading clockwise from UTM grid north, deg)
-Vehicle=maxxum|polaris          a single vehicle (the default is the Maxxum)

Per-agent settings are JSON keys of the agent's entry. For agent 0 each key falls back to its command-line flag, so a single-vehicle session works exactly as before; the other agents see only their JSON keys (FParse matches any substring, so prefixed per-agent flags would be matched by agent 0's own lookups).

| JSON key | Agent 0 flag | Meaning | |---|---|---| | name | | agent name: logs, sensor folders, HUD, bridge messages (default: the vehicle kind) | | vehicle | -Vehicle= | "maxxum" (the tractor of tractor.json) or "polaris" | | finish | -PolarisFinish= | Polaris paint: graphite, forest_green, desert_tan, deep_blue | | implement | -Implement= | Maxxum implement id | | spawn | -VehicleSpawnU/V/Yaw= | [u, v, yaw_deg]: survey grid cell and Unreal yaw | | utm | | [easting_m, northing_m, heading_deg]: UTM 16N pose, heading clockwise from UTM grid north (/vehicle/odom) | | utm_frame | | datum of the UTM pose: "nad83_2011" (RTK, default) or "wgs84" | | replay_file, replay_mode | -ReplayFile=, -ReplayMode= | replay track and mode (commands / path) | | drive_script | -DriveScript= | drive script JSON | | rl_port | -RlPort= (or -RlPorts=a,b,... by agent index) | JSON/TCP bridge port | | gear | -VehicleGear= | starting gear (Maxxum) | | sensor_record | -SensorRecord | true / false: record this agent's sensors | | sensor_overlay | -PolarisSensorConfig= (Polaris) | sensor overlay JSON on top of sensors.json (e.g. no camera) |

Pure data on the game thread; no Unreal objects.

Load#

Reads the session's agent list from the command line (-Agents=, -Vehicles=, -Vehicle=). Always returns at least one agent; names are made unique. Invalid input stops the game with a message (checkf).

Returns: The agents in order; element 0 is the game mode's pawn.

TArray<FAcresAgentSpec> Load();

IsMultiAgent#

True when the session has more than one agent (per-agent output folders are used then).

Argument Description
Agents The agent list.
inline bool IsMultiAgent(const TArray<FAcresAgentSpec>& Agents) ;

Value#

String setting of an agent: its JSON key, else (agent 0 only) the command-line flag.

Argument Description
Agent The agent.
Index The agent's index (0 = the game mode's pawn).
JsonKey Key in the agent's JSON entry (numbers are converted to text).
Flag Command-line match string with its trailing "=", e.g. TEXT("ReplayFile="), or null.
Out Receives the value; unchanged when neither is present.

Returns: True when a value was found.

bool Value(const FAcresAgentSpec& Agent, int Index, const TCHAR* JsonKey, const TCHAR* Flag, FString& Out);

Value#

Numeric setting of an agent (see the string overload).

bool Value(const FAcresAgentSpec& Agent, int Index, const TCHAR* JsonKey, const TCHAR* Flag, double& Out);

Value#

Integer setting of an agent (see the string overload).

bool Value(const FAcresAgentSpec& Agent, int Index, const TCHAR* JsonKey, const TCHAR* Flag, int& Out);

FAcresAgentSpec#

struct FAcresAgentSpec

One agent of the session: its vehicle kind, name and settings.

Name Type Unit Default Description
Name FString Unique agent name.
Vehicle FString TEXT("maxxum") "maxxum" or "polaris".
Options TSharedPtr&lt;FJsonObject> Settings from the agent's JSON entry (never null; empty for a -Vehicles= or -Vehicle= agent).
bGridPose, bUtmPose bool Pose given in the -Vehicles= entry or the JSON: survey grid (bGridPose: U, V cells, YawDeg Unreal yaw) or UTM (bUtmPose: EastingM, NorthingM, HeadingDeg clockwise from UTM grid north, UtmFrame datum).