Code Monkey home page Code Monkey logo

godot-procedural-generation's Introduction

Branch remarks

this branch contains updates to the original course code for Godot 4. The scripts will be annotated regardings changes like tihs:

# Camera zoom logic seems to be reversed between Godot 3 and 4, bigger numbers are now more zoomed in

I plan to update the scripts and remove these comments for future reference, when Godot 4 is standard and changes over Godot 3 are no longer relevant and comments about it amount to noise. Also the current effort is change as little as neccessary. Only later it will be about adapting to Godot 4 best practises.

-Thomas

Godot Procedural Generation

project banner

Godot PCG (Procedural Content Generation) is a project to build a series of algorithms and demos to learn about procedural generation. The algorithms are from our course Godot PCG Secrets.

โžก Follow us on Twitter and YouTube for free game creation tutorials, tips, and news! Get one of our Godot game creation courses to support our work on Free Software.

Screenshot of a level generated by the Random walker algorithm

Available demos

RandomWalker

This is an algorithm as seen in Spelunky. This algorithm uses a node that walks randomly on a grid, places hand-designed level chunks, and randomizes them to generate unique levels.

Level generated by the Random walker algorithm

WorldMap

This project demonstrates a technique for generating a world map with biomes and rivers, heavily relying on shaders. It's inspired by Procedurally Generated Wrapping World Maps in Unity C# although it uses a completely different implementation.

Generated world map

BasicDungeonGenerator

A basic generator to get started with procedural content generation. Creates rectangular rooms, rooms with organic shapes, and corridors connecting the rooms.

ModularWeapons

Procedural or emergent gameplay system where you can stack movement modifiers and different emitters to generate weapons. A game that references techniques like this are Binding of Isaac or Enter the Gungeon.

Infinite worlds

In SpaceInfiniteGeneration/, you'll find four infinite world generation demos. You can travel infinitely with your ship, the world never ends. The first two demos generates worlds full asteroids using white noise and blue noise, respectively.

Asteroid field generated with blue noise

The LayeredWorldGenerator scene shows how to use layered generation to create a universe with planets, moons, trade lanes, and asteroid belts.

Screenshot of a world generated by our layered algorithm

Finally, the PersistentWorldGenerator builds upon the previous demo and adds the ability to make persistent changes to this infinite universe.

How to use

Clone the repository and import the godot/ directory as a Godot project. Each demo is in a separate sub-directory.

The start-project/ directory contains starters for students of our course Godot PCG Secrets and not the complete demos.

In the demos, where relevant, we use a timer to show you the content generation steps, as the final level would otherwise appear instantly. Doing so helps to visualize and debug algorithms. Remove that timer code for the algorithm to run at full speed.

Contributing

Contributors are welcome!

If you encounter a bug, please open an issue.

If you want to contribute to the project, for instance, by fixing a bug or adding a feature, check out our:

  1. Contributor guidelines.
  2. GDScript style guide

Licenses

This project is dual-licensed:

  • The source code is available under the MIT license.
  • Art assets (images, audio files) are CC-By 4.0. You can attribute them to GDQuest and contributors (https://www.gdquest.com/).

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.