This is a small NFS inspired car game demo. It’s a project to test my technical abilities in Unity. It features custom made vehicle physics based on Unity’s built in wheel colliders and a custom easy to use solution for racing ai. Besides that, it is (in some small predetermined angles) a fairly good looking game, with a little bit of style.
The game uses Unity’s HDRP render pipeline for its graphics, together with some screen space reflections and reflective materials, the game gets to look fairly good, especialy in the low light enviorment it’s set in.
The car physics are in a sim-cade style. The car can still do crazy steering at high speeds, and its very easy to rotate it, but understeer and oversteer can still occur, besides that, the car is not limited in any way when it comes to external forces that can imbalance it, hit a curb at a high speed and the car can go flying.
The biggest challenge was the racing AI. First of all it was hard to make a car know how much to steer to go from point A to point B. After that, it was fairly simple right? Just sample some point from the road spline and follow them. But curves exist, and for that you need to calculate the right speed to go trough it so that it wont crash. Then, the car was driving very inefficiently, following the middle of the road, so what followed was a long quest of making a racing path generator, in which I succeeded (with the help of AI).
Then came obstacle avoidance, making the car not seem just like a train following a predefined track. If necessary the car will go off track to avoid obstacles and it’s aware of cars around it and will try to keep the distance. There is also a system that predicts collisions with other cars (for example if a car in front is cutting in front of it, it can predict that will happen and brake). This is all theory but it still works in game, sometimes.
Another hard part was building a city. I had no prior experience in making games that aren’t made out of just basic cubes and shapes, so it was difficult to find assets and other stuff to populate the city. Then also came the point of how much detail should I even add and many other factors that in the end made me make the hard decision of making just one race in order to not break the illussion of a semi believable city.
I’m very proud of how it came out, alltough I have so many ideas about how I can make it grander and better, but i currently don’t have the time to do so. I hope to come back in the future and actually make a cool metal-rock and boost infused racing game like NFS Most Wanted, but it has to wait.
For those who want to play test the game. Currently there is only a windows version for the game, and it can also be pretty demanding in terms of GPU (Basically, I think it needs a dedicated GPU, I have a rtx 3050 4gb laptop GPU and it runs fine). There is a simpler driving demo scene which is just white terrain with some roads, that maybe will fair better with lower end hardware.
- 14 devlogs
- 51h
- 15.73x multiplier
- 967 Stardust