How should I do 2d level generation?

Blitz3D Forums/Blitz3D Programming/How should I do 2d level generation?

Rooster(Posted 2015) [#1]
I was just wandering about what the most efficient way of organising a 2d level for the game that I am working on would be.

Right now what I am doing is using small tiles for each thing in the game (like floors and walls), each tile is close to the size of the player, and I don't know how big the levels are going to get.

So what I want to know is would it be more resource efficient if I did all the floors in the level as one big image and then did the same for the other stuff like say walls?

Or would a system in between the two be better?


Matty(Posted 2015) [#2]
That depends on how you want it to look....among other things....

tiles often (but not always) give a repetitive style (eg Mario Bros etc)

single images are useful for games like the Baldurs Gate series for example...

it really depends on the how your game is played...


Rooster(Posted 2015) [#3]
I never thought about that Matty, hmm. I still would like an Idea of which system is going to run faster though.


Rooster(Posted 2015) [#4]
Oh! I forgot to say that I could probably with the tile system unload the stuff away from the screen to save on resources, but I don't know if the other systems would be faster even with that.


Matty(Posted 2015) [#5]
The nice thing with 2d games is that it is much easier to calculate the memory used by your game....pretty much the size of an uncompressed bitmap is the size of your image in memory....

So whether you have 1000 16x16 pixel images or 1 larger image - you can work out the memory footprint pretty easily. Modern PC graphics cards (ie newer than 10 years) have enough memory for pretty much any 2d thing you can throw at it.

Loading resources will take longer for lots of small images - that's where it is useful to chop the image up after loading it in as a single image.

But still.....your actual game mechanics will determine a lot which method is better.

If you use a 2d-in-3d system then that will change things slightly again since textures will be upsized/upscaled in blitz3d to be power of 2 in size (128, 256, 512 etc) - also the largest individual texture size in blitz3d (without being scaled) is 4096x4096 although plain old 2d images can be larger.

However as said - it all depends on what sort of game you are making.....


Rooster(Posted 2015) [#6]
Okay so it doesn't really mater performance wise. I guess I am just being paranoid about this. XD
Thanks for your time. :)