Run unity instance on photon server to simulate physics

Options
I found the following in the official documentation:
"You can actually run Unity instances on the server. Your Photon Server logic will be written in C#, so it's easy to start one Unity process per Room and communicate with it as if it was another client."

But I didn't find any example how to run/use unity instance on server and how to call physics simulation. Does anybody try to do it?

Comments

  • TechCor
    Options
    You have to figure out how you want to set it up yourself.

    A basic outline would be:
    - Create a Unity project for running as the server, or use a server version of the client
    - Use the C# Process class to run your executable from Photon Server. Pass in any relevant arguments (like the room ID to connect to).
    - Have your Unity executable read the command arguments and connect to the Photon Server.
    - Use some kind of special handshake message to let the server know you are the boss

    I personally just run one Unity instance for all rooms and use a special TCP connection to save memory, but that is a somewhat advanced way of doing things.
  • blackfxx
    Options
    Thank you for your answer! I found farseer physics project(opensource, written in C#) and now use it on a server and clients. It only 2d, but it's enough for me)