Minetest-WorldEditAdditions icon indicating copy to clipboard operation
Minetest-WorldEditAdditions copied to clipboard

TeethOfTime: Erosion / time decay simulation

Open sbrl opened this issue 5 years ago • 1 comments

I was browsing the web recently, and I discovered an old tool for Minecraft called TeethOfTime. Finding information on it is difficult - but the basic premise is that it simulates weathering and decay of the selected area over time - e.g. nature reclaiming it, 'man-made' nodes falling down / decaying / disappearing, building crumbling, etc.

With the help of the mod's code repository, I've located the original forum post on the wayback machine. It has some before/after screenshot pairs:

1

2

(Before on the left, after on the right)

While the original tool was an external one using Substrate (awesome project btw if you want to parse Minecraft worlds I'd guess!), I think it's perfectly possible to implement this as a set of regular WorldEditAdditions commands. Perhaps //weather, //decay, or //teethoftime as a reference to the original creator?

The code repo lists the following features:

  • Unsupported blocks fall, supported blocks topple
  • Blocks decay into others (cobble into mossy cobble, etc.)
  • Nature takes over human creations, using Minecraft itself to repopulate all chunks
  • A Perlin filter to add non-uniform destruction and more detail
  • Everything can be customised in config files which can be easily chosen at start of the app
  • Multiple "official" configs included, with varying degree of decay
  • Relighting
  • Fluids recalculation
  • Mod compatible

An impressive feature set! I think we might be able to translate most of this.

  • [ ] Falling / toppling seems pretty straightforward
  • [ ] Decay: we'd need a translation table for this, and expose an API to allow mods to define which block decay into which other blocks (suggestions from the community to add to this table would be welcome - we could have them in a dedicated file with a bunch of if minetest.get_modpath("modname") then ..... end blocks in it. Utilising some well-known groups could be a great way to automatically gain support for other mods.
  • [ ] Nature takes over: this would be a fun challenge.
  • [ ] Perlin filter: Minetest has a built-in Perlin noise generator - we're going to hook into that in #17
    • Some noise algorithms implemented (more to go though), so we should be able to use these to apply them to adjust chances.
  • Everything can be customised: We can expose everything as space-separated key / value pairs in a command - then people can share different command combinations (e.g. a general purpose one that does everything, or one that only lets the erosion engine kick in or something).
  • [ ] Presets: We could definitely include some of these. Perhaps we could have each feature behind its own command, but have 1 big command like //teethoftime that calls all the others? Again, suggestions from the community playing around with it can be added here!
  • [x] Relighting: I think Minetest / the WorldEdit helpers does this automagically when saving a VoxelManip back? I can't remember. Either way, //fixlight is a thing.
  • [ ] Fluids recalculation: Certainly possible. This might result in a new separate command too.
  • Mod compatibility: If we try to use established groups as much as possible, we should retain some automatic mod compatibility.

Some other ideas that spring to mind:

  • //flowfluids - recalculate fluids
  • //fall - from we_env - though we'll want far more granular control, perhaps we can use the code from here that identifies nodes that are affected by gravity

It's going to be a while until I can get to this, so if anyone wants to start tackling this in the meantime, please go ahead! Please comment on this issue if you start working on it to avoid duplicating effort - and consider opening a PR when done :-)

Links

sbrl avatar Jun 22 '20 00:06 sbrl

We now have an initial erosion implementation, based on this blog post! I'm still on the fence about the result, so please let me know what you think of its effects.

sbrl avatar Aug 21 '20 20:08 sbrl