Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Standalone player pauses when dragging its window

Discussion in 'Multiplayer' started by aspirit, Feb 28, 2010.

  1. aspirit

    aspirit

    Joined:
    Jan 20, 2010
    Posts:
    4
    Standalone player pauses when dragging its window. Is it some way to work around it?
    Setting Run In Background option doesn't change anything. Player is still paused during dragging window, which makes that for example FixedUpdate don't work.

    I have some computing code in FixedUpdate. Results are later being sent to other players. But when I drag server player window, other players does not receive any messages. This destroys whole simulation.

    Please help solving this problem.
     
  2. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    set your windows to render windows while the window is being dragged. otherwise there is no frame rendering and the app will pause
     
  3. aspirit

    aspirit

    Joined:
    Jan 20, 2010
    Posts:
    4
    That's not it. I've got this setting enabled in windows. All windows, and my player window are rendered.
     
  4. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    I don't see why it is that important that it sends all the time, because you can't expect to get even remotely consistent timing on the net anyway, so your code should handle lag etc accordingly (the network example and zero to hero guide contain important aspects like the 100ms push back of event handling to compensate for flux and to get consistent handling)
    This handling is important as the latency between players will vary from 30 - 300ms and each side still should get a comparable result to work with :) (check the internet on interpolation, extra polation, client side prediction especially in relation to HL, Q3, Tribes)


    Also, if your code uses Time.deltaTime for its calculations it will always calculate consistently as thats paused when the simulation is paused for some reason
     
  5. aspirit

    aspirit

    Joined:
    Jan 20, 2010
    Posts:
    4
    I'm sending updated to clients about 2 times per second.

    Got all of these, lag compensation, client side prediction, etc... all works fine, even with latency 300ms. After this time all things will synchronize.
    But server player can drag window for example for 16 seconds. So clients will not receive any updates by this time, and world state will be totally different on server and clients...

    Just checked networking example and m2h tutorials, and there is the same problem, which allows server player to cheat. For example car racing tutorial, server player may drag his window all the time, and client player may push server player to other part of map. When server player releases window, his car jumps to start position, client see that pushed enemy car just dissapeared.

    I could pause clients when they didn't recived message from server for longer time, but I guess its not the right solution...

    ---

    Just tested starcraft in window mode, I didn't find a way to stop updating it, even when minimized or during dragging, simulation still works, and client receives messages...
     
  6. aspirit

    aspirit

    Joined:
    Jan 20, 2010
    Posts:
    4
  7. nunesbarbosa

    nunesbarbosa

    Joined:
    Jul 17, 2012
    Posts:
    103
    I know this is a 2010 post, but I have this issue and I can't find a solution.. How do you guys managed to do that?
     
  8. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    You make sure your simulation can withstand pauses.