Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It'd be interesting to see more information about L-systems that aren't strictly branching structures! I played around with them for procedural level generation on a dead prototype.

https://imgur.com/a/dtmQcHt

That image shows 9 generations of the following system:

Symbols:

* Rect(Corner, Dimensions) [black]

* Room(Corner, Dimensions) [green]

* Hall(Corner, Dimensions) [blue]

Rules:

* Rect(Corner, Dimensions) => Room(Corner, Dimensions) if Dimensions matches the size of a predefined room (so I could easily place preconstructed rooms)

* Rect(Corner, Dimensions) => Hall(Corner, Dimensions) if either X or Y dimensions are 100 (1 meter width)

* Rect(Corner, Dimensions) => split at a random distance along either X or Y axis to replace with two Rects()

I'd love to see any examples that are more elegant :) One of the few posts I found was about dungeon generation[0] although I've been assured they're used all over game dev for things other than plants!

[0]: https://www.gamasutra.com/blogs/OsamaAlsalman/20180827/32531...



Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: