The game keeps track of time of day and, when outdoors, the ambient lighting adjusts to appropriate levels. Walking into a bed triggers sleep which will pass time. Sleep will reset spell cooldowns and recharge energy and health, but the characters' hunger continues to increase while asleep.
Animated tiles and room fade.
The engine now supports animated static tiles, which should make the world feel a bit more alive. Also, when indoors, the walls get in the way. In searching for a solution I decided it was best to simply fade out the entire exterior area when entering a building or room within a building.
The engine can now serialize entities, saving state of dungeons and outdoor areas when moving between, and making it possible to save/load games. To avoid "save scumming", however, the game will only have 1 save slot per game, and saving will occur automatically when certain events occur.
I don't lightly accuse my tools of being the problem, but I don't know what other conclusion to draw in this case. The problem first exhibited as some sort of heap corruption; the Marmalade system would get arbitrary read or write violations when flushing the GL buffer. I thoroughly examined every piece of code that touched the heap. I commented out large swaths of code but was having trouble correlating the absence or presence of code to the absence or presence of the bug. I searched the marmalade forums, I upgrade marmalade and uninstalled Visual Studio patches. Nothing worked. Finally, while commenting/uncommenting code trying to manually narrow down the source once again, it dawned on me that maybe it wasn't the procedural code per se but the variable declarations -- I located a rather large structure that was allocated on the stack in the top-level rendering function and moved its declaration outside the function. Boom, worked perfectly every time, the problem was gone. I never bothered to root cause the true source of the bug, but I'm pretty sure it's an issue with the VS compiler. Somehow, it was allowing the stack to collide with the heap undetected. This only happened in debug mode. The problem never occurred in release and did not occur in ARM builds (which are built with gcc). Anyways this was a huge waste of time.
Unsatisfied with the idea of the game automatically choosing targets of all ranged attacks/spells/skills, I bit the bullet and implemented ranged target selection. The system allows a selection of a varying radius and maximum range.
AOE Target Selection
I really didn't want to have to draw death animations for every sprite, and I did want to implement more effects to make combat more satisfying. I realized that a particle effect engine could solve both problems very nicely.
And boom goes the dynamite.
As the game is played, the characters become hungry. I want the gameplay focus to be on survival, as many roguelikes are. Actions have consequences, and once of those consequences is increasing hunger and the need to procure sustenance. I've implemented hunger and a (perhaps too complex) food item system. Food decays over time. Cooking can decrease decay rates and increase flavor (characters' willingness to actually eat the food). Prepared foods have different ingredient components: e.g., meat, plant, minerals. This may (eventually) affect different characters differently. Prepared foods may also have additional effects aside from just sustenance.
Details of Fried Bacon item. Also note the exterior area around the room has faded out, giving a much clearer and cleaner view of the contents of the room.
- I redid the font. I can't figure out where the old one came from and I think it's just a Windows font anyways.
- Combat mechanics are partially implemented. Details to come in a future post.
- Title screen and menu is implemented. I'm trying to come up with a good title.
- My focus right now is on getting an actual game playable. It won't have a ton of content immediately, but that can be added as time goes on.
- I'm going to try to make updates more frequent. Minor feature implemented? Screenshot+update. As is I was having trouble remembering everything I had done.