Skip to content

AcresCoreWorld.h#

Game/Core/Source/AcresCoreWorld.h Generated

The static world of ACRES Core, shared read-only by every environment: the ACRE terrain, the surface map, the tyre surface templates and soil parameters of tractor.json, the soil texture and soil-water unit grids, the field raster, the crop patches and the named places. It replaces what the game does inside Unreal around the engine-free models: AAcresVehiclePawn::SampleSurface and SoilLibraryClassAt, FAcresFarmRuntime::Initialize (units, cells, patches) and Sample (soil water at a wheel), FAcresFieldSetup (fields, surface polygons, crop season).

Load it once per process; afterwards any number of threads may query it (nothing in it changes). What changes per environment (ruts, crushed crop) is in FAcresFarmState (AcresCoreFarm.h); the soil-water scenario is an FAcresConditions value each environment holds.

Frames: Core ENU metres about the tile centre (x east, y north). The game's grids are indexed in Unreal's world (X east, Y south), so lookups mirror y where they reach them (Unreal Y = -y).

SurfaceTemplateName#

Name of a surface template ("asphalt", ..., "dirt_track").

const char* SurfaceTemplateName(int Index);

ApplyConditionsWinter#

The winter of the conditions (FAcresConditions::SnowDepthM ...) on one wheel's surface of a surface class.

void ApplyConditionsWinter(AcresSim::FVehicleInput& Surface, int SurfaceClass, const FAcresConditions& Conditions);

ESurfaceTemplate#

enum ESurfaceTemplate : int

Surface template indices, the game's SampleSurface order (FVehicleInput::SurfaceIndex; 6 is "mapped").

Value Description
SurfaceAsphaltTemplate
SurfaceConcreteTemplate
SurfaceGravelTemplate
SurfaceDrySoilTemplate
SurfaceWetSoilTemplate
SurfaceMudTemplate
SurfaceMappedTemplate
SurfaceSodLaneTemplate
SurfaceSodTemplate
SurfaceDirtTrackTemplate
SurfaceTemplateCount

ECropKind#

enum ECropKind : int

Crop kinds (AcresCrops.h order).

Value Description
CropCorn
CropSoybean
CropPotato
CropKindCount

FAcresCropPatch#

struct FAcresCropPatch

One 1.52 m x 1 m crop patch (FAcresFarmRuntime's Patch): origin, ENU m; full-grown plant height, m; field 1-59; crop kind.

FAcresConditions#

struct FAcresConditions

Soil-water scenario of one environment (version 1 of the scouting task: constant during an episode).

The game starts every soil cell of the 4 m water grid at a fraction of the way from its unit's wilting point to its field capacity (farm.json initial_fraction..., 0.5; the menu's per-field wetness, 0..1.3 where above 1 moves toward saturation) and reports the surface wetness relative to that start (0 at the start). Without rain or a water-grid state, that is what the wheels see; Core reproduces it per cell.

Name Type Unit Default Description
GlobalFraction double Antecedent fraction for every soil cell (NaN: farm.json's value).
FieldFraction double On the regional ground (no water grid) the fraction sets the water content of each soil texture class between the class means of the tile's wilting point and field capacity (AcresSim::FRegionalSoilWater). Per tile field 1..59: its own fraction (NaN: GlobalFraction). Index 0 unused.
SurfaceFilm double 0 Rain film on the surface, 0..1 (the weather model's interception store; wets soil and nothing else).
MaxFraction double 1.3 The largest fraction that a soil cell takes (a larger GlobalFraction or FieldFraction is clamped to it): 1.3, 30 % of the way from field capacity to saturation (the limit of the game's menu), or up to 2 (saturation, the scale of -FieldSetup= and of the Mesonet wetness index).
bWeather bool false Weather of the soil-water columns of the regional ground (FAcresFarmState::StartWater). bWeather false: no columns, and the regional soil keeps the water content of its texture class (the state before the columns). RainMmH: rain rate, mm/h. EvapMmDay: potential evaporation, mm/day. TimeScale: environment seconds for each simulation second (the farm clock of the game).
SnowDepthM, SnowDensity, IceShare double Winter of the episode, constant (the game's weather snowpack, glaze ice and frozen soil; SetWinter): the snow depth, m, and density, kg/m3; the share of the surface that glaze ice makes slick, 0 to 1; whether the soil is frozen. Each wheel's surface gets them by its surface class (AcresSim::ApplyWinter). None: the surfaces of before.

FWetSpot#

struct FWetSpot

Wet spots of the tile's 4 m water grid (a hollow or a seep in a field; the scenes of the benchmark task T2): a soil cell whose centre is within RadiusM of a spot's centre (ENU m) takes the spot's fraction where it is larger than its own (before the clamp at MaxFraction). The wheels and the tools read the grid bilinearly, so the edge of a spot is a ramp of one cell (4 m). None (WetSpotCount 0): the grid of before, bit for bit. Not on the regional ground (it has no water grid).

FAcresWorldOptions#

struct FAcresWorldOptions

Options of FAcresWorld::Load.

Name Type Unit Default Description
ContentDir std::string Game/Content/Simulation (the game's data folder).
bFlat bool false A flat world instead of the ACRE tile: a plane at FlatZ with one surface everywhere (the log replays of the Polaris test stand, tests). FlatSurface is a tractor.json surface name, or "bench_asphalt" / "bench_grass" / "bench_gravel" for the Polaris test stand's grounds (Tests/Game/Polaris/UtvBench.h).
CropSeason std::string "2026" Crop season file ACRE/crops_<season>.json ("legacy": fields.json land cover); growth fraction of every planted field (the game's default 1: mature); whether fields without surveyed patches are planted on the patch grid.
CropDate std::string The date mode of the growth (the game's -CropStage=date): a date YYYY-MM-DD. Each field of the tile and each regional field then starts with the degree days of the season's daily temperatures from its planting date to this date (crops_<season>.json, DriveRegion/fields.json), and InitialGrowth is not used. Empty: off.
bFarmWater bool true The wheels read the farm's soil water (the game's FAcresFarmRuntime::Sample); false keeps the tractor.json templates' own water content, as the game does without a farm (-FarmDisabled).
bDriveRegion bool false Include the surveyed ground around the tile (ACRE/DriveRegion): its heights, surface classes and soil texture, and the regional fields RF001 to RF100 (ids 101 to 200) in FieldAt. The water grid and the tile's crop patches still describe the original tile.
bRegionCrops bool true With bDriveRegion: the standing crops of the regional fields (DriveRegion/crops.bin, crops.json), which the wheels and the body crush as they crush the tile's patches. They load when the two files exist; the load fails when crops.json does not name the region.bin and the crops.bin beside it. False: no regional crops.
CropHeightM double m Full-grown plant height per crop kind (corn, soybean, potato), m: the game takes it from the patch meshes' bounds; these are estimates (they only matter for the body sweep against the 0.33 m clearance).
SceneFile std::string Obstacle scene for the LiDAR and collisions (Game/Core/Data/acre_scene.json; empty: none).
ObstaclesFile, GroundClassesFile, GroundClassesMetaFile std::string The scouting map's obstacles (ACRE/Scouting/obstacles.json: the collision geometry the ground classes use) for the collisions and obstacle distances, with the shapes the scene lacks added for the LiDAR (needs SceneFile); and its ground classes (ACRE/Scouting/ground_classes.u8, 0.5 m) as the task zones, so the crushed crop is counted per class: 0 crop, 1 lane, 2 verge, 3 edge band, 4 obstacle, 5 other. Empty: none. The raster's size and position come from "ground_classes" of GroundClassesMetaFile (empty: scouting_map.json beside the raster): width, height, step_m and west_m, north_m (schema acres-scouting-map-2) or origin_m (schema 1, a square raster about the origin). Without that file the raster is the tile's 3048 x 3048 cells of 0.5 m.

FAcresPlace#

struct FAcresPlace

Named place of places.json: ENU position, m; heading, deg compass (NaN when the place has none).

FAcresWorld#

class FAcresWorld

The static world. See the file comment.

Name Type Unit Default Description
ZoneCount static constexpr int 8 Task zones: a raster the task layer sets (the scouting task's ground classes: e.g. 0 other, 1 lane or verge, 2 edge band, 3 crop), so crushed crop is counted per zone where each sample stands. Cell (i, j) covers x in [X0 + i c, X0 + (i + 1) c), y in [Y0 + j c, Y0 + (j + 1) c) (rows run north); values are clamped to ZoneCount - 1; outside the raster the zone is 0. Set it before stepping (not thread-safe with Step).
Options FAcresWorldOptions Options it was loaded with.
Terrain FAcresTerrain Terrain (a plane in a flat world).
Scene std::unique_ptr&lt;FAcresScene> Obstacle scene for the LiDAR and collisions (null without FAcresWorldOptions::SceneFile).
SurfaceMap AcresSim::FSurfaceMap Surface polygons (Unreal world metres, as the game's map).
SurfaceCodes std::vector&lt;unsigned char> Maps without surface_polygons.json: surfaces.u8, one template code 0-5 per 1.524 m survey cell (the game's fallback), and its lookup.
Templates AcresSim::FVehicleInput tractor.json surface templates by ESurfaceTemplate (HasTemplate false where the file has none).
TractorRolling double The rolling resistance of each template for the Maxxum's tyres (tractor.json "rolling"; Templates holds the Polaris's, "rolling_polaris" where the file has it). FAcresTractor uses these on hard ground.
FlatSurface AcresSim::FVehicleInput The flat world's surface (bFlat).
Ground AcresSim::FGroundParameters tractor.json soil block (the session's ground: soil library class per wheel from the soil map when ClassFromTexture) and vehicle.water_drag_cd.
SoilTexture std::vector&lt;uint8_t> Soil texture group per 1.524 m survey cell (1000 x 1000, row v).
FarmWidth int 0 4 m farm grid (field-grid.json): cells per side, corner (Unreal metres, both axes), cell size.
FieldIds, Cover, CellUnit, CellKind std::vector&lt;uint8_t> Per 4 m cell: field id (field_ids.u8), cover code (cover.u8), water unit and kind (0 soil, 1 pavement, 2 gravel).
RegionFieldWidth, RegionFieldHeight int Regional 4 m field raster (DriveRegion/field-grid.json, field_ids.u8; empty without bDriveRegion): cells per side, corner (Unreal metres, both axes), cell size, and the half side of the tile inside which the tile's raster holds. Values: 0 or 101-200.
UnitWilting, UnitFieldCapacity, UnitSaturated std::vector&lt;double> Surface-layer water contents of the SSURGO units (soils.json; unit 0 = the most common one): wilting point, field capacity, saturation, m3/m3.
InitialFraction, GravelFieldCapacity double farm.json initial_fraction_between_wilting_and_field_capacity; gravel's field capacity.
RegionTheta double Water content of the regional ground by soil texture class (SoilFine, SoilMedium, SoilCoarse), m3/m3: the tile's soil of that class at the start of the water grid (AcresSim::RegionalSoilTheta).
RegionWater AcresSim::FRegionalSoilWater The class sums behind RegionTheta, for the water content of the regional ground at a condition's fraction.
RegionColumns AcresFarm::FieldColumns The soil-water columns of the regional ground with the soil, the detention depth and the sealing of each column and the values of farm.json (ksat_scale, evaporation_factor, surface_sealing), at the start state of farm.json. Empty without the regional field raster. An environment copies it (StartRegionColumns).
RegionFieldMainTexture int Main soil texture class of each regional field (the class of most of its raster cells; -1: no cell).
FieldCrop int Crop per field after the season (-1 none, else ECropKind); farm.json crop parameters; degree days per field.
Patches std::vector&lt;FAcresCropPatch> Crop patches and their 4 m bins (CSR over BinCount x BinCount bins from BinOrigin, m).
LevelPatchCount size_t 0 The first LevelPatchCount patches are the patches that are planted in the level (ACRE/crop_patches.bin); 0 without that file. The patches of the generated fields follow.
CulledPatchCount size_t 0 The patches that are left out because their centre is not field ground of the surface map (the game logs the same count: ACRES_CROP_SEASON_PLANTED culled=).
RegionCrops AcresSim::FRegionCropData The regional crops (bound to the ground chunks; empty without them). A patch has no entry in Patches: the crush state is kept under its ordinal in the file (FAcresFarmState::RegionCrushed).
RegionCropField std::vector&lt;uint8_t> Field id 101-200 of each field index of the crop file (DriveRegion/fields.json crop_field_index); crop kind by field id (-1: none; the entries below 101 are unused); growth fraction of the regional crop by crop kind.
RegionFieldGdd double Degree days of the crop of each regional field by field id (the entries below 101 are unused), as FieldGdd of a tile field.
SeasonYear, SeasonFirstDay, CropDay int The crop season's weather (crops_<season>.json): the year that the day numbers count from, the day number of the first weather day, and the daily minimum and maximum air temperature, deg C. CropDay: the day number of Options.CropDate (-1: no date mode).
Places std::vector&lt;FAcresPlace> Named places.

FAcresWorld::Load#

Loads everything; false with Error on a missing or malformed file.

bool Load(const FAcresWorldOptions& Options, std::string* Error = nullptr);

FAcresWorld::SurfaceClassAt#

Surface-map class (AcresSim::ESurfaceClass) at a point; field where no polygon holds it.

int SurfaceClassAt(double X, double Y) const;

FAcresWorld::SurfaceAt#

The surface a wheel stands on (the game's SampleSurface, FAcresFarmRuntime::Sample and SoilLibraryClassAt): the tractor.json template of the surface-map class, the soil water of the 4 m grid bilinear at the point, the rut depth of the 25 cm rut cell and, on soil, the library class of the mapped soil unit.

Argument Description
Conditions Soil-water scenario.
RutDepthM Existing rut depth at the point, m (FAcresFarmState::RutAt).
OutClass Receives the surface-map class (may be null).
Farm The farm of the environment (may be null). When it has soil-water columns (FAcresFarmState::StartWater), a wheel on regional soil gets the water content, the wetness and the pond of its column where rain made the column wetter than at the start.

Returns: The wheel's surface input (controls left at their defaults).

AcresSim::FVehicleInput SurfaceAt(double X, double Y, const FAcresConditions& Conditions, double RutDepthM, int* OutClass = nullptr, const FAcresFarmState* Farm = nullptr) const;

FAcresWorld::RegionColumnIndex#

Index of the soil-water column of a field id and a soil texture class (FAcresFarmRuntime::RegionColumnIndex): three columns for each regional field, and the first three for the regional ground that is in no field.

static int RegionColumnIndex(int Field, int Texture) ;

FAcresWorld::StartRegionColumns#

The soil-water columns of the regional ground at the start state of a scenario (FAcresFarmRuntime::BuildRegionColumns and ResetRegionColumns): the surface layer at the water content of its texture class, the subsoil at the fraction of the scenario, no pond and empty ledgers. Out is empty when the world has no regional field raster.

void StartRegionColumns(const FAcresConditions& Conditions, AcresFarm::FieldColumns& Out) const;

FAcresWorld::FieldAt#

Field id of the 4 m field rasters at a point (0: none; FAcresFarmRuntime::FieldAt): 1-59 from the tile's raster (ACRE/field_ids.u8). With the regional fields (bDriveRegion), a point outside the tile (|X| or |Y| at or above the tile's half side) reads the regional raster (DriveRegion/field_ids.u8): 101-200. See AcresFields.h.

int FieldAt(double X, double Y) const;

FAcresWorld::FieldPolygonAt#

Tile field id 1-59 whose polygon (fields.json) holds a point (0: none; FAcresFieldSetup::FieldAtUv).

int FieldPolygonAt(double X, double Y) const;

FAcresWorld::SoilTextureAt#

Soil texture group (AcresSim::SoilFine / Medium / Coarse) of the mapped SSURGO unit at a point.

int SoilTextureAt(double X, double Y) const;

FAcresWorld::CellTheta#

Surface-layer water content of a 4 m cell under a scenario, m3/m3 (pavement 0, gravel its field capacity).

double CellTheta(int Cell, const FAcresConditions& Conditions) const;

FAcresWorld::FieldGrowth#

Growth fraction 0..1 of a field's crop (AcresFarm::Growth of its degree days), for a tile field and for a regional field 101-200. The growth is fixed at the load: InitialGrowth, or the date mode (CropDate).

double FieldGrowth(int Field) const;

FAcresWorld::DayOfSeason#

Day number of a date YYYY-MM-DD: days since 1 January of the year of the crop season (-1: not a date, or no season weather).

int DayOfSeason(const std::string& Date) const;

FAcresWorld::StartGdd#

Start degree days of a crop: InitialGrowth of its maturity, or in the date mode the degree days of the season from PlantDay (a day number; below 0: not planted) to CropDate, at most the maturity (the rule of the game).

double StartGdd(int PlantDay, int Kind) const;

FAcresWorld::FieldCropKind#

Crop kind (ECropKind) of a field id, tile or regional; -1: no crop or no field.

int FieldCropKind(int Field) const ;

FAcresWorld::HasRegionCrops#

True when the regional crops are loaded.

bool HasRegionCrops() const ;

FAcresWorld::RegionPatch#

A regional crop patch by its ordinal: centre, ENU m; field id 101-200; crop kind. False for an ordinal the crop file does not have.

bool RegionPatch(uint32_t Ordinal, double& OutX, double& OutY, int& OutField, int& OutKind) const;

FAcresWorld::PatchBin#

Crop patches whose 4 m bin (ENU floor(x / 4), floor(y / 4)) is (Bx, By): [Begin, End) into PatchIndex.

void PatchBin(int Bx, int By, const uint32_t*& Begin, const uint32_t*& End) const;

FAcresWorld::FindPlace#

A named place by id or name (case-insensitive); null when unknown.

const FAcresPlace* FindPlace(const std::string& IdOrName) const;

FField#

struct FField

Fields of fields.json: outer ring in survey (u, v) cells and bounds, by id (index 0 unused).