What a day it has been. I’ve basically wasted most of my evening fiddling with some nice to have stuff. I won’t jot it down as a complete waste as I’ve now discovered how to properly add extra projects into the Unity generated solution as well as optimizing the Unity asset serialization to cater better towards using Git.
One of my other successes today was to fix the issue I had with my camera yesterday. My previous implementation made use of some tweening that would cause it to lag farther and farther behind the player ship when accelerating in one direction. I fixed that using the code below:
This is a very rough work in progress still, but I can quickly explain the gist of it all. I firstly calculate a “speed” vector that is used to offset the current camera position. Using the new offset point I’m able to leverage the nice smoothing camera we used for Spitballin’ as part of Ludum Dare 32. I haven’t spent enough time to fully grasp what that code is actually doing under the hood, I just know that it will smooth out camera movement and make things feel a bit more natural.
I’ll also have to add some value clamping to ensure that when the ship is moving at a fast enough speed it does not cause the camera to lead too far ahead. I don’t really see that as a massive problem while testing as a player is far more likely to lose control of their ship before that happens, but it will have to be looked at to decrease the likelihood of losing control because you can’t see your ship. Once I’ve got a cleaner better solution I’ll be able to more easily explain what is going on.
I haven’t yet settled on an implementation to follow for reading some map data and then building the game state from that, but I’m really considering opting to use bitmap images for that. Each pixel can store an astonishing total of 24 bits!
I’m most likely scope creeping myself here, but splitting the 24 bits into the three colours used (Red, Green and Blue) I’ll be able to nicely define what enemies/asteroids are stationed where as well as have the player position defined with possible pickups etc. The possibilities are quite vast and would allow for quick and easy game setup.
I’ve also come to the realization that I need to plan what I want to do a bit better. My ideas are currently floating about on different posts, pieces of paper, a notebook and some are still just ideas. I’ll have to setup a Trello board so that I can properly manage what I still need to do and what I’ve done, but that’s tomorrows worries as it’s already late. That’s it for today!