Dear SFML-community : )
I'm trying to solve the following problem:
My game shall have the possibility to support customised levels by users.
Therefore, I want to offer already implemented game-objects and the chance of creating new ones.
A game-object can be a platform to walk on, an enemy, ...
Every object owns its very own set of animation key frames (idle, attack, ...)
Now, the game provides multiple level. I could provide one complete sprite-sheet optimised for every level. Optimised as in, only the needed objects shall be on the sheet.
But at the moment, my game works like this:
Every object brings in its very own sprite-sheet, e.g. an enemy owns a sprite-sheet (texture) with all its needed animation key frames nothing more. This texture gets cached.
If an animated ground-part - on which the player can walk - is loaded, it will only provide these needed texture.
My idea behind this was to only load the needed textures and offer flexibility for customised objects.
Players can create their very own object by specifying characteristics (as behaviour and sprite-sheet locations) via a Lua file.
Once the player feels the need of creating their complete custom animated enemy (or whatever entity they want), they can easily integrate them on this way.
If they would have to invoke them on a large tile-sheet, they would have to set all the mapping of objects as well - which is a bigger hassle. Especially, it would need the player to know, how their final level will look like. Therefore, they would have to provide an already thoroughly planned tile-map before they even can start creating.
Now, the worry with my approach is the performance and RAM usage. Current testing results in rather large RAM usage per vertex-array. As this game runs on a variety of platforms, I want to keep requirements low.
I could think of a merging-process before one level is loaded. This would provide only one texture, therefore only one vertex-array/draw-call.
But this will take some work in order to track the mapping of where are what subsets. It might also create some ugly loading/processing screens.
Does someone might know how to solve this problem with a different approach? Or do I have to bite into the sour apple and just simply go with a possible large amount of vertex-arrays?
Thanks a lot for taking your time and reading my thread. If I've been unclear in anything I said, please let me know : )