Updating lowres NPC sprites. Wrong palette?

Discuss modding questions and implementation details.
sayber1
Posts: 46
Joined: Thu Sep 16, 2021 3:27 pm

Updating lowres NPC sprites. Wrong palette?

Post by sayber1 »

I've been trying to upscale and manually redraw NPC sprites from 184.

To save myself a lot of hussle I've been sampling color directly from the original images. It worked allright, but when in game the details on the sprites turned out messed up. I'm trying to figure out, what went wrong and how to fix it.

I suspect it is an issue with my color palette, but does this mean that those original flats use wrong palette, since I sampled it directly, or am I missing something completely.
Spoiler!
19-0.png
19-0.png (15.73 KiB) Viewed 1141 times
2021_09_21_21_14_46.jpg
2021_09_21_21_14_46.jpg (308.72 KiB) Viewed 1141 times

EDIT:
An incredibly dirty fix is to artificially increase resolution of the sprite by 2 or 4 nearest neighbor, but I wouldn't really want to resort to this.
Last edited by sayber1 on Tue Sep 28, 2021 2:46 pm, edited 1 time in total.

sayber1
Posts: 46
Joined: Thu Sep 16, 2021 3:27 pm

Re: Updating lowres NPC sprites. Wrong palette?

Post by sayber1 »

Bumping this thread as I still haven't found solution to this problem and it stalled my entire progress on this mod.

An additional example
Spoiler!
2021_09_28_17_37_19.png
2021_09_28_17_37_19.png (1.05 MiB) Viewed 1090 times

User avatar
bearhead
Posts: 21
Joined: Thu Sep 23, 2021 10:00 pm

Re: Updating lowres NPC sprites. Wrong palette?

Post by bearhead »

Something does indeed seem to break the color palette in your process of upscaling these sprites.

For #184 19-0, the color palette consists of 91 colors, whereas your upscaled version (at least what was posted to this forum) contains somewhat more than that.

I've attached the palette as an ACT file - can be opened with photoshop.

Here is an image of your artwork copied into the original artwork with the 91 color palette - as you can see there is dithering in the hair of your upscaled version.
19-0_example.png
19-0_example.png (20.86 KiB) Viewed 1046 times
Well, I'm not sure what this means for your process, but hopefully it will help you figure out a solution...
Attachments
184_16-0_palette.zip
(428 Bytes) Downloaded 59 times

sayber1
Posts: 46
Joined: Thu Sep 16, 2021 3:27 pm

Re: Updating lowres NPC sprites. Wrong palette?

Post by sayber1 »

Thanks, while I still don't really know what exactly went wrong, now I atleast know my suspicions were correct and I know in what direction I should work.
EDIT:
I saved the image converting it to the original's palette you've attached, but it didn't seem to fix the issue. Now I'm confused even more. The sprite system in DFU seem much more complicated and difficult to work than I've imagined.

sayber1
Posts: 46
Joined: Thu Sep 16, 2021 3:27 pm

Re: Updating lowres NPC sprites. Wrong palette?

Post by sayber1 »

OK, now I'm pretty sure it's DFU's bug. I've just imported an original sprite directly from Daggerfall IMG upacked folder and it was messed up as well.

User avatar
bearhead
Posts: 21
Joined: Thu Sep 23, 2021 10:00 pm

Re: Updating lowres NPC sprites. Wrong palette?

Post by bearhead »

yeah - I was able to reproduce your issue, so definitely something strange about how sprites are being saved out of Daggerfall Imaging 2, or how their data is being read in-game (maybe both?).

The weird thing is that I was working on some new graphics for the night sky, and I was able to get those into the game (seemingly) without issue. Granted those are IMG files instead of Texture files, but then I tried to alter some UI images as a test (also IMG files) and was having the same color palette issues as your textures... so I don't know? Only thing I can think of is that maybe I just didn't notice any issues with my new sky artwork because it is so dark?

I did read up on UESP that the game actually uses several different palettes:
https://en.uesp.net/wiki/Category:Dagge ... r_Palettes

But I'm not sure which one to use for which images...

I'm also not sure why this issue wasn't noticed with DREAM textures? Maybe because they are so large, that the occasional pixel being the wrong color just isn't noticeable?

sayber1
Posts: 46
Joined: Thu Sep 16, 2021 3:27 pm

Re: Updating lowres NPC sprites. Wrong palette?

Post by sayber1 »

As I said in my first post the issue is fixed when artificialy upscaling sprites 2x/4x the size, so it's not present on higher res ones. I've also haven't noticed it when editing ground textures, so it may be limited to low res flats/low res NPC flats.
Offtopic, would you mind sharing how you've managed to get new sky textures ingame, I mean the naming and folder in Streaming Assets. I've been planning to fix the mapping on them after I've finished upscaling NPCs.

EDIT:
Missed the part about UI textures also being glitched out. I've also noticed that carademono's Animated People replacer done through dfmod works well, but then I put raw files through StreamingAssets it shows same artifacts.

sayber1
Posts: 46
Joined: Thu Sep 16, 2021 3:27 pm

Re: Updating lowres NPC sprites. Wrong palette?

Post by sayber1 »

Now, my entire previous post apart from the last sentence about carademono's Animated People mod was wrong and based on misobservations. It does appear like higher res does not fix the issue, but merely masks it.

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Updating lowres NPC sprites. Wrong palette?

Post by Interkarma »

This looks like mipmapping. Default billboards don't have a mipmap chain, but imported billboards do as they are typically higher resolution (sometimes considerably higher). The reason default billboards don't use mipmaps is they're so low resolution that lower mipmap versions can only look worse (as you see here).

The mipmap selection is also based on quality setting - I.e.. a lower quality setting will show courser mipmaps at closer distances than higher quality settings.

Workaround is to increase starting resolution as you found. Also check your quality setting is max (Beautiful setting in Unity-speak). I don't know if possible to control mipmap creation by adding an XML file with replacement image.

It might be worth comparing notes with someone who makes low-res billboard replacements look good in their mod. There might be some tricks to pull this off.

Edit: If you can please attach one one of your PNG files to test with, I'm happy to take a look today to see if I can offer better support. The above is just off the top of my head, I'd need to reproduce problem on my end to understand better.

sayber1
Posts: 46
Joined: Thu Sep 16, 2021 3:27 pm

Re: Updating lowres NPC sprites. Wrong palette?

Post by sayber1 »

Wellp, at least now I know I probably won't have to redraw all the sprites that I've already made.
But why would UI textures would be affected by mipmaps?

Edit: 2 of my sprites with pretty obvious artifacts ingame
Spoiler!
184_18-0.png
184_18-0.png (8.9 KiB) Viewed 971 times
184_19-0.png
184_19-0.png (10.28 KiB) Viewed 971 times

Post Reply