by
RudgerWolvram
» 21 Mar 2015, 20:54
I had an idea on this, but haven't had time to work on it.
The idea would be to "collapse" the ground stacks.
From what i can tell, the whole reason the geo_patch is there is to keep track of what is on the ground (quality of dirt/etc) and every modified square under it. e.g. you throw down sand, then snow, then dirt. dig them up and you get dirt, snow then sand.
My idea is to collapse and reset all dirt. This way, it will not affect ore/rock piles, etc.
So it would need to find the highest version of a particular square that is a type of soil/sand/snow (so it ignores ore/rock). Then, remove all versions for that geo_id. I'm not sure if the version number should be dropped to 1 or left alone (haven't written code to test).
What this will hopefully do is shrink the size and essentially reset the current map to act as if it was the original map.
It would have to be a nightly reboot process. But even though it doesn't do it on the fly, it would hopefully make the table small enough it would not have any issues until you had like 64 players flattening for 20 hours straight. Then the nightly maintenance would hopefully take care of it.
Potential problems.
Likely:
Tearing in the terrain. e.g. a square and the next square is not meeting edges properly.
Flattened terrain with buildings may get dirt in them. e.g. you have a flattened edge, and the next square is 2.0 in height, the flattened square may slope up from it's middle, putting dirt in the building that can't be fixed.
Unlikely:
Someone decides to put iron or rock on every square they heavily teraformed so that it intentionally increases the table size and stays that way until dirt is put on top or the iron is removed.
It would destroy any ore or rock pile someone is trying to hide by putting dirt on top and making it look like a dirt pile. I don't know of anyone that does this.
Unknowns.
No idea what would happen to mines/tunnels. It could leave them alone or turn them into an M.C. Escher piece.
No idea how the map will react to being collapsed like that. If I put sand down in the snow, let the script run, then come back, will there be nothing but sand as i dig down or will it dig down until it hits the original map and you get snow?
No idea how it will handle intersecting with the original map. Most have seen the terrain lag from loading into a world and the terrain is all wonky until the full geo_patch loads for them. I don't know if things will load fast enough that it's normal, or you end up with the original map until it all loads. Hopefully, it would load fast enough that it wouldn't be noticed.