Wrap multiplayer-only code inside preprocessor directives like #if MULTIPLAYER_ENABLED .
Even as an "optional" build, the netcode synchronization remains impressively tight, showing minimal desync during high-intensity sessions. Modularity: fgoptionalmultiplayerbuildbin
# Define the optional feature gate for multiplayer modules option(ENABLE_FG_MULTIPLAYER "Compile the optional multiplayer networking module" OFF) if(ENABLE_FG_MULTIPLAYER) message(STATUS "Configuring isolated multiplayer binaries...") # Locate all network, socket, and RPC source files file(GLOB_RECURSE MULTIPLAYER_SOURCES "src/fg_multiplayer/*.cpp") # Define the independent build target add_executable(fg_multiplayer_node $MULTIPLAYER_SOURCES) # Force the build system to output binaries into the dedicated 'bin' subfolder set_target_properties(fg_multiplayer_node PROPERTIES RUNTIME_OUTPUT_DIRECTORY "$CMAKE_BINARY_DIR/fgoptionalmultiplayerbuildbin" LIBRARY_OUTPUT_DIRECTORY "$CMAKE_BINARY_DIR/fgoptionalmultiplayerbuildbin" ) # Link specific low-level socket and encryption libraries target_link_libraries(fg_multiplayer_node PRIVATE OpenSSL::SSL Threads::Threads) endif() Use code with caution. Why does a “single‑player” game have a mysterious
The fgoptionalmultiplayerbuildbin file is kept separate for two major reasons: 1. Saving Internet Data and Storage for Steam or Origin emulation)
The downside? For players, it creates confusion. Why does a “single‑player” game have a mysterious multiplayer binary? Why does deleting it sometimes break achievements or save syncing? (Answer: lazy dependency checks.)
If the repack includes a multiplayer fix (e.g., for Steam or Origin emulation), make sure to copy the contents of the fix folder into the game's main directory, overwriting files when prompted. Some repacks include a batch script to automate this process.