Car Game
- 25 Devlogs
- 78 Total hours
An arcade racer inspired by NFS MW
An arcade racer inspired by NFS MW
This has been a big push to finish the new version of the game. Together with a linux build the new version brings a new map, new UI, racing line, settings menu, AI-improvements, optimization, driver models, 3 new races, a loading screen, and a start race “screen”.
Specific for this devlog, the settings menu, with three graphical presets, a loading screen and a start race screen. Two new races. Small map additions (some houses and parked cars, and physical objects incld cones and barriers that you can hit).
Bug fixes across the board.
A big challenge for this was the data transition between scenes and settings saving. And I used player prefs to save settings, and some simple static objects to transfer info between scenes.
Overall what I have here is a nice base to start building a campaign.
I made a line that shows you where to go, so you don’t need to guess anymore. It uses the baked racing path the AI uses, and passes the points to a line renderer. It also scales with speed, higher speed => line extends further, in order to help you see upcoming corners easier.
So, there have been a few changes. There are now drivers, the cars are no longer driven by ghosts. There are procedural animations for steering using IK (it’s really not that complicated. They also look ahead and where they drive (INCREDIBLE!!!!). Besides that they also react to crashes, eating the steering wheel, cus there ain’t no airbag (poor lads).
I’ve reworked the crash system, not visually but technically. You are now allowed to have 3 small crashes, they still trigger the slow motion, but they don’t end your race. Crash many more times than that, your race ends. This way you are still penalised for bad driving.
There is still a one hit “lethal impact”, but that basically means going top speed into a tree to trigger.
Another small addition are some more sounds, to make the driving feel even better:
-Gear shifter sounds
-Handbrake pull/release sounds
Just a small bit of polish. Besides that there were small bug fixes, nothing notable.
I’ve been working on a new surface system!
Now I can add surfaces with different sounds and effects when sliding. I also added “rolling sounds” that play when just driving over at adequate speed. I’ve added a dirt surface, for obvious reasons.
It also has something called rolling resistance. You will observe the fact that when driving over dirt with one side of the car still on the road, the car will steer towards the dirt, because of the higher resistance, and also will have as a consequence a lower top speed, also acting as a penalty for driving offroad.
Besides that I also added ambient sounds, like a wind and leaves thing so that you can tell when standing still that you are in a forest :)))
Last thing is I made the crashing better, no longer will any impact “crash” you but the sounds are also better, with separate sounds for high and low impact speeds.
Basically a lot of polish for the game, the driving feels better, I feel like, because of it, and it also incentivises you to stay on the road, alltough the trees already kinda did that.
I’ve been working on the HUD for the game.
Really simple, but it was missing.
It features a lap counter, lap timer, best lap, lap delta, position. The speed/rpm/gear cluster is the same as before.
Speed.
Speed is very important when it comes to racing, right? Well yes, but in a video game, where you sit down on a chair, static, in a room, the sensation of speed is even more important. That’s why these few hours i’ve been working on making the game feel fast.
Changes have been made to the way the camera moves behind the car and in how it tracks it. Besides that, there has been a little sound work. At high speeds sounds become muffled and a wind noise can be heard. There is also the post processing i’ve been talking about in the other devlogs.
Besides that, i’ve started reworking the UI, and the first element was the gauge cluster.
I’ve decided to have the text physically live in the world, it reacts to the car, lagging behind or moving from side to side slightly. It also gets blurred at high speeds, because from a certain point it doesn’t matter if you’re going 150 or 200 kph, since that road barrier is still approaching you at a lethal speed, so you should probably just brake.
I LOVE the way the driving turned out, and I sometimes sit for too long just driving around, so I can’t wait to get this game back to you guyz. Peace.
The map is doneeeeeeee!!!!
It’s as varied as I could make it, but you can see the different regions, and I like that. Besides that I’ve made the first race layout, and the AI just works (wowowowwow!!!!).
Another cool thing I’ve added is wind, as a sound, when you go really really fast. On high speed, as I said in a previous devlog, a tunnel vision effect forms. Now, the sounds will deafen as if the ears are getting plugged, the only thing you hear clearly being the sound of the wind passing by your car. It has a really cool implementation, using a curve and some inverse lerp to sample, this way the effect is not linear and at low speed no big changes happen. Anyway, down here i’ll add some screenshots with the map, love to hear your feedback!
I’ve been working on the dry-ish mountain region. I’ve also added grass to the map, as you can see. For the moment I have some lighting issues in the mountain region because of the rock models, and some settings, so the dry grass there is black, but other than that it looks great and it really helps fill the map with life.
Other than map work, I took some time to work on the speed feeling. In the second and third photo is how the game looks at a speed of >120km/h. The edges get deformed, pulled back, and a vignette help sell the tunnel vision illusion. Besides that, its screen shake and FOV work. Between the third and last picture you can clearly see the difference between the two states.
I’ve put in another hour on the map. I’ve decided to split the map in multiple regions for visual variety. There is the dense forest in the first photo, followed by a low vegetation, high altitude mountain region (began working, second and third photo). Planned is also a plains-like region, a lake and i’ll see if I can fit a small town somewhere. The roads are curved and never go straight for too long, and compared to the city map, some of the chicanes here make sense. I am still thinking about how I could still have the night city here in the next demo. Maybe i’ll restore the map itself, or i’m thinking of just adding a docks area for free driving.
I’ve been messing around with assets, lighting and visual effects. I kinda like this a bit more than the city night. So for the next demo, this will be the theme. I’ve also deleted the city scene, since it was just bad in terms of performance and other stuff. Basically, my hope is that, using a forest, will help me conceal a lot more, and repetition of trees and other assets wont be as visible as in a city, thus i’ll be able to finish it faster without losing visual fidelity. Also all the assets have LOD’s for optimization!
So, after all the positive feedback I couldn’t just leave the project to rot. Soo, in my free time I will try to work some more on this game. So I made a little list with what to add:
I will be leaving the night city behind, it’s hard to optimize. Instead I will be making a forest/mountain scene, which I think will be cool to race in. I also decided to experiment some more with the visual effects available to me, so I added flares to light sources, for now a bit excessive, but oh well. I also upped the collision particles, more smoke, sparks and debris => looks better cuz it hides the bad crash physics (maybe ???)
After I am done with the forest scene, and I will make a couple races, what will follow is another ship, and then I will work on traffic followed (if finished) by another ship.
As a prize for your great work, look out for a bonus prize in the mail :)
BUILD READY!!!
This is the last devlog before the ship.
Alltough the game isnt in the state I would like it to be, school started and i’m in my terminal grade, so it’s a tough year ahead, so I have to shelve this project. The race is playable, its difficult in a way but its also fun. I also added a second level which is just an open map with a field and hills for you to test the driving physics and also as a lower graphical alternative to the city race.
In the final hours of development I added all the basic necessary menus and fixed some bugs that I catched while testing.
See you in the ship!
I’ve reworked a few sections of the track and tweaked the racing AI. They can now almost always finish the race unless the player does some tomfoolery. Besides that I fixed a ugly visual bug where the terrain would poke trough the road when the camera was closed to the ground.
Next, I remade the speedometer, RPM indicator and Gear indicator as you can see in the screenshots.
The final thing that I added is a detection of “large” crashes, alltough is inconsistent, I dont currently have ideas how to fix it right now. For now when it detects a crash it enables slowmotion for a fraction of a second just for some oomph.
All that remains for me to do is UI:
-Race start countdown
-Race finish info
-Pause Menu
-Main menu
And a Game Over screen for when you crash.
After these additions I will ship the game, as school started and I will have to shelve it, and I dont want to miss out on the sweet stardust it can offer!
Soo, I made the car more believable. It has working brake lights (WOOW), and new engine sounds that make it sound more powerful, but also added something extra spice, like exhaust backfire, that is programically made, with a multitude of firecracker sounds that I then processed. Besides that I also added a turbo blow off sound. They use the simulated rpm to decide their pitch and intensity, while also considering the throttle difference and position.
Last thing (visible in the last seconds of the last video), I improved the crash physics with detachable parts and deformable chassis.
The map is done! I added some bariers with a simple shader, but I might change them soon, as I dont like the way they look. I also added a new car for the race.
I’ve also done some optimzing, enabled mesh batching, and after i’m 100% done with the map I will also bake the lighting for even better performance.
I’ve decided to leave out traffic for now, as its’ pretty difficult to implement and I don’t have the time, since school is starting.
As a small to do list for the ship:
-Main menu with settings
-Start sequence
-Race Timer
-Ending Cutscene
-Model credit list
-Sounds
-Maybe some music
I have been working on the map ever since the last devlog. There isn’t much to say as there is to show. The scene has gotten laggy with lag spikes that seem random, so I will have to investigate and see how to optimize the game.
Alright, i’ve been busy collecting assets and making materials and collections in order to start work on the map, which I did, I started with the dock area, since I dont yet have many house models, and well, I think it’s looking pretty cool, ngl.
Next up I’ll go around the track in order to detail the section most. I am using the darkness and distance as a tool to be lazy, but also optimize. No point in detailing a part the player wont see. Also in my toolset is the fact the player will be moving fast and concentrating on the road, so it won’t be necessary for me to detail every inch of the map, instead focusing on intersections and areas the player will be slow enough to notice such details.
The really fun part has begun! Im stylizing the game. Yeah, I decided to skip traffic for now and instead get busy making my environment. First I started by making a cool night sky and lighting, i turned on some settings, and I am pretty afraid that this game wont run decent at all when Im done, but ill do optimizing later, im sure it will be fine.
Im still in search of models, as modelling everything by myself is out of the scope of this little project. But it’s gonna be pretty cool looking, i believe.
Ok, i’ve worked around a bit, and decided that for the first ship I want to release ONE very good feeling race. So I wont complicate myself with tuning and other systems, it will be one car, one race. So the atmosphere will be very important. I already have the layout of the race done, it’s supposed to go trough the docks > coast > downtown > highway and then the race ends.
Also I believe making this small but very polished game will lend me more experience than something that will be overly complex, as many of my game projects end up.
I will start with the terrain an polishing the track to make it more interesting in terms of driving and then i’ll get started on the terrain and dock area
The racing AI is done. I also made a small race manager which takes the cars, aligns them in a grid and then starts a countdown. It also keeps trak of the position and lap-times, but there is no UI for that yet.
I also started working on the Map for the demo, i’m still debating how big the demo will be, but probably it’ll be a few races. After I have a small map layout, i’ll get started on the traffic AI, and move on from there.
Im still trying to get the hang of this road tool I am using, and also getting the road dimensions right, but we’ll see.
I’m very happy with the racing AI, while it’s not perfect and cannot avoid everything, like a wall in the middle of the road, I dont think that will be the case like ever. It can avoid other cars, either static or not and it uses a basic prediction to determine if it’s on a collision course with another car and act accordingly.
Also, for the path, as you could see from the beggining of the video, the path was already backed based on the road. The car then only decides when to brake and steer based on that path.
Next up i’ll make a demo race with multiple racers and position marking and stuff and then get started on the map.
Alrighty, I decided to actually use my brain and came to the conclusion to instead bake the racing paths, instead of just having them create one at runtime. I made a small unity tool, I just place the checkpoints, click bake and a racing spline gets generated. If you look real close, you can see that the line follows an outside-inside-outside path for steering. Now that I have this, I will work on the racer Ai itself. First I will make it follow the track with optimal speed and then teach it to avoid obstacles, other cars and then even overtake.
Okk, I feel like i’m getting close. As you can see, the car now tries to build a racing line, this is all in real time. While its still not perfect, I feel like I am getting close.
There are still some bugs related to the pathing on the road that I will have to fix, but overall its very good.
The system works by identifying an apex. The geometrical apex is considered in this case the point which has the biggest angle difference compared to its neighbours. Now, after it identifies the apex, it grabs all points leading to the apex, and shifts them to the outside, before starting to shift them to the inside towards the apex, all using a sine wave based lerp in order to get a nice arc. While this system is good, I feel like the driver script that is responsible with making the car follow the points is kind of goofed, so i’ll look into that.
Racing ai, thats all I’ve been doing. It works fine-ish, i feel like Im close but it still overshoots, but I have some ideas on how to fix it.
I have been working on making racing ai for the game. As a small intro, i have worked on this project before, and what I got is a working car controller, and dialed in physics to something I like how it feels.
The ai represented a difficult problem. If I want this to be open world, and for there to be police chases, I needed the NPC car to be able to go offroad, so basically, of a set path. There would be the option to make a hand tailored map and even for the offroad sections to be counted as roads, but that would be hard for one developer to do and test, so I opted for this. When the car is not on a road network, it fallbacks to the built in navmesh system in unity. It then uses it to calculate a path as a list of point and then drives between them. On the road, we just need to sample points from the spline of the road and then drive between them.
The hard part was this driving part :D
While it might seem simple, just point the car to the next point, and then have it move forwards, there is much more nuance to this. First, the NPC car should behave just like the player car, it should have the same turn angle, and thus I must now convert a simple direction into a steering angle. Another difficult part is when racing. I can’t just have it accelerate always, the car must brake when a sharp corner is coming up, and for really tight one, maybe even drift. So how do you do that? Well, i dont know yet, this past 4 hours I have been working on the same script and same section trying to figure that out. I really hope that next devlog I can come with a solution, but i cant promise anything.
My plan is to calculate the curve of the upcoming curve, and then somehow spit out a good speed for that, but there are a lot of factors to account for, like the grip of the car and actual speed, distance to corner etc.