We are looking for some hints or ideas on how to solve an issue of getting 20 machines on a LAN to randomly pair up with another machine on the LAN at roughly the same time.
We’re using Blueprints, by the way)
This is part of a University research project that involves anywhere from 4-20 people in a room, randomly connect to another person in the room so they can complete a level together, but not know who it is (kinda like Journey for the PS3)
We thought about ‘pre-connecting’ them all, by setting them up before the participants arrive, but unfortunately there will also be other software being run on the machines (laptops) for the experiment and we can’t have an Unreal app running in the background while that happens (it’s also a battery killer). So basically, as part of the experiment protocol, they will all be starting the app at the same time (give or take a few seconds).
Our plan, then, is to have half of the people in the room run an app that creates a session, and the other half connect to one of those sessions.
So far we’ve tried the following:
We have two builds, which differ only in one hard coded variable (isHost)
-The ‘Host’ build (isHost - True), when started, immediately creates a LAN session, chooses the level, and waits.
-The ‘Client’ build (isHost - False), when started, waits 10 seconds (to allow all the hosts to create their sessions), then runs the ‘Find Sessions’ function. It then looks through the array of sessions found, looking for a session with only one player connected. When it finds one, it joins the session.
This works, but unfortunately we sometimes get two clients and one host in a single session. It’s like there are two clients joining at the same time.
We tried limiting the number of ‘public connections’ to 2 (one for host, one for client) but it doesn’t seem to help. When we tried 1 public connection, it wouldn’t join at all.
(Does anyone know, as an aside, if the public connection parameter is supposed to include room for the ‘creator’ of the session… we can’t find any documentation to indicate yes or no?)
Anyway, does anyone have any ideas on how to solve our issue?
Thanks in advance.