New and Improved C++ Client Library

Author profile
Gabe
September 12, 2022
Featured image

A lot has changed since we first released our C++ Client Library in 2019. We’ve added several new client libraries, expanded documentation for the Unity, JavaScript, Godot, and Java clients (with more to come), many new versions of Nakama, and launched some new products in Heroic Cloud and Satori.

During this time the C++ client library has proved a popular choice for many studios and independent developers. With that in mind, we decided it was time to make some much needed improvements and are happy to announce the release of our re-architected C++ Client Library!

Why the redesign

As Nakama has evolved over time, and as the needs of our developer community have grown, it became clear that there were many areas we could improve upon from the initial version of our C++ client library.

The original client was written in three layers: C++ with a C layer on top, and then an additional C++ layer on top of that. This yielded a too-large library with complex and unwieldy dependency management and build system.

The end result was a library where maintaining support for multiple platforms became a big pain point. Compounding these pain points was the deprecation of a dependency used by the HTTP and Websocket libraries.

Taken all together this meant a large refactoring was in order, so we rolled up our sleeves and got to work!

What’s new

More important than what’s new in this version is what’s missing - nearly two-thirds of the original codebase!

The layered approach has been removed, no more intermediary C layer needed as we now compile our library with the same compiler as Unreal Engine, making support for multiple platforms a breeze.

Improved build system

A complete rework of the build system has been done, including the following:

  • Using CMake converted to a toolchain file approach for building our library
  • Modularized CMake files to allow for easy addition of new build targets
  • Removed Git submodules and instead use a new package manager: Vcpkg
  • Added universal binary support, so now a single library can be used on any Mac architecture

A new CI pipeline was also added to take advantage of the new build system, and the ability to build for multiple platforms at once.

Added platform support

The dramatically simplified library, new build system, and improved CI pipeline mean support for multiple platforms is now easily achieved, including:

  • Windows
  • Linux
  • MacOS / iOS
  • Android
  • Xbox One
  • Xbox Series S|X
  • PS4
  • PS5

New and expanded documentation

To go along with the new library we’ve added a comprehensive new C++ Client Guide to our documentation, using a mock-game format walking you through all Nakama features.

Same open-source commitment

At Heroic Labs we’ve always been committed to growing and supporting the open-source ecosystem for GameTech, and that hasn’t changed. This new C++ library and the Unreal client library for which it serves as a base remain fully open-source, as they always have been.

We hope the new client library makes it easier than ever to get started and build your dream games with Nakama! Join us in the Heroic Labs Forum and let us know what you think.

Speak to the Heroic Labs team

Do you have any questions about this blog post or would you like to find out more about any of our products or services?