The goal ahead of me, to have a solid framework to create 2D tilebased games gets ever closer but as I get closer the hurdles get higher.
Performance is a bit of an issue now. I can't have the game at less then 30fps on my machine, it's an old machine and SDL isn't the fastest library but that is still a very reasonable goal. Earlier today the game was sitting at 15fps.
First thing was to change to 16BPP graphics. No image quality loss on my current art assets, 5fps gained.
Now the tricky stuff, actual code optimizations and I've tracked down the main root of my troubles. Collision checking. Taking this out I gain 10fps up to 30fps now, but it is not something I can just remove.
The current system involves checking each tile every game loop (around 1000) checking if that tile is a solid object and then checking if the player is colliding with it. Yea it doesn't take a genius to see that that is a a disaster. So...
Code optimization FROM:
if((layer0->at(t).type==9)||(layer0->at(t).type==10)||(layer0->at(t).type>=16)&&(layer0->at(t).type<=23)||(layer0->at(t).type==17)||(layer0->at(t).type==18)||(layer0->at(t).type==19)||(layer0->at(t).type==20)||(layer0->at(t).type==21)||(layer0->at(t).type==22)||(layer0->at(t).type==23))
TO:
if((layer0->at(t).type==9)||(layer0->at(t).type==10)||(layer0->at(t).type>=16)&&(layer0->at(t).type<=23))
That change got my an extra 5fps, but there is still another 5 fps to claw back from it. That is what I'm working on now. I think I may have to instead look at some more backend stuff... currently I only render tiles that are on screen(ofc)... I would extend that to collision checks but when I populate with AI's that may be operating offscreen... they will need to be able to still perform these checks with these offscreen tiles. Multiple AI's will bring system to a crawl...
I need a sort of event listener, an object fires a collision call after it is hit and only then, but how to do that without first looping through them all to check if they have actually been hit... fun stuff. There is always a better way... find it I shall.
Also had to deal with a memory leak. My first ever real memory leak, I'm so proud. Didn't take me more then 15 mins to track own and kill, but to actually fix... when I can be arsed. (It was the way I was rendering text for the FPS counter)
Feature wise the game now features a more robust layer system so I can do real world interior environments. Pictures will explain.
Outside horribly drawn building (That's a roof...yes I know)

Inside horribly drawn building
Oh and yea you will also notice that I killed the art style. The game is... dunn dunn dunn... post apocalyptic. I do this too often but uninspired post apocalyptic is better then uninspired generic fantasy. I've got some good ideas that I will be implementing once game dev begins in earnest, basically a lot of the game revolves around just surviving, keeping your stats up, finding materials for the generator, building new weaponry, scavenging, befriending people and eventually getting a little player town going. Not a huge epic RPG, I'd never finish it, the game becomes more sandbox as time passes.
Last problem to talk on, actually splitting my editor and game has now actually started to become troublesome, not sure if more trouble then I would be having if I had both the same though. I need to find some way that I can get both programs to run from one file directory for some files, then their own local for others. Changing one then having to manually change the other is causing too many errors through human error.
Edit: I am also itching to have another go at Kynis Assault my side shooter with all I've learned... must must focus on task at hand! (Besides I guess I should figure out 360* aiming in C++ first... god I miss those built in flash math libraries)
Double Edit:
I've been sitting here for the last hour or two thinking hard about ways to implement game objects that can be walked up to and interacted with in some way.
Many solutions, very exciting thing to begin coding. The main concept for detection I think I am going to go with is creating an SDL_Rect object that is always positioned directly infront of the player object. This rect will do a basic boundary check with objects on a button press.
But the objects themselves, how to define what they actually are. Two solutions:
Give my tiles a new property, check tiles against my players detection SDL_Rect. This would happen only on button press so the overhead would be minimal and only existent for a single game loop (kind of what I've done on my collision detection now - checks are only made when player state is in moving, takes care of overhead until player moves...). There is a chance of some problems with this however, the players detection box will almost always be over two or more tiles. A good advantage gameplay of this is that I could apply to this everytile very easily and allow some deep examining by the player "A broken tree", "A burnt tire" etc.
The second method is to use my effects system! ;) I create a new effect and place it over any game object. Then very similar usage to above BUT being much smaller (a vector of around 20 as opposed to 1000) I could run this check every frame and therefore do some cool things, like make a lightbulb appear above the players head when they are facing something they can interact with, save the player clicking everything! Or maybe make the effect be visible as a glow in game!
Then there are a few others but this is one major edit so I'll stop. I need to try to relax, risk of burnout is possibly very high.