KD-lab-Open-Source/Perimeter

Modernization/Porting tracking issue

IonAgorria opened this issue · 0 comments

I open this meta-issue to keep track of all issues identified that are required to solve so the game can be ported to modern 64bits Windows and non-Windows OSes.

Removing incompatible dependencies:

  • Embedded Boost removal #42
  • Embedded STLport removal #41
  • Stop dependency on precompiled libraries like XTools.lib

Code/Building:

  • 64 bits support #26
    • Main menu
    • Map loading
    • CI builds
    • Game saving, needs to be fixed on 32bits first (probably we will be storing size_t or pointers which should be handled)
  • Modern compilers support
    • GCC/MinGW
    • Clang
    • MSVC #25
  • CMake support #13
  • Fix Undefined Behavior in code, game relies on some MSVC 2005 UB derived behavior that is not compatible with current compilers generated code
  • Replace asm and __asm code with C/C++ equivalent
    • Compare results between asm and current C implementation, untested currently
  • Replace Win32 threads and CriticalSection stuff with SDL
  • Replace Win32 CreateEvent stuff
    • Workaround: pevents for API wrapper

Windowing/Input:

  • Replace Win32 Window with SDL2 window
  • Replace input handling with SDL2 input events
  • Load game cursors using SDL2
  • Use SDL2 window/events in windows builds

Graphics/Renderer:

  • AVI animated texture loading, it uses windows codecs which is unavailable in other platforms
    • Workaround: Use another library like ffmpeg for decoding AVIs
  • Modern/portable API using renderer #14
    • Workaround: reusing existing DirectX renderer with DX9 wrapper like DXVK
    • Removed CMatrix and D3DX9 math in favor of xmath
    • Sokol GFX and D3D separation by creating separate backend classes
    • Sokol backend feature parity with D3D:
      • 2D rendering
      • Basic meshes
      • Terrain mesh
      • Bump mapping
      • Shadows
  • Deprecated dependency on DirectX extensions (d3dx9)
    • Workaround: implement using methods manually in Exodus module

Music/Sound issues:

  • PlayOgg module depends on Windows API sound #50
    • Make PlayOgg optional
    • Make Windows API code dependency optional
    • Evaluate SDL2/SDL2-mixer as potential replacement (for playing decoded ogg samples)
    • Remove Windows API dependency
  • Sound module depends on DirectX's DirectSound API which is Windows only
    • Make Sound optional
    • Make DirectSound code dependency optional
    • Evaluate SDL2/SDL2-mixer as potential replacement, we may need to handle several audios playing simultaneously + music + voice in background
    • Remove DirectSound dependency

Network:

  • Fix network host starting, right now crashes even with DP8
  • Game module depends on DirectX's DirectPlay 8 which is deprecated and removed on modern DirectX SDK's, should be replaced with cross-platform compatible lib
    • Make DirectPlay code dependency optional
    • Evaluate SDL2-net as potential replacement
    • Remove DirectPlay dependency
  • Gamespy should be removed #49
  • Servers list and NAT workaround #89

Other issues:

  • Currently Windows binaries are console apps, reenable win32 app and add icon
  • Fix save saving/loading
  • Bink video codec and files replacement #48
  • Handle Windows format paths, most were wrapped using convert_path_resource but some may be missing yet
  • Remove "using namespace std;" around code
  • Restoring Scripts compilation using XPrm sources to create scripts compiler binary (XPrm.exe) and call it as part of builds if requested
  • Math code cleanup and modernization #46
  • Replace Win32 file choosing and mission editor dialogs with cross-platform code
    • Evaluate ImGUI as potential candidate once Sokol GFX is integrated
  • Alternate 3D formats #92
  • Code cleanup, line endings, UTF8, removing binaries #20