Storing tile data

Hi,

As my game progresses, I’m now looking at reducing my 2d array size, it current is 3000x2000:


TileEntity[][] worldMap = new TileEntity[3000][2000];

TileEntity is defined as:


abstract class TileEntity
{
    protected int xPos,yPos;
    protected int txPos,tYPos;
    protected int lightValue;
    protected int hits;
    
    protected void draw(SpriteBatch s) { ... }

}

Then other tile entities derive from this one. Now, looking at the class the int’s could be changed to a short for the xPos,yPos, the txPos,tYPos could be changed to byte and same for lightValue and hits thus saving up some memory.

Is there another way - maybe make array smaller and read from file storage?

Any advice is appreciated.

Thanks