KoW - D.R.E.A.M.

A curated forum for approved mods. Users are unable to create new topics in this forum but can reply to existing topics. Please message a moderator to have your mod moved into this forum area.
User avatar
King of Worms
Posts: 1599
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow
Contact:

Re: KoW - D.R.E.A.M.

Post by King of Worms » Mon May 06, 2019 10:12 am

Its not nitpicking at all, this is final stage of the game, this should be less evident than the 2019 "puzzles" AKA

Main protagonists says: "Hmm I think there is something strange about the 3rd skull from the left, I wonder what happens if I left click it? I have a strange feeling that if I click some other skull I will die. Well.. not die. Because Im immortal, so lets say.. I will respawn, thats it" and than the 10 minute video sequence of him approaching the correct skull ending with.. Press E to interact with this correct skull you idiot" :x

Anyway.. even if I make the skulls exact same dimensions, the adjusted one is a bit smaller. So I decided to just remove few teeth. Ive tryed other things, but it looked too easy (spider on the skull, removing more teeth etc)

So now it looks like this. Too bad the skull is different size.. will try to somehow adjust it to be the same. Than it would make more sense actually. Only way to do it I can think of now, is making the other skulls smaller (by making the canvas around them bigger)
Spoiler!
skull.jpg
skull.jpg (482.78 KiB) Viewed 178 times

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

Re: KoW - D.R.E.A.M.

Post by King of Worms » Mon May 06, 2019 10:27 am

This is as close as I can get them... took like 20 tryes, thanks god for reset_assets command :) I just adjust in photoshop, save to streaming assets and hit that command and all the changes translate to the game. This was my request to Interkarma way back and comes extremely handy for any kind of assets modding.

The special skull is placed a bit back, nothing I can do with it. But Imo this is ok difficulty.
Anyone who actualy observes the skulls a bit will see it.. I hope ;) Plus playing in fullscreen helps--
Spoiler!
this.jpg
this.jpg (460.75 KiB) Viewed 172 times

User avatar
pango
Posts: 1079
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: KoW - D.R.E.A.M.

Post by pango » Mon May 06, 2019 10:53 am

Yep, much better :)
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

User avatar
Nystul
Posts: 1327
Joined: Mon Mar 23, 2015 8:31 am

Re: KoW - D.R.E.A.M.

Post by Nystul » Mon May 06, 2019 12:24 pm

TheLacus wrote:
Fri May 03, 2019 10:18 pm
King of Worms wrote:
Fri May 03, 2019 9:44 pm
Lacus, this was the case for a long time, as far back as I remember. Its not caused by the recent version.
Sorry for not being specific enough :oops:
I was worried my changes introduced some unexpected results, i'm glad this is not the case :)
I believe the look of mipmaps is due to a shader issue which @Nystul solved with a workaround. This was in 2017 so maybe improvements are now possible after Unity update.
TheLacus is right, the problem back then was that unity's shader sampler function (UNITY_SAMPLE_TEX2DARRAY_GRAD (resolving to SampleGrad, texCUBEGrad)) produced wrong border pixels at tile borders - see my original comment in code:

Code: Select all

//half4 c = UNITY_SAMPLE_TEX2DARRAY_GRAD(_TileTexArr, uv3, ddx(uv3), ddy(uv3)); // (see https://forum.unity3d.com/threads/texture2d-array-mipmap-troubles.416799/)
// since there is currently a bug with seams when using the UNITY_SAMPLE_TEX2DARRAY_GRAD function in unity, this is used as workaround
// mip map level is selected manually dependent on fragment's distance from camera
so I manually select the mip map level in the shader but this one was just a workaround. Maybe this could be finetuned. I will test if the problem with the original sampler function still exists ;)

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

Re: KoW - D.R.E.A.M.

Post by King of Worms » Mon May 06, 2019 12:55 pm

Thanks a lot for looking at it Nystul.
If the problem with shader sampler function remains, would it be possible to set the mip map level manually a bit lower, so the textures are not that sharp at the distance?
Nothing extreme, just lets say 10% lower if possible..
Be well!

User avatar
Nystul
Posts: 1327
Joined: Mon Mar 23, 2015 8:31 am

Re: KoW - D.R.E.A.M.

Post by Nystul » Mon May 06, 2019 1:16 pm

sure, these are just values that can be finetuned (although they are hardcoded in the shader).

the ugly code is in DaggerfallTilemapTextureArray.shader in lines 104-121:

Code: Select all

			if (dist < 10.0f)
				mipMapLevel = 0.0;
			else if (dist < 15.0f)
				mipMapLevel = 1.0;
			else if (dist < 50.0f)
				mipMapLevel = 2.0;
			else if (dist < 125.0f)
				mipMapLevel = 3.0;
			else if (dist < 250.0f)
				mipMapLevel = 4.0;
			else if (dist < 500.0f)
				mipMapLevel = 5.0;
			else if (dist < 1000.0f)
				mipMapLevel = 6.0;
			else if (dist < 10000.0f)
				mipMapLevel = 7.0;
			else
				mipMapLevel = 8.0;
who wants to play around with this.

btw, the problem with the original function still persists (anyone interested, can try to replace UNITY_SAMPLE_TEX2DARRAY_LOD with UNITY_SAMPLE_TEX2DARRAY and check out the texture border seams) - see this screenshot:
Image

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

Re: KoW - D.R.E.A.M.

Post by King of Worms » Mon May 06, 2019 3:08 pm

Thank you,

I deduct that "mipMapLevel = 0.0" is the sharpest full resolution map and contrary the 8.0 is the most low res one?
Does the number of mipmaps need to be 0 to 8?

If so, Id reduced the distances by 30%, so the lower res mipmaps kick in earlier.


if (dist < 7.0f)
mipMapLevel = 0.0;
else if (dist < 10.5f)
mipMapLevel = 1.0;
else if (dist < 35.0f)
mipMapLevel = 2.0;
else if (dist < 87.5f)
mipMapLevel = 3.0;
else if (dist < 175.0f)
mipMapLevel = 4.0;
else if (dist < 350.0f)
mipMapLevel = 5.0;
else if (dist < 700.0f)
mipMapLevel = 6.0;
else if (dist < 7000.0f)
mipMapLevel = 7.0;
else
mipMapLevel = 8.0;

Does it make sense?
Can I test it somehow?
Never used git... but I found this section there.
Last edited by King of Worms on Mon May 06, 2019 3:13 pm, edited 1 time in total.

User avatar
Adrinus
Posts: 130
Joined: Mon Oct 01, 2018 2:28 am

Re: KoW - D.R.E.A.M.

Post by Adrinus » Mon May 06, 2019 3:12 pm

So, if you wanted to git it. You'd want to get a full copy of the source code. Make your changes. See that it works. I think then you can make a "pull request" that asks the devs to accept your changes into the main code-base.

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

Re: KoW - D.R.E.A.M.

Post by King of Worms » Mon May 06, 2019 3:18 pm

Adrinus wrote:
Mon May 06, 2019 3:12 pm
So, if you wanted to git it. You'd want to get a full copy of the source code. Make your changes. See that it works. I think then you can make a "pull request" that asks the devs to accept your changes into the main code-base.
Thanks!
Ive made the changes on my local master.
But how to get it ingame?

User avatar
Adrinus
Posts: 130
Joined: Mon Oct 01, 2018 2:28 am

Re: KoW - D.R.E.A.M.

Post by Adrinus » Mon May 06, 2019 3:52 pm

You'd need to compile it? Lemme see how hard it is...

Well, that's unfortunate. Looks like you'll have to know how Unity compiles things. Sadly I do not, but it should be as simple as loading up the project and hitting run to test it.

Post Reply