Hi,
I just started developing my first game, a learning project of sorts. It’d describe the envisioned finished version as something between Minecraft, Dwarf Fortress, and Battle of Wesnoth; a blocky, tick-based simulation of a randomly generated fantasy world with thousands of unique, detailed characters in it, in which you can do pretty much anything. I got to a problem right at the beginning. I was trying to generate a basic random world, so that I have something to work with when setting up the display, but when I tried to represent the game world as a 24,576 x 24,576 x 150 3D array of Element objects(a class I made to eventually represent everything in the game), I kept getting the “Exception in thread “Display” java.lang.OutOfMemoryError: Java heap space”.
I got those numbers from Dwarf Fortress, and that’s not even a large world. And Minecraft worlds can be up to 6,000,000x6,000,000x256, so it should be possible, but how? I tried to google for how to save it in a file, but all the advice there was a bit off from what I wanted and I couldn’t divine anything useful from it. So, how would you go aroung managing a game world like this?