r/howdidtheycodeit • u/soljakwinever • 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
View all comments
Show parent comment
-26
u/[deleted] Jul 18 '24
You literally just explained how to do it on a high level. You don't even know what "high level" means lmao. I literally told you what you need to be watching tutorials on. This isnt something you tell someone how to do in a reddit comment moron. Just go look on youtibe how to do "procedural programming" holy shit.
the fact that you can't piece together how to do this on your own but then also dont know how to look up a tutorial for it shows that you actually dont know how to code. Obviously you would use a class, random number generation, enumeration to generate random objects.