43 lines
1 KiB
Markdown
43 lines
1 KiB
Markdown
---
|
|
title: "Nethack's Rooms & Corridors Generator"
|
|
date: 2023-02-05T09:08:07-08:00
|
|
draft: true
|
|
series: "Nethack Level Generation"
|
|
categories: Tech
|
|
tags: [Nethack, Programming]
|
|
---
|
|
|
|
## Rectangles
|
|
|
|
## Placing Rooms
|
|
|
|
[`makerooms`][makerooms_func] uses a "random rect" algorithm to create up to `MAXNROFROOMS` rooms. It iteratively
|
|
generates a random rectancle
|
|
|
|
`create_room`
|
|
|
|
`sort_rooms`
|
|
|
|
## Digging Corridors
|
|
|
|
[`makecorridors`][makecorridors_func]
|
|
|
|
[`join`][join_func]
|
|
|
|
`dig_corridor`
|
|
|
|
## Special Features
|
|
|
|
`make_niches`
|
|
|
|
`do_vault`
|
|
|
|
`create_vault`
|
|
|
|
## Special Rooms
|
|
|
|
[nh36]: https://github.com/NetHack/NetHack/tree/NetHack-3.6
|
|
[mklevc_file]: https://github.com/NetHack/NetHack/blob/NetHack-3.6/src/mklev.c
|
|
[makerooms_func]: https://github.com/NetHack/NetHack/blob/59b117c655731bdf1f8b92c57bdb786119927f3a/src/mklev.c#L223
|
|
[makecorridors_func]: https://github.com/NetHack/NetHack/blob/59b117c655731bdf1f8b92c57bdb786119927f3a/src/mklev.c#L319
|
|
[join_func]: https://github.com/NetHack/NetHack/blob/59b117c655731bdf1f8b92c57bdb786119927f3a/src/mklev.c#L244
|