This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Nocty's profile picture

A Chunk Loading World Explorer/generator Turtle Script?

Started by Nocty, 18 November 2013 - 03:37 AM
Nocty #1
Posted 18 November 2013 - 04:37 AM
I have a heavily modded minecraft setup (based originally on FTB Unleashed, but I since added much more - 220 mods in total so far) and want to pregenerate the world. I'm using a combination of ATG (Alternate Terrain Generation) and Underground Biomes, which make the actual worldgen very slow and completely kills the server tick rate. Usually then Dynmap starts to render it, which continues the lag.

I've tried a few other methods, but I couldn't get most of them to work. One (Minecraft Land Generator) did work, but only generated vanilla terrain… back to square one.

Someone suggested that a misc peripherals chunkloader turtle with fuel (temporarily) switched to unlimited might be able to do the job. Unfortunately, my free time is limited (about to move house) and I want to upload and generate this server by the end of the month. Not an ideal time for me to be trying to learn another programming language (although I'm sure this is a fairly simple program I'm wanting). I do understand basic programming concepst, but haven't dabbled in much past my old 1980's era C64 BASIC.

What I would like is a simple program that does the following:

* moves up to the world ceiling (L255?)
* using a loop, spirals around crossing the chunks to generate the world in an increasing manner, but stopping at a pre-determined point (i.e. approx 10k*10k area)
* Ideally self-destruct; or at least move to the ground (L unknown) so I can teleport to it and destroy it manually.

I don't have much to offer other than my thanks; however if you are the FTB kind and would like to poke at my server while it's up testing, I can offer a copy of the client and an invitation to the server to play (or not play).

Thanks for reading.
Engineer #2
Posted 18 November 2013 - 09:57 AM
Errr… The program shouldnt be hard, like at all. But this you are not going to fix it by pre generating your biomes.
Take it like this: Java is a memory sensitive programming language, so Im already surprised you can even have 220 mods loaded at the same time. You really should remove all mods which are unnecessary.

I really believe that turtles arent your fix, just remove mods. And you must have a lot of RAM to keep those mods loaded 0.0
Bomb Bloke #3
Posted 18 November 2013 - 04:36 PM
The problem isn't so much getting the chunks generated, it's dealing with the aftermath of the new chunks appearing.

By that I mean, when a chunk forms, it'll often have things "happening" in it. Water/lava has to flow and "come to rest". Many trees will have leaf blocks that aren't properly connected - they all have to be processed as they go through their decay routines. Then all the saplings take five minutes to despawn, and so on… In short, even after all the chunks are generated it'll still be quite some time until the load on the server goes away.

Given that turtles move around very slowly, I'd recommend you just log into your server, let it chunk load the region around you, then just give your computer some alone time. Sure the tick rate will be low, but that doesn't mean your computer isn't working flat out!

Even if you don't want to play without any of the mods you've added in, you should at least disable all mods that aren't related to world generation until such time as the area around spawn is all sorted out. If once that's done gameplay is still overly slow, then you should keep in mind that this is a problem you'll run into every time a player decides to go exploring.
Lyqyd #4
Posted 18 November 2013 - 06:06 PM
Chunk loaded turtles do not fully generate terrain.
Nocty #5
Posted 19 November 2013 - 01:53 AM
Thank you all for your input.

I was well aware of the massive resource requirement due to the sheer amount of mods loaded - the idea was to pregenerate the world to lessen the load when people do go exploring. The entire pack (with a 1k*1k world generated through exploring and 4 players active) uses approx 1.1-1.5Gb of RAM for the JVM. I was planning on hosting it within a 2-3Gb pro host and seem to be fine with it on my dev box so far.

I can (using creative mode flight) easily "outrun" the worldgen at the moment. The expectation was that if the world was generated, the movement (lava/water/trees) could happen when people explored at a later time. With ATG handling the above ground and biomes, Underground Biomes doing the below ground part, as well as several other mods adding their own ores (or in the case of the Ruins mod, structures) I am not at all surprised it crawls to a halt. The relatively slow movement of the turtles is likely a benefit in this case as it gives the server plenty of time to do it's thing before the next chunk is created. Although…

Chunk loaded turtles do not fully generate terrain.

This is likely the end of the topic. I apologise for being lazy and not testing myself (something I'm about to do right now as I got the afternoon off unexpectedly). However, can you elaborate (or link to an explaination) please? My google-fu seems to be lacking on this topic, and most of the chunk loading+turtle results deal with needing a chunk loaded to use a turtle remotely.

Thanks again.

I can't see my previous post to edit (new user, all good).

Testing reveals that the turtle travelled to the end of the loaded area, then stopped and reset. No generation.

Chalk this up to another idea that didn't work (and you did tell me so) :)/>/>
Lyqyd #6
Posted 19 November 2013 - 10:27 AM
I set up eight chunk loading turtles with a naive tunnel bore program–dig top, bottom and front, check fuel, check inventory, etc. They would generate terrain fine, but not terrain features. I'd find those abandoned mineshafts in the tunnels they dug, occupying space that they would have dug. I suspect that the terrain itself generates, but not any terrain features. Ore berry bushes, mineshafts, and dungeons all seem to generate when a player walks the tunnels, but not before. This won't be as noticeable if you have them fly along the surface, but they won't be able to generate features unless you have a lot of them spaced out.