GithubHelp home page GithubHelp logo

lebodro / procedurallevelgenerator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ondrejnepozitek/edgar-dotnet

0.0 2.0 0.0 27.71 MB

Configurable procedural layout generator

Home Page: https://ondrejnepozitek.github.io/ProceduralLevelGenerator/docs/introduction.html

License: MIT License

C++ 1.56% C 0.25% C# 98.19%

procedurallevelgenerator's Introduction

ProceduralLevelGenerator

This project is a library for procedural generation of 2D layouts based on a graph of rooms connections.

To produce a game level, the algorithm takes a set of polygonal building blocks and a level connectivity graph (the level topology) as an input. Nodes in the graph represent rooms, and edges define connectivities between them. The graph has to be planar. The goal of the algorithm is to assign a room shape and a position to each node in the graph in a way that no two room shapes intersect and every pair of neighbouring room shapes can be connected by doors.

See the documentation here

Bachelor thesis and paper

This library was created as a part of my bachelor thesis. Text of the thesis can be found here. After completing the thesis, we decided to transform it to a paper and submit it to the Game-On 2018 conference. The extended version of the paper can be found here. This version also contains a practical use-case of the algorithm, which is not present in the regular version due to length limitations.

Features

  • Any planar connected graph can be used as an input
  • Any orthogonal polygon can be used as a room shape
  • Complete control over shapes of individual rooms
  • Complete control over door positions of individual room shapes
  • Rooms either directly connected by doors or connected by corridors
  • Export to JSON, SVG, JPG
  • Majority of features available through a GUI and YAML config files
  • Implicit support for keys and locks - just define the connectivity graph hovewer you like

Inspiration

The main idea of the algorithm used in this library comes from a paper written by Chongyang Ma and colleagues so be sure to check their work out.

Some things in this library are done differently and/or improved:

  • Integer coordinates are used instead of reals - room shapes are therefore only orthogonal polygons.
  • With integer coordinates, optimized polygon operations (intersections, etc..) were implemented with a complete control over the process.
  • User has a complete control over door positions of rooms.
  • The algorithm was optimized to generate a layout as fast as possible.
  • A specialized version of the generator was implemented to support adding (usally) short corridors between rooms to the layout without sacrificing most of the convergence speed. (Average number of iterations usually stays the same but iterations themselves are slower.)

Examples

Input

alt-text

Results

result result result result

Note: Click on images to see them in a full size.

procedurallevelgenerator's People

Contributors

ondrejnepozitek avatar

Watchers

James Cloos avatar  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.