Category Archives: Articles

Best of both worlds: SFS2X + server side Unity for realtime games (p2)

In part one of this article series we took a bird’s eye look at various client-server strategies for action multiplayer games. We then highlighted the advantages of running an hybrid solution with SmartFoxServer 2X and Unity on the server side to combine the best of both worlds.

In this second part we’ll be looking at the details of implementing such a solution, the potential difficulties and how to overcome them.

If you have skipped the first article we highly recommend to go back and read it, before you proceed. Continue reading

Best of both worlds: SFS2X + server side Unity for realtime games (p1)

Realtime multiplayer games have been around for over four decades, even though their popularity is a much more recent phenomenon, and they remain one of the trickiest type of games  to develop. Delivering a smooth and responsive action for the players while hiding the latency and limitations of the network is still a major source of coding pain.

Also many games heavily rely on physics to add extra realism and interesting mechanics which in turn adds more complexity to make sure that all players are accurately in synch with each other.

With the emergence of powerful 3D engines such as Unreal and Unity these complex features have been integrated with the visual and rendering systems, hiding the intricacies of physics simulations and networking, and making it more accessible to all developers.

In this article we’re going to take a deep look at the available solutions for multiplayer action games, explore different architectures and examine the multiplayer side of engines such as Unity.

For each method we’ll discuss the pros and cons and finally we’ll propose an integration with SmartFoxServer 2X that we think provides the best of both worlds. Continue reading

SFS2X and Node.js

Some time ago we have been asked by the developers at Gameshastra how to integrate our SFS2X JavaScript client API in Node.js, in order to create a Node application capable of interacting with SmartFoxServer 2X.

We have a strategy game for which we built native client apps in Android, iOS and HTML5. We are also exposing the client functionality as a rest api for apps to be built for Amazon Alexa and Google Assistant. That rest api is being built on Node.js and we want to consume the same services hosted on SFS2X, so that we can manage all the platforms from the same server base and provide unified experience.

Continue reading

Using functional Java with SFS2X Java API

With the release of patch 2.13.1 SmartFoxServer 2X adds support for lambda expressions in Java Extensions. Also we have added support for this new JDK 8 feature in the Java client API, starting from release 1.7.1

If you’re not familiar with lambda expressions we highly recommend to take a look at our introductory article where we illustrate the basics and show how to integrate the feature in your server side code.

In this new article we will focus on the client side of things but, before getting started, make sure you are already using the JDK 8 (or later) and the SFS2X Java API 1.7.1 (or higher) Continue reading

Handling network switches on mobile devices

In the last blog post we talked about what happens behind the scenes when we pull the ethernet cable or shut down the wifi network, and why this isn’t a reliable way to test a “sudden disconnection” scenario.

In this new article we’ll continue our journey “behind the scenes” taking a look at mobile devices and in particular at how to correctly handle the switch between networks, such as WiFi, 3G and 4G. Continue reading

What really happens when you unplug your network or wifi

In this brief article we’re going to take a look at what really happens when we shut down a device’s wifi or unplug the ethernet cable off of a computer. While intuitively one would expect the current connections to go down, this is likely not the case.
We are going to see why this happens and clarify a few misconceptions that arise when testing disconnection scenarios in a multiplayer game. Continue reading

Kotlin and SmartFoxServer 2X

You may have heard of the Kotlin language before, but recently it has seen a big spike in popularity thanks to Google officially adopting it for Android development, alongside Java and C++.

Kotlin is an interesting statically typed language, developed by the good folks at Jetbrains, that shares many similarities with the likes of Scala and Swift. In a sense, it could be thought of the equivalent of Swift for the Java platform: a more modern, concise and safer language that runs in the JVM, fully interoperable with Java.

If that’s not enough, Kotlin also aims at compiling for other targets beyond the JVM, such as Javascript and native platforms and seeks to support asynchronous programming via coroutines and non blocking I/O.

In the context of using Kotlin with SmartFoxServer nothing would be easier: the integration on both server side and client side is painless and it works out of the box with any SFS2X release.

Let’s take a closer look, shall we? Continue reading

JavaScript is back!

With the release of SFS2X 2.13 last week we’re happy to reintroduce JavaScript as a server side language. For those familiar with the history of SmartFoxServer, JavaScript has been available since the early days of SFS PRO for writing server side code, and it’s now coming back thanks to the latest improvements in JDK 7 and 8.

Continue reading