2 added 751 characters in body
source | link

You have a three dimensional float array of the size [3000,1000]? Well thats two dimensions?

Ignoring that: that are 3 million floats with 8 bytes each (there seems additional overhead if you use Float insead of float) = 24 million bytes = 24 mega byte. Seems not too much for a usual memory in a pc.

May tunning the memory settings will help you temporarily: Java memory settings

To calculate the actual size you store may that SO question will help you.

From my experiences with tilemaps: yes, they can become large in memory even if you trim down every single byte possible. (think I was up to 8 - 12 GB ram in my experiments for the tile map array only.)

But in fact you most likely do not need all the data in memory all the time. Since you generate a map may try to store that created map in a file and load (and update on demand) only the area near the player. So you can limit your memory demand.


Possible improvements of the data structure of the tilemap

If you have a 3 dimensional map where the third dimension are tiles stacked up you still could use a short or integer array (depending on the needed amount of tiles) instead of a float array saving some bytes. The short/int indicates the tile type.

The tiles themselves can be stored in a seconds structure like an array which holds all the data needed for this specific tile type.

I have to guess but I think you used the float "as drawing position"? Iterating over the array while drawing gives you the x,y,z tile indizes and you could calculate the drawing position out ouf the tile index you already have at this point. Which makes it unnecessary to store them.

You have a three dimensional float array of the size [3000,1000]? Well thats two dimensions?

Ignoring that: that are 3 million floats with 8 bytes each (there seems additional overhead if you use Float insead of float) = 24 million bytes = 24 mega byte. Seems not too much for a usual memory in a pc.

May tunning the memory settings will help you temporarily: Java memory settings

To calculate the actual size you store may that SO question will help you.

From my experiences with tilemaps: yes, they can become large in memory even if you trim down every single byte possible. (think I was up to 8 - 12 GB ram in my experiments for the tile map array only.)

But in fact you most likely do not need all the data in memory all the time. Since you generate a map may try to store that created map in a file and load (and update on demand) only the area near the player. So you can limit your memory demand.

You have a three dimensional float array of the size [3000,1000]? Well thats two dimensions?

Ignoring that: that are 3 million floats with 8 bytes each (there seems additional overhead if you use Float insead of float) = 24 million bytes = 24 mega byte. Seems not too much for a usual memory in a pc.

May tunning the memory settings will help you temporarily: Java memory settings

To calculate the actual size you store may that SO question will help you.

From my experiences with tilemaps: yes, they can become large in memory even if you trim down every single byte possible. (think I was up to 8 - 12 GB ram in my experiments for the tile map array only.)

But in fact you most likely do not need all the data in memory all the time. Since you generate a map may try to store that created map in a file and load (and update on demand) only the area near the player. So you can limit your memory demand.


Possible improvements of the data structure of the tilemap

If you have a 3 dimensional map where the third dimension are tiles stacked up you still could use a short or integer array (depending on the needed amount of tiles) instead of a float array saving some bytes. The short/int indicates the tile type.

The tiles themselves can be stored in a seconds structure like an array which holds all the data needed for this specific tile type.

I have to guess but I think you used the float "as drawing position"? Iterating over the array while drawing gives you the x,y,z tile indizes and you could calculate the drawing position out ouf the tile index you already have at this point. Which makes it unnecessary to store them.

1
source | link

You have a three dimensional float array of the size [3000,1000]? Well thats two dimensions?

Ignoring that: that are 3 million floats with 8 bytes each (there seems additional overhead if you use Float insead of float) = 24 million bytes = 24 mega byte. Seems not too much for a usual memory in a pc.

May tunning the memory settings will help you temporarily: Java memory settings

To calculate the actual size you store may that SO question will help you.

From my experiences with tilemaps: yes, they can become large in memory even if you trim down every single byte possible. (think I was up to 8 - 12 GB ram in my experiments for the tile map array only.)

But in fact you most likely do not need all the data in memory all the time. Since you generate a map may try to store that created map in a file and load (and update on demand) only the area near the player. So you can limit your memory demand.