[Originally written July 12 2020]
“The only difference between screwing around and science is writing it down.” – Adam Savage, Mythbusters.
Intrigued by the pigment bleed genes I’d encountered while analyzing my Grendels, I decided to do a little experimentation in a lab world. I attempted research as well but unfortunately, all I could find were explanations of how pigment swaps, rotations, etc, themselves work – which I already understand. What I don’t understand, and could not find documentation on, was the genes controlling these. So I shrugged and started fiddling with the Genetics Kit.
In theory, a color rotation of 255 should effectively move all the pixels from the red channel to the blue channel, the blue channel to the green channel, and the green channel to the red channel. This can easily be mocked up in photoshop for a ground truth visual. Also, the creature information in C3/DS reports their pigmentation info, including swap and rotation – but only one value for each. My testing immediately showed that all three genes are somehow involved.
Visual | |||||||||
---|---|---|---|---|---|---|---|---|---|
Gene1 | 128 | 255 | 128 | 255 | 128 | 255 | 128 | 255 | Ground Truth 255 |
Gene2 | 128 | 128 | 255 | 255 | 128 | 128 | 255 | 255 | |
Gene3 | 128 | 128 | 128 | 128 | 255 | 255 | 255 | 255 | |
Reported | 128 | 143 | 159 | 175 | 191 | 207 | 223 | 239 |
I was rather mystified by these values beyond understanding that the third gene carries the most weight and the first gene carries the least, and took them to an excel spreadsheet to see if I could figure out a relationship. After a lot of fiddling around I managed to nail down a formula:
Floor((((0.5 * Gene1) + (Gene2) + (2 * Gene3)) / 4) + 16) = Actual Value
I tested this out by creating a norn with rotations of 100/180/235, which I predicted would produce the same output as the 128/128/255 girl in the table – and it did!Swap appears to calculate its final value the same way, although the visual effect is determined by how far the value is from 128 and is not affected by the direction; 191 and 63 produce the same color since they’re equally far from the middle.
No comments:
Post a Comment