Search Unity

Redis for real-time multiplayer games?

Discussion in 'Connected Games' started by JoeStrout, Sep 6, 2019.

  1. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    8,138
    Has anyone tried using Redis as the networking architecture for real-time multiplayer games? The same sort of games you might otherwise do with Photon, DarkNet, etc.?

    My guess is that the latency will be a bit high. Not good enough for a fighting game or FPS, perhaps, but good enough for a MOBA or any point-and-click type game where a little latency is easily hidden.

    But this is pure speculation, and I'd love to hear from folks who have actually tried it. I'm considering adding it as the standard networking architecture in Mini Micro, and it'd be nice to know what the performance implications are.

    Thanks,
    - Joe
     
  2. MrsPiggy

    MrsPiggy

    Joined:
    Jun 13, 2018
    Posts:
    93
    You mean using the PubSub features in Redis? I have never seen this used in mp games. Are there any examples?
    In theory it could work though probably best for turn-based games, I guess.
     
  3. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    8,138
    Yes, that's the feature I mean. I've heard claims that it is actually quite performant, since it is keeping everything in memory — when a pub comes in, it just turns around and squirts it right out to the subscribers. So maybe it could be used for real-time games? But like you, I've never seen it. Hoping to find someone here who can share their experience.
     
    MrsPiggy likes this.
  4. doctorpangloss

    doctorpangloss

    Joined:
    Feb 20, 2013
    Posts:
    216
    Redis has a pretty idiosyncratic protocol and limited security model. It isn't tested on untrusted clients, buggy or malicious clients may be able to crash your Redis instance. That's why in practice nobody uses Redis clients in an untrusted domain.
     
  5. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    8,138
    Thank you, that's a helpful insight!