Crowd Control for Dying Light
=============================

Dying Light, Steam AppID 239140 (Enhanced Edition). Single player.
Version and build details are in VERSION.txt next to this file.


WHAT IS IN THIS ARCHIVE
-----------------------

  winmm.dll           Ultimate ASI Loader - loads the mod into the game.
  CrowdControl.asi    the mod.
  CrowdControl\       the mod's payload and its own copy of .NET 8. You do not
                      need to install .NET; nothing is installed on your machine.
  CrowdControl\CrowdControl.ini    optional settings, all at their defaults.
  INSTALL.txt         this file.
  VERSION.txt         what was built, and when.

Everything extracts into the game folder, next to DyingLightGame.exe.


INSTALL - WINDOWS
-----------------

1. Find the game folder:
   Steam -> right-click Dying Light -> Manage -> Browse local files.
   It is the folder containing DyingLightGame.exe.

2. Extract this archive into that folder. When it is right, DyingLightGame.exe
   and winmm.dll sit side by side in the same folder.

3. Start the game from Steam as usual.

That is the whole install. There is no launcher option to set on Windows.


INSTALL - LINUX AND STEAM DECK (Proton)
---------------------------------------

Same extraction as above, plus two settings that Proton needs. Both are on the
game's Properties page in Steam.

1. Extract this archive into the game folder, next to DyingLightGame.exe.

2. Properties -> Compatibility -> "Force the use of a specific Steam Play
   compatibility tool" -> Proton Experimental (or any recent Proton).

   Dying Light also ships a native Linux build, and Steam picks that one by
   default. The native build cannot load a Windows DLL, so the mod will simply
   never run until Proton is forced.

3. Properties -> General -> Launch Options, paste exactly:

       WINEDLLOVERRIDES="winmm=n,b" %command%

   Without this, Wine uses its own built-in winmm and the loader in the game
   folder is never mapped. There is no error message when this happens - the
   game just runs with no mod.

4. Start the game from Steam.


CHECKING THAT IT LOADED
-----------------------

The mod writes CrowdControl\CrowdControl.log inside the game folder from the
moment it attaches. If that file appears and grows while the game runs, the mod
is in. If it never appears:

  - Windows: check that winmm.dll is in the same folder as DyingLightGame.exe
    and not in a subfolder. Extracting the archive "as a folder" is the usual
    mistake.
  - Linux: check the two Proton settings above, then restart Steam. Steam only
    picks up launch options after the client has been restarted.


CONNECTING CROWD CONTROL
------------------------

The mod connects out to the Crowd Control app on 127.0.0.1 port 51337, and keeps
retrying until it gets an answer. Start them in whichever order you like.

CrowdControl.log records the connection:

    [Info] Crowd Control initialized with 42 effects.
    [Info] Connected to Crowd Control


SETTINGS
--------

CrowdControl\CrowdControl.ini, read once when the game starts. The file is
commented; the defaults are what most streamers want.


UNINSTALL
---------

Delete these three from the game folder:

  winmm.dll
  CrowdControl.asi
  CrowdControl\

(INSTALL.txt and VERSION.txt are just text and can go too.) Nothing else is
touched: the mod modifies no game file, writes nothing into your save, and
changes nothing that survives closing the game.


BEFORE YOU START
----------------

  - Single player. Dying Light is 4-player co-op and this has not been tested
    there; the effects act on the local game only, and a modified client in
    someone else's session is a good way to be dropped from it.
  - Back up your saves if you care about them. On Windows they live in
    Documents\DyingLight\out\save; under Proton they are in the Steam userdata
    folder for 239140.
  - This is a mod. It patches game code in memory while the game runs, and it
    undoes those patches when an effect ends. If something goes strange, quit to
    the menu and load your last save.
