Please someone help me with online SESSIONS (nobody knows!?)

Hi guys. I am fighting with this since like 3 months ago.

I asked a lot of questions here regarding networking and I never get any answer.

My case is this:

I am working on a multiplayer game for coin-op.
So basically the whole system are 4 pc connected via LAN.

I want any terminal to be server or client on demand realtime.

If all the terminals are IDLE and someone hits start, then that terminal will be the server
for a game. while this terminal is setting up for the game, other terminals can press start and then will join that game. once all players are set the game will start and will close doors so no others can join, but if there are idle terminals, someone press start and creates a new game and so on…so the goal is having 1 to 4 simultaneous games running.

I struggled a lot trying to know what is going on inside the games without joining the sessions. tried with beacon plugin upd, etc…finally i created a tcp system that can establish a clean realtime communication between all terminals and work as administrator to decide who will start a new game or join an open existent one. So this part is somehow solved.

One of the big problems I am facing now is the server/clients sequence and the times it takes to work.

the only working sequence I found is like this:

server creates a session (fast, almost no time)
server opens the game map with ?listen (some seconds)
clients find sessions (F I V E S E C O N D S ! ! !)
client picks the session and joins

the above order is the only that allows me to sucessfully join the game.
once all players are set to play, I must run that sequence in that order to successfully load the game map and have all players there. it takes like 10 secs! (couple secs for open map?listen and then 5 secs for find and couple secs again for players to open the map too.

I need to know if there is some way to decrease the find time because I cant find any parameter like some findMaxTime or findTimeout.

A local LAN with just 4 computers on it cant take 5 seconds to find some sessions.

I also would like if there is another sequence that can work to make the players to join the
map anyway like this:

first terminal press start —> creates a session

other terminals press start → find the session (5 secs is ok in this case as they must select some features of the game before start the actual game)

all set ----> server opens the map with ?listen and players JOIN

is there some way to accomplish it?

I pray for some answer
Thanks!

Daniel

besides introducing a “5th system” (you might be able to “beef up” 1 of the systems to act as a listen server where technically all the systems are “clients”) which might change quite a bit of your architecture.

I am going to presume this is mostly a closed communication structure (so the systems will be in explicit configuration with no/little communication to the outside, and will know of each other) though if you want the ability to have external communication that gets to different data-security stuff. so I am also thinking “trusted IP” and each system already “knowing of” each other.

could

  • the “1st player” broadcast the initial session start to the other systems with some kind of token that the session is created: even if it is a "HostID" and then "OpenSeats" (1 player game, 2 player game, 4 player game but this gets into your other structures that this thread is not and should not be concerned with)
  • when the other systems receive this they send their SystemID and some joiningstate.
  • then when another player hits “start” (?pays?) that system broadcasts the original “HostID” and that SystemID
  • then the “1st player” system broadcasts again “HostID” and “OpenSeats” (and the responses can be checked against game type)

This could run into situation with race conditions if 2 or more of the systems attempt to be the “1st player” at the “same time” or if 2 or more of the none “1st player” attempt to register. In my mind I think I have addressing the ladder, but I am not sure on the former.

it is up to your design if there is to be a lock-out once the actual game has started.

this is presuming that this will be only through the LAN setup and none be through WAN.

Depending on where you want to release the game, the Steam Online Subsystem’s net driver is much much faster (about 0.3 seconds) when it comes to searching. I don’t know why the Null Online Subsystem’s net driver is so slow, maybe it is simulating an online environment but I’m not sure.

hey @gardian206 thanks for your reply!

Yes the system is closed (just 4 units) and offline (not internet).

I already handled all the pre gamesetups via TCP…one of the terminals is configured as TCP server (via savegame config) and the others as TCP clients.

They hook each other no matter the boot order and when the server knows all the terminals are set then the game goes to ‘title/demo’ mode.

Just one entry game can be opened at the same time for joining.

That means any terminal that starts asks the TCP server if some other terminal is accepting players.

If so then it will be able to be part of that race. if not then it will be the ‘host’ terminal and let the TCP server know that. This way we avoid having two terminals starting a game at the same time because they have to ask to the server, the server will register the new race and then reply to the terminal to approve the new race.

I think the logistics for games managment is pretty solved.

Biggest concern was the high search time required after all is set for the game and the sequence to make it work (session creation->map open->client search->client join) but just figured out that I can use open IP console command instead searching and joining and I think that solves that long time part for now.

I added 3 more IPs to my PC so I can run 4 instances of the game at the same time using gamename.exe multihome=IP so I can test the system as if they where actually in different terminals (I just have a second computer but i think building copying and running the game in more terminals every time I want to test something would be too tedious. Even building and locally running instances with multihome is tedious.

Do you have some idea of a faster workflow for testing? is it possible to run with multiple ips (like using multihome in the exe file) inside the editor to save builds and batch opening the test instances?

Thanks again for your time and help! I feel blessed to receive some answer about this case because it seems there is not much support about multiplayer in the forums or people with knowledge/time enough for helping.

All available help are just youtube videos with the same 3rd person template sesion/client example and a few Udemy courses.

This case is a bit special because the dynamic realtime server/client feature.

Best,
Dany

@STRiFE.x Hi! Thanks for your reply.
Steam Subsystem netdriver is a lot stronger but it requires the system to be connected to internet, to have one steam user for each terminal and be connected to steam service. This project is about an offline/LAN standalone 2/4 terminals product so sadly this approach would not be possible :frowning:

Best,
Dany

So then I’m confused what do you need the Online Subsystem for in the first place?

hey @STRiFE.x yes because is a local network system (no internet).
My biggest problem was the session find times but I found out that I dont need to make that as I know the IP address of each terminal so I can just join a session without finding it via console command (open IP).