r/howdidtheycodeit • • Jul 18 '24

How does terraria generate structures

I'm kind of curious how terraria generates structures like the dungeon, the jungle temple, etc. My initial thoughts would be too generate a bunch of points, indicating different sizes, fill in the space between points with blocks and then basically carve out the space between them, using the points to determine the size/height of the corridors.

But I'm wondering if that is a naive approach.

8 Upvotes

16 comments sorted by

View all comments

Show parent comment

1

u/soljakwinever Jul 18 '24

Thank you, I appreciate your response. So you're saying that I should make the dungeon it's own biome, and put the logic I require for generating rooms in there? I'm guessing since the dungeon in terraria is a structure, it would be generated after all the other biomes have been generated so it can be put on top of them?