AcresFieldMarks.h#
Acres/Source/Acres/AcresFieldMarks.h Generated
Marks of field work on the 25 cm cells of the farm, shared by the game and ACRES Core. Engine-free.
The farm keeps the ruts, the work flags and the look of field work in sparse maps with a world cell as the key: the cell (floor(X / 0.25 m), floor(Y / 0.25 m)) in Unreal world metres (X east, Y south). The game (FAcresFarmRuntime::Work) and ACRES Core (FAcresFarmState::Work) mark the same cells for the same strip, because the two use the walk of this file. ACRES Core has the frame east, north, up: it gives the walk the strip with the sign of Y and of the forward Y component changed.
FFarmDigest is the digest of the farm state that the two programs compute with the same function, for the cross-check of a session (Tools/SimControl/check_region_field_work.py).
| Name | Type | Unit | Default | Description |
|---|---|---|---|---|
MarkCellM |
constexpr double |
m | .25 |
Cell size of the rut map and of the field work map, m. |
MarkTilled, MarkSeeded, MarkSprayed |
constexpr uint8_t |
Field work flag bits of a cell: tilled, seeded, sprayed (FAcresFarmRuntime::WorkTilled and the others). |
ForEachStripCell#
Visits the cells below a strip of field work.
The walk goes along the strip and across it in steps of 12.5 cm (half a cell), so that no cell below the strip is skipped. It can visit a cell more than one time (four times at most).
| Argument | Description |
|---|---|
Width |
Width across the heading, m. |
Length |
Length along the heading, m. |
Visit |
Called with the cell key (int X, int Y) of each step. |
FFarmDigest#
64-bit digest of farm state (FNV-1a over the bytes of the values, in the sequence of the calls).
The digest of the regional farm state has three parts in this sequence. Part 1: for each regional crop patch with a crushed or a harvested sample, in ascending ordinal: the ordinal (uint32), the crushed mask and the harvested mask (uint16 each). Part 2: for each worked cell, sorted by X key and then by Y key: the two keys (int32 each) and the work flags (uint8). Part 3: for each field id from 0 to 200, the tilled, the seeded and the sprayed area as a count of cells (uint32 each: the area divided by 0.0625 m2 and rounded). The rut depths are not in the digest: ACRES Core keeps them as float and the game deepens a cell only in steps of more than 0.1 mm.
FFarmDigest::Add#
Adds the bytes of a buffer.
FFarmDigest::AddValue#
Adds the bytes of one value of a plain type (little-endian on the machines of ACRES).