-1

Please let me describe my question with details.

Lets say I will create a game with 500 different maps. Each of these maps are containing 80x40 16px tiles.(unfortunately it's necessary to parse per 16px)

But in game , I'm gonna create 32px tiles per 4 16px tiles.

I store every embedded tmx file in a class with static methods.

Here is my question, which of the following 2 options I should chose;

1- Should I convert the tmx data into as3 data ( into an array which contains tiles' data) each time player enters a different map.

2- Should I convert all maps' data at the beginning of the game, then whenever player enters a different map, I directly take the array and create the map from it.

I am asking this because I'm not sure if it's a problem to keep 500 arrays with the size of 80x40. (would it tire ram too much? )

Ozan Deniz
  • 135
  • 1
  • 12

1 Answers1

1

Option 1 is better.You can load map config data before you enter a map, and it's not necessary to store all config data in the memory, you can store 10 map config data which are recently used(like LRU cache algorithm).

In my experience, if your map config data is a xml,you can transfer it to a byteArray to reduce its size and decompress when loaded.

Pan
  • 2,101
  • 3
  • 13
  • 17