LS25 Realistic Soil & Fertilizer V1.0.7.2

LS25 Other

LS25 Realistic Soil & Fertilizer V1.0.7.2

Realistic Soil & Fertilizer Mod for Farming Simulator 25

V1.0.7.0
The HUD (J key) has been repurposed from a live per-field data display into a quick-reference legend. The full field data is now properly served by the Soil Report dialog.

– Fixed settings page injection that caused other mods’ settings pages (Graphics, Better Contracts, etc.) to appear white/blank when SoilFertilizer was loaded
– Fixed a latent runtime error in the HUD where self:getActionName() was called but the method did not exist on SoilHUD
– Added g_fieldManager:getFieldAtWorldPosition() as the primary field lookup (Tier 0) — the most accurate FS25 API, resolving mismatches on complex or dense maps
– Added color coding for N / P / K

What’s New in v1.0.6.0
HUD: Status-Colored Soil Display
Soil nutrient lines now show health at a glance — no more guessing from raw numbers:
N / P / K lines are color-coded: 🟢 Green = Good, 🟡 Yellow = Fair, 🔴 Red = Poor
Compact mode shows single-letter abbreviations: N: 45 (G) instead of N: 45 (Good)
Orange warning ! Needs fertilizer appears when any nutrient is below the critical threshold
Last: N days ago line shows when the field was last harvested (hidden until first harvest)

HUD: More Accurate Field Detection
Added g_fieldManager:getFieldAtWorldPosition() as the primary field lookup (Tier 0) — the most accurate FS25 API, resolving mismatches on complex or dense maps
Existing manual iteration and nearest-field fallbacks remain for compatibility

Bug Fix: Settings UI Corruption on Dedicated Servers (v1.0.5.2)
Fixed settings page injection that caused other mods’ settings pages (Graphics, Better Contracts, etc.) to appear white/blank when SoilFertilizer was loaded
Non-admin clients on dedicated servers no longer attempt settings injection (settings are admin-only by design; HUD and console commands remain available)

Internal Cleanup
Player/vehicle position detected once per HUD frame instead of twice (eliminated duplicate position detection code)
51 lines of dead code removed

v1.0.5.1 – Critical HUD and Multiplayer Fixes
This release addresses 6 critical issues that prevented the HUD from displaying soil data, caused crashes in field-related functionality, and introduced multiplayer desync risks.

Issues Fixed
1. Console Command Crash
Problem: SoilListFields crashed with “invalid argument #2 to ‘format’”
Fix: Added safe string conversion for nil fieldIds
2. Input Registration Error
Problem: Lua stack warnings during mod initialization
Fix: Implemented proper RVB (Register-Validate-Bind) pattern with all required parameters
3. Hidden Keybind
Problem: J key worked but didn’t appear in Settings > Controls
Fix: Added missing declaration in modDesc.xml
4. HUD Field Detection (Critical)
Problem: HUD showed “No field data” because field detection APIs were unreliable
Fix: Implemented NPCFavor’s proven field detection pattern with 500m fallback
5. Identical Field Values
Problem: All 77 fields showed identical hardcoded values (N=50, P=40, K=45)
Fix: Added natural soil variation (±10% nutrients, ±0.5 pH, ±0.5% OM) with deterministic seeding
6. Multiplayer Desync Risk (Critical)
Problem: Clients could create fields with different random values than server
Fix: Added multiplayer safety guard – only server creates fields, clients wait for sync

Key Improvements
Robust Field Detection: Manual field iteration with distance-based fallback
Natural Soil Diversity: Each field has unique but deterministic soil values
Multiplayer Safety: Prevents desync by enforcing server-only field creation
Better Input Integration: Keybind properly appears in game settings
Crash Prevention: Safe handling of edge cases in console commands

Testing
Singleplayer ✅
Console commands work without crashes
HUD displays field data correctly
Fields have varied soil values
Keybind appears in Settings > Controls

Multiplayer Requires Testing
Server player should see HUD data immediately
Clients may briefly see “No field data” until sync completes
All players should see identical soil values for same field
No desync issues after extended play

V1.0.3.1
– Added template validation functions for all element types
– Implemented template caching to ensure consistency
– Added candidate scanning with validation before accepting templates
– Added post-clone validation to catch structural issues
– Cache resets on retry to handle mod load order changes
– Improved error messages for debugging template failures

What’s New in v1.0.3.0
This release fixes critical GUI injection and validation issues that prevented the settings menu from appearing reliably. The mod now works correctly in both singleplayer and multiplayer modes, even when other mods are installed.

Issues Fixed
#17 – Settings menu not appearing in game
#11 – Network settings errors in multiplayer
#10 – Module loading errors (NetworkEvents.lua)

Major Improvements
GUI Validation System
Universal validation – Works in singleplayer, multiplayer, and multi-mod environments
Multi-mod compatibility – No longer conflicts with other mods that inject UI elements (NPC Favor, Income Mod, Farm Tablet, etc.)
Simplified approach – Trusts UIHelper’s built-in validation instead of fragile array checking
Duplicate prevention – Fixed element accumulation during retry attempts

Retry Logic & User Experience
Exponential backoff – Retry attempts at 2s, 4s, and 8s intervals
Lazy injection – Primary injection when settings menu opens
Background retries – Backup retry sequence for edge cases
User feedback – Dialog with retry option if automatic attempts fail

Packaging & Structure
Fixed zip structure – Mod folder (FS25_SoilFertilizer/) now at root level
Correct path resolution – All modules load properly
Development files excluded – Added .gitignore for cleaner repository

Full Changelog
Fixed
GUI validation now works with multiple mods installed
Settings menu appears reliably in both SP and MP modes
Eliminated duplicate UI element creation during retries
Fixed zip packaging structure for proper mod loading
Corrected module path resolution issues

Improved
Validation logic simplified and made more robust
Better compatibility with other mods
Enhanced retry logic with exponential backoff
Clearer error messages and user feedback

Added
AsyncRetryHandler for robust GUI injection
Environment detection (SP/MP server/MP client)
User dialog for manual retry if automatic attempts fail
.gitignore for development workflow

V1.0.2.0
Architecture Refactor & Multiplayer Improvements

New Modules:
– HookManager — Proper hook lifecycle management (install/uninstall) for all game hooks
– SettingsSchema — Single source of truth for all settings definitions, reducing touch points for new settings from ~10 to 1
– Constants (SoilConstants) — All magic numbers extracted into a centralized config (crop rates, fertilizer profiles, recovery rates, thresholds, timing, difficulty multipliers)
– Logger (SoilLogger) — Consistent [SoilFertilizer] log prefix across all files

Multiplayer:
– Added SoilFieldUpdateEvent — server-authoritative per-field soil data sync on harvest/fertilize
– Field data now included in full sync event for joining players
– Network sync retry logic (3 attempts, 5-second intervals) for full sync requests

Bug Fixes:
– Converted unsafe direct function replacements (Sprayer.spray, environment.update) to Utils.appendedFunction for better mod compatibility
– Added field data cleanup on ownership change (memory leak fix)

Code Quality:
– Refactored SoilFertilitySystem with clean delegate methods (onHarvest, onFertilizerApplied, onFieldOwnershipChanged, onEnvironmentUpdate)
– Simplified SettingsManager, Settings, and SoilSettingsUI by driving them from the schema
– Updated modDesc version descriptor from 92 to 105
– Added community localization improvements (PR #9)

V1.0.1.6
Added missing file that would cause the .new error upon starting savegame

V1.0.1.3
Added 3 new settings (Seasonal Effects, Rain Effects, and Plowing Bonus)
Improved GUI initialization
Improved compatibility checks

V1.0.1.2
Changelog:
Fixed SoilFieldInfo command now properly initializes and returns field data
Improved daily soil updates with weather/season effects
Fixed small bug in settings UI

Not working:
Visual soil indicators on map (no color changes yet)
Crop yield effects (doesn’t change harvest amounts)
Fertilizer cost adjustments (setting exists but not implemented)
Equipment wear/tear from soil conditions
Soil texture/sand/clay effects

Planned:
Crop rotation bonuses – doesn’t give yield bonuses for good rotations
Cover crop effects – doesn’t recognize cover crops
Soil compaction – from heavy equipment
Irrigation effects – on nutrient availability

V1.0.1.1
Fields can be scanned, but will give default values for now
Precision Farming now correctly detected and sets read-only mode.
Fixed settings tab (When u have FS25_WorkerCosts issues WILL appear in the game)
Lazy initialization added to prevent crashes on servers/clients.

V1.0.1
Please read this carefully
When the mod is used together with mods like Precision Farming, the settings are not available in the pause menu for now. You can configure it using the console. I’m working on a proper fix for this.

You can still use the mod with other mods, but there won’t be a settings tab in the pause menu. Keep this in mind.
There might still be issues, but I have tested it on my own machine and got no errors after the changes. For this reason I pushed this version.

Please create an issue on the GitHub repo if you get any errors after this changelog!
Fixed settings tab overlapping with other mods in pause menu
Fixed game crash when updating before fields were scanned
Fixed “pairs() table expected, got nil” error in SoilFertilitySystem
Fixed multiplayer and dedicated server compatibility
Fixed GUI injection failures causing settings menu issues
Added full compatibility with Precision Farming mod
Added Used Tyres mod compatibility (GUI disabled, console commands work)
Added dedicated server support with automatic GUI disabling
Added config file for user customization options
Added mod conflict detection and auto-compatibility mode
Added console-only mode for server environments
Improved GUI spacing to prevent overlapping with other mods
Improved field scanning with nil safety checks
Improved error handling throughout the mod
Improved multiplayer stability and server/client detection
Improved logging and debug information
Improved settings menu layout and button persistence
Ensured fieldData always initializes as a table (not nil)
Changed initialization order to prevent premature updates
Changed GUI injection to avoid conflicts with other mods

V1.0.0.5
– Fixed major issue with the shop screen and the in-game map
– Temporarily disabled settings via the pause menu due to ongoing conflicts
– Added compatibility for Precision Farming
– Ensured self.fieldData is always initialized as a table (not nil)
– Added type checking before using pairs() to iterate
– Added improved error logging for debugging
– Fixed a game crash when the mod attempted to update before fields were scanned

Adds depth and realism to soil management and fertilization in FS25. This mod introduces dynamic soil fertility, nutrient cycles, and realistic fertilizer economics, making farming more challenging and strategic.

Key Features:
DYNAMIC SOIL FERTILITY: Tracks nitrogen, phosphorus, and potassium levels for each field. Soil nutrients deplete as crops grow and recover when fields are fallow.
REALISTIC NUTRIENT CYCLES: Different crops extract different nutrients. Organic matter content affects long-term fertility. pH levels impact nutrient availability.
FERTILIZER ECONOMICS: Three fertilizer types with varying costs and effectiveness:
– Liquid Fertilizer: Balanced nutrients, moderate cost
– Solid Fertilizer: Higher phosphorus, standard cost
– Manure: Improves organic matter, lower cost
CUSTOMIZABLE DIFFICULTY:
– Simple: Reduced nutrient depletion, lower costs
– Realistic: Balanced gameplay, standard settings
– Hardcore: Rapid nutrient depletion, higher costs
USER-FRIENDLY INTERFACE:
– Integrated into game settings menu
– Console commands for advanced control
– Real-time notifications for low nutrients
– Field-specific soil information
FULLY COMPATIBLE:
– Multiplayer supported
– Works with all maps
– No conflicts with other mods
– Save game compatible

Gameplay Impact:
– Makes fertilizer management more important
– Encourages crop rotation strategies
– Adds economic planning element
– Increases realism without excessive complexity

Console Commands Available:
– soilfertility (show all commands)
– SoilEnable/Disable
– SoilSetDifficulty 1/2/3
– SoilFieldInfo
– SoilShowSettings
– SoilResetSettings

Installation: Extract to your mods folder. Configure in-game settings under “Soil & Fertilizer” section.
This mod is perfect for players who want more depth from their farming experience without overwhelming complexity. It strikes a balance between realism and playability, making soil management a meaningful part of your farm strategy.
Note: This mod does not affect crop growth rates directly – it adds management layers around soil health and fertilizer economics.
Enjoy more realistic farming!


Authors:
tisonK




Why & How to use FS25 mods

Have you tried Farming Simulator 25 Mods already? Downloading FS25 / FS22 mods is one of the best ways to upgrade your Farming Simulator 25 / 22 game by just installing it. All that you need is to select Farming Simulator 25 / 22 mod and upload it to your game mod folder. Here you will find modifications such as Tractors, Maps, harvesters mods for FS22 / FS22. However, the best way to see how it works is just to try and explore these LS25 / LS22 mods right now.


LS25 Other

Leave a Reply

Do you need help or to say thanks for mod author? Just leave a comment bellow!