How does the regen algorithm determine which block to place

@james, @rossstephens, @lucadeltodecso

The server handles the regen, is it looking up what block used to be in a certain position from a pristine copy of the entire planet or is it using the algorithm and seed that was also used for the initial generation of the planet?

I am assuming it’s the latter…

But if it’s not then we could have options to completely terraform a rental world to our heart’s content… Hence why I’m wondering!

2 Likes

I do want to get an answer to your question, but I do wonder how long it would take to terraform a planet with the given tools? Even if you could do it in creative mode and fly (which would save alot of time).

Lots of time I am assuming, and I most certainly would not want to do that, but… I might want to do it for smaller parts…

Like in Nova Golda I had this beach idea, plenty of sandy areas, some even near water but not close enough to my settlement so I terra formed a coast into a beach. Took ages (and still not finished since I want to re-do it on a rental planet)!

2 Likes

Far enough. Or if they allowed for some copying or blueprinting you could copy sections and then do light customization on those copies if you wanted.

2 Likes

Oh yes, with some blueprinting you can change things a lot quicker, add some weird trees, or ruins, etc.

Would be rather cool! Wonder if it would be a lot of work to make a hybrid of it, algorithm + certain parts having to look up…

1 Like

I just do not know enough about how regen works to even comment. I would hope there was a way to turn off regen, edit the planet, take a copy of the planet, change the marker for every player placed block to be a natural block, and then put the planet out in the real universe. Now it is a “natural” planet with forests, caverns, oceans, ruins or whatever you have changed as part of the planet. You would have to restrict any placed blocks to naturally occuring blocks, so no diamond or brick ruins or you are kind of breaking the universe rules.

2 Likes

Answer is “neither” precisely, but closer to the first.

Every time a block is modified, a delta is stored to say what used to be at that position, so that regeneration applies the delta to put back to original state (ordered by a static distance field done at world-gen time which lets it “fill in holes from the bottom” and “collapse towers from the top”), and beacon plot changes move those deltas between a seperate locked storage etc.

It gets a bit more complex than that in terms of application of deltas and manipulation of the delta for resources and liquids (eg no flowing liquids get inserted back, its left to the liquid simulation to re-flow from the sources and a lot of effort was put into the flow behaviour of liquids so that this would always “do the right thing” and reflow to the original state precisely as long as the terrain is back to its original state as well

There are certain types of operations then, which permanently modify (and can never be recovered) the state of the world, eg removal of resin/oil blocks and resources; but also to a lesser extent because dealing with it was more complexity than was deemed worth, chisel rotating surface-resource meshes :stuck_out_tongue: (if you do it, they wont rotate back when regen occurs)

As a developer, there are cheats to apply changes to the world that are permanent as well, though never used (was just handy when implementing resin/oil behaviour to add “fake” natural source blocks)

5 Likes

What is a delta? Is it the item in it’s current state, like a data snapshot of all the items as a group or?

as in it stores a big group of position xyz used to be 'this block+meta+color+liquid’ whenever the block changes

so you destroy a block of sand, and there is no existing delta for that position, so it stores “position used to be sand”
if you then modify it in some otherway, there is already a delta so does nothing
regeneration then restores the sand from that delta.

its closer to the “first” option AeneaGames suggested as it is effectively a copy of what the world looked like when it was first generated but never stored explicitly and only generated as the world is modified instead.

4 Likes

So a planet which has had no changes yet has no deltas stored?

If one would make a lot of changes and then throw away all the delta info for that planet you’ve basically changed to what state the planet will regenerate to!

This is mighty interesting!

Would it be possible to add something to the World Control for rental planets where we can turn off regen. We then make changes to the world, game creates delta info, and when we turn regen back on we get the choice to revert to original state (World regens back right away using the delta info, acting like an undo action) OR to clear the delta info for the whole planet.

From then on regen will preserve the edited state.

Would this be possible to implement easily?

What do you think of the idea?

3 Likes

Tho I could come up with ways to abuse this…

If I have some pieces of black gleam I could turn regen off, plop them down, turn regen back on with the reset of the deltas (= clearing them), then I can keep on regen farming that black gleam to my heart’s content. Heck we could do that with all the gleambow blocks too.

We have 2 of some block, regen off, place them, regen on with reset, regen farm those 2 blocks a couple of times, turn regen off, place the bigger amount of them you have now, regen on with reset…

That way the scarcity of any item suddenly is a thing of the past…

Ohh, I could make a sand/gravel regen farm for all the colours all on my own rental planet and make concrete and deco gravel as much as I want!

Heck I could harvest some diamond seams with that epic skill, regen off, place those, regen on with reset, harvest the seams and so on… Tho in this case the planet does not have the correct flags set to allow diamond seams so am wondering what the regen algorithm then decides to do, hehe…

In any case this could indeed potentially be a problem like this. On one hand I kinda would love it if I could make a Till sand farm on my own low level rental world, but with more scarce block types it might not be a good idea.


So, what we can do is only allow the placement of blocks in the planet’s own colour palette. Even if you place a sedimentary rock with another colour it resets it to colour #0 (when you turn regen back on with a reset) which is the planet’s default. But this will add to the complexity of this, in my opinion, rather nice idea…

I agree there is a way to abuse it. but maybe they could create a new planet editing version of creative mode where the only blocks you can spawn are natural blocks and no resources. And also limit it to the planets color palette (like you suggested). If your palette has black gleam you could place it but if it was cool blue then that would be the only color gleam you could place.

1 Like