VadaVaka

Full Version: Colour Switch
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
If you play DM, you're well aware of the seventh player who is indistinguishable from the first. I did some digging through the source, and there's no way to *fix* this; though there is a painless workaround.

These are the disc colours:
Code:
//disc_weapon_disc.cpp, line 32


float g_iaDiscColors[33][3] =
{
    { 255, 255, 255, },
    { 250, 0, 0 },
    { 0, 0, 250 },
    { 0, 250, 0 },
    { 128, 128, 0 },
    { 128, 0, 128 },
    { 0, 128, 128 },
    { 128, 128, 128 },
    { 64, 128, 0 },
    { 128, 64, 0 },
    { 128, 0, 64 },
    { 64, 0, 128 },
    { 0, 64, 128 },
    { 64, 64, 128 },
    { 128, 64, 64 },
    { 64, 128, 64 },
    { 128, 128, 64 },
    { 128, 64, 128 },
    { 64, 128, 128 },
    { 250, 128, 0 },
    { 128, 250, 0 },
    { 128, 0, 250 },
    { 250, 0, 128 },
    { 0, 250, 128 },
    { 250, 250, 128 },
    { 250, 128, 250 },
    { 128, 250, 250 },
    { 250, 128, 64 },
    { 250, 64, 128 },
    { 128, 250, 64 },
    { 64, 128, 250 },
    { 128, 64, 250 },
};
And this is how they map out:
NOTE: g_iaDiscColors[32][] is left empty. Not sure why, or what happens to player 32.
What I propose is swapping the colour in slot 19 for the colour in slot 7. The other colours relevant to a player are generated with a calculation done on the appropriate disc colour, so it should be seamless.

Since there are only 12 slots, any colour above that is fair game.

No, it doesn't solve the problem of identical-looking players on servers with higher max player counts, but it does make it less common.

Code:
float g_iaDiscColors[33][3] =
{
    { 255, 255, 255, },
    { 250, 0, 0 },
    { 0, 0, 250 },
    { 0, 250, 0 },
    { 128, 128, 0 },
    { 128, 0, 128 },
    { 0, 128, 128 },
    { 250, 128, 0 },
    { 64, 128, 0 },
    { 128, 64, 0 },
    { 128, 0, 64 },
    { 64, 0, 128 },
    { 0, 64, 128 },
    { 64, 64, 128 },
    { 128, 64, 64 },
    { 64, 128, 64 },
    { 128, 128, 64 },
    { 128, 64, 128 },
    { 64, 128, 128 },
    { 128, 128, 128},
    { 128, 250, 0 },
    { 128, 0, 250 },
    { 250, 0, 128 },
    { 0, 250, 128 },
    { 250, 250, 128 },
    { 250, 128, 250 },
    { 128, 250, 250 },
    { 250, 128, 64 },
    { 250, 64, 128 },
    { 128, 250, 64 },
    { 64, 128, 250 },
    { 128, 64, 250 },
};
amazing


B)
This is how player colours map out. Each swatch is divided into topcolor and bottomcolor (intuitive). As you can see, 19 is the same as 9, so that's a no go.

Turns out that there are virtually no unique colours. These are the matching ones:
[*]0, 1, 7, 14
[*]2, 13
[*]3, 15
[*]4, 16, 24
[*]5, 17, 25
[*]6, 18, 26
[*]8, 20
[*]9, 19
[*]10, 22
[*]11, 21

And these are unique (though some may be a little tough to tell):
[*]12, 23, 27, 28, 29, 30, 31



[Image: post-16-1125887165.jpg]
Did some more digging and it appears as though the client chooses the colour a player (and their team on the scoreboard) should be, even though the server sets the colour of the discs.

Oh well.
Scratch that. I looked a little harder, and it called on the same disc colour array, so I did a search for it. Lo and behold cl_dll.dll includes a few files from mp.dll; one of which is disc_weapon_disc.cpp. Just needed to rebuild the client dll.

Best part is that you can still play on the servers (not sure about servers with VAC).

Now... the weird part is that it defaults to third person on my HLDS. It doesn't seem to default elsewhere, but you can still use it. Guess the SDK dll supports it.

I have yet to settle on a colour to use for team 7, since 23 was a little close to green and teal.
I think I left my 3rd person code in the client code:P. Didn't think people would want to compile that since the servers are not suppose to allow you to use your own version... But I don't know how you were able to play on other servers...
Well, it does.. spooky, huh?

*NOTE* This is on Vad's, so the skin is red (since it isn't patched). That's why I have the scoreboard open. I used colour 30 for team 1.
I have noooo idea what valve changed in the hlds, but now my thirdperson code can work since we can use a custom client.dll now. Woot.

I'm glad I left the code in there..
i was thinking about that back when we did the steam/won fix

we switched the clients from steam and won, and if i remember right they were different sizes too...

are custom clients allowed in ricochet?
This will resolve the team 7 issue.

Code:
float g_iaDiscColors[33][3] =
{
    { 255, 255, 255, },
    { 250, 0, 0 },
    { 0, 0, 250 },
    { 0, 250, 0 },
    { 128, 128, 0 },
    { 128, 0, 128 },
    { 0, 128, 128 },
    { 250, 160, 0 },//{ 128, 128, 128 },
    { 64, 128, 0 },
    { 0, 250, 128 },//{ 128, 64, 0 },
    { 128, 0, 64 },
    { 64, 0, 128 },
    { 0, 64, 128 },//12
    { 64, 64, 128 },
    { 128, 64, 64 },
    { 64, 128, 64 },
    { 128, 128, 64 },
    { 128, 64, 128 },
    { 64, 128, 128 },
    { 250, 128, 0 },
    { 128, 250, 0 },
    { 128, 0, 250 },
    { 250, 0, 128 },
    { 128, 128, 128 },//{ 0, 250, 128 }, //23
    { 250, 250, 128 },
    { 250, 128, 250 },
    { 128, 250, 250 },
    { 250, 128, 64 },//27
    { 250, 64, 128 },//28
    { 128, 250, 64 },//29
    { 64, 128, 250 },//30
    { 128, 64, 250 },//31
};
:blink:
this is precisely why I'm not studying code, thank god I picked hardware instead
geeks:wub:

gotta luv em :heartbeat:
This is the client.dll that gets built.