Can I use photon sdk just like a network library.

I have made my game. Both client and server are written in C# with tcp socket. Is there a easy way to replace my tcp socket with the photon reliable udp socket?
I looks like it is not easy to do. Because
1. I must make my server to a dll.
2. I can't make my own server logic loop. My server must run in a somehow accurately frame per second to broadcast data to client.

Answers

  • edited September 2015
    Hi jwq,

    without knowing your codebase I can tell you only what I'm doing. I made a custom implementation of photon server with the provided sdk. The steps are (in general):
    1. make a custom implementation of PhotonApplication
    2. make a custom client peer implementation so that you can identify clients and sub-server
    3. write your handlers and logic to raise events and answer to operations

    It's definativly not easy to switch from a custom server to photon. I only can advise you to rework all code regarding client, subserver and application handling with the photon sdk. Using this only a network transport layer seem's impossible.

    @community: correct me if I'm wrong on this.
  • Hi,
    I don't care to rework my codebase. What I am worried about is if photon sdk can provide a very accurate event。My game is a lock step RTS game, it needs sending frame data in 30fps, not too fast, not too slow.
  • Photon has a queue for incoming and outgoing commands. You have to call a service method to process these queues. I use Unreal Engine 4 on the client side and call this service method every frame and have not seen any delays. If you have hundrets of objects communicating with each other than that may evolve to a problem but than you must rely on interest management. I think it's possible to achieve what you are looking for.
  • Sorry I miss typing the word “timer”. I mean a very accurate timer event. I don't know how to create a timer in PhotonApplication.
Sign In or Register to comment.