When I started developing LightnerX, I decided to use C++26 modules.

At the time, it seemed like a reasonable choice. I was building a new library, so why not use the latest features available?

Well, there's one problem: not everyone is using C++26.

And when you're developing an open-source library that other people are supposed to integrate into their projects, compatibility matters.
What is LightnerX?

LightnerX is an open-source C++ networking library I've been developing for multiplayer games.

It originally started as part of my own game project, but eventually became a standalone library.

It uses Valve's GameNetworkingSockets as its transport layer and implements INER, a communication model I designed around four message types:

Intention: A client requests an action from the server. Notification: A client sends information without expecting a response. Event: The authoritative server communicates something to clients. Response: The server reports the outcome of an intention. 

LightnerX also provides connection management, message interpretation, callbacks, and message batching.

The idea is to provide a relatively small networking library that developers can integrate into their own games without adopting an entire networking framework.
The compatibility problem

My original implementation relied on C++26 modules and newer standard library features.

That worked for my development environment, but it also introduced requirements that many existing projects might not satisfy.

For example, someone developing a game with a C++17 codebase would need to deal with those requirements just to integrate LightnerX.

I didn't want that.

So I started working on a C++17 migration.
What needs to change?

This isn't just about changing the CMake standard from 26 to 17.

The migration involves several changes:

  1. Replacing modules with traditional headers

The original library uses .cppm files and module imports.

The C++17 version needs conventional .hpp and .cpp files, with the appropriate includes and declarations.

  1. Replacing newer standard library features

Some of the original implementation relies on features such as std::span and std::expected.

Since these aren't available in C++17, I'm implementing compatible alternatives within the LightnerX namespace.

  1. Preserving the existing behavior

This is probably the most important part.

I don't want to redesign the library during the migration.

The objective is to preserve its behavior and functionality while making the implementation compatible with an older C++ standard.

That means reviewing the API, testing edge cases, and checking that the migration doesn't introduce regressions.
Why C++17?

I considered other standards, but C++17 felt like a reasonable compatibility target.

It's modern enough for the architecture I'm using while allowing developers with older C++ projects to integrate the library more easily.

And honestly, I would rather spend time improving the networking library than require people to change their entire toolchain to try it.
What's next?

The C++17 migration is part of my effort to make LightnerX more practical for other developers.

I'm also working on testing, documentation, and examples that demonstrate how to use the library in actual applications.

If you're interested in multiplayer networking, C++, or open-source game development, I'd appreciate any feedback.

GitHub

I'm particularly curious about one thing:

When choosing a C++ library for your own project, how much does the minimum required C++ standard influence your decision?