RTS using Cloud or Server?

Options
lampshade9909
edited September 2013 in Photon Server
I'm developing an RTS game (think Command and Conquer or Star Craft style RTS) for mobile devices, Android/iOS. Yes, I'm aware of the challenge of making an RTS play multiplayer on a device that may be using cellular internet (for example, someone on an iPhone(cellular) may be playing against someone on an iPad(wifi).

I read in the documentation that Photon Cloud allows for "Casual real-time games". Am I reading too much into the word "Casual" or should I be using Photon Server (not cloud) for a RTS game? I'm developing my proof of concept for bringing my RTS online using Photon Cloud. So far so good, I'm currently able to have two device's units occupy the same battlefield and move around in real time. But I have yet to really get knee deep into send the real amount of data that I require in order to fully bring the game online.

Anyways, some Q's:
    -Are there any concerns with using Photon Cloud for a Command and Conquer or Star Craft style RTS?
    -Does anyone know of a multiplayer RTS that currently uses Photon Cloud/Server?
    -Any tips for someone looking to do so?
    -Can anyone think of any RTS specific techniques I could implement using Photon Server that would dramatically improve the online playing experience over Photon Cloud's simple client based data exchange?

Thanks a bunch!

Comments

  • Hi lampshade,

    I'm no expert on RTS games, but I think I can say a few general things about Photon Cloud & Photon Server that might help with your decision.

    First, Photon Cloud & Photon Server are (nearly) the same product - the main difference is that we are hosting Photon for you with Photon Cloud, while you need to handle hosting yourself with Photon Server.

    So there might be a small performance benefit if you host yourself (you have full control about the hardware, the network, the Photon configuration etc.) and could fine-tune everything until it fits your needs perfectly - but first, that requires lots of effort (and knowledge as well), and second, we make sure that Photon Cloud performance is always as good as possible and that there are sufficient capacities.
    Furthermore, with the different Photon Cloud regions (EU / US / Asia / Japan), your clients can always choose the Photon instance with the lowest latency.

    That being said - we ask our Photon Cloud customers to limit their traffic to ~ 500msg/s per room. That is, in general, sufficient for most types of games (especially if you have mobile clients that need to handle that amount of messages!) - but if you really plan to have large rooms with high message send rates, you might be better off with a self-hosted server.

    One thing you also want to keep in mind: if you have large amounts of "units", you should not try to synchronize all (position, movement, ... ) data between all clients in small intervals. You probably want to implement a kind of interest management, i.e. synchronize only the data that other players actually need (because they are in sight etc.) - or, probably even better, only synchronize the player actions & run a full simulation on each client.

    If you need server-side logic to achieve this, you need Photon Server, which allows modifications of the server-side logic. Photon Cloud can not be modified on the server side. However, it's a common approach to start development on Photon Cloud and later switch to Photon Server if you find that you need more flexibility.

    To answer your questions :
    - no general concerns, no.

    - I don't know of a big RTS game right now, but the range of successful games on Photon Cloud goes from PC-based minecraft - like games to a well-known hack & slay-game for mobile devices, first person shooters and many more.

    I'm no expert in RTS games and so I can not share specific tips & tricks, but hopefully someone from the community can share their experience here.

    EDIT: I just found this thread on the Unitiy forums - even if you don't plan to use Unity, it might give some insight: http://forum.unity3d.com/threads/107453 ... e-RTS-Game
  • Thanks for the tips, I am running a full simulation on each client. Planning out all the details right now... Here's my game in it's current alpha state playing multi player using Photon cloud!
    http://www.youtube.com/watch?v=eDiJSYm2efs

    Does Photon Cloud automatically determine which server to connect to, or do you set it somewhere? I see on my monitor that I've been connecting to EU even though I'm in the US. Pretty good connection considering.

    When you say "limit their traffic to ~ 500msg/s per room". What do you define as a message exactly? A OpRaiseEvent, or a byte, or a packet? Because I can pack 500 things into a OpRaiseEvent if I really wanted to be crazy. Obviously optimizing and sending the minimum amount of data possible is the way to go.
  • Hey, that's looking cool - good job! :)

    The client SDKs are using the Photon EU cloud per default, but you can change that by setting the master server address: http://doc.exitgames.com/photon-cloud/Regions/ (either let your players choose, set a fixed region, or choose one dynamically by comparing round trip times etc. - there are many options).

    Regarding the 500 msg / room / s: incoming operation requests, outgoing operation responses and outgoing events are counted as messages.

    Example - let's say you have 4 clients per room, each sending 10 "raise event" operations per second:

    -> 4 x 10 = 40 incoming operation requests
    -> 4 x 10 = 40 outgoing operation responses
    -> 4 x 3 (other players to send to ) x 10 = 120 outgoing events

    => 200 msg / s for your room.

    So, the more players per room, the less messages should be sent. Of course, you *could* try to stuff enormous amounts of data into a message, but you might want to take the limit as a rule of thumb that prevents client overloading as well ;) We recommend message sizes of <1kb.