Thread:LOTRMod/@comment-29101335-20160724200010/@comment-25101089-20160724230201

Codebreaker 2100 wrote: One question, Mevans: The Hobbit Tavern is the largest structure in the mod currently? Well, what about the Tauredain Pyramid? High Elven tower was already larger than the Tauredain pyramid, judged both by lines of code, and by file size. So was the Hobbit hole, and also two other new structures coming this update (one of which is a redesign, not including the hobbit tavern).

The Dorwinion house was larger by file size, and so is another new structure coming this update.

This might seem surprising, but despite the Tauredain pyramid being very large it's actually quite a simple structure. It only has a few rooms in it and they all follow simple patterns. Whereas, something like a tavern is a lot less regular and has many distinct parts, and thus the code to generate it is larger. (It's like image compression tbh)

Wurquhart8 wrote: Yeah wait what.. how deep does that underground cellar go?

You'll have to wait and see! (Or work it out from the code :^))

Fenrir lokisen wrote: LOTRMod wrote: Sure! This is the code file for the new Hobbit Tavern design which is coming in the next update:

http://pastebin.com/QxyUhFVh

Note that at over 2000 lines of code this is by far the longest structure code in the mod currently. Here's a simpler structure to compare it to, the Dwarf Smithy.

Dwarf Smithy: http://pastebin.com/S1EsPUBW

(The base structure file is around 1000 lines of code, as GandalftheTurquoise said, and that handles things like setting up the structure, rotating it appropriately, working out how blocks should be rotated properly, and various utility methods like placing chests/mugs/barrels etc.)

Now it is true that I might be giving myself a little too much work here, by manually coding them all. The structures could just be scanned in using schematics or whatever. But then they wouldn't be able to have random block types and randomised chests/barrels/etc, and they wouldn't adapt to the terrain or detect where would be suitable to spawn, unless I did some extra work to make that possible - and at that point, I'd be manually coding much of the structure anyway. WOW! thats amazing how much code there is in a little structure! And i think mojang just "scans" in the structures like villages,igloos, etc. and that is why there are so many glitches in there structures when the generate.

From what I've seen of the code it looks like their structures are hand-coded too. Well, the old ones at least: there is that new structure block in 1.9, which looks like it performs this sort of 'scanning' function and also has some randomisation features enabled, so the new End Cities may have been scanned in. I haven't checked it out in detail or seen the code, though.