News:

Welcome to World of Banished!

Main Menu

WIP: Natural Diversity

Started by Bartender, April 11, 2017, 01:14:52 AM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

Abandoned

beautiful, just beautiful. good job.  :)

RedKetchup

Quote from: Bartender on April 29, 2017, 06:34:26 AM

And then, last but most certainly not least, I have made a very exciting discovery yesterday evening. While I was testing an idea for one of the buildings of the production chain, I created something that I didn't even think would actually be possible. I made a little video of it being placed, just to prove that this is not a late April fools joke :P.

https://webmshare.com/play/rZw9D

Indeed, it is a placeable pool of water! It looks exactly like the normal water, though ofcourse it is entirely decorational. I have not yet tested if this could be used to make custom rivers and such, but theoretically it should be possible. I will have to play around a bit to see if I can make connecting pieces.

If I manage to create such a 'custom water tool' it will not be a part of Natural Diversity though, as it wouldn't fit within the focus of this mod. I'm thinking about adding it to the decoration pack that I promised, or just making it a separate mod all together.

That's it for this week, please share any thoughts or ideas :)!

What the ....... ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??


i passed weeks and weeks on that and never succeeded to make that work (NMT pools, NMC canals .....)

you will need to share with me !!!!!! lol
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

Bartender

Thanks everyone :)!

@embx61 Perhaps your browser doesn't support .webm files.. I have attached some screenshots ;).

@RedKetchup I'm just polishing up some things so that I can give a clear explanation of what I did exactly, then I'm happy to share! Perhaps I'll write a little tutorial so everyone can benefit from it. I would love to see your canals with the real water flowing through them :)!

elemental

Placeable water! That is a huge discovery.  :)

Now the question: can it be placed at different levels? I'm thinking Red's ponds (and canals, but they are at water level). But even water tanks and the little fountains, troughs and irrigation ditches that we already have from various mods might be able to benefit from this.

RedKetchup

i think thats the BIGGEST discovery ever made in this game :)
i saw you talked about the rivermaterial.slrl.....  thats something i could never figured out cause i have absolutely no knowledge of programming.
making mods with the toolkit is not programming.... in my mind ^^


cant wait to start updating the medieval canal :) that will be GORGEOUS !
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

Bartender

Haha, I guess I should start calling myself a coding magician then :P.

@elemental It can be placed at different levels. All it requires is a simple plane, which can be placed wherever you want, including as part of bigger meshes. The colour and reflection of the water do depend very much on what's below it though.. most of it is actually achieved because the terrain is coloured blue at low levels. Without that the water looks transparent, though you still see the movement and closeby reflections.

@RedKetchup The .srsl files are rather complex indeed. I am slowly starting to understand how they function, but it's still very hard to figure out how to change things. There's no way to know how the game handles them exactly, so I'm literally changing variables one by one, testing their effect in the game every time, untill I find one that does something :P.

I've managed to create quite a few interesting new materials by doing this though, which I use for my plants. Most of them combine existing features, like being able to have decolouring meshes that sway in the wind at the same time. I'm also working on a material that only shows up in winter. I believe there's still many more possibilities to discover :).

RedKetchup

Quote from: Bartender on April 29, 2017, 04:20:17 PM
I've managed to create quite a few interesting new materials by doing this though, which I use for my plants. Most of them combine existing features, like being able to have decolouring meshes that sway in the wind at the same time. I'm also working on a material that only shows up in winter. I believe there's still many more possibilities to discover :).


ha!

like the time i spent once with trying to make ice stalagtites appear just in winter under roof houses ^^
again, i am so bad at those complicated .slrl (slrl = seriously ^^)
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

Abandoned

oh my goodness, look at that.  How amazing, great work @Bartender  :)   But Mr @RedKetchup that doesn't mean I don't still want that beautiful fishing pond of yours from NMT, when you get to it, no rush.  :)


embx61

@Bartender

Yeah, I guess that my browser not support the format.

But now I see some pictures and all I can say is that more and more some of the modders seem to do and find stuff with the Modkit what was deemed impossible. :)

Great stuff Buddy :) Cheers and going to pop open a beer (oops..euh.... of course a case of beers) :)



[size=8pt][color=teal]My beloved Kathy
As you were you will always be
Treasured forever in my memory[/color][/size]

[size=10pt]For my list of Mods with download links go here[/size]

brads3

BT, you and NECORA have definetely changed the game. the new textures is much appreciated.i am still trying to get used to these and RED's fodder fields.so many options. i will asl this though. when you dug the ground out was there water already there? i do know from when we dig down in CC some places has water and some is more just darkness. what does your pond look like over the dark holes? if you can lower the ground and have it rounded and not square can you also raise it and make new hills? how high can you go?would it be possable to start making flat topped hills that we can build on or will the game set the texture to rock at a certain height?
     yep i have many questions now. i see crazy potential and possabilities.to give you some idea of how crazy,after learning from RED's tutorials i attempted stuff with the old FS13. my goal was to make a super map by joining several maps together.with the testing i did i still think it would have been possable to create a much larger map 3 layers deep. a 16X map was done but the cameras were very glitchy once you went past 4x.don't shoot me if i come up with an idea that is near impossible.

RedKetchup

#115
Quote from: brads3 on April 29, 2017, 08:26:18 PM
when you dug the ground out was there water already there?

No, thats the problem. when you dig, the water doesnt magically .... appear.
even if you tag the tile as Water or DeepWater, the water still doesnt appear. definitely something is missing ...
and Bartender found it while playing with RiverMaterial.srsl file.

here what that file is looking :
#include "../constants.srsl"
#include "../lighting.srsl"

struct Vertex
{
int4 position : 0;
int2 texcoord : 1;
float4 normal : 2;
}

struct Interpolant
{
float4 position : clipposition;
float4 texcoord;
float3 viewDir;
float4 screenProjection;
float4 lightFogAlpha;
#ifn DETAIL0 float4 shadowProjection; #end

}

struct Textures
{
texture2d water : 0;
texture2d frame : 1;
texture2d reflection : 2;
texturecube highlight : 3;
shadow2d e_shadowMap : 5;
}

program Normal
{
stream(Vertex) uniforms(VSConstants)
vertexshader basevs
{
float3 position = input.position.xyz.cast(float3) / float3(48.0, 48.0, 256.0);

float4x4 localToWorld = tc.transforms[0];
float3 worldPosition = localToWorld.cast(float3x4) * float4(position, 1.0);
output.position = gc.worldToProjection * float4(worldPosition, 1.0);

#if GL3
float4x4 so = float4x4(
float4(0.5, 0.0, 0.0, 0.0),
float4(0.0, 0.5, 0.0, 0.0),
float4(0.0, 0.0, 1.0, 0.0),
float4(0.5, 0.5, 0.0, 1.0));
#else
float4x4 so = float4x4(
float4(0.5, 0.0, 0.0, 0.5),
float4(0.0, -0.5, 0.0, 0.5),
float4(0.0, 0.0, 1.0, 0.0),
float4(0.0, 0.0, 0.0, 1.0));
#end

output.screenProjection = so * output.position;

output.lightFogAlpha.xyz = GetLightingFog(float3(0.0, 0.0, 1.0), output.position.z, lc.nearPlane, gc.fog);
output.lightFogAlpha.w = input.normal.z;

output.texcoord.xy = input.texcoord.xy.cast(float2) / 1024.0;
output.texcoord.zw = output.texcoord.xy;

output.viewDir = worldPosition - gc.cameraPosition.xyz;

#ifn DETAIL0
output.shadowProjection = lc.shadowProjection[0] * float4(worldPosition, 1.0);
#end
}
vertexshader vs : basevs
{
output.texcoord.w += gc.time.x * 0.01;
output.texcoord.y += gc.time.x * 0.02;
}
vertexshader lakevs : basevs
{
output.texcoord.wz += gc.time.xx * float2(0.01, 0.005);
output.texcoord.y += gc.time.x * -0.006 * 0.95;
}
stream(Interpolant) uniforms(PSConstants) textures(Textures)
pixelshader ps
{
// too many instructions for ps_2_0 calling GetShadowHigh... limit river to medium shadow sampling
#if DETAIL3
float shadow = GetShadowMedium(e_shadowMap, input.shadowProjection, pc.texelSize.x);
#else
float shadow = #ifn DETAIL0 GetShadowValue(e_shadowMap, input.shadowProjection, pc.texelSize.x) #else 1.0 #end;
#end

float3 normal;
normal.xy = sample(water, input.texcoord.xy).wy - 0.5;
normal.xy += sample(water, input.texcoord.zw).wy - 0.5;
normal.z = 1.0 - sqrt(dot(normal.xy, normal.xy));

float2 screenCoord = input.screenProjection.xy / input.screenProjection.w;
float4 frameBuffer = sample(frame, (screenCoord + normal.xy * 0.05));

float d = dot(-normalize(input.viewDir), normal * float3(4.0, 4.0, 1.0));

float3 dir = reflect(normalize(input.viewDir), normal);
float3 bloom = sample(highlight, dir).xyz * 1.5;

float fresnel = d * d;

float4 ref = sample(reflection, (screenCoord + normal.xy * 0.6));

float diffuseAmount = 0.33;
float refractAmount = (fresnel) * (1.0 - diffuseAmount);
float reflectAmount = (1.0 - fresnel) * (1.0 - diffuseAmount);

float3 refractColor = frameBuffer.xyz;
float3 reflectColor = ref.xyz + bloom * ref.w;
float3 diffuseColor = float3(0.5, 0.55, 0.5) * shadow;

float3 lighting = diffuseColor * diffuseAmount;
lighting += refractColor * refractAmount;
lighting += reflectColor * reflectAmount;

lighting = lerp(lighting.xyz, pc.fogColor.xyz, min(saturate(input.lightFogAlpha.z), pc.fogColor.w));
lighting = lerp(frameBuffer.xyz, lighting, frameBuffer.w);

output.color.xyz = lighting;
output.color.w = input.lightFogAlpha.w;
//output.color.xyz = frameBuffer.xyz;
//output.color.w = 1.0;
}
stream(PixelOutput)
}


i tried at some point to change the material attached to a .png to RiverMaterial.rsc .... and i ve got only errors so i dont know what Bartender did... but he is gifted :)
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

tanypredator

#116
Wow. Just WOW!!! I knew, that these .slrl files hide treasures for mod-makers, but until now noone was able to dig into them. I wonder if it become possible now to make a new material for spring tree blooming!

Thank you, Bartender, for your work and discoveries! And yeah, NatDiv is already great and becomes more great every time!

embx61

I have to say I appreciate that some of the Modders are going out of their way to try to discover new things.
I am too quickly bored to dig in all that code and keep testing and testing with no results so my hat off to you.

I have to say though that Luke could have been here a bit more helpful.
If Bartender would not have stumbled on this by accident we still would be thinking that it was impossible to place the in game water on the map.
He post some stuff on his site about making a game editor and other C++ code snippets. Mostly low level code what is maybe nice for programmers but won't do much for us modders as we don't have the source code.

It would be very nice if he extended this to sometimes show a snippet how to work with some of the deeper files like the slrl files in the Mod Kit.
and a snippet about how he does his animations would be helpful too.
[size=8pt][color=teal]My beloved Kathy
As you were you will always be
Treasured forever in my memory[/color][/size]

[size=10pt]For my list of Mods with download links go here[/size]

Bartender

Thanks for all the kind words everyone :)!

Quote from: brads3 on April 29, 2017, 08:26:18 PM
BT, you and NECORA have definetely changed the game. the new textures is much appreciated.i am still trying to get used to these and RED's fodder fields.so many options. i will asl this though. when you dug the ground out was there water already there? i do know from when we dig down in CC some places has water and some is more just darkness. what does your pond look like over the dark holes? if you can lower the ground and have it rounded and not square can you also raise it and make new hills? how high can you go?would it be possable to start making flat topped hills that we can build on or will the game set the texture to rock at a certain height?

as RedKetchup explained, the water doesn't appear by itself. My pond will look the same no matter where you place it ;).

Now hills are a very interesting idea! I changed some values from negative to positive.. and yes! it's possible:


It looks a bit weird with the underwater terrain texture on it, but that's something I can change ;). Unfortunately most buildings cannot be built on hills, because of the way they are coded. They would either flatten the terrain, or show a red tile if you try.

Quote from: tanypredator on April 29, 2017, 10:31:04 PM
Wow. Just WOW!!! I knew, that these .slrl files hide treasures for mod-makers, but until now noone was able to dig into them. I wonder if it become possible now to make a new material for spring tree blooming!
I would love to be able to change the timing of the seasonality! Reversing the process for a winter appearance is definitely possible, but I'm not sure about shifting it or changing the length of the period. It seems that the .srsl file takes that information from elsewhere, so I would not be able to alter it. I haven't tried everything yet though, so maybe I'll find it one day ;).

Quote from: embx61 on April 29, 2017, 10:47:54 PM
I have to say though that Luke could have been here a bit more helpful.
If Bartender would not have stumbled on this by accident we still would be thinking that it was impossible to place the in game water on the map.
He post some stuff on his site about making a game editor and other C++ code snippets. Mostly low level code what is maybe nice for programmers but won't do much for us modders as we don't have the source code.

It would be very nice if he extended this to sometimes show a snippet how to work with some of the deeper files like the slrl files in the Mod Kit.
and a snippet about how he does his animations would be helpful too.

I wholeheartedly agree! There are many parts of the code that are very difficult, if not impossible, to understand without knowing the game code behind it. If Mr. Luke would share some insight into these parts it could help us immensely, who knows what other crazy things might actually be possible. Working my way through these srsl files to try to understand them is a very slow process, while it shouldn't have to be if I knew what every part did. It's obviously rewarding to do this, but there might still be a lot of things I'm missing because I don't know where to look for them. Another limiting factor is that I can only go by what's already in there; perhaps there are options that Mr.  Luke created but in the end didn't utilize in his files. We would never be able to find those.


brads3

setting buildings on top of the hills not working does make sence. did you check how tall the hills can go?i take it according to our mountains there isn't much height we can gain.