Special Aircraft Service

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Tracer color code decoding? With new values for modders to try  (Read 2410 times)

0 Members and 1 Guest are viewing this topic.

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 5582
Tracer color code decoding? With new values for modders to try
« on: January 12, 2019, 10:46:47 PM »

[EDIT: See Reply #9 for a listing of new tracer colors for all tracers, by color.]

In the various gun classes where the tracers are defined, the color code values are an odd looking string of numbers, often preceded with a negative sign. I've tried to work out the rationale by charting in a spreadsheet, but I see no particularly clear pattern.

Anyone know how to interpret these? Or can you point to a table of values to pick from? I'd like to adjust the colors so as to be less saturated. I don't much like deep red, or cobalt blue, etc. hues for distant tracers; the transition between these and the textured graphics when nearer is jarring.

Thanks!

Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

SAS~Storebror

  • Editor
  • member
  • Offline Offline
  • Posts: 23584
  • Taking a timeout
    • STFU
Re: Tracer color code decoding?
« Reply #1 on: January 13, 2019, 01:01:50 AM »

Something like this?
Code: [Select]
traceColor = -771686401;
decimal -771686401 is hex FFFF00D2, which is an RGBA value.

]cheers[
Mike
Logged
Don't split your mentality without thinking twice.

Koty

  • Mr. MiG
  • Modder
  • member
  • Offline Offline
  • Posts: 2274
  • It's a MiG!
Re: Tracer color code decoding?
« Reply #2 on: January 13, 2019, 03:33:37 PM »

wow... that is unexpectedly simple...
Logged
If I don't have to do it, I won't. If I have to do it, I'll make it quick.

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 5582
Re: Tracer color code decoding?
« Reply #3 on: January 13, 2019, 04:48:13 PM »

Now I'm doing a Homeresque "D'oh!" Shoulda thought to explore such a conversion before giving up. At least I tried a thorough search before handing off to the brain trust. ;)

Perhaps a sticky post/thread that collates such esoterica as this might be contemplated?

Thanks, Mike!
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 5582
Re: Tracer color code decoding?
« Reply #4 on: January 13, 2019, 11:41:51 PM »

After converting all the values for all aircraft guns, and knowing the colors for pretty nearly all tracers, the actual arrangement for the hex values turns out to be:

ABGR,

where A is opacity. Reversed, as we see, from the more common RBGA arrangement.

For airborne MG and cannon tracers, all decimal values for A are 210 (which can range from 0 to 255), except two, which are 216 and 217.
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

SAS~Storebror

  • Editor
  • member
  • Offline Offline
  • Posts: 23584
  • Taking a timeout
    • STFU
Re: Tracer color code decoding?
« Reply #5 on: January 13, 2019, 11:51:17 PM »

Eh... well yes and no 8)
Converting -771686401 to Hex can go two ways, Big Endian and Little Endian.
Arithmetic conversion always is Big Endian, which results in hex 0xD200FFFF. In game this would be ABGR order.
However Intel CPUs always use Little Endian Byte Order, so the programmer's result was 0xFFFF00D2 and that's RGBA 8)

]cheers[
Mike
Logged
Don't split your mentality without thinking twice.

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 5582
Re: Tracer color code decoding?
« Reply #6 on: January 14, 2019, 02:30:21 AM »

Just did a first pass at toning down tracer color intensity for the red, green and blue ones.

In Photoshop I made a set of color swatches, starting with the full saturation (where one channel is set to 255 and the other two are set to 0), and then for their copies brought down the saturation, altered the hue a little and boosted the brightness (this latter just for the red and blue).

Calculated the hex values for the BGR channels, then converted to decimal as a group with the alpha value (I kept it the same as the default.) Inserted these new values into several MGun classes to test.

In the game, what a nice improvement! The not-so-strongly colored  tracers blend much better with the textured  guncam mod tracers I use.

But I'll try dialing back the opacity (lowering the alpha to about half.) That's because the transition between the guncam tracer mod appearance and the base tracer has the latter appearing rather more prominent when seen from a direction other than end-on. And at increasing distance the base tracers become increasingly relatively more prominent because the same line thickness seems to apply for all distances. So increasing the transparency in order to make the tracer color blend more with the environment seems like a potentially fruitful strategem.

Incidentally, here are the three values from my first pass other modders might wish to insert into the relevant MGun classes.

Red (e.g, Browning .303 and .50)
-645968138

Green (ShKAS)
-647632795

Blue (MG131, MG15120)
-637576872

If my reduced opacity experiment works, I'll post results...
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 5582
Re: Tracer color code decoding?
« Reply #7 on: January 14, 2019, 03:01:12 AM »

I tried setting a lower opacity, but the number of digits in conversion goes from 9 to 10, and Java balks. The lowest alpha value (decimal) I could get away with was 200, hardly different from the stock 210. I was hoping for half, or 127.

There's probably something obvious I'm missing.... ]dontknow[
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

SAS~Storebror

  • Editor
  • member
  • Offline Offline
  • Posts: 23584
  • Taking a timeout
    • STFU
Re: Tracer color code decoding?
« Reply #8 on: January 14, 2019, 07:12:31 AM »

Make your life easier and rewrite the source in Big Endian Hex notation.
If e.g. the original line reads
Code: [Select]
traceColor = -771686401;make it
Code: [Select]
traceColor = 0xd200ffff;instead.

That way you only have think in reversed byte order (ABGR), but you don't need to convert anything.
Alpha values lower than 0xC8 (decimal 200) should definitely work.

]cheers[
Mike
Logged
Don't split your mentality without thinking twice.

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 5582
Re: Tracer color code decoding?
« Reply #9 on: January 15, 2019, 07:11:53 PM »

Mike, and all;
OK, I went Big Indian, and all works swimmingly; thanks!

After a bit of altering and testing, here are the values I've settled upon, which work well with the guncam tracers mod at least. I've adopted a uniform opacity of 43%. I notably lowered the saturation, so that the formerly garish--nay, cartoonish--colors are toned down and blend better with the tracer textures due to the latter having white cores. I strove for a balance between appearance in day and night, and between the texture transition point and maximum distance for visibility.

The color names are as defined in 3do/Effects/Tracers/

Note the common prefix "0x" (for Big Indian notation) and "6D" (an opacity of 109 out of 255 or 43%).

Color     prefixABGR
-------------------------
Red    0x6d6351ff
Green    0x6d3cb33c
Blue     0x6de54e4d
Cyan     0x6daaa92d
GreenBlue     0x6d52b419
Magenta     0x6db12fab
Orange     0x6d3475be
Pink     0x6daf43af
SkyBlue     0x6db88919
White     0x6db3b3b3
Yellow     0x6d25b3b2


I'd love to get some feedback from anyone willing to try altering at least a few gun classes covering a couple or few tracer colors...

Because of the potential variety among gun mods dealing with any of the numerous parameters defining the guns, perhaps the best approach is for the author of a mod to incorporate this stuff and offer an update/variation.
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 5582
Re: Tracer color code decoding? With new values for modders to try
« Reply #10 on: January 15, 2019, 07:23:29 PM »

I might add...

From my 4.08 game, I altered 44 MGun* classes.

Yet to do are roughly the same number of MachineGun* and Cannon* classes added together.

More recent game versions likely have some number of additional guns that I do not.
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)
Pages: [1]   Go Up
 

Page created in 0.075 seconds with 28 queries.