We’ve got a small update on the new phantom blocks that are currently being implemented into our gameloop system. There’s still a lot of wiring left to be done, but in spite of that things are going really well. It’s also going to fix the blueprint memory leak that some of you may have been encountering lately. The problem appears when you have a large amount of blueprints, and then they’re hidden when the task isn’t selected. This is likely the biggest memory hogging culprit we’ve got right now.
Gameloop? what is a gameloop?
To explain the gameloop, we first need to explain a little bit about how the engine works. Every frame, there are a lot of elements such as variables and assets being refreshed and modified. Those elements being modified make the changes you see on your screen appear. For example, a Bricktron that is moving across the landscape has his position variable being refreshed every frame. Sadly, Unity3D doesn’t provide a whole lot of control over how and when elements are being modified, and when multiple are being modified at the same time, we can encounter strange issues. We call that ‘race’ conditions. That means two or more elements are racing against one another to see who will come first in the refresh list
One example of a race you could easily see in game is when a Bricktron is placing down a new block and at the same time an explosion occurs on the wall he’s building. It’s possible that everything on the wall will be destroyed except for the block he was putting down at the exact same time since the new block ended up being initialized after the explosion.
The gameloop is intended to fix these kinds of situations, giving us much more control over who will win the race, and why they should win it. For the example given above, each gameloop would start by checking if there were any new objects that have been initialized, and then distribute damage from the explosion, and finally remove any destroyed objects.
The serialization process on the save and load system is now in a day to be over. This was a really long, painful and unexciting quest. We are moving the save system to a more organized way so it would become easier for everyone to save and transfer data.
For example, at this point it is completely impossible to load a saved multiplayer game. The serialization process allow that kind of usage but also us to save many other components that weren’t available before.
The costs in the actual save system is really high and require a lot of work on the dev side. To save new content it would require us constantly add new code to save this new content, which scale really bad. The idea is to ease up the pipeline of development so we could add new content without having to worry how to serialize the data.
Statistics and Analytics
We had a question for you guys, we want to eventually implement an analytic system in our game that would allow us to get data from every games that are played. That way we could analyze the data and optimize our mechanics depending on how you play the games.
Obviously this is something that require your agreement and we will never activate the system without your consent. So is it something that you would participate too?
Guillaume is currently pushing the limits of our game by testing different impossible structure and how well they are handled by our engine. We thought we would show you a couple of them who really stand out.
Bug of the week
Guillaume is having fun with the physicalized barrel bug.
Song of the week
This week, some of us saw a movie with others yellow blocky fellas, it felt right to add the main song as our song of the week. The Lego Movie is really great and if you haven’t saw it already, grab a couple of friends or your valentine date and go together to the theater this weekend. Enjoy!
10 Comments for Dev-Diary Eighty-One: Gameloop and Serialization