Some Beginner questions

Options
sparr0w
edited February 2014 in Photon Server
Hi there!

I started developing my game with the Service of Player.IO (<-- Please edit out if cannot be named publicly) and intend to switch over to self hosted Photon due to lack of Support and connectivity issues.

Although I checked all of the examples and tutorials there are, I still have nothing but questionmarks above my head :D
My game is being developed in Unity 3D.

Questions:

1.) In above named service the workflow for my game would be as follows:
- Server.dll needs to be compiled. .dll contains of several "Roomtype"'s, each with a custom logic in them. Let's assume there would be "Room1" and "Room2".
"Room1" holds a custom logic for a message called "PlayerSync". "Room2" would hold more game related custom logic for messages like "FightInitiated", "CalcExp" and so on.

- Player connects to the Server, and connects to the Room1. The connection var would be named say "room1Connect". He would then do something like room1Connect.Send("PlayerSync", someInt, someFloat, someString"). The Server, within it's GotMessage Function filters it and recognizes the string "PlayerSync". It runs its logic based on whatever the switch for "PlayerSync" calls and sends something back to the Player again with Send(). In the meantime the Player could be messaging with the Room2 through say "room2Connect" right away.

How would I do that in Photon? Can I split logics into different Roomtypes? And If so, does it make sense with Photon? I think I read somewhere, that each peer a client runs, consumes 1 CCU. So 1 User being in 2 rooms at the same time would consume 2 CCU, is that correct?

2.) I started watching the CJR Gaming Tutorials for Photon + Unity, are they being recommended or is that outdated?

3.) Based on your experience, what server specs are needed to run 500 CCU? I know this is a hard to answer question, since you do not know my game. But in terms of heavyness it should be compared to something like an online poker game. Most of the logics are Server Sided to prevent cheating and the Message Count is not incredibly high.

Sorry for all these amateur questions, but I really need to get started on this fast, since I have lost so much time with the previous Service and need to get this done ASAP, I hope you understand :)

Thanks a lot!

Comments

  • Okay, I just found the Adding Operations Page, which seems to explain all the stuff needed to get custom messages & logics (in my example "PlayerSync" and so on) started.

    If that's the case, and I'm pretty sure it is :D , you can freely skip my "How would I do that in Photon?".

    Thanks!
  • 1.) Yes, you need to add some custom operations, so that is the answer you were looking for. :-)
    Side note: 1 CCU is one physical connection between client and server. One client can have ONLY one connection to the server at the same time.
    However, you can build the server-side logic so that a client is in multiple rooms (also that would require some significant changes of our demo code, but it is certainly possible). The room logic is independent from physical connections / CCU.

    2. The CJR tutorials are a great starting point to understand Photon, but the code examples might be slightly outdated. You might need to make a few minor changes to get them running with the latest Photon. But they are still very helpful, I think :)

    3. Hardware requirements aren't a big deal for your scenario. From our experience, any quad-core server (e.g., Intel Xeons from the 34xx or E3-12xx series - which are really affordable by today) with 4-8 GB RAM should handle this just fine. 100MBit/s uplink should be sufficient as well. Try to run a few load tests and calculate how much traffic you will send and find a hoster that has affordable rates for traffic, it is often the most expensive part of the hosting.
  • Small correction: it is possible to set up more than one connection from a client to the server - this depends on the client platform / the type of client SDK you are using. If you want to know details, please create a separate thread in the subforum for that client SDK (Native, .NET, PUN etc.) so that our client developers can tell you more about that.