Is it possible to have semi-reliable UDP?

Options
Hello,
I'm making an action game with Photon Realtime.
Some commands have to be sent in time. And when they aren't arrived in time, I'd like to discard them.
Is it possible to have semi-reliable UDP? It means that semi-reliable UDP resend commands two or three times, and then give up.

Thanks in advance.

Comments

  • Kaiserludi
    Options
    Hi @Tatsuya.

    No, resending a command 2-3 times and then throwing it away is not supported.
    You either need to send a message reliably, which means it will get resend until it goes through or until the max resend count o the resend timeout triggers. If a reliable command does not goes through in any of the retries, then Photon considers the connection as lost.
    For your use case I would really just send the commands as unreliable.
    Packet losses are rather rare with a somewhat stable connection and when you could throw away a a package and still continue the game then it should not matter if once in while such a packet gets lost.

    So, consider, what is more important:
    Does the message need to arrive at all means, otherwise it does not make sense to continue playing?
    Then send that message reliably.
    Is it important that the message arrives quickly and it does not make sense to resend it if some times has past, as more up to date data would have been sent by then anyway?
    Then send that message unreliably.
  • Tatsuya
    Options
    Hello, Thanks for your reply.

    Our target devices are mobile phones and packet loss can occur depending on where the user play in.
    If I can have semi-reliable UDP, then I'd like to use it for visual expression. I also use reliable UDP for game logic.
    For example at shooting game, a player shoots a gun and a bullet goes to an enemy.
    A bullet may not hit an enemy due to using semi-reliable UDP, but an enemy can die due to using reliable UDP.
    I'd like to discard a bullet message when it's not necessary and resend an enemy killing message instead.
    I think it's good for reducing total packets on mobile network.

    I'd like to have your advice.
    Thank you very much.
  • Kaiserludi
    Options
    Hi @Tatsuya.

    Sorry, but this sounds like a terrible idea to me.
    It would mean that it can happen, that a player does not get hit, but still dies out of nowhere. For the dying player that would feel like if his opponent uses a hack.

    Therefor I think that hit-messages should be sent reliably.