Free Roam Roguelike Racer

ZireaelZireael Posts: 33Member
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: 33Member

    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)

  • BishopBishop Posts: 198Member

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

  • ZireaelZireael Posts: 33Member

    @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: 33Member

    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: 33Member

    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: 37Member

    The million dollar question: does your demo support drifting?

  • ZireaelZireael Posts: 33Member

    @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: 33Member

    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: 33Member

    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: 33Member

    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: 33Member
    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: 82Admin 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: 33Member

    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: 33Member

    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: 33Member

    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: 33Member

    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...

Sign In or Register to comment.