EzyFox Server With Unity

Updated at 1685685740000

EzyFox Server with Unity

In a simple game, which game you can write your logic on EzyFox Server like turn base game, casual game, simple MMO game, ... It's possible for Unity clients play game on EzyFox Server directly. But in a complicated game like MMO game use physical system and Unity hasn't exposed outside Unity framework, so we must use Unity Server.

1. Unity clients play game on EzyFox Server

In this case, everything will be on EzyFox Server include, game managment, game logic, ... You can use game-box, it will support you write server side game logic more quickly. Client will use ezyfox-server-csharp-client to connect to server. Play game and sync game's state.

2. Unity clients play game on Unity server

EzyFox Server will act as the lobby server. It means, every client will connect to EzyFox Server first, wait here util a game has enough players to start. When a game is startable, you can have 2 options:

  1. Run a script from EzyFox Server to start an Unity server
  2. Select an Unity server from managed server list

And then, EzyFox Server will return the Unity server's information to client. Client in a game will connect to the Unity server. When every client connected to the Unity server, game can start automatically, by a timer, by the game master or something else. You can use redis or any framework you want to store and notify the game's state from the Unity server to EzyFox Server. When the game finish, denpend on your above option, you can shutdown the Unity server or clear it's state.