
Mods / Sea Level Fix
Author: MadSeraph
Side: Server
Created: Mar 1st at 12:45 PM
Last modified: Jun 15th at 1:29 PM
Downloads: 6474
Follow Unfollow 246
Recommended download (for Vintage Story 1.20.12):
SeaLevelFix_1.0.11.zip
1-click install
NOT NEEDED FOR 1.21!
This fix has been integrated into the base game starting with 1.21.0-pre.1. Thanks Devs! :)
IMPORTANT: This mod will only work with the exact game versions listed in the Files tab. New game releases will require a new version of the mod. This is to prevent accidental application of the mods patch in future versions of the game that may already have the fix included. Please update to 1.0.1 to ensure you have a version with this protection.
There is a bug that affects ore generation for ores that use the sea level disc generator where the generator uses the wrong sea level for world heights larger than 256. This results in those deposits being much further underground than they are suppose to be and prevents them from generating surface pieces. This affects things like borax, sulfer, obsidian, saltpeter, all of the irons, black coal, and more.
A less severe bug is that surface ore pieces like copper and tin do not scale how close to the surface a deposit can be based on the world height. Since ore deposit generation is percentage based, this make surface ore pieces less common on larger world heights.
This mod attempts fix both of these bugs. It will only impact new generation and will not fix chunks that were generated before the mod was installed.
Please beware this mod is only lightly tested. There may be bugs. Please report any you find.
In addition, there are two configuration options that will allow you to adjust the default sea level and how deep ore deposits can be to generate surface ore pieces. There is also ConfigLib integration if you'd prefer to use that.
Changing the sea level setting is entirely untested and experimental!! Do not change this unless you are prepared for bugs and are starting a brand new world.
If you decide to give it a try, however, please report the results!
Mod Version | For Game version | Downloads | Release date | Changelog | Download | 1-click mod install* |
---|---|---|---|---|---|---|
1.0.11 | 1750 | Jun 15th at 1:29 PM | SeaLevelFix_1.0.11.zip | 1-click install | ||
Add support for 1.20.12. | ||||||
1.0.10 | 1195 | Jun 2nd at 2:14 AM | SeaLevelFix_1.0.10.zip | 1-click install | ||
An attempt at fixing reported patching failures. This will work with all versions of 1.20 up to 1.20.11. | ||||||
1.0.9 | 300 | May 30th at 3:09 AM | SeaLevelFix_1.0.9.zip | 1-click install | ||
Add 1.20.11 support. | ||||||
1.0.8 | 120 | May 22nd at 2:54 AM | SeaLevelFix_1.0.8.zip | 1-click install | ||
Add 1.20.11-rc.1 support. | ||||||
1.0.7 | 860 | May 5th at 7:46 PM | SeaLevelFix_1.0.7.zip | 1-click install | ||
Add support for 1.20.10. | ||||||
1.0.6 | 429 | Apr 22nd at 8:54 PM | SeaLevelFix_1.0.6.zip | 1-click install | ||
Update for 1.20.8-rc.2, 1.20.8, and 1.20.9. | ||||||
1.0.5 | 216 | Apr 8th at 3:19 AM | SeaLevelFix_1.0.5.zip | 1-click install | ||
Add support for 1.20.8-rc.1. | ||||||
1.0.4 | 485 | Mar 27th at 8:58 AM | SeaLevelFix_1.0.4.zip | 1-click install | ||
Support game version 1.20.7 | ||||||
1.0.3 | 299 | Mar 22nd at 3:54 AM | SeaLevelFix_1.0.3.zip | 1-click install | ||
Enabled support for 1.20.5 and 1.20.6. | ||||||
1.0.2 | 361 | Mar 9th at 12:19 AM | SeaLevelFix_1.0.2.zip | 1-click install | ||
Adds support for 1.20.5-rc.2 and 1.20.5-rc.3. | ||||||
1.0.1 | 217 | Mar 3rd at 1:53 AM | SeaLevelFix_1.0.1.zip | 1-click install | ||
Added an explicit game version check to prevent conflicts with future game releases that may already include the fix. | ||||||
1.0.0 | 242 | Mar 1st at 12:47 PM | SeaLevelFix_1.0.0.zip | 1-click install | ||
Initial Release |
MadSeraph any plans for a 1.20.12 version? Also it would be lovely to remove that version check (perhaps by an 'opt-in' in the config or so) because right now it's annoying that we can't immediatelly update VS because of one mod blocking it
Does it work in .12?
I was explaining more in details the error that everybody reported below. The mod aparently still works if you do as you mentioned, completely exiting between loads.
Kalmorph what error? Also in general it's recommended to always completely exist VS when switching worlds. That's a good habbit to avoid problems with memory leaks and similar
This error happens everytime you load a world and unload. If you're creating or loading a world for the first time after opening the game, it runs fine without error. Now if we go back to main menu and try to create/load another world, it start accumulating these errors once per load. It gives 1 error when loading the 2nd world, and if you go to main menu and try to load a 3rd world, it gives 2 errors, and goes on.
Taltin The Better Grass mod is essentially a modified texture that does not affect the modding aspect at all and therefore should not conflict with other mods
Better Grass is actually OK. I don't think this is a conflict anymore. Version 1.0.10 is up with an attempt at a fix. I suspect the issue is "random", or at least only presents under certain conditions that cannot be predicted. If you continue to see exceptions thrown in the logs on 1.0.10 please let me know.
I think it is better grass, Ran a few tests.
Adding that one threw that error.
1.6.2025 11:56:10 [Notification] External Origins in load order: modorigin@E:\Vintagestory\assets\creative\, modorigin@E:\Vintagestory\assets\survival\, mod@BetterGrass_v0.0.3.zip, mod@SeaLevelFix_1.0.9.zip
1.6.2025 11:56:10 [Error] Exception during GenTerra_StartServerSide.Transpiler: System.InvalidOperationException: Could not find call to IServerEventAPI.ServerRunPhase. - Current state is invalid
at HarmonyLib.CodeMatcher.ThrowIfInvalid(String explanation)
at SeaLevelFix.SeaLevelFix.GenTerra_StartServerSide_Patch.Transpiler(IEnumerable`1 instructions) in /home/mrgrim/RiderProjects/SeaLevelFix/SeaLevelFix/src/SeaLevelFix.cs:line 51
1.6.2025 11:56:10 [Error] Exception during GenTerra_StartServerSide.Transpiler: System.InvalidOperationException: Could not find call to IServerEventAPI.ServerRunPhase. - Current state is invalid
at HarmonyLib.CodeMatcher.ThrowIfInvalid(String explanation)
at SeaLevelFix.SeaLevelFix.GenTerra_StartServerSide_Patch.Transpiler(IEnumerable`1 instructions) in /home/mrgrim/RiderProjects/SeaLevelFix/SeaLevelFix/src/SeaLevelFix.cs:line 51
1.6.2025 11:56:10 [Error] Exception during GenTerra_StartServerSide.Transpiler: System.InvalidOperationException: Could not find call to IServerEventAPI.ServerRunPhase. - Current state is invalid
at HarmonyLib.CodeMatcher.ThrowIfInvalid(String explanation)
at SeaLevelFix.SeaLevelFix.GenTerra_StartServerSide_Patch.Transpiler(IEnumerable`1 instructions) in /home/mrgrim/RiderProjects/SeaLevelFix/SeaLevelFix/src/SeaLevelFix.cs:line 51
1.6.2025 11:56:10 [Event] Applying SurfaceDepositFix patches.
The Terra Prety mod says better grass nice to have installed.
Nephelangelo
F4OAXB
Someone was kind enough to open a github issue which seems to be the same thing you guys are experiencing. Would you please comment on that issue with your full mod list? I suspect a conflict. I can't reproduce this on my system with vanilla + only my mod. I want to keep this comments section clean so please use the github issue for any further communication. Thanks!
Also getting the error.
I keep on getting this error and im unsure if im just doing something wrong.
30.5.2025 23:44:43 [Event] Applying SeaLevelFix patches.
30.5.2025 23:44:43 [Error] Exception during GenTerra_StartServerSide.Transpiler: System.InvalidOperationException: Could not find call to IServerEventAPI.ServerRunPhase. - Current state is invalid
at HarmonyLib.CodeMatcher.ThrowIfInvalid(String explanation)
at SeaLevelFix.SeaLevelFix.GenTerra_StartServerSide_Patch.Transpiler(IEnumerable`1 instructions) in /home/mrgrim/RiderProjects/SeaLevelFix/SeaLevelFix/src/SeaLevelFix.cs:line 51
30.5.2025 23:44:43 [Error] Exception during GenTerra_StartServerSide.Transpiler: System.InvalidOperationException: Could not find call to IServerEventAPI.ServerRunPhase. - Current state is invalid
at HarmonyLib.CodeMatcher.ThrowIfInvalid(String explanation)
at SeaLevelFix.SeaLevelFix.GenTerra_StartServerSide_Patch.Transpiler(IEnumerable`1 instructions) in /home/mrgrim/RiderProjects/SeaLevelFix/SeaLevelFix/src/SeaLevelFix.cs:line 51
30.5.2025 23:44:43 [Event] Applying SurfaceDepositFix patches.
help would be appreciated.
Sorry about the delay. I was holding out for the full release and didn't expect the RC period to go for so long.
Do you think you might do an update for 1.20.11rc1? Since the real 1.20.11 is apparently a bit delayed. Thanks!
Do you happen to know if this mod is compatible with terrain generation-changing mods, such as plains and valleys? I am getting mixed results and have defaulted to standard worldheight.
@Streetwind
Would you please share your world settings. I would like to try another mod that uses increased world heigth and think this mod may be helpful.
Thank you.
Just to offer a counterpoint to people questioning whether the mod actually works, and a big thank you to the author:
It does work for me, and spectacularly so. I've been comparing it to my 1.18.x world, where I ran with world height 384, and found a grand total of three (3) surface copper deposits in the entire first ingame year. Despite having raised the copper abundance by a tick in the settings, and employing a special search strategy designed to help discover surface deposits.
Now in 1.20, same height but default copper settings (so technically more rare than in the other world), and the difference is like night and day. I keep running into copper everywhere. Definitely a must-have mod! =)
Centcom15
Those deposits still have to generate close enough to the surface to be eligible for creating surface chunks, and the terrain itself must be near sea level. Many things are just exceedingly rare under those conditions. Black coal almost never generates there. Obsidian needs surface basalt. Iron doesn't spawn in sedimentary layers, etc. This mod doesn't change any of these realities. Even in a completely default world these things are very rare.
As long as you see the following entries in your server-main.log file with no errors, this mod should at least make it possible for those ores to generate near sea level, even if they still rarely would anyway:
[Event] Applying SeaLevelFix patches.
[Event] Applying SurfaceDepositFix patches.
I've got this mod installed, and bearing in mind that already gen'd chunks aren't affected, I went on a huge looping adventure into new (maybe new? Heard the game has funky chunk generation), chunks, and I didn't find surface spawns of any of the listed elements, just.. endless fields of copper, brown coal and flint, and quartz. Nothing else. Could just be I haven't looked long enough or in the right areas but wondering if it should've been an immediate change. ... Could I go into the worldconfig settings, change the worldheight back to 256 after the fact?
Marlim
Removing it will have no ill effects. Newly generated chunks will simply not benefit from it. Also, the mod has an extremely permissive license allowing anyone to to fork it if something happens to me. It's a fairly simple and small mod, and with some luck it won't even be needed in 1.21.
If the mod happens to be abandoned, or takes too long to update and I remove it from the server, will that cause a problem?
MadSeraph
game version 1.20.6
using this with CLO and rivers, 320 worldHieght
Found surface copper bits about 100 blocks away from spawn. Thank you
Marlim Yes pruning/deleting chunks will cause this mod to apply to those chunks when they are regenerated.
Pecs
If you want to verify your findings use the xray mod Block Overlay. I use it extensively when seed hunting to verify the presense of various resources. Keep in mind this mod, when working appropriately, should make surface ores and ore deposits in tall worlds (worlds greater than 256 blocks tall) appear as frequently as they do and in the same relative depths as in the default world height of 256. That's all it does. In fact, at the default world height this mod does nothing at all! Also keep in mind that for anything beyond your first 40 bits of copper prospecting is the best way to find ores. Surface bits will not sustain you.
mj_outlaw
This mod is not a cheat. This fixes a bug that affects ore generation of only some types of ores in non default game settings. As stated above, with all default map settings, this mod does nothing.
Contrary to other reports, I can't find any surface ore at all. I thought this would fix initial issues with finding just two surface nugget spawns 4k blocks apart, and 0 deposits, but now I can't find any deposits at all. I've seen elsewhere that they're supposed to spawn around 300 blocks from each other on average. I've seen a singular quartz bit out of a huge area I've slowly scanned in a creative test with just this mod enabled. World is set to 320, and this is the second go I've had at it to see if gen was just unlucky. Tips or info? This is my first time playing and so far the metal grind after sifting looks brutal, especially after wasting 5 hours looking for blue clay when it's rare as a hair on a tortoise. I don't want to repeat the blue clay process for every bit of metal scraps.
Edit: I've found a couple in the same general area, like 30 blocks from each other, but none others in a zigzag pattern for about 1k blocks... I'm really not sure what to think. Both have deposits though, which is a first. Both are at sea level though. That probably matters for this fix? I'm using version labeled 1.20.4, 1.20.5-rc.1
I have found 1 borax, 2 lead, and 2 more copper. Borax and lead more or less at sea level, copper on the glacier of a mountain. All with deposits. I guess this means this works?
is this a "cheat" ? I mean when you start a new world there are settings to change the chance of spawning ores.. it doesnt work or what?
MadSeraph Thank you for the update and please don't say sorry, we appreciate all the work modders do <3
Sorry this one took so long. I'm trying to be conservative to not break anyones game accidentally by intentionally not supporting future versions. It's a code patch so could interact badly in ways I can't predict if that code changes. This was a busy week for me. I'll try to get these out faster in the future.
"This mod attempts fix both of these bugs. It will only impact new generation and will not fix chunks that were generated before the mod was installed."
So if I use the /db prune command to delete the chunks in an already loaded save, would it work?
I don't know if I explained it well.
MadSeraph
PeterSanderson
I did indeed have Rivers installed and enabled.
Junrall I don't suppose you had Rivers on when you tested with Terra Prety by any chance?
ElusiveEnigma
I use this with Terra Pretty... works perfectly!
ElusiveEnigma
Mods that work with vanilla worldgen systems, often called "landform" mods, such as Conquest, Terra Prety, Plains & Valleys, etc should work just fine. In fact I did most of my testing with Conquest running. Ones that modify vanilla worldgen code such as Rivers or Alpine Story, however, have the potential to conflict. I have not tested with any of them, so I can't tell you for sure.
MadSeraph
To your knowledge, is this compataible with worldgen mods or do you have reason to believe there could be overlapping conflict?
Yes, point 2 is very valid. I'm also often wary of mods that claim to "fix" things, often fixing things that aren't actually broken, or fixing it in ways that aren't proper - which can cause other issues. So far though, after some testing, this mod seems to work very well. I can find many surface bits again when traveling at 320 world height.
As for the clay, I guess I'll leave that be for now until the devs rebalance it maybe. Unless it's their intention to have it this rare / barely visible. I guess if you're lucky you might dig into it when looking for ore. Red clay can be found but it's definitely harder to find than blue clay in 1.19. It's a bit of a shame because this of course nerfs clay working as a whole, and consequently mods that expand on that.
DarkThoughts
1) Blue Clay seems to be working "as intended". It only generates at exactly sea level (using the right value even without this patch). It only attempts to spawn 1 in every 250 chunks (vs red clays 1 in every 52). So that low random chance to attempt a spawn has to just happen to try on a block sitting right at sea level. Often those blocks are sand blocks, so you often only end up with half a disc that forms in the dirt behind the sand but _under the surface_. It is _exceptionally_ rare. I don't know why the devs did it this way, but they did.
2) Yes, I have reported these and submitted pull requests on github as well. I have also discussed the issue extensively with one of the devs on Discord. They are aware of the issue, and I'm hopeful it wll be fixed soon, but possibly not before 1.21. Devs are rightly wary of fixes submitted by outsiders. They need to be extra sure my fix works and didn't inadvertantly break something else, and they have much bigger issues to deal with right now. Honestly, I'd prefer they spend their time on desyncs that cause items to vanish when moving between inventories before taking the time to look at this. In the meantime, this issue was particularly itchy for me so I fixed it and made it a mod so I can run it on my server. :)
3) Mods that add their own ores should benefit from this fix. The issue is specifically with deposit configurations that use 'generator: "disc-followsealevel"' in their json configuration.
Droseran
Yeah I've seen your mod and have a tab open for it for consideration. I'm just curious whether it actually is a bug - specifically with increased world heights or different worldgen than that of vanilla, simply intended, or just badly balanced in general. There's definitely been an issue with ores, because I've never had this much trouble with finding surface copper before. It's pretty common normally, just often well hidden by shrubs and other foliage. Clay on the other hand was super common before, at least in wetter regions I found patches very close to each other. Since the update I only found a few very rare red clay patches (one of them in a dangerous mountain side since I play with soil instability) and only one blue clay deposit. Given how many test worlds I do where I just explore around to get a feel for the worldgen mods & settings, I think it's incredibly rare at the moment.
DarkThoughts
I've made a mod to increase blue clay generation (https://mods.vintagestory.at/show/mod/20343). I think it's just been made ridiculously rare, as it has a spawn rate around 2/3 of red clay on top of the new rigid spawning constraints.
Lightpowder
Check the wiki. VS has commands to regenerate chunks. Just be careful and create a backup first in case you accidentally regenerate parts of your base.
Ah, so that's why I could barely find anything on our Conquest Landform Overhaul (with the mod's recommended settings ofc) world huh...
Shame that it requires either a remaking a world with the same seed or a new world, but it's completely understandable.
We'd probably use it later, when Wildcraft gets a new module cuz we wanna remake our world and copy important chunks when that comes out.
Oh my fucking god... I thought I was going crazy with the lack of almost ANY surface ore nuggets anywhere. Some questions though:
1) Could you check if there's a similar issue with blue clay? I use Conquest Landform Overhaul for the worldgen and it seems excessively rare now, even at sea level height on worldgen that recommends 320 world height.
2) Is this reported on the actual VS issue tracker so it can get properly fixed instead of modded band-aid solutions? No disrespect btw, I just don't think it should be a mod's purpose to fix bugs. This should not end up like Bethesda where the developers let the community take care of bug fixing instead of doing it themselves.
3) Is this based on code issues with the individual ores themselves or how the game handles ore spawns in general? I'm asking to understand whether mods that add their own ores, such as Geology Additions, would be affected by this bug or not.
following this! i always love playing with a larger world height, makes adventuring all the more fun but i NEVER find borax or black coal.
DUCATISLO I'm sure it will be. It's been reported. I made this because I want to run a server with a 320 world height, and I wanted working ores. :)
i think this should been an official fix tbh