Time What Is Time
This blog post is a little late because of the Devcom/Gamescom preparation. But that’s the subject of next months blog. In this one we will discuss the steps we took to increase performance and also how we made a time machine!
Because the work we did last month is mostly behind the scenes, the post will be a little bit shorter as usual.
Spritesheet
Different levels require different assets. Since each level has its own set of possible background highlights (stoneheads, temples etc.), this would require a huge spritesheet, which could easily exceed the texture size limit of many devices. One solution would be the use of multiple spritesheets. But that would cause more texture changes during a frame, which reduces the performance. Our solution to avoid this problem is to create the spritesheet at runtime during the level loading process. This allows us to have an individual set of high resolution sprites per level, without a limitation of the overall highlight set of the game. By the way: the overarching word for this construct is texture atlas. Each texture atlas contains one or more pages which in turn consist of a spritesheet. Below you can see the current spritesheet for our test level. As you can see, there is a lot of room for more unique textures.
To reduce texture changes during a frame even more, the game adds all textures, including the textures which are created at runtime, to the spritesheet. So all in all, each level has its unique spritesheet, without needing to ship the spritesheets with the game.
Physic Optimization
Most physic objects do not need to be simulated, when they are off screen. In order to avoid unnecessary physic calculations, we enable and disable the simulation of each physic object within a customized clipping system.
Time Machine
When entering the pause menu or bringing up a tutorial popup, the game is stopped. To create a smooth experience during the stopping process, we added a feature called time machine. The time machine modifies the frame delta time to induce smooth changes to the progression of time. It’s possible to create a slow motion effect or even a super slow motion one, which results in a somehow moving, but not really progressing state. This looks cool especially during tutorial popups, since the game doesn’t look freezed while in this state.
That’s it for this month. See you in the jungle!
… or on twitter.
