Skip to content

v2.8.0: Merge pull request #20 from Trinculo54/feature/2.8.0-online-and-choices

Latest

Choose a tag to compare

@Trinculo54 Trinculo54 released this 29 Oct 05:46
2862600

Online play, title-screen entries, named choices, hotkeys, commands and session logs (API 9). Everything 2.7.4 brought is still here. The platform comes as both d3dcompiler_47.dll and DWrite.dll, so Azimuth 1.0.3 and older releases alike can load it. The lists at the end say which setups it has been seen working on.

For players

  • Online play (FH2MP). When you start the game from the FH2MP launcher, mods whose authors say they shouldn't run online aren't loaded.
    • Once FH2MP is installed, each mod's page under MODS > Installed mods has a "Load when playing online" switch, so you can choose for any mod. A change counts from the next time you start the game from the launcher.
    • Mods made for older platforms can't say so themselves, so they load online unless you switch them off.
  • Other games on Azimuth 1.0.1. When you start Forza Motorsport 5 or 6 from the same launcher, the platform and its mods leave the game alone, and platform.log says which game was started.
  • Title-screen entries. Mods can add a line under PRESS (A) TO START with a button of its own, to start straight into a track, say. A list of more than 10 choices is shown 8 at a time, with Previous and Next.
  • Named choices and hotkeys on the Mods page: rows like "LB / RB / A", and keys or controller chords you can rebind there.
  • A log for each session. fh2-mods\platform-logs keeps the newest 20, and the third line of platform.log names the session.
  • Better crash dumps. The dump saved with each crash report now holds the mods' own data, so send both files.
  • Steadier start-up. The platform's reads of the game while Azimuth maps it are now properly guarded. Before, a rare fault at start-up could turn a mod off for the session, or close the game.

Installing: put both d3dcompiler_47.dll and DWrite.dll next to azimuth.exe, as with 2.7.4. If you extract an older mod's zip afterwards, it can put an older platform back; extract this zip again.

For mod makers: API 9. Check api_version >= 9 before using any of it.

  • add_title_entry and title_started_by.
  • FH2ModInfo.offline_only and playing_online.
  • FH2_SETTING_CHOICE rows.
  • add_hotkey.
  • add_command, run with fh2mod.exe (in the zip's tools folder) or through the pipe named in platform-session.json.
  • session_id, session_log_path and request_save_snapshot.
  • add_dump_memory, and full in fh2-mods\platform-dump.txt for a full-memory dump.
  • include/fh2game.h: the game addresses mods use, with their bytes for a check before hooking.

Bump the platform submodule to v2.8.0, and ship both d3dcompiler_47.dll and DWrite.dll in your zip.

Tested in game on Azimuth 1.0.3 without Extra Options, with Achievements 1.0.2, a test build of WreckingBall and two test mods:

  • loading as DWrite.dll, sessions and their logs, and save snapshots;
  • the platform mounting mediaoverride itself;
  • title-screen lists and hotkeys, and the commands;
  • the MODS tab, and changing mods' settings on their pages there.

The steadier start-up came last, and its own build was retested for all of the above. Mods' own pages (Achievements' list behind the pause menu's tile) and a race counted by Achievements were tested on the build just before it, which differs only in how the platform finds the game while it starts.

Also tested:

  • starting on Azimuth 1.0.3 with Extra Options 0.3.9 (the Mods page and the MODS tab weren't used in that launch);
  • starting on Azimuth 0.9.10 with Extra Options 0.2.88 and a full set of mods.

Not yet seen working in game:

  • The crash dumps, since nothing crashed.
  • Anything on Linux (Wine or Proton), where hotkeys, commands and DWrite.dll haven't been tried.

Known issues

  • Extra Options that makes no patches. If Extra Options is loaded but makes no patches (line 2 of FH2_ExtraOptions.log starts with REFUSED or DISABLED), or has EnableMediaOverrides=0, the platform still leaves mediaoverride to it, so the game never reads that folder.
    • The Mods page rows, the MODS tab, mods' own pages and title-screen entries don't appear, and mods' text, file and database changes don't reach the game.
    • In the first case, platform.log says "hooks: game code is ready (Extra Options made no patches this time)".
    • Fix what FH2_ExtraOptions.log names, set EnableMediaOverrides=1 in FH2_ExtraOptions.ini, or remove Extra Options.
  • Proton. Under Proton (reported on a Steam Deck), Azimuth can map the game at another address.
    • Without Extra Options, the platform then leaves mediaoverride alone (platform.log: "media overrides: the game's code isn't what this build expects; left alone"). The same things go missing as above.
    • With Extra Options, it can load after the platform there and refuse its patches.
    • A fix is in review (#17).
  • Very old platforms on Azimuth 1.0.1. Platforms 2.0.0 to 2.2.1 aren't recognised there. If a mod's zip that old puts its d3dcompiler_47.dll back, both copies run and both load every mod, so mods can start twice and platform.log gets mixed up. Replace it with this zip's.