x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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 https://www.youtube.com/watch?v=BWz4J5n6l8I

Regards

Paul G

Product Version: UE 4.17
Tags:
more ▼

asked Nov 21 '17 at 08:15 PM in Blueprint Scripting

avatar image

Sly401
30 2 3

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

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.

more ▼

answered Nov 21 '17 at 10:28 PM

avatar image

c4tnt
1k 12 8 29

avatar image Sly401 Nov 22 '17 at 12:00 AM

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

avatar image Sly401 Nov 28 '17 at 01:49 PM

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

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question