Thanks guys!

I know about the building and I know why it's placed there (the buildings along the road have a bit of a buffer to avoid the road's endpoint being boring with no props, and I should switch off said buffer for turns which have a small radius so that they don't wind up overlapping - unfortunately no physics available for tool scripts, because otherwise I'd simply use a couple of Area2Ds)

Game now calculates the path to the finish marker and displays it; the black marker visible at the beginning shows you where the garage is

That's right, there is now a garage you can enter and exit.

Calculating the path involves A, obviously, but this is not your typical A (and it's no longer navmeshes as these couldn't be made to work sensibly with the procedural nature of the map). I am using A* on two levels, first between intersections, and then on the roads connecting the intersections I'm interested in.

7 days later

You can now upgrade your car in the garage; the road in the rain gained reflections and the neon gives a little bit of a glow in the day

The eagle-eyed viewer will also notice your current compass bearing noted at the top of the screen.

There were also some changes not showing in the gif, for instance the day/night cycle is now tied to the real time and the sunset now has a bit of a red tint to the light. The sky colors have been changed to the ones provided by default in 3.1. alpha 2. I must say it looks nicer when reflections are on (and is blue enough for you to tell it's the sky even with the clouds)

That is some absolutely amazing progress so far. Truly wonderful work! I'd so like to believe this will eventually gain a whole dev team, then maybe turn into an open-source alternative of at least the good old Need for Speed - Underground games.

6 months later

Loong time no see, my computer had to be serviced twice in January and February, and updating to Godot 3.1. broke map generation. Fortunately all those obstacles are over now :)

The map once I fixed it :) I basically rewrote the code that selected which intersection ends are available for connecting, so that I could finally avoid roads crossing over the intersection itself. Not all intersections are connected in the map, though (there's three down out of the view which are not connected to anything because they resulted in some bugs)

The reason I dug up my log/pass, today I succeded at a feature loong in planning - the steering wheel now rotates and the driver mesh now uses Godot's built-in IK to hold it. The IK and the mesh are not perfectly aligned yet, though :)

5 months later

Gorgeous sunset

The skysphere based approach had an issue where, due to either the sphere's size or the fact that it used transparency, it would sometimes be badly sorted in regards to depth, causing lines to appear along screen edges. I pulled in a Godot asset (https://github.com/danilw/godot-utils-and-other/tree/master/Dynamic%20sky%20and%20reflection) and applied BastiaanOlij's reflection workaround. I also optimized it a bit by replacing panorama sampling with a simple gradient sky.

The clouds should be moving, but I didn't hook up the movement to the shader yet.

4 months later

Gave this a try in 3.2.

Overall, it works, but there are two issues to fix: a) there are less intersections generated for some reason (the seed is the exact same), so I'll have to apply fixes to the map (move the garage and the station, etc etc.) b) the driver mesh got really small and IK borked up (I already fixed the scaling, but the IK is out of whack)

3 months later

IK is still borked, so I had to disable it. On the visual end, I also made some improvements to the motion blur shader, eliminating the jank. The AIs now path to the next intersection once they reach the first, and they are even capable of turning back if the road is a dead end.

I added a cop that will chase you if you go above the speed limit (unfortunately it's pretty brain-dead, it's possible to get it stuck e.g. on a building)

![] (https://i.imgur.com/pPyyICM.png)

Also, I didn't think the game needed bikes, until I dreamed it tonight :P Thanks to Godot's node system, I had a drivable bike within 30 minutes.

Nice to see this "roadmap". Impressive progress and you can see the work that went into it. I've came across your project a few weeks ago. I can't get it to work because of a missing "police_lights.tres" or something. Do you actually use the VehicleBody? I can see the node of the VehicleBody in your project, but in one of these posts you mentioned switching to raycasts. I don't yet know what that exactly is, but someone else also said to me that I'm better of going for raycast with my raceg-game, mainly because of bullet-physics not doing well with collision, giving random "jumps" and such. And driving uphill and turning making you lose too much speed. The driving uphill I have currently "fixed" by lerping the engine_force value according to the speed. So high engine_force at low speeds and decreasing it to the actual engine_force as speed increases.

Impressive coding btw, gets me lost ? . I still get stuck too much with coding on little things.

I uploaded the missing file in one of the most recent commits - two days ago or yesterday? (whoops! I tend to miss such things because so far I've been the only player/user).

I do use the VehicleBody (the raycasts were mentioned for collision detection for AI, not vehicle physics as such). Tuning the physics can be indeed pretty difficult, and I am indeed getting random jumps, but from my understanding they are a general physics issue, so it would still happen if you used a hand-rolled raycast implementation. There is a drop-in raycast physics replacement addon: https://github.com/jonri/godot-raycast-vehicle but I haven't tried it yet.

2 months later

I updated the project to 3.2.2. after an interested person on GitHub let me know that the parser changes broke it. For a day or two, the outer loop of the city was removed while I was figuring out what broke it, but currently it's back on the map.

6 months later

Development slowed down a bit - since July, I mostly worked on AI. It can now avoid obstacles and/or other cars. The biggest problem was avoiding head-on collisions. Then I had almost two months of a break, until a brainwave hit and I worked a bit on the assets instead.

More variety in the city A bit of shader magic for the signs, some texture editing for the lanterns, more window color variants, and a bit of procedural modeling again to create storefronts on the ground floor (the textures are from a public domain set, and I applied some shaders to them, too)

Winter scenery Unfortunately there's not much winter this year where I live, but I implemented snowy ground material and snow particles, and snow/smoke/dust effect. I also added skid marks, which have long been on my wishlist.

The main game is mostly done now, the majority of the things left on my wishlist are pretty much optional (such as adding some clutter to the streets, or roundabouts and more race types and multiple AIs in a race...)

4 months later

I saw a post on gamedev subreddit that showed how to make a low speed seem fast in a game. Implementing some of their tricks had the added benefit of making the motion blur kick-in much less jarring.

However the main reason that I posted is because I have done some major improvements to traffic AI. It no longer drives off the road when turning thanks to using a circular arc through 3 points. Using those revealed some false negatives in the "am I going straight across" code, which I fixed by making the code check relative to the intersections and not the car, because the car wasn't always perfectly aligned. Intersections now track which cars are on it, which allowed me to implement a very simple right of way rule (yield to anyone already on said intersection). I also rewrote the lane generation code to use relative positions to the intersection and some simple general rules instead of magic numbers and angle comparisons.

Before the fixes, this intersection was a crash-fest due to two out of three roads having bugged (crossing over) lanes. Since yesterday, the AI are happily driving through and the only accidents are due to collision avoidance not working when going very slow.

Red lane is left for cars going from an intersection marked red. Ditto for black.

9 months later

Not much has been happening since I discovered my laptop can run Godot 4.x, and therefore I started a Git branch devoted to upgrading.

In 3.x branch, I only committed minor stuff such as automating the winter mode switch (by using the OS date), and fixing a stupid typo that prevented a freshly downloaded clone of the repo from running!

The 4.x branch is totally unusable yet - 4.0 alpha 1 landed today and I got my hands on a converter script, but there is apparently A LOT of stuff to fix before the game even runs... On the other hand, a test scene revealed that sky shaders allow me to get the same day/night system with much better performance than the 3.x complex setup plus I did get far-away mountains (just some clever shader tricks) to work.

Sooo... it took me a lot of work, but the game now runs in 4.0 alpha 1: https://github.com/Zireael07/FreeRoamRoguelikeRacerPrototype/tree/4.x

Still not playable, because the mapgen needs fixes (same seed, but the roads look different for some reason...).

Performance improvements from Vulkan sky are obvious even on the broken map. What is less to my liking is AWFUL moire on building textures, which was not present in 3.x

I managed to fix the moire by tweaking shadow settings (it was most likely self-shadowing)

I also managed to work around broken mapgen by implementing save in 3.x, and then loading the saved data. This works, which means the issue is somewhere in the mapgen itself, not in individual elements.

Next step: print all the mapgen debug stuff to a file so that I can compare what is different between 3 and 4. Re-add the AI to the loaded map (I was running into crashes, and nixing them nixed the crashes)

Around a week after I started, and the game is playable on Vulkan and behaves just like the 3.x version AFAICT - if you pick the loaded map, not the generated map:

https://github.com/Zireael07/FreeRoamRoguelikeRacerPrototype/tree/4.x

I also did some more minor improvements on a yet another separate branch as well as I've tried putting lights around the map, now that Vulkan effectively has no limit on the amount of lights, they can be used to light up the map at night-time

The single big issue to solve is to figure out what happens wrong with the mapgen...

Good news, the 4.x branch is now practically the same as the master branch was in 3.x (I managed to fix the mapgen issue, turns out the upgrade script messed up the line that was calculating relative positions)

Develop-4 branch continues to see improvements, this time around AI (I stopped them creeping around when they were supposed to stop, and made AI debugging better, I can even see the danger/interestst the context steering uses)

2 months later

I created a simple parking lot mesh in Godot and worked a bit on the AI so that the traffic can drive both to and from such a parking lot. There are also still some cases when the AI gets stuck on something but there should be less and less of those.

Bonus: I made the neon sign procedural thanks to a shader adapted from Shadertoy. The characters are fake (no longer real Japanese) but the diversity far outweighs the (linguistic) loss ;)

https://i.imgur.com/yjYQZSf.jpeg

I was also going to work on improving building generation, but every idea I get is either too time intensive for my current abilities (going through a massive rework/refactor at my day job) or reduces performance (matching up Kenney's pieces)

3 months later

Yep!!!! That's circuit (looped) races finally coming to FDB! Turns out finding loops in a graph is an already solved problem, only I had to google "cycles in graph" not "loops in graph". I tried finding all cycles in a graph only to have a brainwave today, that I don't need ALL of them just the ones through the intersection my marker happened to spawn on (current map is funny because pretty much every intersection HAS a loop through it, but I will later need some more code that checks if we happened to be a dead-end or something)

BTW that would've been much easier if we had a Graph in Godot itself, see https://github.com/godotengine/godot-proposals/issues/3848, instead of me writing clunky stuff while AStar2D/3D basically have a graph data structure already... :/

No racers/actual racing yet as the AI/race code will need some more tweaks before they're let loose 😛

Note: shaders are currently a bit broke, waiting for beta1 because I don't want to keep refixing them for every new alpha. That doesn't preclude AI/code improvements, though, see above 😉