[Solved] How are dungeon texture variations implemented?

Discuss modding questions and implementation details.
User avatar
TheLacus
Posts: 1305
Joined: Wed Sep 14, 2016 6:22 pm

Re: How are dungeon texture variations implemented?

Post by TheLacus »

XJDHDR wrote: Thu Jul 30, 2020 8:35 am @TheLacus, am I doing something wrong here? I cloned your repository and loaded it into the editor to test your PR.
The model must be in the child hierarchy of dungeon gameoject (wich holds the component DaggerfalDungeon). Can you check if this is true for the models you have tested?
Attachments
dungeon_example.jpeg
dungeon_example.jpeg (126.75 KiB) Viewed 1733 times

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

Re: How are dungeon texture variations implemented?

Post by XJDHDR »

TheLacus wrote: Wed Aug 05, 2020 8:11 pm The model must be in the child hierarchy of dungeon gameoject (wich holds the component DaggerfalDungeon). Can you check if this is true for the models you have tested?
I can confirm that this is the case. My test procedure was to start the game in the editor then load a save where my character was standing near the model in question.

Maybe it will help if I include a copy of the model I am working on.
9004.zip
(8.42 KiB) Downloaded 126 times
Attachments
Daggerfall Unity editor screenshot.png
Daggerfall Unity editor screenshot.png (482.81 KiB) Viewed 1718 times

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

Re: How are dungeon texture variations implemented?

Post by XJDHDR »

I'm not sure if this helps but I just noticed that the model in your image with the Dungeon Texture Table feature working is a new object whereas all of the models that I'm working on in my screenshots are not new objects. They are model replacements for objects that are already in the game.

Maybe that could be the reason it isn't working in my case?

User avatar
TheLacus
Posts: 1305
Joined: Wed Sep 14, 2016 6:22 pm

Re: How are dungeon texture variations implemented?

Post by TheLacus »

XJDHDR wrote: Mon Aug 10, 2020 11:00 pm I'm not sure if this helps but I just noticed that the model in your image with the Dungeon Texture Table feature working is a new object whereas all of the models that I'm working on in my screenshots are not new objects. They are model replacements for objects that are already in the game.

Maybe that could be the reason it isn't working in my case?
Yes, the issue is probably the way imported objects are parented to dungeon. Dungeon component must be available in hierarchy when object parent changes, but apparently this is not the case here. I'll see what i can do.

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

Re: How are dungeon texture variations implemented?

Post by XJDHDR »

I just took a look at the latest version of TheLacus' pull request and it's better than before.

The door that is shown in my OP now displays the correct texture:
Door correct texture.jpg
Door correct texture.jpg (46.57 KiB) Viewed 1546 times
However, the tower models in my OP are still purple:
Tower still purple.jpg
Tower still purple.jpg (55.74 KiB) Viewed 1546 times
If it helps, I'll include a copy of the models I tested that are still missing textures and a save game you can use to test:
58036.zip
(404.06 KiB) Downloaded 121 times

User avatar
TheLacus
Posts: 1305
Joined: Wed Sep 14, 2016 6:22 pm

Re: How are dungeon texture variations implemented?

Post by TheLacus »

Thank you for save and models for testing.

It didn't work in your second example because RuntimeMaterials component isn't on root of prefab but on a child. I think this is a valid use case, so i reworked assignment of texture table to be event based. This will ensure it also works if is not on root of prefab, without performance implications for classic layout or custom prefabs without this component (unlike alternatives like GetComponentInChildren).

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

Re: How are dungeon texture variations implemented?

Post by XJDHDR »

And thank you very much for working on this. I'll give your new code a try when I get home tonight.

The reason my second set of prefabs were set up that way was because my models were originally OBJs. When you generate prefabs from one, the prefab gets that child attached. This was not the case with my door prefab because the model was an FBX, which does not create children.

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

Re: How are dungeon texture variations implemented?

Post by XJDHDR »

Took longer than I thought but I've managed to test the tower models and they are now working. I've got a bunch of other models I need to test that also need this dungeon texture table feature but I think this commit is probably ready to be merged into DFU. If this can happen before the .26 release, even better.

Post Reply