IcyPhoenix
Terrarian
Hey Guys,
So I decided to once again look into if it was possible to generate a world that is larger then large...
Well the conclusion is no, you cannot do it natively by just changing the generation values.
Obviously that didn't stop me, so here is a sneak peak at a 30,000 x 4000 world (warning boring video!), this was tested with tshock (running to the end of the world takes too long)
Difficulties Encountered
Since I'm dealing with the decompiled code base, understanding what each variable does is pretty big headache - but the things that caused the most grief were:
So I decided to once again look into if it was possible to generate a world that is larger then large...
Well the conclusion is no, you cannot do it natively by just changing the generation values.
Obviously that didn't stop me, so here is a sneak peak at a 30,000 x 4000 world (warning boring video!), this was tested with tshock (running to the end of the world takes too long)
Difficulties Encountered
Since I'm dealing with the decompiled code base, understanding what each variable does is pretty big headache - but the things that caused the most grief were:
- Memory Limitation - I tried to keep the server as a 32bit application, using large memory space to provide it 4gig, but the above generated world went beyond that, so had to compile it as a 64bit application, the end ram usage was 5gig.
- Stack Over Flow - If you have read the code, you'll notice that heaps and heaps of code reference itself within itself, on a small scale that is okay, but on a larger scale this hit the Stack Over Flow exception, even after increasing the stack size beyond 4gig (default is 1mb) it still didn't help, so I assumed some sort of recursion is happening too deep for it to matter. This was overcame by commenting out certain generations.
- Hard Coded Limitations - There are a few areas where the array is created with a hard coded size, this size under normal circumstances is fine, but it doesn't dynamically adjust with the growing map size, example of these are the arrays that hold dungeon doors/platforms etc... - these had to be arbitrarily increased as I didn't want to delve too deep on figuring out the max size needed.
- Coding Problems -
- The initial code didn't account for what would happen if the arrays reached its maximum, so everything was initiated with X value and for some reason the random generator decided to be inclusive upper bound, not sure why this is the case, had to initialize some arrays with +1 to max elements.
- Chest limit got hit before it was able to generate any special chests (water/biome etc...) this was never accounted for and the chest generation infinitely looped, as it never was able to end its while loop, for generating the special chests.
- Minimap - Everything client side worked, except for the minimap, I'm actually unsure why this doesn't work - as the methods are abit too ambigious and require more examining.
- Bottom of Hell Tiles not being sent - once again didn't bother looking into this, but the bottom of hell is just empty but actually has tiles there, something isn't updating properly.