Realistic Terrain Generation

Realistic Terrain Generation

3M Downloads

Question about world generation

Baughn opened this issue ยท 8 comments

commented

Hi,

I've been poking at a simulation-based method for terrain generation, and I'm hoping you can help me decide if it's worth working harder on it--that is, whether this is something that can realistically be used with modded Minecraft.

Basically, I'm using a tectonic simulation to generate a 3D rock density map. If I proceed, I'll also be simulating erosion, microclimate and plant-growth (and associated erosion / soil generation). All of it up-front; it's computationally expensive enough that I'm not sure it can be done on a single computer in a reasonable amount of time, but I'm arranging the code to be runnable as a map-reduce type thing on EC2. (Alternately, of course, the user can just wait. Or generate a smaller world. Incremental generation is not really feasible, except as a 'continent' sort of thing.)

So the output of all this would be a number of 3D maps. From that map it'd be possible to reverse-engineer biomes, e.g. detecting sudden elevation changes, while most of the blocks (rock, ores, soil/grass/etc.) would be generated by referencing the maps directly. If I get erosion to work right, it'll even include realistic-looking caves.

I'm not asking for your help in programming this, because I know that it's a risky project--I might not get it to work at all--but by my very vague understanding of these things, Minecraft usually does it the other way around; that is, first deciding what biome a spot should be and then generating the terrain.

If I'm wrong about that, great. If you want to talk about it, even better; I'm hanging out in #TeamRTG at the moment. I do have some idea about how I could integrate with RTG, some time in the future. The thing is, Minecraft's worldgen code is gnarly enough that I can't make heads or tails of it, so...

Is an approach like the one I've sketched feasible?

commented

Pinky can correct me if I'm wrong or you for that matter but mc and RTG don't use the same world generation as far as I can tell.

RTG skips the genlayer system and genlayer system does "i think" things different.

The reason I think this is because when I gen a map with gelayers I get a total different world map then with standard RTG aka RWG way.
I think Ted tried to skip the genlayer system and made his own way and dumped all that info in chunkmanager and provider files.

The ocean for example generated like a biome. As in it seems it acts like a biome. Whereas get layer greates a real ocean "this is my opinion".

If you compare 2 maps i generated with RWG and with gelayers you see that the ocean in RTG or RWG are small and somewhat round (as in a round way biomes border it. And with gelayers it's huge and have different styles of oceans.

Knowing that I have no clue what your talking about hahaha I understand the words but I can't picture what you mean.

Besides that I think everything is possible when it comes to coding. I mean is there really something that cannot be done ? :p

commented

On a egotistical way:

If your that smart maybe you can help us fix our biggest problem which is the point I just described. Again pinky may correct me if I'm wrong. But we either need to get the genlayer system to work properly with RTG or we need to build our own way starting with how to make sure hot biomes cannot generate next to a snow biome but only a wet and cold for example.

If you want to make a world generator or addon and want to make use of RTGs realism decoration en generation why not make use of our code that way you build your project while fixing some of our Shit ; )

Haha don't take this too seriously but I would lie if I would say I wasn't serious about it ;) get it ? :p

commented

@Baughn - I've only been coding in Java/Forge for about two months now, so I'm hardly one to comment on the inner workings of Minecraft and whether your project is feasible or not, sorry. My gut feeling, based on what I've learned so far, is telling me that if performance is an issue in your current environment, it's only going to be more of an issue when you start turning it into a Minecraft mod.

And I think what @Ezoteric was trying to say is... maybe it might be worth getting involved in an existing project such as RTG or another world-gen type of mod so you can start to get an idea of how modded Minecraft works. After throwing yourself in the deep end, you'd probably be able to determine for yourself after a short while whether your project is feasible or not.

Hope that helps.

commented

Performance isn't a concern for running a world like this. The worldgen just needs to happen up-front, because only huge (multi-kilometer) sized chunks can be generated at a time, but in-game "worldgen" would be near-instant afterwards.

I'm already involved with Eln. I have a pretty good idea how to mod minecraft in general, I've just never touched worldgen before. There doesn't seem to be documentation on how it works.

commented

No, there certainly isn't - at least none that I've found anyway.

This is a nice little write-up explaining how Minecraft's GenLayer system works: https://www.evernote.com/shard/s9/sh/2170e56b-2858-45f7-8fd7-591ac54d780e/610a77215134bc87e101a4bb9a66dae4

That's the best thing I've read about how MC's world gen works... but sadly, I still don't really know what's going on behind the scenes.

Hope you have better luck than me! :)

commented

Sounds like I should stub out most of my code, then see if I can get the integration working.

I may go ahead and help you with RTG a bit. I was planning to use it for my next world anyway. :)

commented

I took a quick look, and... okay. Without commenting on how pretty the code is...

It's the lack of a defined interface to worldgen that's killing you here, as those mods almost certainly make different assumptions about how chunk generation is supposed to work than you do. That said, it isn't something I can help with; I know even less about that than you do.

Plus, I took a few hours last night and managed to positively answer my own question from #1; that is, I can indeed write tectonic world gen. So I'm going to do that; I may get back to you later, if I stall out. By that time I should have a better idea of what's going on.

commented

@Baughn Cool, well... there are several crashes that I'm struggling with at the moment: #195 #249 #228 being the major ones. Having a look through ChunkProviderRTG.java might be a good place to start, as I suspect that a lot of our crashes are being caused by a lack of Forge/Java best-practices in that file. For example, maybe RTG isn't registering its ore generators correctly, or not posting Forge events correctly, etc. I don't know for certain, but it feels like if we just improved the quality of the code we've got already, it would go a long way towards not only resolving the existing crash issues, but prevent future ones from happening at all.

Just my thoughts on how you could help out - feel free to suggest something else though - any help at all would be appreciated.