Skip to content

Developers

michelMK45 edited this page Oct 7, 2026 · 1 revision

For Developers

Everything below is about building and working on the codebase itself — not needed just to run the app.

Repository Structure

  • main.py: project entry point.
  • server16_py/: main application source code.
  • server16_py/app.py: application entry class; assembles the mixin modules below.
  • server16_py/app_ui.py: main window construction, dashboard layout, and UI helpers.
  • server16_py/app_overlay.py: in-game overlay loop, gamepad/keyboard/mouse input handling, and syncing menu content/state to the native overlay (menu rendering itself is done by the RmlUi-based native side, see below).
  • server16_py/app_game.py: game process polling, live match context reading, and stats loop.
  • server16_py/app_settings.py: settings loading, module state management, the Autorun launch, and worker queue.
  • server16_py/module_catalog.py: single source for the Dashboard Modules card — the module groups and order, their locale label/tooltip keys, and the names loaded from settings.ini. A new module only has to be added here (plus its locales/*.json strings).
  • server16_py/app_logging.py: runtime log panel and auto-follow toggle.
  • server16_py/app_localization.py: language switching and UI string application.
  • server16_py/win32_types.py: shared Win32 ctypes type definitions.
  • server16_py/assignment_runtime.py: assignment flow for stadiums, scoreboards, TV logos, movies, and exclusions.
  • server16_py/stadium_runtime.py: stadium loading and application logic, including folder and archive sources.
  • server16_py/asset_runtime.py: scoreboard, TV logo, movie (round / tournament / derby / home team lookups) and Ball/Referee/Wipe/Adboard routing.
  • server16_py/match_asset_ids.py: works out the id the game asks for in a Ball/Referee/Wipe/Adboard pack and plans the rename-on-install.
  • server16_py/chants_runtime.py: chants and audio playback runtime, including the random pick among numbered ClubSong/Entrance variants.
  • server16_py/camera_runtime.py: Anth camera package discovery, preview, and application.
  • server16_py/kit_mixer.py: Kit Mixer runtime — mixes jersey/shorts textures, kit numbers, kit UI thumbnails, and jersey name color (Advanced tab), plus Kit Sets/[kitgk] linked-goalkeeper support (Simple tab), with a per-kit-type restore manager.
  • server16_py/gamepad_bridge_runtime.py / server16_py/hidhide_runtime.py / server16_py/win_elevation.py: Gamepads tab — physical-to-virtual Xbox 360 bridging (ViGEmBus), optional HidHide cloaking of the physical pad from FIFA, and shared UAC-elevation helpers.
  • server16_py/gamepad_test_dialog.py: live raw-vs-translated controller test panel.
  • server16_py/xinput_players.py: tells which XInput player each real or virtual pad is, for the Gamepads tab's Xbox Controllers card.
  • server16_py/substitution_runtime.py: live in-game hook that lets you raise FIFA 16's hardcoded substitution limit for the current match.
  • server16_py/entrance_runtime.py: Team Entrance runtime — walkout anthem playback (round > tournament > home team).
  • server16_py/match_string_patcher.py: live memory scan-and-patch coordinators, including the one behind the scoreboardstdname fix.
  • server16_py/settings_editor.py: settings editing UI.
  • server16_py/dialogs.py: assignment dialogs.
  • server16_py/team_picker_dialog.py / server16_py/stadium_picker_dialog.py: browsable Team/Stadium picker dialogs with crest/logo previews and search.
  • server16_py/asset_grid_picker_dialog.py / server16_py/asset_grid_items.py: the ▦ thumbnail-grid picker beside the asset dropdowns.
  • server16_py/rx3_texture_preview.py: the Match Assets tabs' .rx3 texture preview box with ◀ ▶.
  • server16_py/video_preview.py: embedded ffpyplayer-based movie (.vp8) preview widget shared by the Movie assignment dialog and the settings editor, decoding on its own worker thread.
  • server16_py/movie_preview_runtime.py: streams decoded preview frames into the D3D overlay for in-overlay movie previews.
  • server16_py/dds_image_worker.py: 32-bit bridge that bakes a loose .png/.jpg into a kit-selection UI .dds thumbnail.
  • server16_py/file_tools.py: shared file-copying, archive extraction, and setup helpers.
  • server16_py/fifa_db.py: reads team/stadium names from the FIFA t3db database via the db_worker.py subprocess bridge.
  • server16_py/db_worker.py / server16_py/bh_worker.py / server16_py/kit_worker.py / server16_py/kit_preview_worker.py: 32-bit subprocess workers that load FifaLibrary16.dll (x86-only) to read the database, regenerate BH entries, and mix/preview kit textures, respectively.
  • server16_py/native_tools/kit_extractor/: source for KitExtractorHost.exe (bin/KitExtractorHost.exe), a standalone x86 tool that bulk-extracts kits/database/league-logo content used by the Setup tab's Assets Extractor.
  • server16_py/d3d_overlay/cgfs16_rmlui.cpp / .h, cgfs16_rmlui_menu.cpp / .h: the RmlUi-based F12 overlay menu renderer and menu logic; resources/rmlui/*.rml are loaded as loose files.
  • runtime/: local runtime data such as settings and logs.
  • legacy/: reference material from the original project/conversion process.
  • scripts/setup_python32.bat: provisions the bundled 32-bit Python interpreter used by the workers above.
  • build_exe.bat: convenience build script for Windows.
  • Server16Python.spec: PyInstaller spec file.

Requirements

  • Windows
  • FIFA 16 installed locally
  • Python 3.10+ recommended
  • The Python packages used by the project, especially:
    • psutil
    • Pillow
    • pygame
    • rarfile for native RAR extraction when available
    • vgamepad (Gamepads tab virtual Xbox 360 pads; optional — its bundled ViGEmBus installer is used by the Install Driver button)
    • pypresence for Discord Rich Presence (optional, see DISCORD_SETUP.md)
    • ffpyplayer for the embedded movie (.vp8) preview player in the Movie assignment/settings dialogs (optional — its prebuilt wheel bundles FFmpeg + SDL2 directly, so no separate player install is needed; the preview's Play button just disables itself if the package is missing)
    • pyinstaller for packaging

RAR stadium archives can also be extracted through the Windows tar command when rarfile is not installed (and rarfile itself is configured to use it as a fallback when unrar/7z are unavailable). Depending on your environment, additional packages may be needed if they are introduced by future changes.

FIFA Database Reading (32-bit Bridge)

Team names, stadium names, and BH regeneration are read/written through bin/FifaLibrary16.dll, which is x86-only. Since the main app can run as 64-bit Python, these operations are delegated to a dedicated 32-bit Python subprocess:

  • Run scripts\setup_python32.bat once to provision a 32-bit Python embeddable (with pythonnet installed) at bin/python32/. It is idempotent and is also run automatically by build_exe.bat.
  • If bin/python32/ is not present, the app falls back to the Windows Python Launcher (py -3-32) or common x86 install paths.
  • Without a working 32-bit interpreter, Discord Rich Presence team/stadium name resolution, the Regenerate BH action in the Setup tab, and Kit Mixer will all be unavailable.

The Setup tab's Assets Extractor additionally requires bin/KitExtractorHost.exe (built from server16_py/native_tools/kit_extractor/ via build_exe.bat, or from the prebuilt binary) plus fifa16_decryptor.exe, un_chunlzma.exe, and zlib.net.dll in bin/ — these three ship with third-party tools (Creation Master 16 / FIF Converter) and are not built or redistributed by this repository, so they must be copied into bin/ manually if missing.

Running From Source

  1. Clone the repository.
  2. Create and activate a virtual environment.
  3. Install the dependencies you need.
  4. Run the app with Python.

Example:

python -m venv .venv
.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install psutil pillow pygame rarfile pypresence ffpyplayer pyinstaller
python main.py

Running from source also requires the native binaries described in Overlay Requirements below and in FIFA Database Reading (32-bit Bridge) above to already be present in bin/ for overlay/DB/kit features to work — they are not fetched by pip install.

Overlay Requirements

The overlay uses native C++ helpers (bin/cgfs16_overlay.dll and bin/cgfs16_inject.exe) that ship with the release build. Running from source requires these binaries to be present in the bin/ folder. The build script (build_exe.bat) compiles them when Visual Studio C++ tools are available.

Building The EXE

You can build the standalone executable with the included batch file:

.\build_exe.bat

The batch file compiles the C++ overlay helpers when Visual Studio C++ tools are available. If they are not installed, it uses the existing helper binaries in bin/ and still runs the PyInstaller package step.

Or run PyInstaller directly:

pyinstaller --noconfirm --clean --distpath dist --workpath build\pyinstaller Server16Python.spec

The resulting executable will be created at:

dist/Server16Python.exe

Release Assets

Suggested GitHub release contents:

  • Server16Python.exe
  • RELEASE_NOTES_v<version>.md
  • release notes summarizing major fixes and improvements
  • optional screenshots or changelog excerpts

Previous release notes: v1.2.0 · v1.3.0 · v1.3.1 · v1.4.0 · v1.5.0 · v1.6.0

Clone this wiki locally