Giter Club home page Giter Club logo

wavefunctioncollapse's Introduction

Wave Function Collapse

An infinite, procedurally generated city, assembled out of blocks using the Wave Function Collapse algorithm with backtracking.

Read more about this project here and about the WFC algorithm here.

Play

Download the game on Itch.io: https://marian42.itch.io/wfc
Currently, there is no gameplay, you can only walk around and look at the scenery.

Keyboard Controls: WASD for walking, Space to jump, Shift to run, Ctrl to jetpack.
XBOX Controls: Left Stick for walking, right stick for looking around, A to jump, LB to run, RB to jetpack

Flight mode: Use M to toggle between flight mode and normal mode. In flight mode, you fly across the world, without any controls.

Opening the project in Unity

If you want to work on this project using the Untiy Editor, you need to have Blender installed on your computer.

Editing the module set

By changing the module set, you can make some changes to the world generation without writing code. You can disable or enable modules, change their spawn probability, their connectors, their neighbor rules or you can add new ones. Here is how to do it:

  1. Open the Prototypes scene.
  2. Edit the blocks in the scene. You'll mostly change values in the ModulePrototype components.
  3. Select the "Prototypes" game object in the hieararchy and apply your changes to the prefab (Overrides -> Apply all).
  4. Select the file "ModuleData" in the asset folder.
  5. Click "Create module data".
  6. Optional: Click "Simplify module data". This takes some time, but will make world generation faster.
  7. Save your work and go back to the Game scene. You can now use your updated module set.

Generating worlds in the editor

There are different ways to generate worlds in the editor:

  • Select the Map object. In the MapBehaviour component, select a size and click "Initialize NxN area".
  • Select the "Area Selector" object. Move and scale it to select an area, then use the "Generate" button to generate a map.
  • Use the "Slot Inspector" object to show details about a single position. It shows you which modules can be spawned at that position and lets you select modules manually.

If you want to enter Play mode without losing your map, disable the "Generate Map Near Player" and the "Occlusion culling" script. Note that none of the components serialize, so you can't change the map once it has been serialized. That means that you can't change your map in Play mode unless you initialized it in Play mode.

wavefunctioncollapse's People

Contributors

marian42 avatar andybak avatar shemetz avatar

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.