"Unity and Smartfox Best Of Both Worlds" How to use with Jelastic?

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

User avatar
Zenith
Posts: 55
Joined: 09 Oct 2017, 09:57

"Unity and Smartfox Best Of Both Worlds" How to use with Jelastic?

Postby Zenith » 21 Jun 2018, 20:04

Hi,
As I read we need to have sfs on same server where we intend to start our unity servers.
Now that is understandable if I host both on a linux or windows server.

I wonder how would that work with Jelastic?
Can you please shed some light on it.. because if I am going to spin up and down the servers it only makes sense to use it with Jelastic like cloud.

Waiting for your answer.
Regards.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: "Unity and Smartfox Best Of Both Worlds" How to use with Jelastic?

Postby Lapo » 22 Jun 2018, 07:32

Hi,
you don't necessarily need all the Unity servers to run on the same machine as SFS2X.
You can also opt for a setup where you run a dedicated machine for SFS2X and multiple dedicated machines for the Unity servers.

I wonder how would that work with Jelastic?

Yes, this approach is ideal in a cloud-based environment like Jelastic / AWS etc... where you can use the cloud API to launch new servers on demand.

About the "how" question:
as outlined in the articles you would typically run one Unity engine per game Room, so your Extension will be responsible for launching the Unity via the cloud API.

The simpler approach would be to spin one micro cloud server per game (running the Unity server). When the game is over the instance gets shut down or recycled for another game.

Makes sense?
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
Zenith
Posts: 55
Joined: 09 Oct 2017, 09:57

Re: "Unity and Smartfox Best Of Both Worlds" How to use with Jelastic?

Postby Zenith » 22 Jun 2018, 15:47

Lapo wrote:Hi,
you don't necessarily need all the Unity servers to run on the same machine as SFS2X.
You can also opt for a setup where you run a dedicated machine for SFS2X and multiple dedicated machines for the Unity servers.

I wonder how would that work with Jelastic?

Yes, this approach is ideal in a cloud-based environment like Jelastic / AWS etc... where you can use the cloud API to launch new servers on demand.

About the "how" question:
as outlined in the articles you would typically run one Unity engine per game Room, so your Extension will be responsible for launching the Unity via the cloud API.

The simpler approach would be to spin one micro cloud server per game (running the Unity server). When the game is over the instance gets shut down or recycled for another game.

Makes sense?


It does. But how to spin up a jelastic micro server/environment through calls from sfs. Like can you point me to some docs or something where it is possible or so?

I mean to say for Jelastic if I just keep starting new unity servers it would keep scaling vertically right. Or do you suggest creating a new environment for every one of the unity server/game room.
I see amazon provides micro instances. I wonder if that be economically best way to go for this? My game is battle royale type game session typically around 5 to 10 minutes maximum.

I need to know how would I make a package where after starting a server up SFS would also instruct the other party to start a unity server in there with required properties for example port number. It seems this thing is called a docker/container? Where should I start reading about that?

I understand this might be out of scope of SFS and more into the respective could provider. But still if you can pin point for one or two major providers It would be very helpful regards.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: "Unity and Smartfox Best Of Both Worlds" How to use with Jelastic?

Postby Lapo » 25 Jun 2018, 08:43

It does. But how to spin up a jelastic micro server/environment through calls from sfs. Like can you point me to some docs or something where it is possible or so?

Well, every cloud environment provides API to interact with it. You can integrate the API in your Extension and control the creation of new servers. Here's a link to the Jelastic API docs:
https://docs.jelastic.com/api-overview

I mean to say for Jelastic if I just keep starting new unity servers it would keep scaling vertically right. Or do you suggest creating a new environment for every one of the unity server/game room.

It depends on how many resources the game takes. If you can run multiple games on a single server it's even better, I think.
In any case running one game per server is also a good approach, so I think the final decision boils down to how much does it cost and how convenient it is to use one approach or the other.

I see amazon provides micro instances. I wonder if that be economically best way to go for this? My game is battle royale type game session typically around 5 to 10 minutes maximum.

I think you could explore both environments (AWS and Jelastic) and see which one offers the best features/prices for your project.

I need to know how would I make a package where after starting a server up SFS would also instruct the other party to start a unity server in there with required properties for example port number. It seems this thing is called a docker/container? Where should I start reading about that?

Your Extension should manage the Unity servers. Whether you use docker or plain disk images it's a matter of persona preference. What you need is an image that contains the OS and the Unity executable, stored in the cloud system (e.g. AWS). Then you can instruct the cloud system to spin up a new machine of size X, with image Y.

In terms of managing ports, if you run one game per server instance you don't need to juggle port numbers. Every instance can run the server on the same port number. When the server creation is complete you can obtain the IP address of the machine and send it to the clients to connect to it.

Hope it helps
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
Zenith
Posts: 55
Joined: 09 Oct 2017, 09:57

Re: "Unity and Smartfox Best Of Both Worlds" How to use with Jelastic?

Postby Zenith » 25 Jun 2018, 15:35

Great ! Thanks this helps .. I will currently use Jelastic same server for everything as my game takes like 1 cloudlet for 1 game instance.

I would look into docker and container and disk thing and see if it ends up being cheaper. Thanks ! :)

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 69 guests