Code Monkey home page Code Monkey logo

procedural-city-truck-sim's Introduction

Procedural City Generation and Driving Simulator in Godot

Drive through a procedurally-generated city using OBB (Object Aligned Bounding Box) Parcelling.

example1 example2

Installation

Clone or save this repo locally (instructions), and then import it using Godot's project manager.

Usage

Run Project

Within Godot, run the scene by pressing the Play Scene button in the top-right of the screen or press F6 (Cmd + R on macOS). Every time the scene is run, a new city is randomly created.

Controls

  • Arrow-Keys: Move truck forwards, backwards, left, or right.
  • Spacebar: Drift button 😈.
  • M: View map of city.
  • R: Generate new city.
  • P: Save screenshot of viewport to screenshots/.
  • Escape: Exit game.

Regenerate a City Island

To get a new city, you can press the R key to rerun the scene.

Take a Screenshot

You can save a screenshot of the viewport to screenshots/ by pressing the P key.

Modify Variables

The main logic can be found in the script associated with the parent node, Node2D. The program can be easily configured by modifying the values found in the Godot node inspector tab with the parent node selected. The city block that is parcelled is created by generating N random points on the circumference of a circle of radius R.

  • max_radius (int): The maximum possible length of radius R.
  • min_radius (int): The minimum possible length of radius R.
  • points (int): The amount of points N to be generated on the circumference.
  • min_area (int): Minimum area of parcel. Once area is less than min_area, recursion ends and parcel is created.

Roadmap

  • Finish car controller
  • Add colliders to buildings
  • Scale world to be larger and more accurate
  • Add fast travel
  • Make island, surround with water
  • Add parks
  • Incorporate Godot Road Generator
  • Add loading screen to beginning
  • Implement shadows
  • Building textures
  • Create mlutiple islands using noise:
    • Poisson disc sample to generate points
    • Use voronoi to form land blocks
    • Group land blocks together to form islands
    • Use geometry to find closest island coast edge to create bridges
  • Create toon shader
  • Add skybox
  • Add sound
  • Improve speedometer/GUI
  • Compass in map and radar
  • Improve how roads are rendered in radar
  • Add infinite water shader To register changes, press the Tab button on your keyboard after modifying an inspector field. Then save the changes and rerun the project.

Credits

procedural-city-truck-sim's People

Contributors

stavguo avatar

Stargazers

 avatar

Watchers

 avatar

procedural-city-truck-sim's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.