Git Product home page Git Product logo

dungeon_generator's Introduction

Dungeon Generator

Generates dungeons of arbitrary size. Useful for Roguelike/Top down/Action RPGs/Anything that needs random dungeons.

image

How To Use

This library doesn't have any third party dependencies and is easy to use:

   var size = MapSize.Huge;
   var seed = 1024u;
   var dungeon = Generator.Generate(size, seed);

The return value from Generator.Generate() gives you an ITileMap, which is just a wrapper around a 2D array of UShorts.

Optionally, you can give fine grained generation options

 Generate(MapSize.Huge, new GeneratorParams{
   Seed = 1024,  
   Doors = 1.0f,  // NOT IMPLLEMENTED the chance to add a door tile attribute to a room's exits
   Exits = true, // will generate and place an exit tile
   Loot = .25f,  // chance that a loot marker will be placed in a room, 0 - 1.0
   MobSpawns = .66f, // chance that a mob spawn will be placed in a cell, 0 - 1.0
   RoomChance = .66f, // chance that a cell will become a room instead of a corridor, 0 - 1.0
   MobsInRoomsOnly = false // if mobs should only spawn in rooms
 })

If you want to use the tester console app that comes along with this, you need to make sure to change your font size to be 8x8. You can do this by right clicking on the window title bar icon and selecting "properties", then go to the "font" tab and apply the following settings:

font screen cap

If you don't do this, the characters will be taller than they are wide when the dungeon prints, skewing everything and making it look wacky asf.

License

MIT

dungeon_generator's People

Contributors

adamveld12 avatar ericfreeman avatar gitter-badger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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