Docs · Engineering reference
Harvest
docs/features/harvest.mdEdit on GitHub
LF_WheatGrid and LF_WheatFieldRules — Feature/Harvest/LF_WheatFieldRules.c (#3285, 2026-11-18)
- ⚠️ Wheat field rules only, no player-visible effect yet: a field is a 3 m cell grid (60 x 40 m is 260 cells) with a cut bitset, a reaper bar footprint, a 0.5 to 6 m/s speed gate, 10 kg a cell and a 600 kg hopper. Cut wheat, the hopper and the reaper follow in #3287, #3288 and #3289. Tests:
harvest/wheat-field-rules(LOGIC).
LF_WheatField and LF_WheatFieldView — Feature/Harvest/LF_WheatField.c, LF_WheatFieldView.c (#3287, 2026-11-19)
- 🧪 A placed wheat field draws itself:
Prefabs/Harvest/LF_WheatField.et(LF_WheatField, boxm_fSizeXxm_fSizeZ, default 60 x 40 m = 260 cells, centred on the entity, yaw ignored) keeps theLF_WheatGridcut bitset and, on every machine except a dedicated server, one localStaticModelEntitypatch per standing cell (SpawnEntityPrefabLocal, never replicated).CutCells(cells)marks the bitset and swaps each cut patch for stubble (a repeat or out-of-range cell is skipped, the return is the newly cut count);Regrow()clears the bitset and stands every patch again. The patch, stubble and cell size come fromConfigs/Harvest/LF_WheatFields.conf(the wheat and stubble patch meshes of #3290; the vanilla stand-insc_arrhenatherum_elatius_01andc_fallen_leaves_01are gone). Every change logs on[LFDebug:Harvest]. Nothing replicates yet (#3288) and no reaper calls it (#3289). DebugWorld grid cellslice-3287holds a 45 x 21 m field. Test:harvest/wheat-field-cut(WORLD).
LF_ImplementHitch and LF_ImplementComponent — Feature/Harvest/LF_ImplementHitch.c, LF_ImplementComponent.c (#3284, 2026-11-19)
- 🧪 A reaper hitches behind a UAZ469 or a Z7211. Server
LF_ImplementHitch.Hitch(vehicle, out reason)spawnsPrefabs/Harvest/LF_Reaper_01.etwith the vehicle as its parent (EntitySpawnParams.Parent, the vanilla weapon-rack way) at the local offset of the vehicle's row inConfigs/Harvest/LF_Hitches.conf; a row matches the vehicle's prefab or any ancestor, so every UAZ469 variant uses theUAZ469_baserow. Neither mesh has a hitch pivot: the UAZ469 offset (0, 0, -3.4) sits behind its measured rear bound (-1.87 m); the Z7211 row (0, 0, -3) is an estimate, since the Rally DLC tractor does not load on the test server. The reaper has a mesh (vanillaCultivatorWreck_01until H5b), aHierarchyand anRplComponent, and no physics body, so it never drags or flips the vehicle; the hierarchy replicates, so other players and late joiners get it under the same vehicle. Refusals (not the server, not on the hitch list, already towing, a bad prefab) set the reason and log on[LFDebug:Harvest].Unhitchdeletes the reaper;FindHitchedfinds it on any machine.LF_ImplementComponentholds the bar width and the replicated hopper kg (SetHopperKg, for the cut tick #3289) and logsimplement present/implement follows(every 10 m the vehicle moves) on every machine, withbehind true|false. No player action hitches yet (the implement rack is H8, #3295); nothing is persisted. Test:harvest/implement-hitch(WORLD). Session proof:session hitch-sync(harness verbhitch,LF_ImplementHitchHarness.c): a late joiner sees the reaper behind the UAZ after it moves 50 m, and it goes when the vehicle is deleted the garage way.
LF_WheatFieldReplication — Feature/Harvest/LF_WheatFieldReplication.c (#3288, 2026-11-19)
- 🧪 A field's cut cells reach every client and a late joiner. The server sends cuts in batches: at most one reliable
RpcDo_LF_WheatCutper field per 250 ms (leading edge sends at once, the rest wait for the next allowed frame), carrying packed cell words as one string (12 hex characters per bitset word: 4 of word index, 8 of mask), plus oneRpcDo_LF_WheatRegrow; a cell already cut is never queued, so a repeat cut sends nothing.RplSave/RplLoadon the field carries the bitset (260 cells are 9 ints) and the client redraws from it. A dedicated server draws no patch. The replicated side is amodded class LF_WheatField(pure parts:LF_WheatFieldWire,LF_WheatCutBatch). Harness verbwheatsync state|cut|regrow <fieldIndex>(dev gate). Tests:harvest/wheat-field-snapshot(LOGIC); proof: dedicated server, two clients and a late joiner each report 21 stubbles after a 21-cell cut.
Wheat and stubble patch meshes — Prefabs/Harvest/LF_WheatPatch_01.et, LF_WheatStubble_01.et, Assets/Harvest/WheatPatch/ (#3290, 2026-11-19)
- 🧪 The two 3 x 3 m meshes a wheat field draws per cell.
LF_WheatPatch_01is 75 alpha-cut planes (25 positions, a star of three crossed planes at each, bent at half height) about 1.1 m tall: 300 triangles at LOD0, 72 at LOD1.LF_WheatStubble_01is the foot of the same clusters cut level at 30 cm: 216 and 72 triangles. Both use the base game's own wheat atlas,Assets/Vegetation/_Polyplanes/polyplane_wheat_01_{A,BCR,NTC}.edds(no texture of ours), through twoMatPBRTreeCrownmaterials modelled on the vanillaPotatoCrop_01(LF_WheatPatch.ematsways in the wind,LF_WheatStubble.ematdoes not). No collider, no shadow. The cards overhang the 3 m square by about 10 cm, so patches overlap a little and tile with no seam at any yaw (the field view turns each cell by a pseudo-random angle). Built bynode tools/blender/harvest/build.mjs(Blender scriptwheat_patch.py, thentools\cli rebuild-fbxfor the.xob);Configs/Harvest/LF_WheatFields.confpoints at both prefabs. DebugWorld grid cellslice-3290shows a 4 x 4 block (12 wheat, 4 stubble). Test:harvest/wheat-patch-meshes(WORLD). Credit: the textures are Bohemia Interactive's, shipped with the game. - 🧪 (2026-11-19, #3293, slice H6 of #3282, merged in-dev) Grain and flour sacks and the mill (data only, no player action yet).
Prefabs/Items/Harvest/LF_GrainSack.etandLF_FlourSack.etare LF quantity items counted in kilograms (a full sack is 50 kg,m_iMaxQuantity 50) that carry the vanillaSackUniversal_01mesh. The pack fileLF_Everon1989/Configs/Chains/LF_Chain_Wheat_Everon1989.conf(listed in the mission header) adds the process machinemill-wheatthrough the existing machine overlay: 2 kg of grain makes 1 kg of flour, up to 25 batches (50 kg of grain) in one interaction; the 2 minute batch time has no field in a machine row yet.LF_ResourceChainCatalog.Reload()is new (tests). Not in this card: the granary wholesale curve ($0.045/kg) and the bakery flour premium ($0.20/kg), because a market curve and a buyer row price a unit in whole cash (the finest is $1 a kg; the curve steps in hundredths of a cash unit but the base is whole cash); that needs a price unit or lot size in the market and buyer rows first. Testeveron/wheat-chain(pack leg,LF_Test_EveronWheatChain).
LF_OwnedImplements, LF_HarvestSavePayload and the implement rack — Feature/Harvest/LF_OwnedImplements.c, LF_OwnedImplementsSavePayload.c, LF_ImplementRackAction.c, Prefabs/Harvest/LF_ImplementRack.et (#3295, 2026-11-19)
- 🧪 A player buys a reaper once and keeps it on a list. The farm supply counter (catalogue outlet
farm_supply, offerfarm_reaper, $1,200,LF_Everon1989/Configs/Catalogue/LF_Catalogue_Kit_Everon1989/LF_Catalogue_FarmSupply.conf) hands the sale toLF_OwnedImplements.ShopBuy(a three-line hook inLF_ShopComponent.Buy), which charges cash and putsreaperon the buyer's owned list instead of the inventory; a second reaper is refused (LF_EShopRefusal.ALREADY_OWNED, "You already own one of these"). The list is kept per character record key and saved in theharvestsection (LF_HarvestSavePayload, version 1, oneLF_OwnedImplementRowper implement). The rack prefab has two prompts, Take out reaper and Put back reaper (LF_ImplementRackAction). Take-out hitches the player's own reaper (LF_ImplementHitch.Hitch) to the nearest hitch-list vehicle within 8 m of the rack that tows nothing and is not saved as another character's; a player who owns none, or whose reaper is already out, is refused with a toast. Put-back needs the towing vehicle within 8 m of the rack, dumps the hopper (a warning toast says how many kg of grain were lost; the hopper is never saved or paid out) and deletes the reaper. What is out is session state only, so a reaper that is out at a restart is back on the list and not in the world; a reaper whose vehicle is destroyed is back on the list too. The farm supply counter itself is not placed yet (the rack and counter go in the world with the Saint-Philippe farm pass). Tests:harvest/implement-rack(WORLD),harvest/persist-owned-implements(PERSISTENCE),everon/farm-supply(pack leg).
LF_ReaperCutTick — Feature/Harvest/LF_ReaperCutTick.c (#3289, 2026-11-19)
- 🧪 A hitched reaper cuts the field under it and fills its hopper.
LF_ImplementComponentregisters each reaper that spawns on the server; a 200 ms server loop reads the towing vehicle's physics speed and heading, finds theLF_WheatFieldholding the bar (cached until the bar leaves it), and applies the H2 rules: 0.5 to 6 m/s cuts the cells under the bar (LF_WheatGrid.Footprint, width from the implement, 1 m long) throughLF_WheatField.CutCellsand adds cells times 10 kg to the replicated hopper (600 kg cap; a cell is cut only if its yield fits). Too fast, stopped and hopper full are each logged (reaper N refused: TOO_FAST ...) and shown to the driver once per change (#LF-Harvest_TooFast,#LF-Harvest_HopperFull; stopped has no hint). The hopper is session-only like the implement: nothing is saved, and no player can hitch a reaper until the rack (H8, #3295); the unload (H7, #3294) and the rack must persist or pay out the grain. The 10 m "implement follows" lines are debug level now. Test:harvest/reaper-cut(WORLD). Session proof:hitch fieldspawn,hitch drive,hitch state(grid cell slice-3287;stateprintshopper=andcut=).
The Saint-Philippe wheat field (#3302, 2026-11-19)
- 🧪 One
LF_WheatField(60 x 40 m, centred 50 m east and 25 m south of the open barn b19 of thesaint-philippe-farmwestsurvey) stands on the open pasture south of the farm barn, fitted bytown fit saint-philippe wheatfield(kitwheatfield, layerPlace_saint-philippe_wheatfield.layer, kindWheatField). Dressing: a wooden fence on the west and south sides with a gate opening mid-south, a hand cart with sacks, two haystacks, two bales and the vanillaPlowWreck_01andCultivatorWreck_01. Theharvestchalkboard and the contract board stand at the gate (#3656, below); the granary unload is the weighbridge (#3294).
Farm supply counter and implement rack at the Saint-Philippe farm — tools/town/kits/farm-supply.json, Place_saint-philippe_farm-supply.layer (#3631, 2026-11-19)
- 🧪 Slot
farm-supply(town template, shared on the farm barn b73, street furniture beside thefarmslot): on the verge between the barn and the village road, a shop counter with a till on outletfarm_supplyand a clerk, sacks, a crate, thefarm_supplychalk sign (LF_Signs_FarmSupply.conf) and the implement rack, so a player buys the reaper, takes it out onto a UAZ469 or Z7211 on the road shoulder and drives to the field. The rack mesh is the vanillaRack_01_Long(was theShelf_01stand-in). Map POIStoreCounter/farm-supply. Rows stand on the probed terrain (tools/town/terrain/saint-philippe-farm-supply.json). - 🧪 (2026-11-21, #3892) The farm plots slot is a stamped kit.
tools/town/kits/farm.jsoncarries astampblock (prefabBarn_E_02, no lanes), sotown stamp farmwritesPlace_saint-philippe_farm.layerfrom the kit with the three cabbage beds, seed crate, sign, honey kitchen and hives seated on the probed island ground (tools/town/terrain/saint-philippe-farm.json). Hive 1 clipped a vanilla wood pile, so it moved to local z 16. Island audit: no hard finding; the three hives read 6 to 7 cm sunk becauseLF_Beehivehas legs 6.3 cm below its pivot and the seat rests a mesh that reaches under its pivot by the pivot (BELOW_PIVOT), not on the legs; each hive row now carrieslift0.067 (contact -0.4 to +0.3 cm, baseline keys dropped). - 🧪 (2026-11-21, #3892) The farm supply yard is a stamped kit.
tools/town/kits/farm-supply.jsonnow carries astampblock (prefabBarn_E_02, no lanes: an open-ground yard), sotown stamp farm-supply --terrainwritesPlace_saint-philippe_farm-supply.layerfrom the kit and seats every yard row on the island ground (35 probed points, #3961) instead of the old fitted heights. The two sack piles overlapped 0.13 to 0.16 m; the second now stands 2.1 m from the first (kit z -9.7). Island audit: no hard finding (cm-level hover warnings on the sloped verge only). Baseline pass (2026-11-21): the verge is uneven, so the five-point seat left the counter 4 cm and the crate 2.1 cm over the ground; the kit now carrieslift-0.04 on the counter and -0.021 on the crate, the till (which does not follow a stack base's lift) sits at counter-local y 1.024, and the implement rack moved to local x -13.4, z -8.4 so no corner hangs over the lower edge. The four baseline keys are gone.
LF_GranaryUnload — Feature/Harvest/LF_GranaryUnload.c (#3294, 2026-11-19)
- 🧪 Unload a reaper's hopper at the weighbridge.
LF_GranaryUnloadActionis a prompt for the weighbridge entity (mode Sell grain or Bag grain, unload box = half extents in the entity's local frame, default 6 x 4 x 10 m). It shows to the driver of a vehicle that tows a reaper with grain in the hopper and stands in the box. The server decides everything from the user's own seat (LF_GranaryUnload.Sell/Bag); the client sends only the prompt. Sell grain pays the market's wholesale curve for the hopper's whole 50 kg lots ofLF_GrainSack(LF_MarketBook.QuoteAt, price moves down per lot,LF_OnMarketPriceMoved) throughLF_MoneyUtils.AddCashwith reasongrain-sale(soLF_OnMoneyMovedand the ledger record it, cash drops at the feet if the pockets are full); the hopper is emptied first and put back if the payout fails; a part lot (under 50 kg) stays in the hopper. Grain the market does not price (market off, no row; the granary row is the pack'sLF_Market_Granary_Everon1989.conf) is refused with a toast. Bag grain fills grain sacks into the vehicle storage (LF_InventoryUtils.AddAmount) and takes out of the hopper exactly what went in; what does not fit stays. Refusals (outside the box, no reaper, empty, passenger, on foot, no room, no price) loggrain unload refused (<why>)and toast the player; rate limited like a purchase. Not in this card: the prompt is not on any entity yet; the weighbridgeWeightStation_01gets it with the placement card (H12). Test:harvest/granary-unload(WORLD).
LF_HarvestContract — Feature/Harvest/LF_HarvestContract.c (#3297, 2026-11-19)
-
🧪 The farm board's harvest contract, server API only.
Post(field)posts one contract per ripe field (a field already cut to 95 % is refused).Take(field, user, rental, dlcOwned, kitAt, kitAngles, out kit)takes it: with the player's own reaper (they must own one, hitch it at the rack) or with a rental kit, which charges a $300 deposit (harvest-deposit) and spawns a Z7211 when the taker's client saysDlcManager.CanUseResourcepasses (LF_VehicleDlcGate.LocalOwns, the server cannot ask), otherwise a UAZ469, with a reaper hitched; the kit is a job vehicle, kept out of the world save and never an owned record. One taker per field.Settle(field, now)(a 5 s server sweep while a contract is taken) pays at 95 % cut: a $40 bonus (harvest-bonus) and FARMER XP, 5 per whole 100 kg cut since the contract was taken (LF_JobLevels.AddXp, the daily FARMER cap applies), once.ReturnKit(field, user, at, out refunded)takes the kit back within 8 m of the board, refunds the deposit once and deletes the kit (grain left in the hopper is lost); returned before the line, the contract opens again. A kit kept past 30 minutes lapses: it is deleted, the deposit stays with the farm and the field is free again. Contracts are session state; anyone seated in a kit is put out before it is deleted (a seat that stays taken retries every 5 s). Open deposits are the save sectionharvest_deposits(LF_HarvestContractSavePayload): a restart with a kit out pays the deposit into the taker's bank on the next boot, once (harvest-deposit-restart-refund). The board prop and its prompts areLF_HarvestBoard(#3656, below). Test:harvest/harvest-contract(WORLD). -
🧪 The farm board's harvest contract, server API only.
Post(field)posts one contract per ripe field (a field already cut to 95 % is refused).Take(field, user, rental, dlcOwned, kitAt, kitAngles, out kit)takes it: with the player's own reaper (they must own one, hitch it at the rack) or with a rental kit, which charges a $300 deposit (harvest-deposit) and spawns a Z7211 when the taker's client saysDlcManager.CanUseResourcepasses (LF_VehicleDlcGate.LocalOwns, the server cannot ask), otherwise a UAZ469, with a reaper hitched; the kit is a job vehicle, kept out of the world save and never an owned record. One taker per field.Settle(field, now)(a 5 s server sweep while a contract is taken) pays at 95 % cut: a $40 bonus (harvest-bonus) and FARMER XP, 5 per whole 100 kg cut since the contract was taken (LF_JobLevels.AddXp, the daily FARMER cap applies), once.ReturnKit(field, user, at, out refunded)takes the kit back within 8 m of the board, refunds the deposit once and deletes the kit (grain left in the hopper is lost); returned before the line, the contract opens again. A kit kept past 30 minutes lapses: it is deleted, the deposit stays with the farm and the field is free again. Contracts are session state; anyone seated in a kit is put out before it is deleted (a seat that stays taken retries every 5 s). Open deposits are the save sectionharvest_deposits(LF_HarvestContractSavePayload): a restart with a kit out pays the deposit into the taker's bank on the next boot, once (harvest-deposit-restart-refund). Not in this card: the board prop and its prompts (post, take own, take rental, return) are a follow-up card. Test:harvest/harvest-contract(WORLD). -
🧪 (2026-11-19, #3302 follow-up, merged in-dev) A weighbridge at the Saint-Philippe wheat field. The
wheatfieldkit gains a vanillaWeightStation_0116 m south of the gate opening and an invisible prompt entity on its scale pad (the ATM pattern:ActionsManagerComponentwith twoLF_GranaryUnloadActionrows, Sell grain and Bag grain, unload box 10 x 14 m, and anRplComponent), so a driver can unload the reaper hopper there (#3294). Refit withtown fit saint-philippe wheatfield --refit --terrain. -
🧪 (2026-11-19, #3656, in dev) The farm contract board at the wheat field gate.
Prefabs/Harvest/LF_HarvestBoard.et(inheritsLF_Sign_Board, the poster-style cork board) carries fourLF_HarvestBoardActionprompts: Post contract, Take with own reaper, Take with rental kit, Return kit.LF_HarvestBoard.Useis the one server entry: the user must stand within 6 m, the board's field is the nearestLF_WheatFieldwithin 90 m (no coordinates in core), and the call goes toLF_HarvestContract.Post/Take/ReturnKitwith a toast for the result. The rental prompt runs on the acting client, readsLF_VehicleDlcGate.LocalOwns(Z7211)there and sends it withSCR_PlayerController.LF_AskHarvestRental(the server re-checks every other rule; the board id must name a board). The kit spawns 5 m from the board on the side away from the field; a server with no Rally content spawns the UAZ469 for a DLC owner too. Thewheatfieldkit gains the board (pack sign idharvest_board, poster) and aharvestchalkboard (deposit $300, bonus $40, defs inLF_Signs_Harvest.conf), both just outside the south fence either side of the gate. Test:harvest/harvest-board(WORLD). -
🧪 (2026-11-19, #3302 follow-up, merged in-dev) Island harvest proof:
session harvest-island. One dedicated island session (up --mission island --clients 2 --profile full) runs the whole loop with the real prompts:resetplayercash, the farm supply till sells the reaper ($1,200), a plain UAZ469 stands beside the rack (hitch rackspawn) and Take out reaper hitches it, the character is seated (hitch seat), the server steers the pushed UAZ (hitch goto X Z SPEED;hitch warpis the fallback when a prop stalls a leg and the proof prints aWARPline) down the gate column of the wheat field at 3 m/s (26 cells cut, hopper 260 kg), client 2 reads the same cut (wheatsync state 0), Sell grain at the weighbridge pays whole 50 kg lots and leaves the remainder, Bag grain sacks the remainder. The harnessusefinds a named prompt entity by its layer name (FindEntityByName) and measures from the character's world position, so a driver in a seat can use a prompt that has no mesh. The first run found the weighbridge prompt entity at world origin: the layer wrotem_vHalfExtents "5 3 7"(a quoted vector), the engine loggedWORLD (E): Unexpected dataand dropped the entity'scoords; the layer and the kit source now writem_vHalfExtents 5 3 7, so the prompt stands on the scale pad. Frame cost, clean samples on--levers uncapped(a 10 fps flat 100 ms sample is the engine's unfocused-window throttle, not the field): 47.3 fps standing in the cut field, 43.1 fps at the rack. -
🧪 (2026-11-19, #3302 follow-up) Weighbridge prompt entity back on the scale pad. The layer and the
wheatfieldkit source wrote the grain prompt'sm_vHalfExtentsas a quoted string; a layer vector is bare (m_vHalfExtents 5 3 7). The engine loggedWORLD (E): Unexpected data at offset 5304, stopped reading that entity and created it at world origin, so no driver could ever see Sell grain or Bag grain. Found by the island harvest proof; with the fix both prompts work from the driver's seat.
Sickle-bar reaper mesh — Assets/Harvest/Reaper/LF_Reaper_01.fbx, Prefabs/Harvest/LF_Reaper_01.et (#3292, 2026-11-19)
- 🧪 The reaper prefab carries its own mesh, not the vanilla
CultivatorWreck_01stand-in. A trailed sickle-bar mower as 1989 kolkhoz kit: a 3 m cutter bar (38 finger guards and a toothed knife, steel) with its underside 0.30 m above the ground, skid shoes at both ends, a frame in faded field-green paint, two steel-rim wheels with dark tyres and red hubs, a faded-red grain hopper with a lid and a feed tube from the bar, a chain case, and an A-frame drawbar ending in a hitch eye and a jack leg. The origin is on the bar's centre line on the ground and the drawbar tip is 1.53 m toward the vehicle, which meets the UAZ469's rear bumper at theLF_Hitches.confoffset (0, 0, -3.4). 1,484 triangles at LOD0, 628 at LOD1; no collider (the implement has no physics body). Four materials,LF_Reaper_Paint|Red|Steel|Dark, tint the base game's shared metal maps (Assets/_SharedData/Metal/ST_MetalPaint_*,ST_Metal_Stainles01); no texture of ours. Built bynode tools/blender/harvest-reaper/build.mjs(Blender scriptreaper.py, thentools\cli rebuild-fbxfor the.xob). Test:harvest/reaper-mesh(WORLD).