Devlog 10/14/23
Huge changes, huge update. I feel pretty proud of myself for this one.
When I did research on how other developers handled drifting, it made me notice that about half of them had really complicated movement systems for their vehicles while the other half just used smoke and mirrors. I realized the definition of drifting was a bit loose, despite it existing in almost every car-related game so I decided to be just as flexible. The strength of turning was a set variable but whenever the player drifted, the turning strength was altered. Some minor tweaks are in order like limiting when and how the player can drift, such as setting certain speeds or higher and only working in conjunction with turning.
Drift Boost
Adding drifting made moving around a lot more fun but it was missing that juicy boost from a lot of kart games. The logic to set up receiving a drift was almost convoluted. Since the player had to stay drifting for a certain amount of time, say 3 seconds, then when that threshold is reached they're allowed a boost only after the drift is released.
Local Co-Op
There's nothing better than playing with friends so I figured I should get co-op out of the way as both a feature to include but also to use it for testing. Since I was using Cinemachine for the player cameras, I had to find a workaround with the Player Input Manager. This video found a solution, which involved referencing Input Actions as strings. Initially, this broke the entire movement system, but I fixed it so now co-op was real and each player could move individually with their own controls. Co-op caused other issues though, it broke how the sprites worked, partially my fault since I didn't update the sprites to use Action Maps - this had the directional sprite input be overwritten by another one of the player's inputs so even if P1 was facing left and moving left, P2 would be moving not left but still facing left. This had to be resolved in the same manner by referencing the Input Actions as strings.
Billboarding Adjustments
Billboarding was also broken by co-op since it introduced more than one camera into the scene. There were two possible solutions, either have the billboards look at the closest camera or have two of the same billboards target a camera while the camera culls the other ignoring it. The former I didn't really like because of how it would snap to each player if they were close by. It maaaybe wouldn't be an issue in game where you go fast, but it felt un-immersive when I noticed. My crackpot solution was the latter, which made the billboards behave exactly as intended. I feel like doubling the number of billboarded objects in the scene is not the smartest long term, but it allowed for some flexibility and customization.
I uploaded my current progress to GitHub since it's in a good enough state to share even at these beginning stages.