aosprotocol icon indicating copy to clipboard operation
aosprotocol copied to clipboard

PP: player model color

Open Sonicscream opened this issue 6 years ago • 15 comments

This packet / extension would tell supporting clients what color to render a player model for a specific player id (it would override whatever their team color is for the player model, not add accents or anything new)

It is intended for only the server to handle any logic relating to what colors are assigned to specific ID's outside (clients wouldn't change the colors unless they receive a player model color packet from the server).

Theoretically there would be a magic number to represent there being no set player model color that the server could send whenever to revert back to the team color, and that the client would initially start out with upon connecting to a server.

Use cases off the top of my head:

  • Implementation of the Garry's Mod game mode Trouble in Terrorist Town (TTT) into Ace of Spades. Tl;dr In TTT there are three effective teams which are all represented by a specific color which can't currently be accomplished with just two teams.

  • Make a player who is performing exceptionally well stand out amongst other players, making them more of a target.

  • Enhance the rampage script by coloring a player while on a rampage.

  • Show admins a different color.

  • Subtle team color variations, eg make zombies be different dark colors.

  • Etc.

Thoughts?

Sonicscream avatar Mar 12 '19 17:03 Sonicscream

So far, @xtreme8000 and me have agreed this is a good idea. I think we can discuss the implementation now.

NotAFile avatar Mar 12 '19 17:03 NotAFile

Another neat idea: marking your squadmates or similar in a different color

NotAFile avatar Mar 12 '19 17:03 NotAFile

I also wonder why we, while we're at it, don't just allow setting the color for head, torso, legs, arms independently?

NotAFile avatar Mar 12 '19 17:03 NotAFile

I also thought about the squad coloring too! As far as individual body parts, I was aiming for something that would require minimal editing to implement (individual body parts would be cool too).

Sonicscream avatar Mar 12 '19 17:03 Sonicscream

@yvt and @xtreme8000 would have to comment on how much harder that would be in their respective clients

NotAFile avatar Mar 12 '19 17:03 NotAFile

It's no problem to color each part differently. I think we should have different colors for left and right leg.

xtreme8000 avatar Mar 12 '19 18:03 xtreme8000

PacketSetBodyPartColor

  • Packet ID: extID TBA
  • Packet subID: 0
  • Length: 7

It is possible to set the color of many body parts at once.

Field name Field type Example Notes
player id UByte 31
body part bitfield 0x1F See bit meaning below
blue UByte 0
green UByte 255
red UByte 0

Bitfield structure of field body part:

Field name Index Mask
head 1 0x01
torso 2 0x02
arms 3 0x04
left leg 4 0x08
right leg 5 0x10
intel? 6 0x20

PacketResetBodyPartColor

  • Packet ID: extID TBA
  • Packet subID: 1
  • Length: 4

This will reset the body parts back to team color.

Field name Field type Example Notes
player id UByte 31
body part bitfield 0x1F See bit meaning above

xtreme8000 avatar Mar 13 '19 12:03 xtreme8000

No problem implementing it in OS either.

yvt avatar Mar 13 '19 12:03 yvt

If we're going to allow left leg and right leg we should do the same for the arms. Edit: Intel color is good too 👍

Sonicscream avatar Mar 13 '19 14:03 Sonicscream

@xtreme8000 isn't your proposal missing the player id? Intel would be harder to do because of this. I feel like we should have a different packet for setting map entity color by ID then.

NotAFile avatar Mar 13 '19 14:03 NotAFile

@NotAFile you're right, I forgot about that, will add it. @Sonicscream arms dont have a seperate kv6 model The intel would only be colored when it is on the player's back.

xtreme8000 avatar Mar 13 '19 14:03 xtreme8000

I can't personally think of any reason why you'd want to color the legs differently. But I mean, it's just one bit. so it doesn't really matter.

NotAFile avatar Mar 13 '19 14:03 NotAFile

My thought was that it would allow to show e.g. damage to limbs

xtreme8000 avatar Mar 13 '19 14:03 xtreme8000

that's a pretty awesome idea

NotAFile avatar Mar 13 '19 14:03 NotAFile

@xtreme8000 how difficult would using separate models be?

Maybe it would be something to consider for a later revision of this packet. I think it would be useful just as the separate legs would.

Sonicscream avatar Mar 13 '19 15:03 Sonicscream