SmartFoxServer and Jelastic for Mobile Game Development.

By June 20, 2013 HowTo 5 Comments
Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInEmail this to someone

Mobile gaming is a growing phenomena that has exploded with the rapid propagation of smartphones and tablets, in particular those running Apple iOS and Android.

In 2009 the smartphone game sales on those two platforms amounted to 19% of the market. Two years later it was 58% and it’s now leading the apps market, with expected revenues in excess of $8 million for 2013 and twice as much for 2014.

Every day new developers are joining the community of mobile gaming. We have prepared a simple tutorial that will demonstrate how easy it is to get started with Jelastic and SmartFoxServer 2X.

SmartFoxServer 2X is a comprehensive platform for rapid development of multiplayer game s and applications, supporting Adobe Flash, HTML5, Android, Unity3D, iOS, Java, C++ and more. SmartFoxServer 2X comes for free with a 100 CCU (concurrent users) license, 100% of the features and no time limitations.

Thanks to its simplicity of use, versatility and performance, it currently powers hundreds of projects all over the world, from simple turn-based games to massive virtual worlds and real-time action games.

In this post we will show how to rapidly setup a Jelastic environment and deploy SmartFoxServer for testing and production. The whole operation takes no longer than 5 minutes.

Create environment

1. Log into Jelastic Manager and click on Create environment button.

2. Select the Expert Environment topology, click on the VDS button and specify the cloudlet limit for your node. After that type the name of your environment and click Create.

smartfoxserver-environment

3. After you environment is successfully created establish SSH connection using any SSH client suitable for your OS (MacOS, Linux, BSD or Windows) or Jelastic web-based client.

Install server

1. Download SmartFoxServer community addition for Linux x64.

# wget http://www.smartfoxserver.com/downloads/sfs2x/SFS2X_unix_2_7_0_64.tar.gz

2. Unpackage the archive you’ve just downloaded.

# tar -xvf SFS2X_unix_2_7_0_64.tar.gz

Configure the server’s public IP address. In the <unpacked-folder>/SFS2X/config directory open the server.xml file and edit the following line by replacing 127.0.0.1 with the real address of your Jelastic VDS.

<socket address="127.0.0.1" port="9933" type="TCP"/>

4. Navigate to /SFS2X/ directory and enter the next command:

# cd SmartFoxServer_2X/SFS2X/
# ./sfs2x-service start

Now you can navigate to your SmartFoxServer in a browser using the public IP address of your VDS. For example: http://10.11.12.13:8080. The default credentials for the administrator are: sfsadmin / sfsadmin.

smartfoxserver 2x documentation

Success! You have completed the process.

Performance test

The engineers at SmartFoxServer helped Jelastic testing the overall performance of the proposed solution. We used a custom built tool that allows to spawn thousands of clients and generate huge traffic towards the server.

For our simple stress test we set up a cluster of 3 client machines (1 master + 2 slaves) to overload a single SmartFoxServer 2X instance with traffic. Every client runs in its own Jelastic VDS, configured with 32 cloudlets and generating 8333 clients each.

The following are the essential statistics:

  • 25000 total concurrent clients
  • Approximately 5000 Rooms are created
  • Login phase = 30 clients/sec joining the server
  • 6250 messages/sec going to the server
  • 31250 messages/sec going out of the server (this is because each messages is broadcast to 5 users in each Room)
  • The generated network traffic is approximately 8Mb/s IN, and 32Mb/s OUT
  • The whole test uses less than 15% of the CPU and approximately 1.2GB of RAM on the SmartFox instance.

The test was run using the SmartFoxServer’s default configuration for three days, setting the JVM maximum memory at 2GB.

With 25K CCU consuming less than 15% of the computing resources it is immediately clear the massive scalability potential of the SmartFox and Jelastic combination. Paired with the natural horizontal scalability of the cloud, this solution can satisfy projects of all sizes and easily grow with its audience.

smartfoxserver hosting

Finally, with the ability of Jelastic to dynamically allocate resources on the fly, according to the minimum and maximum configured by the user, the solution can satisfy the technical requirements and budgets of every game developer.

If you’re interested in learning more about large SmartFoxServer deployments and relative architectures you can consult these white papers.

Testing a mobile game

SmartFoxServer 2X comes with a large pool of example games for all major supported platforms that can be tested and studied out of the box.

In this white paper we will use the Android version of the Tic-Tac-Toe to get started with SmartFoxServer 2X.

1. Start by downloading the Android example pack.

2. Extract the files from the package you’ve just downloaded and install the .apk on your Android device (Tris/deploy/client/ in our case). You will need to have Android SDK Tools installed.

# adb install SFS_Example_Tris.apk

3. Copy the tris/ folder from the Tris/deploy/extensions/ folder to your SFS2X installation folder, under SFS2X/extensions/

In order to start the game on the client launch the app and change the connection details of your SmartFoxServer using its public IP address.

phone smartfoxserver documentation

Conclusions

The multiplayer aspect in mobile game plays a central role in improving the longevity and popularity of your products, allowing users to enjoy live interaction with friends and other players.

For more information about SmartFoxServer:

For more information about Jelastic:

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInEmail this to someone

5 Comments

  • […] Marina Sprava hat einen neuen interessanten Artikel in unserem englischen Blog geschrieben, den wir Euch nicht vorenthalten wollen. SmartFoxServer and Jelastic for Mobile Game Development. […]

  • Zeater says:

    Hi,

    Recently we have successfully configured word press blog on tomcat 6 for our site zeater hosted on servint jelastic. During the installation we have faced many challenges for which even jelastic team do not have answers. I was thinking of writing an installation guide for php(wordpress) on tomcat using quercus, so that in future it could be helpful for other jelastic customers planning to do same sort of installation.

    Let me know if you guys are interested.

    • Marina Sprava says:

      Hey! It’s great suggestion indeed. We’ll publish your instruction as a guest post at our blog if it is useful for our customers. Could you please contact me via email ms@jelastic.com when you have the first draft?

  • mstram says:

    Hello,
    I signed up for a trial / demo account, hoping to test / replicate your experience with SFS2x, but I see that’s not possible with the demo account (can’t upload app etc).

    Is the “VDS” button also something missing from the demo account ?

    I don’t see it when I launch the Environment topology dialog.

    thx

    Mike

    • Tetiana Fydorenchyk says:

      Hello Mike,
      Usually trial period is restricted and you cannot switch VDS at this stage.
      Anyway you can contact your hosting provider and negotiate with them enabling this option in order to test your application.

      Best regards,
      Tetiana

Leave a Reply

Subscribe to get the latest updates