Repository navigation
Releases: DudeCmonMan/s2fix
Release list
s2fix v0.3.0 - Finally Fix Parity
v0.3.0 Changes
I can finally increase the minor version to v0.3.0. You must replace your old .ini , see notes for why.
I've ported all the applicable fixes from Shogun 2 OG to CE, now both versions are at-parity for the same type of fixes whenever they apply.
Both
- Both OG and CE now have improve signature checks when patching the game. Fixes are grouped together so that fixes can be applied / undone as a feature. This should improve mod compatibility that touches the binary.
- cpuplace: when it has nothing to do (no CCD with a larger L3, or
ccd=off), the log says "off" instead of "refused".
Shogun 2 Original
- New: s2prof.dll now does its own setup as it loads d3d11.dll is only a proxy loader now. Another loader (an ASI loader, for
example) should be able to load s2fix as long as it loads s2fix before the game creates its graphics device.- Only one copy of s2fix runs per game: a second one (from another loader, or under another name) refuses to load.
- Loaded too late (injected while the game runs): a message says some fixes are off for that session.
- DirectX 9: s2fix stays off and a message says so; the game runs unchanged. If the game falls back from DirectX 11
to DirectX 9 on its own, the fixes are undone and the same message appears. - This path is lightly tested, I don't play with ASI loaders, but this should work.
- Fix: changing display settings (resolution, window mode) in game keeps the flip model. The game rebuilds its graphics
device; s2fix now rebuilds with it. If that ever fails, a message asks you to restart the game, and the game closes. - Fix: borderless windowed at any resolution. The game renders at the resolution set in its options, scaled to fill the
monitor, and the mouse is scaled to match, so clicks land where the cursor is. (#3, #4)
Shogun 2 Complete Edition
- New: works alongside mods that change the game's engine, as the original has since v0.2.3. If
empire.retail.x64.dllis a different build or another mod's copy of it, a warning asks whether to launch (Launch Game
/ Exit Game); to skip it, setignore_build_check=1under[s2prof]ins2prof.ini. Each fix checks the engine code
it depends on before it installs and stays off if that code was changed; a fix that can't install completely is fully
undone. The log ends with how many fixes installed, were off or were refused. - New: Same s2prof.dll loading patch as OG.
- New fixes from the original:
- camprelations and campappearance for the campaign map (the same cached faction-record and appearance lookups as the
original's). - listkeep: the render lists keep their per-thread buffers between frames instead of regrowing them every frame.
- maincore: the main thread gets a CPU core of its own; the game's other threads stay off it.
- buildingblock: skips work the building draw throws away every frame (most noticeable with damaged buildings in
sieges and towns). - The render sort uses a faster counting sort when a list has few distinct keys.
- camprelations and campappearance for the campaign map (the same cached faction-record and appearance lookups as the
- Faster startup: installing the fixes took over 3 s on a busy PC; it now takes about 30 ms.
- Fix: the overhaul could silently fail to install when other DLLs in the game had used up the first 64 thread-local
storage slots. - Changed: in
s2prof.ini, the[proxy]section is now[device](the samemultithreaded_deviceandwrap_context
settings).
Notes
- Complete Edition: when updating, let the zip overwrite
s2prof.ini. An old one with a[proxy]section leaves the
multithreaded device off, and the overhaul then runs without its worker threads.
Thanks @Dat-Boi-G2 for reporting #3 and #4. #3 was a lot deeper than it first looked, but it lead to a pretty neat discovery on how the game handles d3d11 devices (and how we can prevent a crash).
s2fix v0.2.3 - Attacking the Campaign Map
v0.2.3 Changes
Shogun 2 Original (also includes v0.2.2 changes since it was only a pre-release)
- Fix: s2fix now works alongside mods that change the game's engine. It will give you a warning that it is applying fixes to a build that isn't the intended verison. This patch will try its best to apply as many patches as it can. To skip the warning, set ignore_build_check=1 under [s2prof] in s2prof.ini. (#2)
- New fix: vram. By default, Windows tells Shogun 2 to use a maximum of 3GB (which Shogun 2 uses 95% of), this patch pushes it to as much as your GPU can give (up to 4GB, engine limitation).
- New fixes for the campaign map:
- camprelations: every character on the map looked up the player's faction relations several times a frame, scanning a long list each time. The answers are now cached (they stay exact). An idle campaign view went from 62.6 to 148 fps in testing.
- campappearance lookup iscached too (about 0.5 ms a frame).
- Campaign map, all fixes on vs all fixes off (Ryzen 9 9950X3D, RTX 4090, 3440verage fps in three scenes, and far fewer stutters.
- New fix: contention. When the game's threads share one CCD (cpuplace), idle helper threads kept CPUs busy while the overhaul's worker threads waited for one. The workers now run at above-normal priority, and the helpers spin only briefly before sleeping.
- Fix: imposterreuse could pick an overhaul worker thread as the main thread and reuse imposter uploads there, which is never valid. It now runs only on the main thread. A latent bug; it was not shown to cause visible artifacts. No measurable performance impact for this fix.
- New: debug report generator (Ctrl+Shift+F6).
- About 2.5–3 minutes with the camera still, with an on-screen banner "Snapshot Running: , ".
- It records system, GPU, game and process details, all-fixes and per-fix A/Bs, and GAME ONLY screenshots (straight from the render chain), packed into perf-logs\report_.zip.
- User and computer names are replaced, and nothing is sent anywhere, purely diagnostic information about Shogun2 and what hooks into it.
- When using the report, try to leave the game alone until the benchmark finishes.
Shogun 2 Complete Edition
- No changes since v0.2.2 (pre-release), so posting those changes here
- Fix: overhaul program copies at batflaw that crashed the original'sv0.2.0 on battle loads. Copies are now refreshed for each range and dropped when the shader library is rebuilt.
- New fix: contention, the same as the original's.
Notes
- The debug report covers the original only for now.
- There has been reports that sometimes this fix triggers Anti Virus, that is not expected, but it snot surprising. These fixes use methods similar to hacking software to inject into the game and overwrite core functions (dll injection, memory scanning, function hijacks, etc.). If you are concerned, all binaries are built straight from source code, you can see the source code yourself.
Thanks @bbblackthorne for reporting the first issue #1, this lead me to building the reporting snapshot module.
Thanks @KarlGhartler for bringing compatibility up and for submitting #2.
s2fix v0.2.2-pre-release
v0.2.2 Changes (Pre-release)
Shogun 2 Original
- New fix: contention. When the game's threads share one CCD (cpuplace), idle helper threads kept CPUs busy while the overhaul's worker threads waited for one. The workers now run at above-normal priority, and the helpers spin only briefly before sleeping.
- Fix: imposterreuse could pick an overhaul worker thread as the main thread and reuse imposter uploads there, which is never valid. It now runs only on the main thread. A latent bug; it was not shown to cause visible artifacts. No measurable performance impact for this fix.
- New: debug report generator (Ctrl+Shift+F6).
- About 2.5–3 minutes with the camera still, with an on-screen banner "Snapshot Running: , ".
- It records system, GPU, game and process details, all-fixes and per-fix A/Bs, and GAME ONLY screenshots (straight from the render chain), packed into perf-logs\report_.zip.
- User and computer names are replaced, and nothing is sent anywhere, purely diagnostic information about Shogun2 and what hooks into it.
- When using the report, try to leave the game alone until the benchmark finishes.
Shogun 2 Complete Edition
- Fix: overhaul program copies at batflaw that crashed the original'sv0.2.0 on battle loads. Copies are now refreshed for each range and dropped when the shader library is rebuilt.
- New fix: contention, the same as the original's.
Notes
- The debug report covers the original only for now.
- There has been reports that sometimes this fix triggers Anti Virus, that is not expected, but it snot surprising. These fixes use methods similar to hacking software to inject into the game and overwrite core functions (dll injection, memory scanning, function hijacks, etc.). If you are concerned, all binaries are built straight from source code, you can see the source code yourself.
s2fix v0.2.1
v0.2.1 Changelog - Mainly Shogun 2 Original Patches
New
- Borderless windowed mode: set the game to windowed and borderless=1 under [window] in s2prof.ini. It covers the
monitor at its native resolution and keeps the cursor on that monitor for edge scrolling (clip_cursor=0 to turn
that off). See the README for more details. - timerperiod: stops the game switching Windows' timer resolution on and off around every timestamp.
Improved
- Swap chain: at most two frames are queued now ([flipmodel] latency=2; 0 keeps Windows' 3), for lower input lag.
- Building draw: skips another piece of per-building work whose result was never used (sieges and towns).
- Render-item sorts copy items with fast inline copies: about 7% more fps in a large battle on the test system.
s2fix v0.2.0
S2Fix has been updated to work with OG Shogun 2 as well.
See the main page for more details on the fixes being implemented.
s2fix v0.1.0
Built from v0.1.0 (e7d9541) with WinLibs GCC 16.2.0. Unzip into the game folder, next to shogun2_complete_edition.exe; see the README.