Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Large visual bug- overriding/skipping color palette shift

A topic by FrogInABoxStudio created Apr 21, 2023 Views: 156 Replies: 3
Viewing posts 1 to 4
(1 edit)

I've found a very annoying visual bug with this plugin, and I have absolutely no idea how to fix it.

This is the color palette I'm using, with extra bright colors in there to demonstrate the problem.https://cdn.discordapp.com/attachments/452615380523810816/1099017953401389187/image.png
For whatever reason, some colors are overriding each other, with values #111111 and #FFFFFF on grayscale patterns being rendered as the same color when they are not. I can't figure out for the life of me why this is happening- if anyone can help, it would be greatly appreciated!!

EDIT:

I've figured out how precisely the bug works- it starts off with everything being totally fine for one frame, then it breaks immediately after with #FFFFFF being overridden by the color that's being displayed in #111111.

Doesn't help me fix it, but if the plugin author or anyone more skilled in coding than me feels like taking a look...

Tested it in a new project as well- still happens, so it must be something specific to this plugin. It happens with multiple patterns and palettes, as well.

Developer

If I remember, how palette shifted colors are figured out is using 255/(width - 1) as the number of valid greyscale values for each shifted color (it doesn't shift the first color, which is always mapped to 0). That would give us 255/15 = 17. This bug would happen because  FF is hitting the max value and wraps around, and #111111, which is decimal 17 in grayscale, is still with the bound [1, 18] for the first mapped color. 

To solve, I would use greys in the middle of the target, so like #090909 and #F7F7F7 instead of #111111 and #FFFFFF respectively, if my logic is correct. (tbh it's been years since I wrote/looked at the code)

(2 edits)

Huh, #090909 doesn't show up in the battle background now... let me try one a little higher.

EDIT: Yep, #171717 works! Thank you so much!!