Communicate on event - from an actor in a level instance to other clients

Hi

I have been looking for a way to .
(each in their own level instance).

I have a persistent level that is basically empty (just lights etc)
and I have 1 populated level that includes interactable actors.
Running a dedicated server, all players are in the lobby.
on Start each player creates his own level instance of the streaming level and is alone in that world.
He can interact with the levers etc in his own world and it has no effect on any other players level
Sort of non replication.

This is exactly as required for my “Relay Play” where player 1 will play the role of 1st signalman and using prototypical bells block instruments and levers to set the signals… pass a train though his own level.

During passage of this train through the level player 1 will communicate and offer the service to player 2 and then he will pass on to player 3 etc etc.

All works as it should except for the fact that player 1 will need to know the status of an Interactable Block instrument in Player 2’s Level.

So far I have not found a way to call
Client2-> Level Instance-> Actors of Class Signalbox-> west blockset → Pegger—State

This could be in level BP or Game instance

Any ideas greatly appreciated

a link to the single player demo which may give an idea


Regards

Paul G

Hi. I think it will be better to use a common network game architecture where server stores the whole game state (It could be a replicated actor, GameState class or something else) and receives requests from players to perform some actions.

Each player have to spawn it’s replication proxy with Replication and Only relevant to owner flags enabled. Server will see all of these objects but players will see only them personal instances. All communications between these objects should be implemented on a server side. Players can’t change state of replicated objects because it’s broadcasted from the server, so you have to use RunOnServer marked events to inform a server about player actions: For example, if you want player to turn the lever you have to send a “lever turning” request to the server and then wait for replication with new state of a lever instead of trying to turn a lever on a client. Really the best way is to inform a server only about player actions (player pressed “use”) and evaluate feedback on a server - it protects against cheaters. Because of using asynchronous levels for playing it might be tricky: some players have train on their stations, some don’t, and you can’t just use tracing on a server side - it will give wrong result, but if it’s not important for gameplay you can just ignore it (but there is possible glitches with collision). To avoid problems with hitting levers you can use static interaction areas which are independant from the levers position.

As result you will get something like this:

Player0 =[requests]=> Server (Player0 state) =[Interacts]=> Server(Player5 state) =[replicates]=> Player0, Player5

If you using separate replication agent you then have to copy state from this to the player level (actually turn levers, launch train arrival script etc.). With this architecture if player is disconnected or link is broken player will be able to walk around (if you don’t replicate movement) but unable to push anything, but it seems normal for your game.

Hi Thanks for the reply,
I will start a new test projext and try as you outlined.

Cheating or train collisions are not a worry.
The train spawns and is destroyed on each level instance in turn, and the bells and block system is designed to only allow one train in a section (each line) at a time…

Just a shame you can’t seem to call client1> actor XXX in any way

Will give it a try

Thanks
Again

Paul

Hi all
Tried a couple of experimental projects.
Using the recomended server client MP , so far there has been no way for me to produce my goal of
3 identical levels each with a single player in each.

So back to my streamed instance level method and its communication difficulties.

Further experiments,
give each player and index and on creation of the instance add a test variable in an array in the game instance BP (index = player index) , then check the length of the array .

Expecting to see 3 ( the same as number of players ) but nope it returns 1

I was under the impression that game instanceBP, was consistent across all levels ,

Seems this is not the case, in this example and in essence I am running 3 seperate games.

so my next question is can a game export / import data realtime ?

Paul_G