Message Boards

Topic: New protocol design ideas  (Read 20779 times)

Offline Russell

  • Developer
  • Posts: 70
    • View Profile
Re: New protocol design ideas
« Reply #15 on: December 02, 2008, 22:04:27 »
I think the layout of our server response packet structure could use a bit of organization for 0.5.

Code: [Select]
//--- Main Response
Tag - Unsigned 32bit Integer
Version - Unsigned 32bit Integer
Protocol version - Unsigned 32bit Integer

//--- Server information Related
Password MD5 hash - ASCIIZ String
Current map - ASCIIZ String
Time Left - Unsigned 16bit Integer

//--- CVAR Related
Cvar Count - Unsigned 8bit Integer
+Cvar name (Cvar Count) - ASCIIZ String
+Cvar value - ASCIIZ String

//--- WAD Related
WAD Count - Unsigned 8bit Integer
+WAD filename (WAD Count) - ASCIIZ String
+WAD MD5 Hash - ASCIIZ String

//--- Team Related
Teams Enabled - Boolean
Team Count - Unsigned 8bit Integer
+Team Name - ASCIIZ String
+Team Color - Unsigned 32bit Integer
+Team Score - Signed 16bit Integer

//--- Player Related
Player Count - Unsigned 8bit Integer
+Player Ping - Unsigned 16bit Integer
+Player Time - Unsigned 32bit Integer
+Spectator - Boolean
+Player Team - Unsigned 8bit Integer
+Player Color - Unsigned 32bit Integer
+Player Score - Signed 32bit Integer
+Player Fragcount - Unsigned 16bit Integer
+Player Deathcount - Unsigned 16bit Integer

You might notice some odd changes in here. They're optional, but here's why I did them:

* Now that we've made the team structure a little less hardcoded (with our teamsinplay cvar), we can treat the number of teams like we would number of cvars/wads/players. We should also be prepared if we want to make teams customizable to the server. (Custom names and colors... but CTF will still remain RED/BLUE)
* If it won't increase the size of the packets too much, I was thinking that the server could submit the color of each team and player to the launcher. I'm not sure if wx's Color (or Colour, it's very picky sometimes) supports RGB values, but it would be nice to support it. (Maybe add a color square next to the name a la the odascoreboard)
* Replaced player killcount with player score so we can use it for other game modes. Making it 32bit is overkill, I know, I'm just putting it in there in case we decide to further implement my "replace monster kills with damage inflicted" patch.
* I was thinking maybe we have player fragcount an unsigned value that doesn't decrease due to suicides and use player score for DM matches. (where it's the fragcount - suicides) Ralphis kinda doesn't like the idea of the scoreboard showing Score / Frags / Deaths instead of Frags / Deaths, so we could either disguise the scoreboard Frags as Score or make it optional to display Score / Deaths.

Not bad so far.

I think "Teams Enabled" is kind of irrelevant, since you can already use "gametype == teamdm" to determine if its enabled.

Also, "Team Name" is kind of the same, we can determine the name launcher-side by comparing "Team Colour" to a list of predefined values and set it.

Fragcount needs to be signed, this value can go into the negative if players keep dieing all the time.

Killcount should stay really, because we already have Deathcount anyway.

Oh and you forgot the player name field too. :P

Offline Nes

  • Developer
  • Posts: 31
    • View Profile
Re: New protocol design ideas
« Reply #16 on: December 04, 2008, 18:48:54 »
Not bad so far.

I think "Teams Enabled" is kind of irrelevant, since you can already use "gametype == teamdm" to determine if its enabled.

Also, "Team Name" is kind of the same, we can determine the name launcher-side by comparing "Team Colour" to a list of predefined values and set it.

Fragcount needs to be signed, this value can go into the negative if players keep dieing all the time.

Killcount should stay really, because we already have Deathcount anyway.

Oh and you forgot the player name field too. :P

But what if the team's color does not match the list of predefined values? TEAM3? TEAM4? And what if one server wanted to display one team both in-game and in the launcher as the EAGLES?

As for fragcount and killcount, the message I posted under the layout should explain everything.
« Last Edit: December 04, 2008, 18:50:13 by Nes »

Offline Russell

  • Developer
  • Posts: 70
    • View Profile
Re: New protocol design ideas
« Reply #17 on: December 05, 2008, 17:33:00 »
But what if the team's color does not match the list of predefined values? TEAM3? TEAM4? And what if one server wanted to display one team both in-game and in the launcher as the EAGLES?

As for fragcount and killcount, the message I posted under the layout should explain everything.

Oh okay, here is an idea: we can have a team name field, but if the field is blank and since we have a limited number of colours to choose from (doom has a palette of only so many colours), we could assign a name to each of them (or have a range for the team colour, so the colours can vary slightly?)

I still don't get it, frags usually dips into the negative and most people who play doom know that, should we really change the semantics/terminology of it?