Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sergeychelak/cellular_automata
Maze generator based on cellular automata
https://github.com/sergeychelak/cellular_automata
bfs cellular-automata matrix research-project rust
Last synced: 3 days ago
JSON representation
Maze generator based on cellular automata
- Host: GitHub
- URL: https://github.com/sergeychelak/cellular_automata
- Owner: SergeyChelak
- License: mit
- Created: 2024-05-14T19:56:36.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-05-17T21:17:51.000Z (8 months ago)
- Last Synced: 2024-05-18T21:42:08.613Z (8 months ago)
- Topics: bfs, cellular-automata, matrix, research-project, rust
- Language: Rust
- Homepage:
- Size: 555 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Cellular automata
## Overview
This research project explores the generation of intricate maze structures tailored for first person shooter (FPS) game environments. Utilizing cellular automata logic, the project aims to create dynamic and challenging level maps while offering parameterization options for initial noise density and the number of iterations (generations). This customization enables researchers to fine-tune maze characteristics and study their impact on gameplay experiences.## Getting Started
- Rust programming language
- SDL2 library with image features## Controls
| key | description |
| -------- | ----------- |
| q | increase noise density |
| a | decrease noise density |
| w | increase iterations |
| s | decrease iterations |
| n | next iteration with current matrix |
| r | regenerate using current settings |
| f | filter small regions |
| m | perform full cycle maze generation |
| esc | exit |
| other key | display generator settings |## Processing
Note: App processing with two logical values: "floor" and "wall"
1. Generate noise (random) matrix with specified density
2. Create new matrix by applying cellular automata for each cell
3. Repeat step 2 specified amount of steps
4. Find with BFS all "floor" regions
5. Threat all unreachable (isolated) regions as a "wall"
6. Find with BFS all "wall" regions
7. Threat all small (depends on threshold) wall regions as a "floor"
6. Calculate contours## Example
This example demonstrates connected "floor" area which is isolated with a large "wall" region. Also there're presented smaller "wall" regions as part of maze. Contour cells are highlight with a lighter color.
![Image](docs/example.png)## P.S.
Anyone can use this code and described approach without any limitations. If this project was helpful for you let me know how did you apply it