[Solved] Missing UV mapping and gaps in dungeon mesh

Post here if you need help getting started with Daggerfall Unity or just want to clarify a potential bug. Questions about playing or modding classic Daggerfall should be posted to Community.
User avatar
XJDHDR
Posts: 120
Joined: Thu Jan 10, 2019 5:15 pm
Location: New Zealand
Contact:

[Solved] Missing UV mapping and gaps in dungeon mesh

Post by XJDHDR »

While exploring a dungeon in Daggerfall (The Lair of Gondyn), I found a piece of the dungeon that appears to have some gaps in the mesh as well as missing UV mapping or textures.

Here are 3 screenshots I took of the problems:
https://imgur.com/a/ConG5TS

Here is a save I made standing on the bugged staircase:
https://forums.dfworkshop.net/download/file.php?id=5506

The question is whether this is a bug in DFU's rendering engine or (more likely) a bug in the mesh itself. If the latter, I can make an attempt at fixing this one but I have no idea how to figure out which mesh this one is. If anyone can tell me what program Ferital was using in this post, that would help a lot.
Last edited by XJDHDR on Sat Jan 09, 2021 5:08 am, edited 1 time in total.

User avatar
pango
Posts: 2749
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: Missing UV mapping and gaps in dungeon mesh

Post by pango »

Yes it's game-data brokeness, but there's some mechanism in DFU to override bytes read from classic game-data so the situation is not totally hopeless ;) Using this mechanism Ferital is also fixing Uv bugs reported here in batches.
I'm not sure what can be done for missing textures, hopefully at list give them a correct color...

And I have no idea how he does that magic; Probably using custom tools developed over the years,..
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

User avatar
BadLuckBurt
Posts: 578
Joined: Sun Nov 05, 2017 8:30 pm

Re: Missing UV mapping and gaps in dungeon mesh

Post by BadLuckBurt »

As far as I know, Ferital is manipulating the bytes in memory when looking at the models in Daggerfall Imaging. No idea how exactly.

I will have a look at your savegame. Its possible that dungeon block is just sloppily put together. The 'untextured' parts look like they just have a base texture applied which are solid color textures from DFs texture set.

- edit

I had a look and I think this is just a case of being sloppily positioned and crappy texturing.

This is the model in Blender and TEXTURE.000-123 is a solid color texture applied to the vertical sides of those steps so this seems intentional though ugly as sin. The same goes for the ceiling from your screenshots, that's a separate mesh which also has a solid texture applied to the ceiling part.

Image
Daggerfall Unity on UESP: https://en.uesp.net/w/index.php?title=T ... fall_Unity
Daggerfall Unity on Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt

User avatar
XJDHDR
Posts: 120
Joined: Thu Jan 10, 2019 5:15 pm
Location: New Zealand
Contact:

Re: Missing UV mapping and gaps in dungeon mesh

Post by XJDHDR »

@BadLuckBurt
Thanks for the help. I just found that mesh myself. 56000
Did you do anything special to find it? I resorted to opening DF Modelling and mashing up/down until I spotted it.

Edit: The only explanation I can think of for this is that the employee was short on time and had to rush through these meshes. Also, this is a different mesh. Notice the wall next to the stairs and floor are using different textures. So there are at least two meshes with this same ugly texturing.

@Pango
It looks like Ferital has a different approach to fixing this to me. His seems to be adding workarounds to DFU's code to make these meshes work whereas mine is to fix the meshes themselves.

User avatar
BadLuckBurt
Posts: 578
Joined: Sun Nov 05, 2017 8:30 pm

Re: Missing UV mapping and gaps in dungeon mesh

Post by BadLuckBurt »

XJDHDR wrote: Wed Apr 01, 2020 7:39 am @BadLuckBurt
Thanks for the help. I just found that mesh myself. 56000
Did you do anything special to find it? I resorted to opening DF Modelling and mashing up/down until I spotted it.

Edit: The only explanation I can think of for this is that the employee was short on time and had to rush through these meshes.
I've spent some time mapping the model IDs to a 'sane' description so I can more easily construct a custom dungeon from vanilla pieces and I recognised / remembered that model because of that ugly look. A couple of the other dungeon models like trapdoors / elevators also suffer the same 'placeholder' texturing.

I have the list I'm working on in a repository on Github, it's model-flat-names.ods: https://github.com/BadLuckBurt/dfu-data-lists. It's not finished yet and I haven't had the drive to continue but I did a good chunk of the dungeon models, trying to identify the different sets.
Daggerfall Unity on UESP: https://en.uesp.net/w/index.php?title=T ... fall_Unity
Daggerfall Unity on Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt

User avatar
pango
Posts: 2749
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: Missing UV mapping and gaps in dungeon mesh

Post by pango »

XJDHDR wrote: Wed Apr 01, 2020 7:39 am @Pango
It looks like Ferital has a different approach to fixing this to me. His seems to be adding workarounds to DFU's code to make these meshes work whereas mine is to fix the meshes themselves.
Yes
It's not too different, but applying patches in memory instead of directly into the file
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

User avatar
Ferital
Posts: 252
Joined: Thu Apr 05, 2018 8:01 am

Re: Missing UV mapping and gaps in dungeon mesh

Post by Ferital »

pango wrote: Wed Apr 01, 2020 6:23 am And I have no idea how he does that magic; Probably using custom tools developed over the years,..
I use a modified version of my own of DF Modelling which is only able to generate broken textures fixes at the moment. It relies on a quick and dirty hack of Interkarma's original code, it's not documented and is not aimed at fixing anything else at the moment.
XJDHDR wrote: Wed Apr 01, 2020 7:39 am It looks like Ferital has a different approach to fixing this to me. His seems to be adding workarounds to DFU's code to make these meshes work whereas mine is to fix the meshes themselves.
My approach is to patch the original data at runtime, it's not a workaround. I took this idea from a more than 20 years old DF hacking tool called "Fallhack", which was bundled with the Andyfall mod.

User avatar
XJDHDR
Posts: 120
Joined: Thu Jan 10, 2019 5:15 pm
Location: New Zealand
Contact:

Re: Missing UV mapping and gaps in dungeon mesh

Post by XJDHDR »

Ferital wrote: Thu Apr 02, 2020 4:42 pm I use a modified version of my own of DF Modelling which is only able to generate broken textures fixes at the moment. It relies on a quick and dirty hack of Interkarma's original code, it's not documented and is not aimed at fixing anything else at the moment.
In the post I referenced, it looks like you had the dungeon the post was about loaded up in a viewer with all it's contents and you were able to select the individual models. Is this something the original DF Modelling can do, is it something you added to your copy or is it something else?
Just took another look and now I see how you did it. Until now, I thought DF Modelling was just a model viewer and didn't notice the option to search locations. Using this new knowledge, I found the Lair of Gondyn, found the staircase in question and then double-clicked on it to find that it is indeed model #56000 that has these gaps and ugly texturing. I also noticed that this dungeon has a lot of unconnected pieces floating in the void. This explains why I kept hearing Daedra Lords laugh at me but never found them.
https://imgur.com/D5fkzX0
https://imgur.com/1cy4jHu
Ferital wrote: Thu Apr 02, 2020 4:42 pm My approach is to patch the original data at runtime, it's not a workaround. I took this idea from a more than 20 years old DF hacking tool called "Fallhack", which was bundled with the Andyfall mod.
Perhaps we have a different definition of "workaround" then. My approach would be to fix the mesh and ensure that DF Unity receives a mesh that is working properly. Your approach is for the engine to accept the buggy mesh as-is then patch it's in-memory copy in the background.

User avatar
BadLuckBurt
Posts: 578
Joined: Sun Nov 05, 2017 8:30 pm

Re: Missing UV mapping and gaps in dungeon mesh

Post by BadLuckBurt »

The unconnected floating meshes are from dungeon border blocks and intended. These blocks surround the main blocks on all sides to ensure a sealed dungeon. Dpepending on which side of the main block a border block is on, different parts will be connected.

Providing DFU with a replacement meshes is an option I considered as well but Feritals approach seemed to be working well and may even be preferred.
Daggerfall Unity on UESP: https://en.uesp.net/w/index.php?title=T ... fall_Unity
Daggerfall Unity on Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt

User avatar
pango
Posts: 2749
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: Missing UV mapping and gaps in dungeon mesh

Post by pango »

Yup, it does not impact classic Daggerfall, can be done at game run time without requiring write access to classic Daggerfall files (nothing in DFU currently requires that), and is fully reversible, in case you have some buggy release, to name the benefits I can think of...
Last edited by pango on Thu Apr 02, 2020 8:48 pm, edited 1 time in total.
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

Post Reply