Skip to content

Make MR ground wetness server-authoritative and persistent dampness - #124

Closed
terega wants to merge 2 commits into
quadural:mainfrom
terega:improvement/synchronized-persistent-wetness
Closed

terega wants to merge 2 commits into
quadural:mainfrom
terega:improvement/synchronized-persistent-wetness

Conversation

@terega

@terega terega commented Oct 16, 2026

Copy link
Copy Markdown

CONTEXT
The existing implementation maintains MR moisture state separately on each game instance. A client joining an ongoing session can start with a different accumulated dampness history from the server.
Accumulated MR dampness is also not persisted by this implementation, so reloading a save can reset the drying history.

CHANGES

  • Calculate MR moisture values on the server.
  • Store the moisture state on the weather instance.
  • Send effective wetness, minimum wetness and dampness to clients when values change, with 2s update intervals.
  • Send the current state to clients joining an ongoing session.
  • Retain native ground wetness on clients until MR state is available.
  • Integrate daytime drying using actual elapsed time and the effective time scale.
  • Save and restore accumulated dampness through the existing weather XML serialization hooks.
  • Replace the old RealisticMain update loop with a Weather.update hook to avoid duplicate updates.
  • Clear pending synchronization and telemetry state when leaving the map.

SCOPE
The temperature and sunlight based moisture formulas are retained.
This synchronizes MR moisture values, not the complete native weather system. Original game coefficients and game time-scale settings are unchanged.
Only accumulated dampness is persistent.
Minimum and effective wetness are recalculated.

FILES CHANGED

  • MoreRealistic/scripts/MR_Weather.lua
  • MoreRealistic/scripts/RealisticMain.lua

NAMING
The implementation uses:

  • MRweather for the moisture module.
  • MRwetnessEvent for the network event.
  • MRwetness for the state stored on the weather instance.
  • MRdampness for the saved xml attribute.

TESTED
Existing official saves without MRdampness remain supported, the accumulated dampness will initially start at zero.
Tested in singleplayer and on dedicated server.

Make the server authoritative for MR moisture values while retaining the existing temperature- and sunlight-based formulas.

Send updated moisture values to clients when they change, and send the current state to newly joining clients. Integrate daytime drying using elapsed time and the effective time scale.

Persist accumulated dampness through the existing weather XML save/load hooks using the MRdampness attribute.

Replace the previous RealisticMain weather update loop with a Weather.update hook and clear pending state when leaving the map.

Use the neutral identifiers MRweather, MRwetnessEvent and MRwetness.

No forecasts, rainfall, cloud settings or traction coefficients are changed.
Make the server authoritative for MR moisture values while retaining the existing temperature- and sunlight-based formulas.

Send updated moisture values to clients when they change, and send the current state to newly joining clients. Integrate daytime drying using elapsed time and the effective time scale.

Persist accumulated dampness through the existing weather XML save/load hooks using the MRdampness attribute.

Replace the previous RealisticMain weather update loop with a Weather.update hook and clear pending state when leaving the map.

Use the neutral identifiers MRweather, MRwetnessEvent and MRwetness.

No forecasts, rainfall, cloud settings or traction coefficients are
changed.
@quadural

Copy link
Copy Markdown
Owner

ok. I don't think the "mr wetness" is useful for client side. but I accepted the solution to keep the value in the savegame. Will be present in next release (with slight changes)

@quadural quadural closed this Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants