Realistic Terrain Generation

Realistic Terrain Generation

3M Downloads

RTG 0.3.0: Weird region files generation with RTG

walkerjonny opened this issue ยท 23 comments

commented

2015-12-20 03_38_59-region
I checked that against the BOP terrain generator and the default terrain generator. This happens only with RTG 0.3.0. The point is - when it starts to generate those weird region files, it does it every few chunks I explore. In some scenarios with many mods this starts to create an endless loop of terrain generation causing the server to freeze and bloating up the game memory usage until the game crashes.
In this time it generates a huge amount of those weird region files - sometimes several hundreds.

commented

Here the fml-client-latest.log for this:
fml-client-latest.log.txt

commented

Just to clarify: I did those tests above only with those mods as asked and there I could not reproduce it.
But when I'm playing with the whole mod list as I did when I wrote my first comment this is repeatable and when it starts to happen it continues also after closing and reloading Minecraft itself.
It just looks like this issue isn't directly related to OptiFine and Fastcraft.

commented

@walkerjonny Would it be possible to send me your config/mods/scripts folders and I'll see if I can reproduce it here? It depends on how many mods you have though, because my crummy laptop can only run about 40 mods before testing becomes a nightmare.

If you're running more than that, maybe you could try removing 10 a time and seeing if the problem is still happening, and then when you've narrowed it down a bit, then send across your stuff?

I'm not entirely convinced this is an RTG thing, but I'm worried enough that I'd like to get to the bottom of it one way or another.

Let me know what you think.

commented

Hmm, that might explain a few issues that people have brought up in the past about running out of memory after exploring long distances.

Have you been able to reproduce the issue with just RTG installed?

commented

Tried it with only RTG, RTG & OptiFine and RTG + OptiFine + FastCraft but could not reproduce it. Maybe it depends on the amount of additional stuff that needs to be done for other mods like decorating, adding ores, placing dungeons and so on or on a certain combination of it.
Maybe you need to set some debug checkpoints when it comes to saving changes to region files or creating new ones.

commented

That could be a problem then. My tower is capable to run more than 200 mods at once easily and that is what I'm doing usually.
At this time I was testing with about 90 different mods. I'll see what I can do about this to narrow it down but as I mentioned it could be also some mod interactions when it comes to a higher amount of mods.

commented

By the way, how are mods handled that generate ores within the generated terrain?
I have an issue at the moment with CustomOreGen, a mod designed to do all the required ore generation for nearly all other mods. COG offers quite more distribution options and ore generation is done much faster that way because ore generation is usually turned off for all other mods and therefore only one mod does all the ore generation.
COG is designed to do the ore generation after the terrain is generated and replaces stone (OreDict Type stone, if declared properly by mods for their custom stone blocks) and sometimes also dirt and sandstone usually with the required ore blocks.
However, at the moment the server module freezes always at the same map point (looks like an endless loop) and Minecraft hangs then also on closing the world and I have to end it forcefully.
Could you make sure that you have generated the whole terrain for a chunk including caves and mineshafts and so on before COG is allowed to generate the ores?
If this happens in parallel it might be possible that COG tries to place an ore block while RTG tries to remove that block because it wants to create a mineshaft for example. What happens then?
So ideally the whole chunk generation should work as described below:

  1. terrain generation by RTG
  2. caves and mineshafts and so on by RTG
  3. dungeon placement by RTG for vanilla and by 3rd party mods
  4. ore generation by RTG, COG and all other mods
  5. generating additional stuff like fluid lakes and so on for 3rd party mods like oil from buildcraft.
    Maybe oil generation is a bit tricky that late and needs to be done earlier...
  6. decorating the surface.
commented

Just had a look at the COG forum. Now I understand some possible issues a bit better.
Maybe both RTG and COG are trying to do some generations that could collide then.

commented

Out of curiosity, what are those possible issues? Reason I'm asking is... I'm currently re-working the ore gen in RTG, partly to attempt to resolve this issue and partly to implement a new feature.

As I've been working on this, I discovered a small bug which I'm trying to fix, so that might have been interfering with COG, but... I'm just wondering what these other potential issues might be that you discovered so I can hopefully avoid them while I'm re-writing the ore gen.

commented

So, I did some tests with COG and RTG to near out that issue above. It looks like there is an issue if COG has to handle a higher amount of ores and RTG wants to place a mineshaft.
It doesn't really depend on a single mod, it looks more like an issue when it comes to a higher amount of ores. The outcome is then a freeze of the server module, maybe by an endless loop somewhere.
As I understand now COG does its ore generation quite early before even the terrain is generated.
If RTG interferes that process by placing mineshafts or maybe caves for example at the same stage this might cause that issue somehow, if it is not handled properly who should win in that case.
Maybe it would be better to let COG finish its ore generation before placing anything like mineshafts, caves or lakes.

commented

Thanks for the feedback - I'll take all of this into consideration as I'm re-writing RTG's ore generation process. I might even release v0.4.1 with these changes if everything goes well, and hopefully that will resolve the COG conflicts as well.

commented

I'll help you out with testing if you want but unfortunately I have no real knowledge of Java or other actual programming languages, just a little knowledge about VB and C and some scripting languages that I need for my daily work.

commented

This seems to be related to I:"Size of Biomes"=1. Same pack, same seed, with a value of 1, I get region files in the hundreds. With a value of 3 (the default), regions all generate appropriately.

I stumbled across this because the biomes looked too big on size 3, so I tried 2, then 1. In each case, the biome size didn't change, but the underlying region files went all wonky. I suspect you're multiplier is getting applied to the wrong operand.

Edit: also, resetting this back to 3 has resolved several reproducible worldgen issues with other mods, particularly AlreadyDecorating exceptions. I suspect bad coordinates were being passed. Big, giant PHEW to get a world gen pass on 160,000 chunks without a single error and all desired mods enabled.

commented

Thanks for tracking that one down @Haggle1996 - I hadn't thought to look at that section of code when I was looking into this, but I'll see if I can figure out what's going on.

commented

I'm encountering this with RTG 0.4.0, with all RTG ore generation turned off. I do use COG. You'll notice at the end of the fml-server-latest that it started generating streams in the 50,000 block range, and I have region files in the hundreds.

https://gist.github.com/Haggle1996/f5ab70de4e073060ec61

commented

@Haggle1996
For how many mods does COG generate ores for you? Have you included support for all your ore generating mods into COG und turned off their own ability to generate the ores?

commented

@walkerjonny COG handles ore generation for all mods in my pack, and yes, I turned off those mods' ore generation.

commented

@whichonespink44 also noted another strange behavior that results in crazy region files. I'm not certain this is RTG related, but noting it here. After resetting biome size to 3, worlds in my pack generate correctly so long as the seed used is positive.

If the seed is negative, streams from the Streams mod will generate in a rigid grid pattern way outside the generation area (all the way from the edge of the expected map to x-coord 25,000). These streams will only generate to the exact left of the map (meaning z-coordinates are always reasonable). These streams are not stored in strange, hundreds-range region files -- they are stored in the expected region files with coordinates outside the region boundaries. Visiting these areas looks like an odd streams-inspired skyblock, and results in the generation of a crazy region file (which isn't crazy, 'cause you're actually there. :P )

commented

@Haggle1996 That sounds like strange behaviour indeed. I haven't had a chance to look into this yet, but I'll certainly keep the sign of the seed in mind when I do.

commented

Yes, CC looks at chunks trying to find one with land above water and in the process leaves a bunch of unacceptable chunks in the files. They're all ocean normally because the search ends on the first land. A bunch of tiny region files would look odd now that I think about it but the chunks should all be the right ones.

commented

@Haggle1996 @walkerjonny Have you guys noticed any of these weird region files whilst testing the 0.5.0 snapshots? I suspect this is issue is related to the RTG layouts, which we're removing soon, so just want to know if we still need to look into this.

commented

No, and I specifically tested for this.

I do see a swath of generated ocean chunks -- I think that's CC trying to find land to put me on or maybe it's moving terrain around. Not sure, but it's nowhere near as bad -- and the chunks all have appropriate regions. I've tested with different biome sizes as well; no issues.

commented

Cool, thanks guys. Closing.