Advertisement
Guest User

Untitled

a guest
Jun 4th, 2022
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.85 KB | None | 0 0
  1. RDB dungeon block setup:
  2.  
  3. Classic dungeon blocks
  4.  
  5. The original dungeons in Daggerfall are made up of blocks that measure 51.2 x 51.2 units on the X and Z axes in Unity with the lowest point of a dungeon block always sitting at 0 on the Y-axis.
  6.  
  7. To give you a sense of scale: 1 unit in Unity is 1 meter so each dungeon blocks is 51.2 x 51.2 meters. You can confirm this by changing the grid settings in Unity's Scene view so that the grid size is 51.2. If you then switch the Scene's camera mode from Perspective to Isometric and click on the Y-axis of the widget that sits in the top-right of the Scene view, each cell of the grid shown will be precisely the size of one dungeon block. Try loading an RDB into the World Data Editor and you will see this is true.
  8.  
  9. This information is important for a functioning minimap as well as the water level of a dungeon block, I will further explain why later.
  10.  
  11. The original dungeon blocks in Daggerfall can be split up into 2 categories: Border blocks and main blocks.
  12.  
  13. Blocks explained:
  14.  
  15. Main blocks:
  16.  
  17. The main blocks make up the part of the dungeon where you can find quest related items, NPCs and enemies. These are the Nxxxxxx and Wxxxxxxx blocks mentioned here (link UESP). There are also Bxxxxxx, Mxxxxxx and Sxxxxxxx blocks, I will explain the purpose of all these blocks below.
  18.  
  19. Nxxxxxx blocks (main blocks):
  20.  
  21. These are the core blocks of a dungeon without water present.
  22.  
  23. Wxxxxxx blocks (main blocks):
  24.  
  25. These are the core blocks of a dungeon that have water present.
  26.  
  27. Bxxxxxx blocks:
  28.  
  29. The border blocks serve to make the main blocks air-tight. They accomplished this by always having passages line up between the main blocks and the border blocks. The border blocks can be identified by the Bxxxxxx name.
  30.  
  31. Open a border block RDB in World Data Editor and you will see that on each edge (north, east, south, west) of the block there are two connecting passages. These line up with passages in the main blocks. This is also why you see inaccessible areas when you reveal the entire dungeon map using console commands.
  32.  
  33. Sxxxxxx blocks:
  34.  
  35. These are handcrafted blocks used for the construction of the main quest dungeons.
  36.  
  37. Mxxxxxx blocks:
  38.  
  39. These are the blocks used for the tiny cemetery dungeons we loot for easy cash.
  40.  
  41. The cemetery dungeons are still surrounded by border blocks because they were procedurally generated and they never bothered to adjust the ruleset.
  42.  
  43. General block information:
  44.  
  45. Any block that has a Start marker present (Texture archive 199 - record 10) can have its own water level, this means you can have a dungeon with varying water levels. When working with classic blocks, only the Wxxxxxx variety will have a water level set.
  46.  
  47. The water level is determined by assigning an integer value larger than 0 to the SoundIndex property of the Start marker. Ask Julian LeFay if you want to know why.
  48.  
  49. Dungeon layout:
  50.  
  51. The dungeon blocks themselves are laid out on the grid using integer offsets, take a look at this image from my HTML-based location editor which illustrates how this works. Any block with a Start marker in it can function as the entrance block of a dungeon but like Highlander, there can be only one.
  52.  
  53. So the core layout of a dungeon is defined by main blocks which are then surrounded on all sides by border blocks to seal off the dungeon.
  54.  
  55. If you're still with me at this point, you have now learned the basics of what makes up a Daggerfall dungeon and what function the different blocks serve.
  56.  
  57. ----------------------------------------------------------------------------------
  58.  
  59. 3d models and the multiples of 2
  60.  
  61. I will now explain a bit more about the grid size and working with the 3d models that make up a dungeon block.
  62.  
  63. In classic Daggerfall, a dungeon block was originally 2048 x 2048 units (old computers worked best with whole numbers, read more about that here if you want). Daggerfall Unity divides that number by 40 which is how we end up with a dungeon block being 51.2 x 51.2 units.
  64.  
  65. The same is done to the original models to scale them down to proper Unity size. At one time I dumped the original model sizes from Daggerfall Unity before they were scaled down and noticed a pattern that the width and length of a model most of the times corresponds to numbers that can be divided by 2.
  66.  
  67. For example, in the original data a square passage model will be around 128x128 units in length and width. Dividing 128 by 40 gives us 3.20 meters so the same model is 3.2 by 3.2 meters in Unity. The height of the model doesn't necessarily conform to a multiple of 2 but that doesn't really matter.
  68.  
  69. This means you could fit 16 of these models along the length or the width of a dungeon blocks since 51.2 / 3.2 = 16. Ofcourse that's not what you want to do most of the time but it's just to give you an idea how these models fit unto the grid.
  70.  
  71. Anyone who has used the editing tools of the later Bethesda games to make layouts should be familiar with this pattern, they probably refined it a lot over the years (I've only done it for Morrowind) but the principle has never changed.
  72.  
  73. I have a list available here (link) with the original sizes for each model and their corresponding Unity size. You don't need this necessarily but it might be of help to understand this better.
  74.  
  75. Knowing that the model sizes are mostly compatible with the block size allows us to set a snap value in Unity's grid settings that makes it easier to create a layout without having to finetune each and every model's placement.
  76.  
  77. I recommend using a snap setting of 0.64, if we ignore the 0. part, the number is 64 which is a multiple of 2. If you move a model 5 steps with this snap setting, it will have moved 3.2 meters since 0.64 times 5 is 3.2.
  78.  
  79. You can always change the grid setting to something else for finetuning (smaller snap setting) or bigger steps to work faster, just keep in mind that numbers that are a multiple of 2 probably work best. There will always be exceptions to the rule however where you will have to resort to more tedious finetuning but that is mostly for smaller or special models.
  80.  
  81. This also applies if you want to make custom models for a dungeon so keep that in mind. You can use different measurements but may start to run into issues on the edge of the block where it's supposed to connect to another block. Just be smart about it or stick to the multiples of 2 rule, in most case that will work out.
  82.  
  83. ----------------------------------------------------------------------------------
  84.  
  85. WARNING: Note that Daggerfall Unity will NOT complain when you exceed the boundaries of the block size but it may screw up water placement and / or the minimap depending on how far you exceed the boundary. If this happens, you're on your own, the information above should be more than enough to avoid this issue.
  86.  
  87. ----------------------------------------------------------------------------------
  88.  
  89. Rotation and their issues:
  90.  
  91. When building a dungeon block, rotations around two or more axes may cause issues because of a difference between the way rotations worked in classic Daggerfall vs the way Unity works with rotations internally.
  92.  
  93. I will not explain this in-depth, check my Rotation Wars thread if you want a rough idea. This issue has caused Interkarma severe trouble in the past and I have dealt with it myself a few times now, it is NOT fun to even try and understand what is going on under the hood when this happens. I thank Julianos I had for the moment of clarity where it clicked.
  94.  
  95. The thread I refer to has a proposed solution but needs to be discussed further once Interkarma feels up to it, DO NOT BUG HIM OR COMPLAIN ABOUT THE ISSUE because I will not entertain any of that.
  96.  
  97. As far as I am concerned, he has earned the right to take this at his own pace considering the grief it has caused him in the past. No matter how much the community has contributed, this is HIS project so what he decides goes. If you disagree with that, fight me.
  98.  
  99. Just be aware for now that rotating an object around 2 or more axes may not give you the desired result once you load it into the game, it will still look fine in the editor after saving and reloading but it WILL NOT look right in-game until this is resolved. Either stick to rotations that work (trial and error, not an exact science) or wait until we are done discussing this. At which point the issue should resolve itself after an agreed upon fix is implemented.
  100.  
  101. As long as you only rotate an object around 1 axis I can guarantee it will work 99,9% of the time but rotate around 2 or more axes and you're going down the rabbit hole. It 'might' work in some cases, it will not in others.
  102.  
  103. ----------------------------------------------------------------------------------
  104.  
  105.  
  106.  
  107.  
  108. Recap:
  109.  
  110. Dungeon block size: 51.2 x 51.2 meters
  111. Main blocks make up the dungeon core
  112. Border blocks seal that dungeon core from the void
  113. Water levels can be set per block provided that the block has a Start marker present
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement