Sign Up, Lost Password
Comments for Adventure
Return to Adventure
A new version of this scenario was uploaded on Thu Jun 28 20:04:08 UTC 2012 Changed world size to fit nicely on the Gallery.
A new version of this scenario was uploaded on Fri Jun 29 00:23:21 UTC 2012 Bugfixes and sprint added
A new version of this scenario was uploaded on Fri Jun 29 02:05:08 UTC 2012 Inventory available but not useable, world is now unbound left and right.
ich blicks net
If you're still interested in this project I can teach you a few techniques on how to manage vast voxel worlds and still get a high FPS.
ich bin interessiert Spilli
I would imagine storing the entire world as an integer array and only adding the on-screen objects from the array would certainly do it. This was a rather rushed project however, but if you have a different solution, I am certainly interested to hear it, Spilli :) Cocky is interested too if you care to translate your solution to German (lol)
Well for a start I would not store the whole world in memory. On start up make it build the world and save it in region based files. I'd then make it load only the region's within X distance. If an active region is no longer within view distance, it's destroyed and removed from active memory. If you don't understand me, just say and I'll make a quick prototype.
I understand but how does one remove a file from active memory?
You don't remove a file from memory, the world files are saved to disk. You read the files and initialize the region into memory.
Ah. See I tried storing the entire world in one gigantic randomly-generated text file but this caused problems for java to read the entire document. I've been kinda off Greenfoot for awhile though, I might hop back on just to try your suggestion out. Too bad Greenfoot doesn't allow security permissions to read/write to text documents; that will make my job a tiny bit harder... Thanks for your input Spilli :)
Don't use a text document, and don't bulk it up. I'd make is so each region (chunk of the world) use it's own file. This mean's you only have to load what you require. Plus I wouldn't use a text document, I'd recommend saving in a raw format which will save tons of space. To identify regions you could give them identification numbers which would vary upon their location within the 2D space for example: int regionId = (y / Region.SIZE) + ((x / Region.SIZE) << 8); I'd also recommend keeping the region size to the power of two. Best of luck. :)