Rumors of my death are greatly exaggerated (if not entirely unwarranted).

posted in Mobile RPG
Published November 09, 2012
Advertisement
It's been quite a while since my last post. I am making progress, if slowly. Here is some of that progress.

Day/night cycles.
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.

rl-ss-28.png



Night falls.




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.

Serialization.
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.

Compiler bugs?
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.

Ranged attacks.
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.


anim3.gif



AOE Target Selection





Particle effects.
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.

anim2.gif


And boom goes the dynamite.



Food.
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.

rl-ss-29.png



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.



Misc.
- 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.
2 likes 5 comments

Comments

Programming020195BRook
Very nice!!! Reminds me of Tibia.
November 10, 2012 08:22 PM
smo97
Thanks! I hadn't seen Tibia before, it looks pretty cool.
November 11, 2012 12:21 PM
Programming020195BRook
I remember causing much trouble in that game online, haha! Was a bit of a troll. ;)
November 11, 2012 07:19 PM
O-san
I am following your project closely. I was afraid you had stopped doing journal updates, glad to see you back :) the particle effect looks great! How do you handle the particle collisions and response. Any physics library involved? Keep it up, looking forward to future updates!
November 14, 2012 02:05 PM
smo97
Thanks :) The particle effect engine is pretty simple, I just track position/velocity/acceleration of groups of particles. Transformations to velocity, color, size, etc., can occur and the particles are rendered as either solid rectangles or bitmaps. Both the 'explosions' and the fire are particle effects. For efficiency, the fire calculations are the same for every instance of the effect, but after some testing I think I can make them completely independent without creating a large CPU burden. Because they can then start and stop independently, I should be able to 'start' the fire when the effect is started and then 'extinguish' the fire shortly before the effect times out.
November 16, 2012 03:17 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement