What is the architecture of something like B.net like?

Slapshot136

Divide et impera
Reaction score
471
particularly how do they manage game lobbies, groups (parties), cross-game chat, friends, etc.

or if not b.net, lets say steam, or xbox live, etc.

I would like to know how they get a group/party into a single game - is there a concept of the "group" somewhere on a B.net server, or does each client form the group themselves?
 

Accname

2D-Graphics enthusiast
Reaction score
1,463
I would guess it is the Host in a Host-Client architecture. A client requests to start a game and the BNet server will host it. Clients can join and at that point its much like a Chat-Server. Whatever one client does is broadcasted to all others within the game / lobby.
Its fairly simple to do this, the problem arises when you try to do it good and on a larger scale.
 

Slapshot136

Divide et impera
Reaction score
471
I would guess it is the Host in a Host-Client architecture. A client requests to start a game and the BNet server will host it. Clients can join and at that point its much like a Chat-Server. Whatever one client does is broadcasted to all others within the game / lobby.
Its fairly simple to do this, the problem arises when you try to do it good and on a larger scale.

how does a "team" join the lobby at the same time then? (since it would suck if you had a party of 4, game accepts 3, and then a random person joins as the 4th instead of your last member).
 

Accname

2D-Graphics enthusiast
Reaction score
1,463
I dont really use BNet much, could you elaborate?
Is it like people make a group and then they always join lobbies together?

I would guess if one person of the group joins the BNet server will send a message to all other members of the group and urge them to join too.
 

Slapshot136

Divide et impera
Reaction score
471
I dont really use BNet much, could you elaborate?
Is it like people make a group and then they always join lobbies together?

I would guess if one person of the group joins the BNet server will send a message to all other members of the group and urge them to join too.

pretty much, except that the group joins as one - as in all at the same time (and also gets placed on the same team)

so an example would be there exists a game that is 4v4, with 2 players in the lobby already on team A - a party of 4 decides that they want to join the game - the party leader will attempt to join the game, party players 2,3,4 will OK the leader's proposal, and then the group joins the lobby and are all placed on team B (whereas if they joined individually, they would occupy 2 slots on team A and 2 slots on team B)
 

Accname

2D-Graphics enthusiast
Reaction score
1,463
I cant see what the problem with that is? Both server and clients are controlled by blizzard.
The server can either place them automatically or make them send the required messages to join the game and a certain team.

It might be a lot of work to do, but it is not complicated work. Its simple, its just a lot of code to make everything work together.
 

jonas

You can change this now in User CP.
Reaction score
67
I think blizzard doesn't do the hosting, they probably use UDP hole punching or something to make the clients do all of the data trafficking... No need to pollute the bnet servers with all of that data.

Joining the lobby as a team seems trivial. Simply have a datastructure for teams on the server which behaves like a collection of players, and if one of the players joins a game, put all of the other players into the same game, notifying their clients of the update... on the server this can be atomic, even if the clients see the change with a huge delay (between each other).
 

Accname

2D-Graphics enthusiast
Reaction score
1,463
I think blizzard doesn't do the hosting, they probably use UDP hole punching or something to make the clients do all of the data trafficking... No need to pollute the bnet servers with all of that data.
I dont think so. If this was the case we would have LAN support for tournaments.
It would also be too easy for hackers to create their own Servers like they did in broodwar. I believe that blizzards wants to milk the player base as much as possible and so they were extra careful with keeping all the control in their hands.
 

jonas

You can change this now in User CP.
Reaction score
67
I dont think so. If this was the case we would have LAN support for tournaments.
It would also be too easy for hackers to create their own Servers like they did in broodwar. I believe that blizzards wants to milk the player base as much as possible and so they were extra careful with keeping all the control in their hands.

Well, it's just a question of money and infrastructure...
Do you think it would be easy to include measures that keep the control, e.g., some small background traffic, without having to broadcast all of the game data of millions of players? Maybe I'm also overestimating the amount of data that is sent...
 

Accname

2D-Graphics enthusiast
Reaction score
1,463
I dont think its too much data. They only have to transfer player inputs. Each single input is probably just a few bytes and the smallest package sizes are what, 64kb?
This should be absolutely no problem with a good connection. Its basically an echo server. Besides, BNet really is pretty laggy from time to time. Even at the larger tournaments the players often have to fight against the lag.


Lets just make a calculation.
Lets assume a single instruction of a player is like 20 bytes. Thats generous. You know, all you need, actually, is the playerID (1 byte), the time (8 bytes) and an ID for the action. But since we wanna be flexible and all, lets make it 20, just to be sure.

A good player has 300 actions per minute. The vast majority of players has much much less, but to keep it simple, lets assume we are all badass and do 300 APM like a BOSS.

For 1 million players we have:
300 * 20 * 1_000_000 == 6_000_000_000 bytes per minute.
That is:
6_000_000_000 / (1024 * 1024) == 5723 mb per minute.
That is:
5723 / 60 == 96 mb per second.

And that is not very much.
Now assume that they do not have one server but hundreds of servers. If you look at it this way, it really isnt that much work they need to put in.
Not in the 21st century for a multi-million dollar company.



Edit: Another point to consider:
If two koreans are playing against each other and they play on the european or NA servers they are still having high lag. This pretty much ensures that there is constant communication with the server involved or otherwise they would get the same speed as if they were playing on the korean servers.
 
Last edited:

jonas

You can change this now in User CP.
Reaction score
67
They send a lot more than that... In fact I'm positive they send data about nearly every update that happens in the game, which is why creating units locally creates desynchs in the first place. Nevertheless, I don't think that your ballpark figure is off by more than 100 (even though just sending the data of a unit creation is at least 20 byte).

The effect that you describe could also be explained by sending just *some* packages over the blizzard servers.
 

Slapshot136

Divide et impera
Reaction score
471
if one of the players joins a game, put all of the other players into the same game, notifying their clients of the update... on the server this can be atomic, even if the clients see the change with a huge delay (between each other).

so in other words the "group" needs to live on the server then
 

Accname

2D-Graphics enthusiast
Reaction score
1,463
They send a lot more than that... In fact I'm positive they send data about nearly every update that happens in the game, which is why creating units locally creates desynchs in the first place. Nevertheless, I don't think that your ballpark figure is off by more than 100 (even though just sending the data of a unit creation is at least 20 byte).
Exactly not!
If they were sending all that data then no desyncs would happen! If all the data was available the game state could be reconstructed to match and desyncs would be no more.

I would guess that each object in the game, no matter what it is, gets a unique ID, probably some 64bit integer value. Whenever something is created it gets a new one.
If there is ever a point where 2 players have an object with a different ID then the game knows it has desynced and thats it.
 

jonas

You can change this now in User CP.
Reaction score
67
Exactly not!
If they were sending all that data then no desyncs would happen! If all the data was available the game state could be reconstructed to match and desyncs would be no more.
This is not the case. There are two ways to deal with inconsistencies in the game states:
Reconstruct or disconnect. The first option only works if enough data is sent to detect inconsistencies immediately.


If there is ever a point where 2 players have an object with a different ID then the game knows it has desynced and thats it.
The game knows it has desynced if it knows that there are two players with different game states.
Maybe my memory is fooling with me, but as I recall, if you create a unit for a single player, the game desynchs immediately. Therefore, the game knows immediately that there is now an additional object on that machine, but not on the machine of the other players.
Otherwise, creating a different unit for each player would also not desynch.
 

Accname

2D-Graphics enthusiast
Reaction score
1,463
I dont know how it is in SC2 because I never play, nor make custom maps there. I never bothered much about desyncs, I never attempted to create anything just for one player.
I would definitely recommend against doing that. Its pointless. There is absolutely nothing that you get from doing so.
The game should always assume that the other computer is doing the same thing. Only when it does not there should be a desync.
I mean, the human players will not notice a difference of a second or two before the desync, but for the game this can be a lot of messages going back and forth. So how exactly would you know how "immediately" the desync happened? Is 100 messages later still immediately? It might only be a second of real time after all.
We also dont know how these ID's would beconstructed, maybe they carry information that can be used to find errors.

Did you ever try to create a local unit for all players simultanously?
 

jonas

You can change this now in User CP.
Reaction score
67
I dont know how it is in SC2 because I never play, nor make custom maps there. I never bothered much about desyncs, I never attempted to create anything just for one player.
I would definitely recommend against doing that. Its pointless. There is absolutely nothing that you get from doing so.

What if you want a single shop that sells different items to each player?

Did you ever try to create a local unit for all players simultanously?
I just did.

Code:
Custom script:   call CreateUnit(GetLocalPlayer(), 'Hpal', 0,0,0)

Desynchs.

Code:
Custom script:   call CreateUnit(GetLocalPlayer(), 'Hpal', GetPlayerId(GetLocalPlayer()) * 1000  - 2000,GetPlayerId(GetLocalPlayer()) * 1000  - 2000,0)

Desynchs.

(I reduced vision of the paladin to 100).

So how exactly would you know how "immediately" the desync happened? Is 100 messages later still immediately? It might only be a second of real time after all.
Probably it has to be the same message. Otherwise, things as the following could happen:
I create a different unit on each machine, one where the unit deals 10, one where it deals 9 damage.
The unit fights, until it kills one unit on the machine where it dealt 10 damage.
The killed unit is ordered stuff on the machine where it was dealt 9 damage -> desync detected, but in between lots of things happened... Basically the whole game state would have to be synchronized now.

I think there were such effects in Star Trek: Armada when we played it in LAN... Units starting to move different on different machines, desynch detected only after 20 minutes.
 

jonas

You can change this now in User CP.
Reaction score
67
as maphacks have proven, each client has information regarding all of the unit data, even if they shouldn't have access to that information in-game

Well, so has the above experiment. Which just shows that there's a lot of extra synchronization going around.

The game should always assume that the other computer is doing the same thing.
It could, but in this case doesn't. I remember other things causing desynchs only at a later point, like adding items to a shop only for a local player - the desynch is caused only once the item is purchased...
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top