Wilderness Overhaul

Show off your mod creations or just a work in progress.
Post Reply
User avatar
Daniel87
Posts: 391
Joined: Thu Nov 28, 2019 6:25 pm

Re: Wilderness Overhaul

Post by Daniel87 »

l3lessed wrote: Thu Apr 22, 2021 9:10 pm Do it all the time myself. I can't tell you how many hours I wasted coding stuff or working on stuff for my mods just to scrap everything because I found a better approach.

Understanding how tiles are assigned will be helpful anyways once I get back to the interactive terrain mod. The code is setup for it and I submitted the speedchanger script updates to the pull request. However, until now, tile assignments and ids were a mystery to me. Getting the documentation from interkarma and you is helpful. This verified that I need to be excluding transition tiles in that mod and having movement only affected when the user moves from one filled tile type(all snow tile) to another filled tile type(all sand tile) and some weird movement changes are a result of odd tile transitions. Interactive terrain with this mod would make the landscape feel much more immersive, alive, and realistic. Combine it with the climates mod, and we will have some real brutal immersion. Won't it be fun trying to make it through a desert without dehydrating, when you are slowed down by the soft sand. Or have fun trying to track through thick snow in the middle of a snow storm and not freeze to death.
I would very much love to have this immersive survival mod/realism in the game :D Excited!!

There might be something I could need your understanding of tiles and some advice from you.

Code: Select all

static byte MakeLookup(int index, bool rotate, bool flip)
{
    if (index > 55)
        throw new IndexOutOfRangeException("Index out of range. Valid range 0-55");
    if (rotate) index += 64;
    if (flip) index += 128;

     return (byte)index;
}
This bit of code handles rotation and flip of the texture. I figured out that "rotate" will rotate the tile texture by 90 degree counter clock-wise.
But what exactly does flip? Does it mirror/flip horizontally + vertically? Is there a way to control which axis to flip over? Otherwise it will be impossible to account for some texture cases I just found out.

I can't find the link to the documentation of the DF files, do you have the URL?
In Julianos we Trust.

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

Re: Wilderness Overhaul

Post by BadLuckBurt »

Daniel87 wrote: Fri Apr 23, 2021 7:59 am This bit of code handles rotation and flip of the texture. I figured out that "rotate" will rotate the tile texture by 90 degree counter clock-wise.
But what exactly does flip? Does it mirror/flip horizontally + vertically? Is there a way to control which axis to flip over? Otherwise it will be impossible to account for some texture cases I just found out.

I can't find the link to the documentation of the DF files, do you have the URL?
It's a 180 degree rotation, calling it 'flip' always ticked me off because that's not what it does. Rotate indeed does 90 degrees, 'flip' does 180 and both combined result in 270 degrees.
DFU on UESP: https://en.uesp.net/w/index.php?title=T ... fall_Unity
DFU Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt

.

User avatar
Daniel87
Posts: 391
Joined: Thu Nov 28, 2019 6:25 pm

Re: Wilderness Overhaul

Post by Daniel87 »

BadLuckBurt wrote: Fri Apr 23, 2021 8:30 am
Daniel87 wrote: Fri Apr 23, 2021 7:59 am This bit of code handles rotation and flip of the texture. I figured out that "rotate" will rotate the tile texture by 90 degree counter clock-wise.
But what exactly does flip? Does it mirror/flip horizontally + vertically? Is there a way to control which axis to flip over? Otherwise it will be impossible to account for some texture cases I just found out.

I can't find the link to the documentation of the DF files, do you have the URL?
It's a 180 degree rotation, calling it 'flip' always ticked me off because that's not what it does. Rotate indeed does 90 degrees, 'flip' does 180 and both combined result in 270 degrees.
Thanks for the clarification!
So there is no way of flipping horizontally/vertically, right?
This will make it impossible to use the tiles combining 3 types of landscape (by example dirt, 2x water. stone). What a pitty :/
Do you know of a way to import custom tile textures? I could just mirror them in photoshop and import them to have the ones I need.

Actually flip is correct here, as 180° rotation is the same as flipping horizontally once and then flipping vertically once.
In Julianos we Trust.

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

Re: Wilderness Overhaul

Post by BadLuckBurt »

Daniel87 wrote: Fri Apr 23, 2021 9:13 am Thanks for the clarification!
So there is no way of flipping horizontally/vertically, right?
This will make it impossible to use the tiles combining 3 types of landscape (by example dirt, 2x water. stone). What a pitty :/
Do you know of a way to import custom tile textures? I could just mirror them in photoshop and import them to have the ones I need.

Actually flip is correct here, as 180° rotation is the same as flipping horizontally once and then flipping vertically once.
Flipping horizontally and vertically at the same time is just a 180 rotation in my book but that's semantics and I see your point :D

You're correct, you can't flip in one direction currently. It does limit the use of the 3-way terrain tiles but they can be used, they help to break up the 'grid' when used correctly.

If this article still applies: https://www.dfworkshop.net/improved-terrain-tiling/, it should be possible to add your one-way flips in that atlas as it's constructed but I'll leave it up to Interkarma to say the final word about that. Right now it's tailored to the classic Daggerfall layouts that only do the rotational stuff. It will complicate the code a bit more though because you get more cases to work with. As long as it's implemented correctly, I don't think it should interfere with the classic data though since you're just adding tiles, not changing.
DFU on UESP: https://en.uesp.net/w/index.php?title=T ... fall_Unity
DFU Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt

.

User avatar
Daniel87
Posts: 391
Joined: Thu Nov 28, 2019 6:25 pm

Re: Wilderness Overhaul

Post by Daniel87 »

BadLuckBurt wrote: Fri Apr 23, 2021 9:55 am
Daniel87 wrote: Fri Apr 23, 2021 9:13 am Thanks for the clarification!
So there is no way of flipping horizontally/vertically, right?
This will make it impossible to use the tiles combining 3 types of landscape (by example dirt, 2x water. stone). What a pitty :/
Do you know of a way to import custom tile textures? I could just mirror them in photoshop and import them to have the ones I need.

Actually flip is correct here, as 180° rotation is the same as flipping horizontally once and then flipping vertically once.
Flipping horizontally and vertically at the same time is just a 180 rotation in my book but that's semantics and I see your point :D

You're correct, you can't flip in one direction currently. It does limit the use of the 3-way terrain tiles but they can be used, they help to break up the 'grid' when used correctly.

If this article still applies: https://www.dfworkshop.net/improved-terrain-tiling/, it should be possible to add your one-way flips in that atlas as it's constructed but I'll leave it up to Interkarma to say the final word about that. Right now it's tailored to the classic Daggerfall layouts that only do the rotational stuff. It will complicate the code a bit more though because you get more cases to work with. As long as it's implemented correctly, I don't think it should interfere with the classic data though since you're just adding tiles, not changing.
Cool, I will have a look into this after dentist.
One problem will remain nevertheless: There are no tiles featuring all 4 terrain types for each corner, as well as tiles that feature two of the same terrain type in opposing directions plus two different ones in opposing position like (dirt, water, dirt, stone) or (water, grass, water, dirt), etc.

I just sent King of Worms a PN about this and asked if he would be willing to help me create the missing tiles as well as the mirrored versions, so we could append it to the existing tile catalogue of original DFU as well as his DREAM mod. Let's where we can get when putting our strengths together :)

Currently it looks like this, due to the lack of mirroring tile textures.
Image

I have no bloody idea how I can expand on the existing tile set. Can anybody hint me at the right direction? I read through the following article: https://www.dfworkshop.net/projects/dag ... /textures/ but it didn't really help me much.
In Julianos we Trust.

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

Re: Wilderness Overhaul

Post by BadLuckBurt »

Daniel87 wrote: Fri Apr 23, 2021 10:04 am Cool, I will have a look into this after dentist.
One problem will remain nevertheless: There are no tiles featuring all 4 terrain types for each corner, as well as tiles that feature two of the same terrain type in opposing directions plus two different ones in opposing position like (dirt, water, dirt, stone) or (water, grass, water, dirt), etc.

I just sent King of Worms a PN about this and asked if he would be willing to help me create the missing tiles as well as the mirrored versions, so we could append it to the existing tile catalogue of original DFU as well as his DREAM mod. Let's where we can get when putting our strengths together :)

I have no bloody idea how I can expand on the existing tile set. Can anybody hint me at the right direction? I read through the following article: https://www.dfworkshop.net/projects/dag ... /textures/ but it didn't really help me much.
You can't simply expand the existing tilesets, the code needs to be altered to accommodate them too since the current algorithm can't handle them. I'd love to help out here but I'm in the same boat as you. It's also a pretty complex thing to code, this is why more modern games use the splatmap approach.

Anyway, if you export the terrain textures from Daggerfall Imaging, you can load them into Tiled: https://www.mapeditor.org/. I spent some time setting up a basic auto-mapping (it automatically places certain tiles when you create a pattern it recognises), you can get that stuff here: https://github.com/BadLuckBurt/tiled-da ... in-automap. There's a brief explanation in the docs but you don't necessarily need to use the automapping.

This way you can get a feel what can be done with the existing tiles. Expanding the existing tileset would have to be done manually for the most part.
DFU on UESP: https://en.uesp.net/w/index.php?title=T ... fall_Unity
DFU Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt

.

User avatar
Daniel87
Posts: 391
Joined: Thu Nov 28, 2019 6:25 pm

Re: Wilderness Overhaul

Post by Daniel87 »

Smoll Update:

After cracking my skull on how to add new tile transitions into the existing texture array, thanks to TheLacus' PR, I was finally able to create new Texture2DArrays and load them into the game instead of the original texture atlas. Since DFU still uses a byte to encode orientation and rotation as well as the index of the texture in its Array, the limit of textures that can be used remains 64. So to circumvent this limitation, I had to create one basic rule for my terrain texturing: Water only borders dirt. This allowed me to remove a couple of unused textures and create the space necessary for additional terrain transitions that did not exist before (Thanks to my awesome Photoshop-Superpowers).
I've finished the Temperate Texture Set now and will move on to the other two to finally complete this part of my journey.

Image
In Julianos we Trust.

User avatar
carademono
Posts: 210
Joined: Sat Jul 11, 2020 3:20 pm

Re: Wilderness Overhaul

Post by carademono »

Mindblowing work!

User avatar
King of Worms
Posts: 4752
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: Wilderness Overhaul

Post by King of Worms »

Water only borders dirt.
Now I get it, well thats really clever and overall this progress is just great to observe... skills!

User avatar
Daniel87
Posts: 391
Joined: Thu Nov 28, 2019 6:25 pm

Re: Wilderness Overhaul

Post by Daniel87 »

King of Worms wrote: Mon Apr 26, 2021 5:24 pm
Water only borders dirt.
Now I get it, well thats really clever and overall this progress is just great to observe... skills!
Thanks! :)
Yeah, by having water only border dirt (beach), I was able to remove almost half of all textures and add in the mirrored ones.

Thank you for pointing me to a huge problem - the location textures are a mess.
I now switch between two methods of texturing the terrain depending on the existence of a location on the terrain or not.
On terrains with locations, transitions between dirt, grass and stone might look crappy. Until I have a way of using two Materials on the same terrain
(one for locations and one for the terrain itself) this will have to do. These arbitrary limitations are just too frustrating...

Before the "quick n dirty" fix:
Image

After the fix (keep in mind that the screenshot features a relatively lucky case of terrain. It might even be possible that in some situations a water tile gets dislayed because the tile texture simply doesn't exist in the standard material of DFU :(( ):
Image
In Julianos we Trust.

Post Reply