Free Roam Roguelike Racer

ZireaelZireael Posts: 79Member
edited June 2017 in Projects

This is what I tinker with when I'm not working on my main project (non-Godot).

The goal is to have something like the 2005s era Need For Speed games or Burnout Paradise, but with procedurally placed stuff so that the poor level designer does not have to place everything by hand.

The code is slowly being uploaded to GitHub -

Currently the basic procedural generation of road segments is in, as well as their placement (two kinds, a straight with a curve left and a series of curves). I have also figured out how to place props (buildings, road signs) procedurally but this is not in the repo yet.

Player and AI use the same physics under the hood. The AI drives to a target, one target per AI. I have a version where the AI pathfinds using a procedural navmesh (that matches the road mesh) but this is not committed yet.

I have also figured out how to draw a 2D minimap using Controls (to avoid rendering the whole level again). The minimap in the repo works like a radar, showing the AI's positions compared to yours. In the test version, it's slightly more advanced and uses shaders to achieve panning (not shown in the gif) and a circular mask. The minimap texture is just a test texture, but I plan to use Image.setPixel() to draw roads based on the data that the procedural generator outputs.

The gif shows my test project (so it has the props and the navmesh and the better minimap, but on the other hand it also has a ton of testing/debugging stuff that the version in the repo doesn't)

P.S. The project is being made in 2.1.3, hence some rendering glitches. I plan to move to 3.0. at some point though.

Tags :


  • ZireaelZireael Posts: 79Member

    More progress! The minimap is almost complete (as you see it lost the circular mask in order to be able to procedurally draw it based on road positions). It rotates as the player rotates, so the arrows fit. Since the minimap is generates at start time, it has no noticeable performance effect at runtime.

    Both the player and AI have a working brake light effect (the code for it is uploaded to github).

    Not uploaded: navmeshes (they are being finicky sometimes, still) as well as the minimap improvements (the procedural drawing code needs a ton of cleanup at the moment)

  • SchusterSchuster Posts: 306Member

    Interesting project..i like, interested about this minimap..would be great some 'how to' minimap tutorial because....looks like low cost minimap :)

  • ZireaelZireael Posts: 79Member

    @Bishop said:
    Interesting project..i like, interested about this minimap..would be great some 'how to' minimap tutorial because....looks like low cost minimap :)

    Head over to tutorials section to see a tutorial :)

  • alexwbcalexwbc Posts: 15Member

    Your project looks cool, congratz!

    I was wondering if I could ask for help; I've build your cars on top of the draft of this demo project, I was looking into that too becouse wanted to make a prototype for this idea of a very basic "racing thing" to be moddable. To make this appealing I was thinking it may need the [url= rendering feature[/url] of godot 3.

    I've tried to strip said truck demo; keeping it as much simple possible I just exported the car, but it behave in really weird way, so I wasn't able to even get thing started (at programming I barley mange to get things done in 2D; 3D it's beyond my skills)
    this is what I did: GranModLibertyGT.tar.bz2(GT is for GodoT).
    Since you said you'll port your project in GD3, I was wondering if you could, well, maybe export just the basic vehicle (no IA, not camera... just the plain car with physics, engine and keys) so I could use it already. ^^"

  • ZireaelZireael Posts: 79Member

    I am using the same truck demo car as the base and I saw the same very weird behavior in Godot 3. The issue has now been reported to Godot repo and I hope it'll get fixed.

  • ZireaelZireael Posts: 79Member

    This is the current state of my working copy. The repo has been updated a bit (it includes the new ground texture, for instance, and the message box [but not the font for Japanese characters]).

    The player now has something to do in the working copy, too (this is NOT in the repo yet):

    I'm leaving for holidays tomorrow so I wanted to leave a note that shows it's not just a tech demo but it'll actually become a game at some point, or so I'm hoping.

  • memermemer Posts: 39Member

    The million dollar question: does your demo support drifting?

  • ZireaelZireael Posts: 79Member

    @memer said:
    The million dollar question: does your demo support drifting?

    Not yet, but I hope to have drifting someday. The changes I made in my only PR so far make it much more possible (by making possible to reduce the rollover if needed - otherwise you'd start to roll before you started to drift)

    And before you ask, no updates. I was on holidays and now I've got to get caught up re my day job, and I'm generally hoping that 3.0 will get the vehicle physics fixed so that I can move to it...

  • ZireaelZireael Posts: 79Member

    Here's the current state of the working copy:

    About the 3.0, the Bullet physics PR ought to get merged soon(tm), and as soon as it happens I will start porting to 3.0.

  • ZireaelZireael Posts: 79Member

    I found some free time to update the repository. The code used to create the procedural car (the one to the side in the gif in the previous post) is in. I also optimized the curved road segments a bit.

    In the working copy, the procedural car has seen some more improvements:

    Also the AI can navigate around obstacles using a simple raycast setup:

    Those two improvements will be the next to go into the repo.

    After that, I will work on committing the navmeshes (because they finally link properly and a path can be found along the whole road). To think that I've been working on the navmeshes since June and only now they are in a committable state... The "vertices must fit perfectly for navmesh to work" rule is fairly annoying.

  • ZireaelZireael Posts: 79Member

    AI raycasting and the general navmesh setup are now in the repo. I will have to make the navigation node itself next so that the navmeshes can be used :wink:

  • ZireaelZireael Posts: 79Member
    edited November 2017

    I made the values for tire friction and mass more realistic.

    Also I moved the brake and throttle to the actual HUD. The car can now have rounded rear lights. And I sped up the AI a bit.


    Sorry about the quality, it seems that embedding gfycats makes them lose quality :(

  • CalinouCalinou Posts: 193Admin Godot Developer

    Sorry about the quality, it seems that embedding gfycats makes them lose quality :(

    This is because it's converted to a low-quality GIF, since most forum platforms do not allow embedding video files directly (ultimately, Gfycat hosts sound-less videos). Consider adding a Gfycat link below the GIF embed.

  • ZireaelZireael Posts: 79Member

    More progress on the local copy:

    The repo has the AI improvements but not the corner barriers or the roadblocks.

    I have grabbed the alpha 2 snapshot and exported the repo anew. Everything seems fine after an hour of fixing API changes apart from the fact I need to invert the steering directions.

    I will definitely be making the jump from 2 to 3 as soon as 3 hits, as the 3.0 exporter works a treat.

  • ZireaelZireael Posts: 79Member

    So here's a little comparison of the game's version that is in the repository (which is missing a lot of the eye candy)


    3.0 (with Bullet physics)

    note: box cars are because 3.0 currently doesn't recognize .obj as a mesh resource :(

  • ZireaelZireael Posts: 79Member

    Here's how the project looks after exporting to 3.0 in beta 1, which correctly works with .obj files.

    And here's a WIP of the day/night system, based on some 2.1. scripts by Khairul Hidayat:

    (Embedded Gfycats experience a rather drastic loss of quality, so I recommend clicking the link to view them on site)

    If you've looked at the project repo recently, I merged the 3.0 branch into master a couple days ago and have now started working on improvements, such as the day/night system above.

  • ZireaelZireael Posts: 79Member

    Having some problems updating the project to 3.0 rc 1 (cars started falling through floor). I will probably have to remake the main scene again, as individual pieces seem to work fine. That's another plus for Godot's node system, remaking scenes takes less time...

  • ZireaelZireael Posts: 79Member

    The problem was fixed in rc2 so I don't have to remake the main scene, yay I guess?

    Currently waiting for 3.0 to land so exploring stuff in small side projects and/or writing helper Python scripts.

  • MagicLordMagicLord Posts: 578Unconfirmed
    edited January 24

    You made great progress, adding some textures and cars models is getting the game to a new level.
    How do you generate roads ? Are they premade road segments you place at runtime ?
    You don't need navmesh, waypoints include in road segment scenes would do the job.

  • Pavan_KumarPavan_Kumar Posts: 8Member

    This reminds me MidTownMadness game.

  • MegalomaniakMegalomaniak Posts: 997Admin
    edited January 31

    You mean midnight madness? Also reminds me of NfS:Underground/Underground 2.

  • CalinouCalinou Posts: 193Admin Godot Developer
    edited January 31

    @Megalomaniak said:
    You mean midnight madness? Also reminds me of NfS:Underground/Underground 2.

    Midtown Madness is a series of racing games from the late 1990s-early 2000s. I have fond memories of playing the first two games when I was younger :smiley:

  • MegalomaniakMegalomaniak Posts: 997Admin

    Ah, yeah just realized I mixed it up with Midnight club series. Yeah the Madness part of the name lines this up with the Monster truck madness and Motocross Madness games in ms games portfolio. Those last two I have actually played(also in the 90s).

  • Pavan_KumarPavan_Kumar Posts: 8Member

    Can the car climb ramps and slopes, the game I mentioned has a bridge which opens and closes, it would be very fun to go towards an open bridge with full speed then fly and land. Another thing that the game does good/bad is that you cannot hit any humans, no matter how hard you try they escape.
    With some effects like day/night cycle, environment effects like fog and some basic water you can blow the game. If you have other priorities, just ignore me.

  • ZireaelZireael Posts: 79Member

    The Bullet car definitely can climb ramps and slopes, but I have none yet.

    The project already has a day/night cycle. I am trying to figure out how to do fog without killing the performance.

    However, this is just a side project for me and I don't have too much time to work on it (one of the reasons why I put the code & assets on GitHub).

    In other news, I just updated to 3.0.1 and lowered the player car's origin to make it more stable.

  • Pavan_KumarPavan_Kumar Posts: 8Member

    nice, I will check it on github.

  • ZireaelZireael Posts: 79Member

    The last two weeks have been spent fighting transforms and rotations. Road pieces now match perfectly (or as close to perfect as possible).

    I also tweaked the car input and the car is much more controllable at 100+ kph.

  • ZireaelZireael Posts: 79Member

    I got back to poking at this, today I applied a cloud shader to a skydome. It's not working well enough to show off mostly because either the clouds are too close or they get culled by the camera frustum (cull distance isn't working in 3.0.2 and I can't figure out AABB maths).

  • ZireaelZireael Posts: 79Member

    Over the last two weeks, I managed to get the skydome working (still can't figure out custom AABB, though). I also added a rain effect (particles) and some textures to the building windows.

  • ZireaelZireael Posts: 79Member

    Some more progress:

    A recharge station.

    The unlabeled meter is health, it goes down when you crash into stuff.

    Not all roads are bordered by buildings, also the left side buildings got rotated so that the neons are over the road.

    This is what a procedural car now looks like:
    - it's missing rear lights and driver seat still but I've added the steering wheel since taking the pic

Sign In or Register to comment.