[MOD] Interesting Terrains [WIP]

Show off your mod creations or just a work in progress.
Post Reply
User avatar
Hazelnut
Posts: 3016
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: [MOD] Interesting Terrains [WIP]

Post by Hazelnut »

monobelisk wrote: Thu Aug 27, 2020 10:56 am
Yes, I am overwriting the terrain textures completely (in order to paint rock texture on steep mountaneous terrain), but it's funny you should mention it because I actually do have your upcoming mod in mind. If it's possible to obtain the road layout data, it could be sent to the compute shader and it would be possible to both smoothen areas with roads and retain the original road texture during tilemap sampling, much like how locations are currently handled. I assume your mod will be using a custom TerrainTexturer?
Yes my roads are done in a custom TerrainTexturer implementation so I could make it as efficient as possible. I expect someone will make fancy roads at some point, but I want my simpler more basic roads to work on any machine that can run DFU okay and also to allow for time accelerated travel with minimal impact.

I already have make the road data available to other mods so my Travel Options mod can use it, so that's easy enough for you to grab. If you do migrate to a TerrainSampler and TerrainTexturer implementation, then you'd need to collaborate with me so the mods are compatible since only one TerrainTexturer implementation can be used. It would be easy enough for me to disable mine or to set up the dependency to ensure your mod always comes after mine in the ordering and then you would paint the roads if my mod was installed. Alternatively I could ensure that the road painting was also exposed for you to call, but that could conflict with the GPU delegation - I am not sure where that bit is happening in your code.

I'm sure we can figure it out anyway. :)
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
Hazelnut
Posts: 3016
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: [MOD] Interesting Terrains [WIP]

Post by Hazelnut »

MasonFace wrote: Thu Aug 27, 2020 2:31 pm May I suggest that you both keep TheLacus's Splat Terrain Texturing in mind with your implementations? It would be awesome to have the roads mod optionally output a spline curve as its path to smooth out the terrain topology, but also paint a path directly onto the splatmap so the road curves are less jagged and ugly.
Well I've pretty much finished my implementation now and have no idea what splat maps are (gfx dunce here) so not going to be able to keep it in mind. Sorry. Not that this would stop the creation of any enhancements, though I should be clear that it's based on each map pixel centre being where the incoming roads meet and that is a constraint, but between these centre points fancy stuff could be done. Right now it's really simple and heavily optimised, but the road data could definitely drive other painting methods.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

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

Re: [MOD] Interesting Terrains [WIP]

Post by King of Worms »

Splatmaps are the future of DFU terrain texture mapping :)

monobelisk
Posts: 75
Joined: Tue Aug 25, 2020 10:43 am

Re: [MOD] Interesting Terrains [WIP]

Post by monobelisk »

Hazelnut wrote: Thu Aug 27, 2020 5:14 pm Yes my roads are done in a custom TerrainTexturer implementation so I could make it as efficient as possible. I expect someone will make fancy roads at some point, but I want my simpler more basic roads to work on any machine that can run DFU okay and also to allow for time accelerated travel with minimal impact.

I already have make the road data available to other mods so my Travel Options mod can use it, so that's easy enough for you to grab. If you do migrate to a TerrainSampler and TerrainTexturer implementation, then you'd need to collaborate with me so the mods are compatible since only one TerrainTexturer implementation can be used. It would be easy enough for me to disable mine or to set up the dependency to ensure your mod always comes after mine in the ordering and then you would paint the roads if my mod was installed. Alternatively I could ensure that the road painting was also exposed for you to call, but that could conflict with the GPU delegation - I am not sure where that bit is happening in your code.

I'm sure we can figure it out anyway. :)
I've discovered that it's fully possible to recreate the terrain basemap in my shaders from the original 1000x500 heightmap! So I'll be moving to a custom TerrainSampler :D Furthermore, I'll move to a custom TerrainTexturer (in which I also deploy a compute shader).

So I'm thinking after I make those changes, the route to compatibility could look like this:
  1. I create a separate compatibility mod
  2. In that mod, I extend my heightmap sampler to include and process the road data from your mod
  3. I create a terrain texturer that merges my own with the one from your mod (I may have to "borrow" some of your code for that, if that's okay)
  4. We make sure that Interesting Terrains is loaded after Basic Roads

User avatar
Ralzar
Posts: 2211
Joined: Mon Oct 07, 2019 4:11 pm
Location: Norway

Re: [MOD] Interesting Terrains [WIP]

Post by Ralzar »

monobelisk wrote: Fri Aug 28, 2020 10:29 am We make sure that Interesting Terrains is loaded after Basic Roads
I can't help with anything else, but that part is dead easy. You just add a dependency to your dfmod.json file:

https://github.com/Ralzar81/Climates-Ca ... d.json#L42

Code: Select all

    "Dependencies": [
        {
            "Name": "basicroads",
            "IsOptional": true,
            "IsPeer": false
        }
    ]

monobelisk
Posts: 75
Joined: Tue Aug 25, 2020 10:43 am

Re: [MOD] Interesting Terrains [WIP]

Post by monobelisk »

MasonFace wrote: Thu Aug 27, 2020 2:31 pm May I suggest that you both keep TheLacus's Splat Terrain Texturing in mind with your implementations? It would be awesome to have the roads mod optionally output a spline curve as its path to smooth out the terrain topology, but also paint a path directly onto the splatmap so the road curves are less jagged and ugly.

I believe these three mods will form the holy terrain trinity!

The other thing that would greatly help the visuals is to adjust the UV scaling on distance terrain to reduce the tiling effect, but that would just be the icing on the top!

Great work to both of you guys so far. I'm really digging what you guys are putting out there!
Thanks :D

I will definitely keep that one in mind! Having worked with the tedious tilemap system, a splatmap system would be a godsend! Since it seems to conform to the original tiles, I'm assuming that it still uses a tilemap system, but one that only consists of the basic types (water, grass, dirt, rock, road) and then uses splatmapping on transitioning tiles instead of premade transition textures. If that's the case, then it should be relatively simple to convert a tilemap to be compatible. It may even be automatically compatible out of the box.

monobelisk
Posts: 75
Joined: Tue Aug 25, 2020 10:43 am

Re: [MOD] Interesting Terrains [WIP]

Post by monobelisk »

Ralzar wrote: Fri Aug 28, 2020 10:33 am I can't help with anything else, but that part is dead easy. You just add a dependency to your dfmod.json file:

https://github.com/Ralzar81/Climates-Ca ... d.json#L42

Code: Select all

    "Dependencies": [
        {
            "Name": "basicroads",
            "IsOptional": true,
            "IsPeer": false
        }
    ]
Thank you! I've really been wondering how to actually do that :)

I suppose that "IsPeer = false" means that Basic Roads should load before, and true would mean it should load after?

User avatar
Ralzar
Posts: 2211
Joined: Mon Oct 07, 2019 4:11 pm
Location: Norway

Re: [MOD] Interesting Terrains [WIP]

Post by Ralzar »

monobelisk wrote: Fri Aug 28, 2020 10:52 am I suppose that "IsPeer = false" means that Basic Roads should load before, and true would mean it should load after?
Almost. True means it doesn't matter. It can load before or after. False means Basic Roads has to load before.

monobelisk
Posts: 75
Joined: Tue Aug 25, 2020 10:43 am

Re: [MOD] Interesting Terrains [WIP]

Post by monobelisk »

Ralzar wrote: Fri Aug 28, 2020 10:57 am Almost. True means it doesn't matter. It can load before or after. False means Basic Roads has to load before.
Ah, ok. Thanks for clarifying :)

Then, if it's for a compatibility mod, it would be:

IsOptional: false,
IsPeer: false

User avatar
Ralzar
Posts: 2211
Joined: Mon Oct 07, 2019 4:11 pm
Location: Norway

Re: [MOD] Interesting Terrains [WIP]

Post by Ralzar »

monobelisk wrote: Fri Aug 28, 2020 11:30 am
Ralzar wrote: Fri Aug 28, 2020 10:57 am Almost. True means it doesn't matter. It can load before or after. False means Basic Roads has to load before.
Ah, ok. Thanks for clarifying :)

Then, if it's for a compatibility mod, it would be:

IsOptional: false,
IsPeer: false
If you want them to always be used together and the other mod to always load first, then yes.

Note that it's possible to do a check in your script for if BasicRoads is there or not and then run or not run code based on that.

https://github.com/Ralzar81/Climates-Ca ... es.cs#L253

So you can have the mod not need BasicRoads to be used with it, but if it's there it loads first and your mod changes behaviour to accomodate it.

Post Reply