{"id":15014599,"url":"https://github.com/sience/astray","last_synced_at":"2025-04-05T09:06:02.443Z","repository":{"id":13060846,"uuid":"15741223","full_name":"SiENcE/astray","owner":"SiENcE","description":"Astray is a lua based maze, room and dungeon generation library for dungeon crawlers and rougelike video games","archived":false,"fork":false,"pushed_at":"2024-12-15T13:34:22.000Z","size":35,"stargazers_count":155,"open_issues_count":0,"forks_count":11,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-05T09:05:56.735Z","etag":null,"topics":["crawlers","dungeon","dungeon-crawler","love2d","lua","maze","procedural-generation","room","rougelike","video-game"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"zlib","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SiENcE.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-01-08T16:35:29.000Z","updated_at":"2025-04-04T10:28:06.000Z","dependencies_parsed_at":"2025-02-03T13:10:57.104Z","dependency_job_id":null,"html_url":"https://github.com/SiENcE/astray","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SiENcE%2Fastray","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SiENcE%2Fastray/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SiENcE%2Fastray/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SiENcE%2Fastray/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SiENcE","download_url":"https://codeload.github.com/SiENcE/astray/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247312077,"owners_count":20918344,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crawlers","dungeon","dungeon-crawler","love2d","lua","maze","procedural-generation","room","rougelike","video-game"],"created_at":"2024-09-24T19:45:49.710Z","updated_at":"2025-04-05T09:06:02.202Z","avatar_url":"https://github.com/SiENcE.png","language":"Lua","readme":"# Astray\n\n[![License: Zlib](https://img.shields.io/badge/License-Zlib-brightgreen.svg)](https://opensource.org/licenses/Zlib)\n\nAstray is a robust Lua library for procedural generation of mazes, rooms, and dungeons. It provides a flexible system for creating diverse layouts suitable for dungeon crawlers, roguelikes, and other games requiring procedural map generation.\n\n\u003cp align=\"center\"\u003e\n \u003ca href=\"https://raw.githubusercontent.com/SiENcE/astray/master/sample.png\"\u003e\n  \u003cimg border=\"0\" src=\"https://raw.githubusercontent.com/SiENcE/astray/master/sample.png\"\u003e\n \u003c/a\u003e\n\u003c/p\u003e\n\n## Features\n\n- Procedural maze generation using modified depth-first search\n- Customizable room placement and connection\n- Configurable parameters for dungeon characteristics:\n  - Corridor density and sparseness\n  - Room size and quantity\n  - Dead end frequency\n  - Direction change probability\n- ASCII map output with customizable tiles\n- Support for different cell types (corridors, rooms, doors)\n\n## Installation\n\n1. Copy the Astray folder to your project:\n```bash\ngit clone https://github.com/SiENcE/astray.git\n```\n\n2. Include the library in your Lua code:\n```lua\nlocal astray = require('astray')\n```\n\n## Quick Start\n\n```lua\nlocal astray = require('astray')\n\n-- Initialize generator with desired parameters\n-- Note: Astray generates uneven-sized maps (e.g., 39x39 from 40x40 input)\nlocal height, width = 40, 40\nlocal generator = astray.Astray:new(\n    width/2-1,                -- Map width\n    height/2-1,               -- Map height\n    30,                       -- Change direction modifier (1-30)\n    70,                       -- Sparseness modifier (25-70)\n    50,                       -- Dead end removal modifier (50-99)\n    astray.RoomGenerator:new( -- Room generator configuration\n        4,                    -- Number of rooms\n        2, 4,                -- Min/Max room width\n        2, 4                 -- Min/Max room height\n    )\n)\n\n-- Generate dungeon\nlocal dungeon = generator:Generate()\n\n-- Convert to ASCII tiles\nlocal tiles = generator:CellToTiles(dungeon)\n\n-- Print the dungeon\nfor y = 0, #tiles[1] do\n    local line = ''\n    for x = 0, #tiles do\n        line = line .. tiles[x][y]\n    end\n    print(line)\nend\n```\n\n## Configuration\n\n### Astray Constructor Parameters\n\n```lua\nAstray:new(width, height, changeDirectionMod, sparsenessMod, deadEndRemovalMod, roomGenerator)\n```\n\n| Parameter | Range | Description |\n|-----------|-------|-------------|\n| width | \u003e 0 | Width of the dungeon in even numbers (map will be uneven) |\n| height | \u003e 0 | Height of the dungeon in even numbers (map will be uneven) |\n| changeDirectionMod | 1-30 | Higher values create more winding corridors |\n| sparsenessMod | 25-70 | Higher values create more open layouts |\n| deadEndRemovalMod | 50-99 | Higher values remove more dead ends |\n\n### Room Generator Parameters\n\n```lua\nRoomGenerator:new(rooms, minWidth, maxWidth, minHeight, maxHeight)\n```\n\n| Parameter | Description |\n|-----------|-------------|\n| rooms | Number of rooms to generate |\n| minWidth | Minimum room width |\n| maxWidth | Maximum room width |\n| minHeight | Minimum room height |\n| maxHeight | Maximum room height |\n\n## Customizing Tiles\n\nYou can customize the appearance of generated dungeons by providing a tile mapping:\n\n```lua\nlocal symbols = {\n    Wall = '#',\n    Empty = ' ',\n    DoorN = '|',\n    DoorS = '|',\n    DoorE = '-',\n    DoorW = '-'\n}\n\nlocal tiles = generator:CellToTiles(dungeon, symbols)\n```\n\n## Example Output\n\n```\nMap size=       39      39\n▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓\n▓▓▓                 ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓\n▓▓▓ ▓▓▓-▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓\n▓▓▓   |       ▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓\n▓▓▓▓▓▓▓       ▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓\n▓▓▓▓▓▓▓       ▓▓▓▓▓     ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓\n▓▓▓▓▓▓▓▓▓▓▓▓▓-▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓\n▓▓▓▓▓▓▓▓▓▓▓▓▓   ▓▓▓▓▓▓▓     ▓▓▓▓▓▓▓▓▓▓▓\n▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓ ▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓\n▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓ |   |       ▓   ▓▓▓▓▓▓▓\n▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓   ▓▓▓▓▓▓▓▓▓ ▓ ▓▓▓▓▓▓▓\n▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓   ▓▓▓▓▓     ▓       ▓\n▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓ ▓▓▓▓▓▓▓ ▓\n▓   ▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓ ▓▓▓▓▓▓▓ ▓\n▓ ▓-▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓ ▓▓▓▓▓▓▓ ▓\n▓ |     ▓▓▓▓▓             ▓▓▓     ▓   ▓\n▓ ▓     ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓ ▓▓▓\n▓ ▓     ▓▓▓▓▓▓▓▓▓                 ▓   ▓\n▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓\n▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓\n▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓\n▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓         ▓\n▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓\n▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓         ▓▓▓▓▓▓▓▓▓\n▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓ ▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓\n▓   ▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓ ▓▓▓▓▓▓▓ ▓▓▓▓▓   ▓\n▓ ▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓ ▓▓▓▓▓▓▓ ▓▓▓▓▓ ▓ ▓\n▓         ▓▓▓▓▓▓▓ ▓▓▓     ▓▓▓ ▓▓▓▓▓   ▓\n▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓-▓▓▓▓▓▓▓ ▓▓▓ ▓▓▓▓▓ ▓▓▓\n▓▓▓▓▓▓▓▓▓       |       | ▓▓▓ ▓▓▓▓▓   ▓\n▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓       ▓ ▓▓▓ ▓▓▓▓▓▓▓ ▓\n▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓       ▓ ▓▓▓ ▓▓▓▓▓▓▓ ▓\n▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓       ▓ ▓▓▓ ▓▓▓▓▓▓▓ ▓\n▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓       ▓ ▓▓▓         ▓\n▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓-▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓\n▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓     ▓▓▓▓▓▓▓▓▓▓▓▓▓\n▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓\n▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓   ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓\n▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓\n```\n\n## License\n\nDistributed under the [zlib/libpng License](https://opensource.org/licenses/Zlib). See `LICENSE` for more information.\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## Acknowledgments\n\nThis work is based on various dungeon generation techniques and algorithms:\n- [Dirkkok's Random Dungeon Generation](http://dirkkok.wordpress.com/2007/11/21/generating-random-dungeons-part-1/)\n- [Myth-Weavers Dungeon Generator](http://www.myth-weavers.com/generate_dungeon.php)\n- [Thomas Bowker's Dungeon Generation](http://thomasbowker.com/2013/08/02/generating-a-dungeon/)\n\n## Support\n\nFor issues, questions, or contributions, please visit the [GitHub repository](https://github.com/SiENcE/astray).","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsience%2Fastray","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsience%2Fastray","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsience%2Fastray/lists"}