• Welcome to SC4 Devotion Forum Archives.
 

News:

The SC4 Devotion Forums are no longer active, but remain online in an archived, read-only "museum" state.  It is not possible for regular members to post or use the private messaging system, and no technical support will be provided for any issues pertaining to the forums in their current state.  Attachments (those that still work) are accessible without login.

The LEX has been replaced with SC4Evermore (SC4E), and SC4E maintains an active Discord server.  For traditional forums, we recommend Simtropolis.

Main Menu

Water terrain properties

Started by mittfh, November 22, 2007, 02:55:39 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

mittfh

I thought I'd have a go at hacking the transparency (or if you prefer, alpha blending) of my water. To avoid an endless cycle of trial and error, I'd appreciate it if someone could explain how the relevant exemplar entries work - after poking around in the CPT Columbus and MeadowShire terrain mods, I presume they are:
WaterDepthForMaxAlpha (Water depth in metres?)
WaterMinAlpha (The maximum amount of transparency?)
WaterDepthToColorGradientFactor (So presumably there's an fsh somewhere with the gradient - this value presumably maps water depth to the relevant colour?)
and for the hell of it,
WaterNightColorAdjustment (Three values?! Is this RGB, HSV or some kind of brightness multiplier?)

Ennedi

#1
If you will open the "Terrain Properties" exemplar in Ilive Reader and click on the property, at the bottom of Ilive window you will see the description, format and default value(s) of this property.

If you haven't Ilive Reader, here are descriptions of properties you told about:

WaterDepthForMaxAlpha: At this depth (meters), water becomes opaque.
Format: Float between -10,000,000 and 10,000,000

WaterMinAlpha: min Alpha of water
Format: Integer between 0 and 255

WaterDepthToColorGradientFactor: Number of pixels in the gradient corresponding to each meter of water depth.
Format: Float between -10,000,000 and 10,000,000

WaterNightColorAdjustment: Modifications to the r,g,b water at night.
Format: Array of 3 floats between -10,000,000 and 10,000,000

If you would like to modify these properties values, I suggest to use Ilive Reader. I was not experienced with it and tried to use DatGen, but Travis (beskhu3epnm) suggested me to use Ilive and he was right, also because you see descriptions of each property and it's values - existing in the given mod and the default one. So you have a good start point to modifications.

Edit:
QuoteTo avoid an endless cycle of trial and error, I'd appreciate it if someone could explain how the relevant exemplar entries work

Personally I'm going to go through this cycle and I hope it will not be endless :D If I will know more about it, I will tell it to you (and probably I will show it in my MD)
New Horizons Productions
Berethor - beskhu3epnm - blade2k5 - dmscopio - dedgren - Emilin - Ennedi
jplumbley - moganite - M4346 - nichter85 - papab2000 - Shadow Assassin - Tarkus - wouanagaine

dedgren

QuotePersonally I'm going to go through this cycle and I hope it will not be endless

You are an SC4 God, my friend.


David
D. Edgren

Please call me David...

Three Rivers Region- A collaborative development of the SC4 community
The 3RR Quick Finder [linkie]


I aten't dead.  —  R.I.P. Granny Weatherwax

Skype: davidredgren

Ennedi

Quote from: dedgren on November 22, 2007, 06:30:03 PM
You are an SC4 God, my friend.


David


Thank you David, it's too big compliment for me and completely unexpected new job!  :D (horribly responsible  ;D)

@mittfh: If you want to change property values in the Terrain Properties exemplar, you should also remember there are some mods using this exemplar:

- Limitless Beach
- Extended Beach
- Gizmo Water Flora v2
- Monolith Night Water Textures
and last few days I found the new one to this list
- Gizmo's Day-Night Mod

If you have any of these mods in your Plugins folder, you must remember the game will use properties from the last one. So if your terrain mod is the most important one for you, it would be good to add "zzz" to it's name.
The list above can be incomplete. If you place the modified terrain mod at the end of plugins and then any other mod will start to work different  ;), check this plugin if it has the Terrain Properties exemplar too.

I want to solve this problem (exemplars used by many plugins) in a more consistent way and it seems I have an idea, but I must think about it a bit more.
New Horizons Productions
Berethor - beskhu3epnm - blade2k5 - dmscopio - dedgren - Emilin - Ennedi
jplumbley - moganite - M4346 - nichter85 - papab2000 - Shadow Assassin - Tarkus - wouanagaine

mittfh

Hmmm...I've actually got both the reader and DatGen installed, but DatGen is currently the default action for .dats - now to have fun persuading Vista + Reader to wrestle control of dats from DatGen :)

Random musing:

Looking at the description of some of those variables, it might be theoretically possible to have an inverse gradient - the deeper the water, the more transparent it becomes. Then with values ranging from minus ten million metres (10,000 km) to plus ten million metres, surely those variables are a few bits longer than necessary...
No doubt someone, sooner or later, will find a practical use for the nonsensical end of the variables' range...

I imagine there are several other variables in the other game exemplars with similarly over-optimistic ranges, all waiting for someone with sufficient time and imagination to exploit them in ways never imagined by the developers... :)

c.p.

You probably guessed most of this already, but here's what I remember from playing around with those settings a long time ago:

WaterDepthForMaxAlpha - If you want to see to a greater depth underwater, change this to a higher number.

WaterMinAlpha - If you want the water to be more transparent at the surface, change this to a lower number.  If you want the water texture to show up stronger at the surface (less transparent) change it to a higher number.

WaterDepthToColorGradientFactor - I think this setting may be for importing grayscale maps (but I could be wrong ).

WaterNightColorAdjustment - no idea what this does.


Also, I don't know if this will help.  It seems to relate to the original question maybe:

The water color comes from the fsh textures with IID nos.  0x09187300, 0x09187301, 0x09187302, 0x09187303, 0x09187304

The shallow underwater color comes from the fsh textures with IID nos.  0x00000014, 0x00000114, 0x00000214, 0x00000314, 0x00000414

The deep underwater texture comes from the fshs with IID nos.  0x00000013, 0x00000113, 0x00000213, 0x00000313, 0x00000413
(All of the above textures have Group ID no 891B0E1A)

Hope some of that helps. :)

Ennedi

Quote from: mittfh on November 23, 2007, 01:08:30 PM
No doubt someone, sooner or later, will find a practical use for the nonsensical end of the variables' range...

I imagine there are several other variables in the other game exemplars with similarly over-optimistic ranges, all waiting for someone with sufficient time and imagination to exploit them in ways never imagined by the developers... :)

All float property values I have see till this time have the same range, from -10,000,000 to 10,000,000 (of course I haven't seen them all). Units can be different in particular properties.
Of course in most cases the useful range of these values (leading to useful and interesting results) is much less, and finding this range is the real goal of any modifications, and it's the most difficult and creative part of this work.

@c.p. - thank you very much for your comment, your information (especially about textures IIDs) will be very useful.
I have a question: I'm going to research some other terrain properties, especially these of them which decide about appearing and merging particular textures in terrain mods. If I will have any questions, could I ask you for a little help?
New Horizons Productions
Berethor - beskhu3epnm - blade2k5 - dmscopio - dedgren - Emilin - Ennedi
jplumbley - moganite - M4346 - nichter85 - papab2000 - Shadow Assassin - Tarkus - wouanagaine

c.p.

Sure, just ask.  No guarantee I'll know the answer, of course.  %confuso