v1.2.7.0 — AI field work: on-demand equipment, harvest, spectator-cost fixes - #61
Closed
TheCodingDad-TisonK wants to merge 19 commits into
Closed
v1.2.7.0 — AI field work: on-demand equipment, harvest, spectator-cost fixes#61TheCodingDad-TisonK wants to merge 19 commits into
TheCodingDad-TisonK wants to merge 19 commits into
Conversation
…B entry The vehicle guard in both hudEditModeActionCallback and the RMB mouse handler blocked edit mode entirely when the player was in a vehicle — which is most of gameplay. Removed the guard from both paths. RMB entry now requires the cursor to be over the HUD (matching SoilFertilizer pattern), preventing accidental edit mode toggle during normal play. Added NPCFavorHUD:isPointerOverHUD() using the existing getHUDRect() API. Fixes #51 (reported via FS25_FarmTablet)
Completes the SoilFertilizer pattern: RMB no longer enters edit mode at all. The existing HUD_EDIT_MODE key binding is the sole entry point. RMB only exits edit mode when already active, and never consumes the event otherwise.
…im (#56) Register NPCFavor as a FieldSentry contract provider so a field under an active favor is masked from Soil & Fertilizer's simulation (the harvest gets vanilla yields and the favor stays completable) instead of being wrecked by depletion on land no one manages. High-relationship neighbours opt the field back into the sim so the player benefits from managing it. Server/host only, tries the FieldSentry_API global then the g_currentMission.fieldSentry bridge, and guarded so NPCFavor still loads without S&F. Bumps version to 1.2.6.0.
…e, edge cases - docs/ai-system.md: Corrected workSatisfaction description (rises when working) - NPCAI.lua: Removed duplicate getScheduledActivity, delegate to NPCScheduler - NPCAI.lua: Added loner personality to personalitySchedule - NPCAI.lua: Schedule-aware commute boost (not just evening) - NPCAI.lua: Split _originalSpeed/_modeSpeed for proper mood preservation - NPCAI.lua: Group speech bubble fallback when no partner found - NPCAI.lua: Clear gatheringData in updateSleepState - NPCSystem.lua: Added client-side orphan vehicle detection - NPCScheduler.lua: Reduced social pairing distance to 50m
- Real base-game AI field work: AIJobFieldWork tillage via temporary field ownership (borrow the player farm for the job, restore on finish, and a save-hook safeguard so a flip never persists), with chained AIJobGoTo driving and a kinematic combo as graceful fallbacks. Capped at 2 concurrent NPC AI jobs. - Fix the AI job start recipe (createJob + setValues) and gate on getCanStartFieldWork. - Fix VehicleCharacter loadCharacter arg order (was calling a table); seat via the correct 4-arg async signature. Spawn a real tractor+implement combo and attach it. - Fix 5 no-op vehicle deletions (g_currentMission:removeVehicle does not exist; use Vehicle:delete). Add npcDeleteVehicle console command. - Fix map-hotspot overlay render spam via a single mapHotspotInList flag.
Job-to-field matching v1: read the field's crop + growth state via FieldState:update() + FruitTypeDesc growth predicates. Only run tillage when the field is empty / stubble / cultivated. A field with a growing or ripe crop falls through to GoTo driving (drive/inspect) so an NPC never plows a crop under. Sowing and harvesting (seeders / self-propelled harvesters + supply) are staged.
Full farming-cycle job-to-field matching. Each farmer NPC gets a job role (till/sow/harvest, weighted, seed-based) and spawns the matching unit: - till: tractor + plow/cultivator (existing) - sow: tractor + seeder, filled with SEEDS after attach - harvest: self-propelled combine + brand-matched header An NPC runs the real AI job only when the field's need matches its role (getFieldJobType: open = tiller/sower, harvest = harvester, protect = growing crop never touched); a mismatch falls through to GoTo driving. New SEEDER_POOL and HARVEST_COMBOS pools, validated against the store. All base-game vehicle paths verified.
- Map-marker overlay spam ("Unknown entity id ... renderOverlay"): switch every
NPC hotspot to ONE shared overlay created once and never freed. Per-NPC overlays
were being freed (setPlaceable reset / delete) and then rendered every frame.
removeMapHotspot no longer deletes (would free the shared overlay); it nulls the
refs and drops the hotspot from the draw list. setPlaceable runs with the icon
nulled so it can't free the shared overlay.
- Field-aware job roles: assign a harvester ONLY when the assigned field is
actually ripe; a growing-crop field gets a tiller (won't till - the work gate
protects the crop - so the NPC just drives). No more combine parked on growing peas.
- Header/cutter attach: add a jointType-only fallback pass so a header that fails the strict subType compatibility check still attaches (a headerless combine can do nothing). If it still fails for a harvester, remove the useless combine too. - Zero the AI cost on GoTo driving jobs (they run under the spectator farm), fixing the "Can't change money of spectator farm" errors in the log.
- Growing-crop fields now assign an "inspect" role: a bare tractor (no implement) that just drives out to look, instead of dragging a plow over a standing crop. - Harvest: if the spawned combine can already do field work (carries a header from its store config), don't spawn/attach a redundant header (which was failing and scrapping otherwise-good combines).
…ost guards - On-demand spawn/despawn: an NPC's tractor/combine + implement is created at the field when they start working (matched to the field's CURRENT need) and removed when they stop, instead of pre-spawning from a stale field snapshot. Growing fields get no equipment; the NPC visits on foot. - Cancel the vehicle load if the NPC leaves work before the implement spawns, so nothing is created just to be deleted. - Fix harvester headers never attaching: the New Holland combo listed a header file (cr980_830, type=cutter) as its "combine", pairing two headers. Use the real combine (chSeries); the header now attaches and harvests. - Stop "Can't change money of spectator farm" spam: keep NPC vehicle fuel topped so the base game never auto-bills the spectator farm for a refuel.
Member
Author
|
Superseded: v1.2.7.0 was released from |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release v1.2.7.0 — real base-game AI field work, now with on-demand equipment.
Highlights
Verified in-game
Not yet verified in-game
Full details in CHANGELOG.md.