I'm back again! While I was busy studying I've had some time devoted to the game and I'll have more of it in the next months, so the progress will be faster hopefully.
Here's the latest screenshot from the game!
As you can see, there are some new graphics there. Houses were previously just sprites, but now they're created out of tiles which makes creating new variations of houses much easier! Their proportions changed too.
I've also redrawn main character sprite which is more undead-y and has a lot more detail in it!
I've also worked on the level editor a lot. (click or zoom in to view in better resolution)
Now I can add tile overlays which makes creating combinations of tiles easier and lets me greatly reduce the number of tiles in tilesets. This makes creating more interesting levels and changing/reusing graphics much easier!
I can also set z-levels for tiles now which determines drawing order (for example, if the tile has z = 1 then all entities with z less than 1 will be drawn below the tile).
One interesting change in code I've done was using
std::stringstream to parse bitmap font config files (BMFont format) and level files which reduced loading times
a lot (not like it was very high, hehe). Previously I had a function which worked like this:
auto tokens = splitString("firstToken,secondToken,thirdToken", ',');
// returns std::vector<std::string> with "firstToken", "secondToken" and "thirdToken" in it
for(auto& token : tokens) {
... // do something
}
This function used stringstream internally but it was still much slower than this code:
std::stringstream ss(str);
std::string token;
while(std::getline(ss, token, ',')) {
... // do something
}
There were thousands of
splitString calls during level/bitmap font loading, so replacing it with a better solution improved perfomance a lot.