Mods / Saplings Grow Resin/Moss/Vines

Tags:
Tweak Flora
Author:
iamevn
Side:
Both
Created:
Jun 29th at 2:49 AM
Last modified:
Jul 21st at 7:18 AM
Downloads:
656
Latest release (for Vintage Story 1.20.0 - 1.22.4, potentially outdated):
saplingsgrowresinmossvines_1.0.3.zip  1-click install

Saplings generate resin/moss/vines when they grow similar to probabilities during worldgen

 

Unmodded, every time saplings call GrowTree, they pass in zeros for otherBlockChance (resin), vinesGrowthChance, and mossGrowthChance which effectively prevent GrowTree from generating a tree with these features.

 

This is a somewhat simple patch to fill out those odds to match the ones that are set during world generation. otherBlockChance is simple because it's just 1.0 but I currently duplicate the logic from WgenTreeSupplier.GetRandomGenForClimate to set vinesGrowthChance, and mossGrowthChance which I'm not super happy with. It should work and it should keep working, but there's a chance it may drift from the probabilities worldgen uses if the logic ever changes.

 

Will need to mess around and see if I can extract and reuse the existing logic somehow without it being a brittle mess.

Mod Version Mod IdentifierFor Game version Downloads Released Changelog Download 1-click mod install*
1.0.3 saplingsgrowresinmossvines
1.20.0 - 1.22.4
467 Jul 2nd at 7:32 AM saplingsgrowresinmossvines_1.0.3.zip 1-click install

bump version, the v1.0.2 tag ended up on an old build with an outdated artifact, these were missing from v1.0.2 and are in v1.0.3:

 

  • Fix errors in vine/moss calculation, vines were spawning far too infrequently and moss was spawning far too frequently compared to worldgen
  • Find the .locals index of treeGenParams rather than hardcoding it
  • Small debug log cleanup, now logs the sapling type and coordinates
1.0.2 saplingsgrowresinmossvines
1.21.0 - 1.22.4
16 Jul 2nd at 6:15 AM saplingsgrowresinmossvines_1.0.2.zip 1-click install
  • Use game's harmony/json libs instead of including our own for compatibility (fixes Exception: Could not load file or assembly '0Harmony, Version=2.4.2.0, Culture=neutral, PublicKeyToken=null'. Assembly with same name is already loaded)
1.0.1 saplingsgrowresinmossvines
1.21.0 - 1.22.4
60 Jul 1st at 8:00 AM saplingsgrowresinmossvines_1.0.1.zip 1-click install

Swap calculation for moss/vines to use climate's WorldgenRainfall/WorldGenTemperature and properly scale rain value from 0-1 to 0-255 as calculation expects

 

Keeping an eye on our server's debug logs I was seeing vine/moss probabilities that looked way off from what I expected. Realized that the rain value I was using was 255x too small compared to the value used for worldgen and also that I should be using the worldgen rainfall/temperature and not the current rainfall/temperature

1.0.0 saplingsgrowresinmossvines
1.21.0 - 1.22.4
113 Jun 29th at 2:51 AM Empty saplingsgrowresinmossvines_1.0.0.zip 1-click install

4 Comments (oldest first | newest first) (threaded | flat)

RedRockG, Jul 1st at 11:22 PM

1.7.2026 17:53:48 [Error] [saplingsgrowresinmossvines] An exception was thrown when trying to load assembly:
1.7.2026 17:53:48 [Error] [saplingsgrowresinmossvines] Exception: Could not load file or assembly '0Harmony, Version=2.4.2.0, Culture=neutral, PublicKeyToken=null'. Assembly with same name is already loaded

iamevn , Jul 1st at 8:03 AM (modified Jul 3rd at 7:54 AM)

please do let me know if it seems like they generate way too much now, I'm planning on adding some configuration for adjusting these odds next

Ashadelo, Jun 29th at 2:58 AM

good mod!