All Projects → AdamWhiteHat → Roguelike-Procedual-Cave-Generator

AdamWhiteHat / Roguelike-Procedual-Cave-Generator

Licence: Apache-2.0 license
A procedurally generated, cave-like dungeon/map creator for rogue-like games using the cellular automata method. During its development, I solved a common/limiting problem with this algorithm that might explain why it is not more commonly implemented in such games.

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to Roguelike-Procedual-Cave-Generator

flare
A Simple Browser Based Game.
Stars: ✭ 85 (+226.92%)
Mutual labels:  rpg, games
Simplexrpgengine
Modular game engine built with MonoGame, with GMS2-like workflow and advanced level editor
Stars: ✭ 122 (+369.23%)
Mutual labels:  rpg, games
Fgmk
Retro RPG Game Maker
Stars: ✭ 794 (+2953.85%)
Mutual labels:  rpg, games
msx-rpg
A Dungeon Crawler for the MSX2
Stars: ✭ 40 (+53.85%)
Mutual labels:  rpg, dungeon-generator
Sulis
Turn based tactical RPG with several campaigns, written in Rust
Stars: ✭ 338 (+1200%)
Mutual labels:  rpg, games
Gameproject3
游戏服务器框架,网络层分别用SocketAPI、Boost Asio、Libuv三种方式实现, 框架内使用共享内存,无锁队列,对象池,内存池来提高服务器性能。还包含一个不断完善的Unity 3D客户端,客户端含大量完整资源,坐骑,宠物,伙伴,装备, 这些均己实现上阵和穿戴, 并可进入副本战斗,多人玩法也己实现, 持续开发中。
Stars: ✭ 655 (+2419.23%)
Mutual labels:  rpg, games
Awesomesheet
Online Pathfinder Character Sheet
Stars: ✭ 110 (+323.08%)
Mutual labels:  rpg, games
Magicallife
A 2d game that aspires to be similar to Rimworld, with more depth, magic, and RPG concepts.
Stars: ✭ 145 (+457.69%)
Mutual labels:  rpg
wowstat
A World of Warcraft realm status monitor
Stars: ✭ 20 (-23.08%)
Mutual labels:  games
Newbark
🌳 A proof-of-concept Pokémon-style Retro RPG engine created with Unity.
Stars: ✭ 129 (+396.15%)
Mutual labels:  rpg
Moba
A turn-based browser RPG built with Phoenix LiveView
Stars: ✭ 120 (+361.54%)
Mutual labels:  rpg
Rpg Core
UNITY engine RPG framework
Stars: ✭ 146 (+461.54%)
Mutual labels:  rpg
PyProjects
These are a collection of some cool games in Python, which you may show up as some funky Python projects.
Stars: ✭ 26 (+0%)
Mutual labels:  games
QshOni
The QShell on IBM i library contains useful CL wrapper commands to allow QShell and PASE apps to be called and consumed from regular IBM i jobs via CL, RPG or COBOL programs.
Stars: ✭ 34 (+30.77%)
Mutual labels:  rpg
verlet
build and animate objects according to verlet physics. pure golang library
Stars: ✭ 26 (+0%)
Mutual labels:  games
hacker-feud
💥 A single page web game made with Svelte.
Stars: ✭ 61 (+134.62%)
Mutual labels:  games
Mixed Cell Cellullar Automata
The Mixed-Cell Cellullar Automata (MCCA) provides a new approach to enable more dynamic mixed landuse modeling to move away from the analysis of static patterns. One of the biggest advantages of mixed-cell CA models is the capability of simulating the quantitative and continuous changes of multiple landuse components inside cells.
Stars: ✭ 33 (+26.92%)
Mutual labels:  cellular-automata
Betonquest
An advanced and powerful quest scripting plugin for Minecraft. Features built-in RPG style conversations and integration for over 25 other plugins.
Stars: ✭ 121 (+365.38%)
Mutual labels:  rpg
Indicium-Supra
DirectX API-hooking framework
Stars: ✭ 292 (+1023.08%)
Mutual labels:  games
Sudoku-Solver
🎯 This Python-based Sudoku Solver utilizes the PyGame Library and Backtracking Algorithm to visualize and solve Sudoku puzzles efficiently. With its intuitive interface, users can input and interact with the Sudoku board, allowing for a seamless solving experience.
Stars: ✭ 51 (+96.15%)
Mutual labels:  games

Roguelike-Procedual-Cave-Generator

Screenshot

==================================

https://csharpcodewhisperer.blogspot.com/2013/07/Rouge-like-dungeon-generation.html

This software provides procedural content generation of cave-like dungeons/maps for rogue-like games using what is known as the Cellular Automata method.

To understand what I mean by cellular automata method, imagine Conway's Game of Life. Many algorithms use what is called the '4-5 method', which means a tile will become a wall if it is a wall and 4 or more of its nine neighbors are walls, or if it is not a wall and 5 or more neighbors are walls. I start by "seeding", or randomly filling the map with walls and spaces based on some weight (say, 2/5 times it places a wall). Then there is a 'Horizontal Blanking' step, which clears all the walls in a horizontal strip that in the spans the map, centered vertically. This step I added to eliminate the 'isolated cave' problem (more on that below), and differs from the standard algorithm. The cellular automata step visits each (x,y) position iteratively and applies the 4-5 rule. The automata step is applied multiple times over the entire map ("rounds"), which hollows out the cave and smooths the wall. I found about 3 rounds produce nice, 'natural' looking caves.

The isolated cave problem: One of the major problems with this technique is (was) the formation of isolated caves. Instead of one big cave-like room, you often get isolated islands of space that is inaccessible from the larger, cavernous space without digging through walls. Isolated caves can trap key items or (even worse) the stairs leading to the next level, preventing further progress in the game. There are a few different proposed approaches to solving this problem: 1) Discarding maps that have isolated caves. 2) Filling in the isolated sections, 3) Not placing doors or other key quest items on tiles if there are any walls within some radius, or 4) Finely tweaking the variables/rules to reduce occurrences of such maps. None of these are ideal (in my mind), and most require a way to detect isolated sections, which is another non-trivial problem in itself.

In this inventions, I propose a solution called 'Horizontal Blanking', because it blanks a horizontal strip through the center, replacing all walls with spaces. I found horizontal strip about 3 or 4 tiles tall works best for a 40 wide by 20 high map (about 1/5th of the map height), but the ideal height also depends on the chosen automata rules. Clearing a horizontal strip of sufficient width creates a centralized cavernous space, and prevent a continuous vertical wall from being created through the center of your map, forming two isolated caves on either side. After horizontal blanking, you can apply the cellular automata method to your map like normally.

NOTE: Because my map is wider than it is tall, so I blanked a horizontal strip to prevent a vertical wall from isolating the left side from the right side. If your map it taller than it is wide, you will probably want to blank a vertical strip to prevent a horizontal wall from isolating the top area from the bottom area. I find it helps to have an asymmetry of dimensions, but if your map is a perfect square, I don't know for sure, but I presume blanking BOTH a horizontal and vertical strip will work, but you'll probably want to make the strips thinner than you would for a asymmetric dimensions, and possibly additionally blank the center region in the shape of a square or approximate circle.

If you map is truly huge, you may still have problems with isolated pockets because there is just so much room for them to form in. Without having ever tested this scenario, I propose either adopting the same strategy as described for a map with perfectly square dimensions as mentioned above, or similarly blanking both a horizontal and vertical region, but use ellipses instead of rectangles. Another idea would be to take a square with the same dimensions as your map, rotate it by 45 degrees so that its corners just touch the N, S, E and W boundaries, and blank that region. Then, to reduce the feature-less cavernous space and give your map more texture/detail, add back in a central region of solid wall.

Anyways, you should get the general idea of my technique to prevent isolated caves by now. If you have unique or problematic map dimensions/shape, some experimentation of blanking regions shape and placement might be required, but basic rectangular blanking works well in the general case.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].