Alright, first off, thanks for all the advice, much appreciated. Here are the things I checked out and how they turned out:
Chunking
The only way to divide the world into chunks that I could come up with was to create a 5D array, with the first two coordinates being coord of a 2D chunk grid comprising of 32x32(chosen arbitrarily) chunks, and the rest a normal 3D coords withing the chunk. When I tried to randomly generate a world like that(nothing too complicated, just a random number from 0 to 9 to represetnt ten different kinds of blocks), I got the same error. I think I’m missing something important here. I get the error because the array is too large, right? So how exactly do I go around chunking it into smaller pieces so that it doesn’t crash when I try to generate a world? I could save each chunk in a separate variable intead of an array, but then I couldn’t make worlds of arbitrary sizes, or could I? Here is the code for the chunked world, for reference:
for (int chx = 0; chx < currentWorld.worldArray.length; chx++) {
for (int chy = 0; chy < currentWorld.worldArray[0].length; chy++) {
for (int ix = 0; ix < currentWorld.worldArray[0][0].length; ix++) {
for (int iy = 0; iy < currentWorld.worldArray[0][0][0].length; iy++) {
for (int iz = 0; iz < currentWorld.worldArray[0][0][0][0].length; iz++) {
currentWorld.worldArray[chx][chy][ix][iy][iz] = new Element(random.nextInt(10));
System.out.println(currentWorld.worldArray[chx][chy][ix][iy][iz].ID);
}
}
}
}
}
Byte arrays
Tried to google and read up on them a bit, but I’m still not sure what do you mean or how to implement it. Are you saying that I should store the data about what’s in each block in a byte instead of in other data types? So far, I’ve been planning on having either blocks or mobs filling the game world; Blocks will just have an integer ID referring to a definition of that block’s properties(texture, hardness, drop, an so on), and mobs will have tons of properties like species, inventory, health, etc., etc. They will also be subject to a regular AI check, as soon as I set up the rest of the basics. So how would you implement this using byte arrays instead of a more straighforward solution like ints and Strings?
Simpler game
I do plan on making it simple… for now. It should look more or less like Dwarf Fortress with a graphic pack:
[spoiler]
[/spoiler]
I don’t want any of that 3D or real-time stuff. Just 2D graphics, 3D block-based space, and tick-based time. I don’t plan on making it super-complex righ now, either. A hero slaughtering sheep on a giant, randomly generated cube world composed solely of “Rock” and “Dirt” blocks would be enough to make me happy for now
I’d like to add a ton of things later(that’s what I like about this porject the most, I can keep adding stuff indefinitely), but for now, I just want to have the basics set up.