I’ve started the baddies game again, this time with a twist, I’ll be using the RT-Desk library, a yet unreleased library that aims to change the paradigm of how games are updated, by making all the entities free to decide when to update themselves, only tied to the processor speed, and using messaging to do so.
It’s going to be part of my End-Year-Project, so there’s only so much I can share, but I shall be writing down how the development progresses, for my own reference, and for anyone else who needs to know how to work with this library once it’s released.
In the past few days, I started by making a rough outline of a timeline of the work I have to do:
From there I decided the only way to get to understand RT-Desk was a hands on approach, so I decided to make a “Pong” clone and have it run both in Loop mode (traditional game loop) and in Message mode (with RT-Desk). Had some problems setting up SDL, so instead I went for SFML for the graphics/input, and did the loop version today, totally playable (and boring).
During the development of Pong I kept on thinking on how to do it so that the messaging version for later on required the minimum number of changes. And I stumbled across my first problem:
How to make one object “observe” another in messaging mode.
Elaborating this means that even though communicating things to other objects is fine, when you actually need to query something (the ball needs to know the position of the paddle every update step, to know if it’s collided or not), we would need to send a message, and wait for a reply… and by the time we get the information, it might be outdated. This would lead to very serious synchronization problems between the entities in the game, and while “hacking” a solution for the pong game would be fairly easy, it defeats the purpose.
Solution? Investigate. Tomorrow I’ll head to the game-development section of the library and see if there is any literature on the subject. The Sims series for example use a complex messaging system and I remember some article on the subject in one of the Gems books.