Oh okay, because I am currently working on a similar solution, only I am modifying the minecraft_server.jar file directly to call the initWorld function repeatedly. I don't shift the spawn point itself, but rather call the function with an offset. I get memory problems though, as even though I am saving the generated chunks to disk, they seem to remain on the heap and slow the generation process down. Maybe you could help me though :-)
rather than call the initworld function, why dont you call the "chunk generate" and "chunk populate" functions and give the location of it?
then do a "chunk unload" on the same location later.
thats how bukkit plugins that generate land work.
EDIT: Memory Management was one of the reasons why MLG chose to load the sever muliple times instead of just increasing the amount of land initially created. running the function but changing the offset wasnt considered at the time, since we could do what MLG does, and not mess with intergrating with the server...
And a correction: My computer at work takes 1hour 56minutes to do 2048 x 2048.
My server did it in 5 mins.
Minecraft Land Generator | Memory issues? Try this:java -Xincgc-Xmx1024M -Xms512M -jar Minecraft.jar "We must be that generation that stands athwart history yelling: 'Hey, jackass, get your government off my freedom!'" - Jason Mattera
MLG seems to be the best option at the moment. I have not yet found a solution to unloading the chunks in memory. The algorithm seems to be running as fast as it can.
But I think I have a suggestion that could improve generation speed 2x/4x/6x depending on the amount of processor cores a CPU has. You cannot bind more than one server to a single port and multi-threading Minecraft further is impossible, but running the JVM multiple times with a different port should work. To avoid locked files, unique subdirectories should be used. Then you just generate different regions. Finally merge all the region files. Sounds like a plan?
Maybe seeing how bukkit interacts with the server to create the chunk unload function would be helpful. I've never looked at bukkit's source code - only the bukkit API
Actually i discussed this in detail on page 21 here, and other times before that: see post #411
Rollback Post to RevisionRollBack
Minecraft Land Generator | Memory issues? Try this:java -Xincgc-Xmx1024M -Xms512M -jar Minecraft.jar "We must be that generation that stands athwart history yelling: 'Hey, jackass, get your government off my freedom!'" - Jason Mattera
I should learn to read more thoroughly. At least my mind is still working, coming up with such a brilliant idea :wink.gif:
I have another idea though. If you check the minecraft_server.jar, it declares a variable char c = '\304'; which is 196 in decimal. Increasing this to 256 will generate chunks in a greater area around the current spawn, so you would have to adjust your incremental value accordingly.
As most time is lost during the stop-start cycles, allowing more time for actual chunk generation should compensate. I know you don't want to modify the original minecraft_server.jar, but maybe someone should give this a shot.
Hey don't worry, there are tons of pages on this thread, containing tons of info.
196/16 = 12.5 chunks around spawn point. 12.5 x 2 = 25 chunks across. (625 total chunks)
256/16 = 16 chunks around spawn point. 16 x 2 = 32 chunks across. (1024 total chunks)
changing it to 256 will add 7 more chunks horizontally and vertically to the map. (additional 399 chunks)
how much of a difference does it make with memory usage and saving speed?
Like i said before this has been done long ago, and it was found that you could run out of memory real fast. (this was also done 1.5 years ago so we do have faster comps with more memory.)
another question, how are you modifying the server, and would there be an easy way to inject this new variable on the fly? (is it set as:
final char c = "\304";
? )
for example, could we create a .jar (hMod style) that could modify this at runtime? (and hopefully work on multiple versions of the server - maybe analyze the .class files like what the donkeykong biome extractor does)
If so, then MLG could just run that .jar which starts the server...
EDIT: I also wanted to say that MLG can support a different initial spawn generation size with "-i nnn" where nnn is the number of blocks across
Minecraft Land Generator | Memory issues? Try this:java -Xincgc-Xmx1024M -Xms512M -jar Minecraft.jar "We must be that generation that stands athwart history yelling: 'Hey, jackass, get your government off my freedom!'" - Jason Mattera
I used MCP 5.0 to decompile, recompile and reobfuscate the code. It's not an instance variable, but rather a local variable declared in the initWorld() method.
char c = '\304';
It was the first variable I experimented with. I cannot give you an exact benchmark right now, as I am in the middle of a world generation process.
Safe to say, chunk generation takes a short while longer, memory usage increases by about 200 MB, saving the chunks to disk slightly longer. But as there are less start-stop cycles involved in total, you can save time. If you like, I can send you a modified minecraft_server.jar so you can run tests yourself.
Declaring this as an int and increasing the value further will result in diminishing returns. It will use more RAM and slow down dramatically. At 512 it feels like driving through treacle :laugh.gif:
I'll think I'll check it out myself...
I don't expect to be able to change that variable externally, at least not easily.
Rollback Post to RevisionRollBack
Minecraft Land Generator | Memory issues? Try this:java -Xincgc-Xmx1024M -Xms512M -jar Minecraft.jar "We must be that generation that stands athwart history yelling: 'Hey, jackass, get your government off my freedom!'" - Jason Mattera
Minecraft Land Generator | Memory issues? Try this:java -Xincgc-Xmx1024M -Xms512M -jar Minecraft.jar "We must be that generation that stands athwart history yelling: 'Hey, jackass, get your government off my freedom!'" - Jason Mattera
The beach doesn't appear when I use MLG on Minecraft 1.1 (I created a new world with the same seed), the world doesn't change except around my spawn point, it that because I used the old version of MLG or something?
I don't know much Eng btw thank you for your hard work :laugh.gif:
The beach doesn't appear when I use MLG on Minecraft 1.1 (I created a new world with the same seed), the world doesn't change except around my spawn point, it that because I used the old version of MLG or something?
I don't know much Eng btw thank you for your hard work :laugh.gif:
did you update the minecraft_server.jar in the MLG folder?
Rollback Post to RevisionRollBack
Minecraft Land Generator | Memory issues? Try this:java -Xincgc-Xmx1024M -Xms512M -jar Minecraft.jar "We must be that generation that stands athwart history yelling: 'Hey, jackass, get your government off my freedom!'" - Jason Mattera
I've looked at LibertasLoader and it hasn't been updated since before 1.8.
We're trying to help Khoorn write a technical wiki for Terrain Control. Back in the day, we used MLG and BiomeTerrainMod to track positive or negative changes to a single setting across a broad sample of the map. We sussed out the effects of various parameters this way.
Now that the biome and terrain code of vanilla Minecraft has changed so much, we need to do it again. BukkitLandGenerator may be just what we need. If there's a way to ensure it won't lock up in 64-bit Java, I'm happy to test it.
I've looked at LibertasLoader and it hasn't been updated since before 1.8.
We're trying to help Khoorn write a technical wiki for Terrain Control. Back in the day, we used MLG and BiomeTerrainMod to track positive or negative changes to a single setting across a broad sample of the map. We sussed out the effects of various parameters this way.
Now that the biome and terrain code of vanilla Minecraft has changed so much, we need to do it again. BukkitLandGenerator may be just what we need. If there's a way to ensure it won't lock up in 64-bit Java, I'm happy to test it.
the only source code that is available is for LibertasLoader 1.0 (1.2 was the last version). I am hoping to merge the scheduling (so chunks don't generate too quickly) from LL with BLG's current code, along with any superior code that LL has when compared with BLG.
BLG as it currently exists is just some hacked up code copied from MLG and some Bukkit template code. yes, it gen's chunks. step 1 complete. step 2: fix crashes from happening. step 3: more features. step 4: goto step 2.
Minecraft Land Generator | Memory issues? Try this:java -Xincgc-Xmx1024M -Xms512M -jar Minecraft.jar "We must be that generation that stands athwart history yelling: 'Hey, jackass, get your government off my freedom!'" - Jason Mattera
Can anyone confirm that the new Mac .command files work properly?
I don't have a Mac or have access to one. I created those files based on information I found on the Internet. Theoretically it should work.
Rollback Post to RevisionRollBack
Minecraft Land Generator | Memory issues? Try this:java -Xincgc-Xmx1024M -Xms512M -jar Minecraft.jar "We must be that generation that stands athwart history yelling: 'Hey, jackass, get your government off my freedom!'" - Jason Mattera
Can anyone confirm that the new Mac .command files work properly?
I don't have a Mac or have access to one. I created those files based on information I found on the Internet. Theoretically it should work.
anyone?
Rollback Post to RevisionRollBack
Minecraft Land Generator | Memory issues? Try this:java -Xincgc-Xmx1024M -Xms512M -jar Minecraft.jar "We must be that generation that stands athwart history yelling: 'Hey, jackass, get your government off my freedom!'" - Jason Mattera
well... I've done the unthinkable - at least for me.
I've verified, personally, that my script files work on OSX. specifically snow leopard 10.6.2.
However... It was a virtual machine running in VirtualBox while running linux, so at least i didn't touch one!
...I still feel dirty though...
Anyways, MLG runs perfectly in OSX. Mission accomplished!
MAC INSTRUCTIONS: (which are very similar to every other operating system)
download zip file. (it unzips automatically!)
open download folder.
open MinecraftLandGenerator folder.
doubleclick "Update_MLG_(Mac).command"
- click "Open" when the warning about being downloaded shows up.
- let it run.
- when it says "[Process completed]" click the red X in the upper left corner to close it.
doubleclick "Update_Server_(Mac).command"
- (same steps apply as before)
doubleclick "Run_Server_(Mac).command"
- click "Open" when the warning about being downloaded shows up.
- let it run. after it says "Done":
- type (without quotes): "stop"
- when it says "[Process completed]" click the red X in the upper left corner to close it.
doubleclick "Run_MLG_(Mac).command"
- (same steps apply as before)
- It is setup to make a 2000x2000 map by default. edit the file before running to change this, or remove "2000 2000" for MLG to ask you each time.
Minecraft Land Generator | Memory issues? Try this:java -Xincgc-Xmx1024M -Xms512M -jar Minecraft.jar "We must be that generation that stands athwart history yelling: 'Hey, jackass, get your government off my freedom!'" - Jason Mattera
Is there a way I can use this with the minecraft client, not server? I want to pre-generate the world for single player, but some mods I'm using, that alter world generation, don't have SMP versions, so I can't use them with server.
Unfortunately, no.
The only possibility i can think of, would be if you are using mods that add blocks in the "populate" section of terrain generation. you can get a tool like repopulator which sets the populateterrain flag for each chunk to 0, forcing minecraft to load new blocks like trees, ores, tall grass, etc. the next time the chunk is loaded.
base terrain mods - map height, mountain height, water depth, cave systems, etc. would need a server version of the mod.
if you could be more specific about your mods, I could possibly give you some ideas/workarounds.
now, if you had mods for both server and client, or you were generating a vanilla map, you can copy in and out any singleplayer world into the MLG folder.
Edit: I just wanted to say that MLG is designed to work with any mods you can throw at it, provided the configuration is properly set up. (the only partial exception is Bukkit - it only works with the main world, not the plugin based multiworlds.)
Minecraft Land Generator | Memory issues? Try this:java -Xincgc-Xmx1024M -Xms512M -jar Minecraft.jar "We must be that generation that stands athwart history yelling: 'Hey, jackass, get your government off my freedom!'" - Jason Mattera
Is there any reason in particular that stopping the server takes longer than the generation itself? It's honestly faster for me to use optifine and fly around in creative mode than use this.
Is there any reason in particular that stopping the server takes longer than the generation itself? It's honestly faster for me to use optifine and fly around in creative mode than use this.
Maybe that's the case for you... But MLG is automated - you can start it and come back later - you don't have to manually fly everywhere. Also, MLG gives a nice square (or rectangle) map - perfect for mapping.
The server takes a long time to stop because it is saving all the chunks. I have no control over the speed of the server. if you want to complain, complain to Mojang - earlier versions of the server (before beta 1.8) quit much faster.
The mods that I'm using without SMP versions are Forestry and Buildcraft 3.1.3
I could just generate a vanilla world, use MCEdit to replace the ores with smoothstone, trees, leaves and tallgrass with air, and use the repopulator tool. That should work. Thanks! :smile.gif:
awesome! good luck!
Rollback Post to RevisionRollBack
Minecraft Land Generator | Memory issues? Try this:java -Xincgc-Xmx1024M -Xms512M -jar Minecraft.jar "We must be that generation that stands athwart history yelling: 'Hey, jackass, get your government off my freedom!'" - Jason Mattera
i generated a world with the last 1.2 server and it look like it crashed when it had done the half of the work.
i'm generating another world with a 1.2 server. i will see if it crash.
EDIT : It Worked
Yes. it works with the new anvil map format. MLG doesnt care about what format the files are in - original chunks, McRegion, Anvil - because it doesnt modify or touch them. It only needs the "level.dat" file which has the spawn location (and other info) in it.
Tested with snapshot 12w08a and MLG 1.6.03.
I doubt MLG crashed - it was probably the server that crashed and MLG was waiting for it to exit.
(using a task manager to close the server will let it continue. - just make sure you close the server, and not MLG! -- the server will have a large memory usage, and MLG will have a small usage, but both will show up as "Java" or "Java.exe")
Rollback Post to RevisionRollBack
Minecraft Land Generator | Memory issues? Try this:java -Xincgc-Xmx1024M -Xms512M -jar Minecraft.jar "We must be that generation that stands athwart history yelling: 'Hey, jackass, get your government off my freedom!'" - Jason Mattera
So i decided to code in support (MLG just ignores the messages unless its in verbose mode) to display the converting map format progress, in the small likelihood that MLG loads the minecraft server for the first time after a map format update.
*** Note: Code not done yet -- Soon ***
if it were to happen with the current version, and not in verbose mode (most people aren't), you would see a long pause while converting - but nothing telling you about it. (and conversion only happens once - and its fairly quick - so its not a big deal)
so i was messing with some old server files and found some alpha maps that were the old "each chunk is its own file" style.
Minecraft Server 1.1 will still convert it to McRegion. (and deletes the original)
And Snapshot 12w08a will convert McRegion into Anvil. (and saves the McRegion as a backup)
But the snapshot wont convert the original style into Anvil. In fact it ignores all the chunk files, and creates new ones alongside the original.
So, just to be safe - make sure all your old maps are converted into McRegion before 1.2 is released! (and backed up too!)
Rollback Post to RevisionRollBack
Minecraft Land Generator | Memory issues? Try this:java -Xincgc-Xmx1024M -Xms512M -jar Minecraft.jar "We must be that generation that stands athwart history yelling: 'Hey, jackass, get your government off my freedom!'" - Jason Mattera
Does it work with 1.2 or will it need to get updated ?
I've tested MLG 1.6 and it works perfect! and i hope you like the updated scripts too!
Rollback Post to RevisionRollBack
Minecraft Land Generator | Memory issues? Try this:java -Xincgc-Xmx1024M -Xms512M -jar Minecraft.jar "We must be that generation that stands athwart history yelling: 'Hey, jackass, get your government off my freedom!'" - Jason Mattera
rather than call the initworld function, why dont you call the "chunk generate" and "chunk populate" functions and give the location of it?
then do a "chunk unload" on the same location later.
thats how bukkit plugins that generate land work.
EDIT: Memory Management was one of the reasons why MLG chose to load the sever muliple times instead of just increasing the amount of land initially created. running the function but changing the offset wasnt considered at the time, since we could do what MLG does, and not mess with intergrating with the server...
And a correction: My computer at work takes 1hour 56minutes to do 2048 x 2048.
My server did it in 5 mins.
"We must be that generation that stands athwart history yelling: 'Hey, jackass, get your government off my freedom!'" - Jason Mattera
Maybe seeing how bukkit interacts with the server to create the chunk unload function would be helpful. I've never looked at bukkit's source code - only the bukkit API
Actually i discussed this in detail on page 21 here, and other times before that: see post #411
"We must be that generation that stands athwart history yelling: 'Hey, jackass, get your government off my freedom!'" - Jason Mattera
Hey don't worry, there are tons of pages on this thread, containing tons of info.
196/16 = 12.5 chunks around spawn point. 12.5 x 2 = 25 chunks across. (625 total chunks)
256/16 = 16 chunks around spawn point. 16 x 2 = 32 chunks across. (1024 total chunks)
changing it to 256 will add 7 more chunks horizontally and vertically to the map. (additional 399 chunks)
how much of a difference does it make with memory usage and saving speed?
Like i said before this has been done long ago, and it was found that you could run out of memory real fast. (this was also done 1.5 years ago so we do have faster comps with more memory.)
another question, how are you modifying the server, and would there be an easy way to inject this new variable on the fly? (is it set as: ? )
for example, could we create a .jar (hMod style) that could modify this at runtime? (and hopefully work on multiple versions of the server - maybe analyze the .class files like what the donkeykong biome extractor does)
If so, then MLG could just run that .jar which starts the server...
EDIT: I also wanted to say that MLG can support a different initial spawn generation size with "-i nnn" where nnn is the number of blocks across
"We must be that generation that stands athwart history yelling: 'Hey, jackass, get your government off my freedom!'" - Jason Mattera
I'll think I'll check it out myself...
I don't expect to be able to change that variable externally, at least not easily.
"We must be that generation that stands athwart history yelling: 'Hey, jackass, get your government off my freedom!'" - Jason Mattera
go for it!
EDIT: I wanted to tell you this...
in net.minecraft.src
in the file:
ChunkProviderServer.java
there is a function called:
unload100OldestChunks()
that might be helpful to you.
"We must be that generation that stands athwart history yelling: 'Hey, jackass, get your government off my freedom!'" - Jason Mattera
I don't know much Eng btw thank you for your hard work :laugh.gif:
did you update the minecraft_server.jar in the MLG folder?
"We must be that generation that stands athwart history yelling: 'Hey, jackass, get your government off my freedom!'" - Jason Mattera
We're trying to help Khoorn write a technical wiki for Terrain Control. Back in the day, we used MLG and BiomeTerrainMod to track positive or negative changes to a single setting across a broad sample of the map. We sussed out the effects of various parameters this way.
Now that the biome and terrain code of vanilla Minecraft has changed so much, we need to do it again. BukkitLandGenerator may be just what we need. If there's a way to ensure it won't lock up in 64-bit Java, I'm happy to test it.
the only source code that is available is for LibertasLoader 1.0 (1.2 was the last version). I am hoping to merge the scheduling (so chunks don't generate too quickly) from LL with BLG's current code, along with any superior code that LL has when compared with BLG.
BLG as it currently exists is just some hacked up code copied from MLG and some Bukkit template code. yes, it gen's chunks. step 1 complete. step 2: fix crashes from happening. step 3: more features. step 4: goto step 2.
In the meantime, i've heard this:
I think he meant this.
"We must be that generation that stands athwart history yelling: 'Hey, jackass, get your government off my freedom!'" - Jason Mattera
I don't have a Mac or have access to one. I created those files based on information I found on the Internet. Theoretically it should work.
"We must be that generation that stands athwart history yelling: 'Hey, jackass, get your government off my freedom!'" - Jason Mattera
anyone?
"We must be that generation that stands athwart history yelling: 'Hey, jackass, get your government off my freedom!'" - Jason Mattera
I've verified, personally, that my script files work on OSX. specifically snow leopard 10.6.2.
However... It was a virtual machine running in VirtualBox while running linux, so at least i didn't touch one!
...I still feel dirty though...
Anyways, MLG runs perfectly in OSX. Mission accomplished!
MAC INSTRUCTIONS: (which are very similar to every other operating system)
download zip file. (it unzips automatically!)
open download folder.
open MinecraftLandGenerator folder.
doubleclick "Update_MLG_(Mac).command"
- click "Open" when the warning about being downloaded shows up.
- let it run.
- when it says "[Process completed]" click the red X in the upper left corner to close it.
doubleclick "Update_Server_(Mac).command"
- (same steps apply as before)
doubleclick "Run_Server_(Mac).command"
- click "Open" when the warning about being downloaded shows up.
- let it run. after it says "Done":
- type (without quotes): "stop"
- when it says "[Process completed]" click the red X in the upper left corner to close it.
doubleclick "Run_MLG_(Mac).command"
- (same steps apply as before)
- It is setup to make a 2000x2000 map by default. edit the file before running to change this, or remove "2000 2000" for MLG to ask you each time.
"We must be that generation that stands athwart history yelling: 'Hey, jackass, get your government off my freedom!'" - Jason Mattera
Unfortunately, no.
The only possibility i can think of, would be if you are using mods that add blocks in the "populate" section of terrain generation. you can get a tool like repopulator which sets the populateterrain flag for each chunk to 0, forcing minecraft to load new blocks like trees, ores, tall grass, etc. the next time the chunk is loaded.
base terrain mods - map height, mountain height, water depth, cave systems, etc. would need a server version of the mod.
if you could be more specific about your mods, I could possibly give you some ideas/workarounds.
now, if you had mods for both server and client, or you were generating a vanilla map, you can copy in and out any singleplayer world into the MLG folder.
Edit: I just wanted to say that MLG is designed to work with any mods you can throw at it, provided the configuration is properly set up. (the only partial exception is Bukkit - it only works with the main world, not the plugin based multiworlds.)
"We must be that generation that stands athwart history yelling: 'Hey, jackass, get your government off my freedom!'" - Jason Mattera
Maybe that's the case for you... But MLG is automated - you can start it and come back later - you don't have to manually fly everywhere. Also, MLG gives a nice square (or rectangle) map - perfect for mapping.
The server takes a long time to stop because it is saving all the chunks. I have no control over the speed of the server. if you want to complain, complain to Mojang - earlier versions of the server (before beta 1.8) quit much faster.
Only a faster computer will help.
awesome! good luck!
"We must be that generation that stands athwart history yelling: 'Hey, jackass, get your government off my freedom!'" - Jason Mattera
Yes. it works with the new anvil map format. MLG doesnt care about what format the files are in - original chunks, McRegion, Anvil - because it doesnt modify or touch them. It only needs the "level.dat" file which has the spawn location (and other info) in it.
Tested with snapshot 12w08a and MLG 1.6.03.
I doubt MLG crashed - it was probably the server that crashed and MLG was waiting for it to exit.
(using a task manager to close the server will let it continue. - just make sure you close the server, and not MLG! -- the server will have a large memory usage, and MLG will have a small usage, but both will show up as "Java" or "Java.exe")
"We must be that generation that stands athwart history yelling: 'Hey, jackass, get your government off my freedom!'" - Jason Mattera
*** Note: Code not done yet -- Soon ***
if it were to happen with the current version, and not in verbose mode (most people aren't), you would see a long pause while converting - but nothing telling you about it. (and conversion only happens once - and its fairly quick - so its not a big deal)
so i was messing with some old server files and found some alpha maps that were the old "each chunk is its own file" style.
Minecraft Server 1.1 will still convert it to McRegion. (and deletes the original)
And Snapshot 12w08a will convert McRegion into Anvil. (and saves the McRegion as a backup)
But the snapshot wont convert the original style into Anvil. In fact it ignores all the chunk files, and creates new ones alongside the original.
So, just to be safe - make sure all your old maps are converted into McRegion before 1.2 is released! (and backed up too!)
"We must be that generation that stands athwart history yelling: 'Hey, jackass, get your government off my freedom!'" - Jason Mattera
I've tested MLG 1.6 and it works perfect! and i hope you like the updated scripts too!
"We must be that generation that stands athwart history yelling: 'Hey, jackass, get your government off my freedom!'" - Jason Mattera