1 min
The cameras were getting too hard coded and fixed so clean up on the cameras was important.
Previous the cameras had all be handled in a switch case. So it was massive and it handled every single type of camera. What I found was that it was too big and there were too many types. Such as a follow camera which looked at the player from a set distance away and a lerp version of the same type so instead of snapping to its position it lerped to it instead. This was implemented for multiple types of cameras and with each one having its own case in the switch it made the code bulky.
The code has been updated so that now any code that is relevant to all the different cameras it executed first at the top and then any code that is specific to any is executed in the switch case. This reduced the code down a lot as well as removing necessary camera types. Any camera that had a lerp and a non lerp version was changed to all cameras moving using a lerp. This allowed for smoother transitions, and if the user wanted a camera to snap to a position then they could just set the lerp amount to one and it would update instantly as that value represents the lifetime percentage of the lerp. If that value is always 1 then it will be at the end of the lerp.
Subscribe to this blog via RSS.
Low level programming dev diary 28
Text based adventure dev diary 6
Level design developer diary 3
Game engine programming dev diary 14
Audio-visual production dev diary 7
Audio-Visual Production: Particle System Mesh Spawning Issues
Posted on 20 Feb 2020Low level programming dev diary (28) Text based adventure dev diary (6) Level design developer diary (3) Post mortem (4) Ex-machina dev diary (11) Game engine programming dev diary (14) Network game dev diary (11) Audio-visual production dev diary (7)