Reflex – Dev Diary 5
With a new week came a new Beta that fixed the YYC native compiler in GMS 2.3 Beta. So, I was able to fully compile Reflex and run it at full speed on Android. Everything is looking really good.
One important change is the way movements are calculated, originally they all used the usual frame time to move and count, so, if the game is running at 60fps and the missile is moving 1 pixel per frame then it has move 60 pixels in 1 second. The problem with this became evident when running the interpreted compiled version on Android. It can’t keep up at 60fps and so the game sloooowwweeed down.
The solution, use delta-time motion instead. With this method you take the amount of time between the current frame and the previous and multiply movement and counters by this factor. This means that if the game dropped to 30fps the delta-time multiplier would compensate and the missile would move the amount of pixels it would have if the game was running full speed. It also means that the game timer at the top of the screen actually counts seconds properly all the time.
A boat of load of bugs have also been squashed this week:
- The 2 way splitter was sending missiles in the wrong direction.
- Speed up and down was actually working backwards.
- Camera shake just before the end of a level was abruptly stopping resulting in the screen looking as if its moved.
- With delta timing the missile would sometimes skip passed the collision of a tile.
- Collision routines now use passed instance ID instead of relying on a referenced instance – turns out it wasn’t reliable.
New features are also a plenty:
- The first dozen or so sound effects have been added to the game.
- There is now a brief delay before win or fail notifications are displayed so you can see you’ve lost easier before you’re actually told.
- A new ‘power controller’ object has been added to the game. This will add in more flexibility to the levels. These boxes can be connected to 3 other tiles and if the power controller is destroyed the reflectors will loose power and stop working.
- delta timing added, as mentioned above, to missile motion, reflector animations, reflector construction and deconstruction and the clock.
- World Select screen now has ‘select’ buttons to bring them inline with the level select screen.
- The large blast doors have been replaced with better sprites.