No announcement yet.

Replicated actor are spawned by server but how to do an "immediate spawn" on client?

  • Filter
  • Time
  • Show
Clear All
new posts

    Replicated actor are spawned by server but how to do an "immediate spawn" on client?

    I want a player to throw a dice on mouse click

    the player click, a rpc is sent to server, so the server spawn a dice

    the dice blueprint is checked to replicate so the dice will appear on client too but the client will have a little delay between the mouseclick and the dice spawn

    so how to "fake" an instant spawn on client side? does i have to spawn a dice on client, then destroy it when the server's dice replication appear? (how to handle this? :x)

    share your idea or tips, i really need some idea to do this properly


      why is seeing dice appear as soon as you click really important?
      is the dice going to be interactive?( like other player can bump into it)

      When you do local spawn, you are risking seeing 2 dices at the same time, or off-sync when you destroyed local ones and show replicated ones.

      If it's just too sluggish, maybe you need to review the click to spawn event.(like maybe too many checks, some nodes that could cause delay, etc)
      Basically I tested my prototype with my friend across Pacific ocean, and it still handles fine according to my friend(client).

      Sorry if I didn't answer your question, as I found it weird for a dice, not a bullet to spawn immediately.
      Unreal Engine 4 Game Framework diagram for relation of all major base object types
      Unreal Engine 4 Input Event diagram, scroll down to section Input Processing Procedural
      Resident Evil Classic Camera
      RPCs official document, Must Read
      Everything you should know about replication


        Well even for a simple dice i found the delay disturbing because the client can move his pawn immediatly due to predication, he dont have to wait the server response to move, but when the player throw a dice the game isnt reactive (tested with 100ms) the delay is disturbing comparing to the movement.

        but yea you answered about problems i will have (2 dices/off sync), was wondering if people tried something like this with success

        btw the game is still playable with 150ms but would be perfect with spawn prediction <3 (i play fast fps game i love feeling a 0 latency) even for a dice game turn by turn i want low latency (i just discovered i was an hardcore dice gamer)
        Last edited by skeleton60; 09-26-2014, 05:57 AM.


          You could spawn the dice on the client but ask the server for the result. Then the dice on the client play a rolling animation while waiting on the result.