All Projects → nbusseneau → hephaistos

nbusseneau / hephaistos

Licence: MIT license
Supergiant Games' Hades mod adding support for ultrawide monitors (21:9, 32:9), multi-monitor (48:9), Steam Deck (16:10), and custom resolutions.

Programming Languages

python
139335 projects - #7 most used programming language
lua
6591 projects

Projects that are alternatives of or similar to hephaistos

Funtuna-Fork
a homebrew ps2 app launcher for FMCB-incompatible ps2 units
Stars: ✭ 33 (-55.41%)
Mutual labels:  mod
go-checksum
Simple tool to calc Golang module checksum of go.mod and module dir.
Stars: ✭ 45 (-39.19%)
Mutual labels:  mod
CarryCapacity
Vintage Story mod which adds the capability to carry blocks in-hand and on your back
Stars: ✭ 17 (-77.03%)
Mutual labels:  mod
advanced npc
Advanced NPC for Minetest, using mobs_redo API
Stars: ✭ 16 (-78.38%)
Mutual labels:  mod
FlySkyRxFirmwareRssiMod
Patched firmwares for the various FlySky receivers to inject RSSI in IBUS channel 14
Stars: ✭ 96 (+29.73%)
Mutual labels:  mod
TTS-Codenames
A LUA script for Codenames on Tabletop Simulator for Steam.
Stars: ✭ 25 (-66.22%)
Mutual labels:  mod
Half-Life-Resurgence
Recreation & expansion of NPCs, entities, and weapons from the Half-Life series into Garry's Mod!
Stars: ✭ 52 (-29.73%)
Mutual labels:  mod
remod-sauerbraten
Lightweight mod of sauerbraten server
Stars: ✭ 25 (-66.22%)
Mutual labels:  mod
Resource-Pack
The official repository for Faithful 32x for Minecraft: Dungeons
Stars: ✭ 16 (-78.38%)
Mutual labels:  mod
FS19 modROS
(partial) ROS1 integration for FarmSim19
Stars: ✭ 45 (-39.19%)
Mutual labels:  mod
Yuris-Revenge
A Red Alert 2 Yuri's Revenge mod for OpenRA Engine
Stars: ✭ 127 (+71.62%)
Mutual labels:  mod
Rising-Stars
A large-scale mod for Star Ruler 2.
Stars: ✭ 16 (-78.38%)
Mutual labels:  mod
Wynntils
Wynntils is a Wynncraft Mod that seeks to enhance the user's gameplay with a variety of customizable options and additions.
Stars: ✭ 133 (+79.73%)
Mutual labels:  mod
AA2Unlimited
Modding framework for Artificial Academy 2
Stars: ✭ 75 (+1.35%)
Mutual labels:  mod
Zee5
Just a simple shit but no one knows
Stars: ✭ 29 (-60.81%)
Mutual labels:  mod
ote
ote updates a packages' go.mod file with a comment next to all dependencies that are test dependencies; identifying them as such.
Stars: ✭ 25 (-66.22%)
Mutual labels:  mod
quantum-space-buddies
Outer Wilds online multiplayer mod, using Mirror and OWML.
Stars: ✭ 56 (-24.32%)
Mutual labels:  mod
Quadz
An FPV drone simulator for Fabric
Stars: ✭ 16 (-78.38%)
Mutual labels:  mod
testing-utilities-js
Just some small utilities for sandbox/modding
Stars: ✭ 18 (-75.68%)
Mutual labels:  mod
wii-gc-adapter-inject
Wii U Gamecube Controller Adapter in SSBB
Stars: ✭ 32 (-56.76%)
Mutual labels:  mod

Hephaistos

Hades.patched.with.Hephaistos.for.3840x1600.mp4

CLI tool for patching any resolution in Supergiant Games' Hades, primarily targeting ultrawide monitors (21:9, 32:9), multi-monitor (48:9), and Steam Deck (16:10).

By default, on Hades:

  • Resolutions wider than 16:9 (e.g. 21:9) are pillarboxed with artwork / black bars on left / right.
  • Resolutions taller than 16:9 (e.g. 16:10) are letterboxed with black bars on top / bottom.

Hephaistos can bypass both, and also allows using custom resolutions (useful for custom window sizes and multi-monitor without Eyefinity / Surround).

  • For trying out Hephaistos right away, see Install.
  • For a preview of how Hades looks in 21:9, 32:9, 48:9, and 16:10, see Showcase.
  • For more details about how Hephaistos works, see Under the hood.

Issues

Hephaistos is in a stable state: many users have been using it for a long time (some of them even from their very first time on Hades), and nothing major has had to be fixed for a while.

Still, there might be some quirks or rare interactions on specific setups that haven't been detected yet: you are most welcome to report anything you witness by opening a new issue (ideally with screenshots / videos / a save file) and I will definitely have a look and fix it 👌

Showcase

Before / after comparisons (click on items for more details):

21:9

21-9_vanilla 21-9_hephaistos

32:9

32-9_vanilla 32-9_hephaistos

48:9 / triple screen (with HUD centered)

48-9_vanilla 48-9_hephaistos

16:10 / Steam Deck

SteamDeck

Additional screenshots

21:9

32:9

48:9 / triple screen (with HUD centered)

16:10 / Steam Deck

ℹ️ More images can be found over at Nexus Mods and WSGF.

Install

Download

Hephaistos can be downloaded as an executable for Windows, macOS, and Linux, or as a Python archive (click on items for more details):

Windows
  • Download hephaistos-windows.zip.
  • Extract the archive. You should get an hephaistos.exe executable.
  • Move hephaistos.exe to Hades main directory. Hephaistos must be sitting right next to the default directories:
    • Steam / Epic Games
      Hades/
      ├── Content/
      ├── x64/
      ├── x64Vk/
      ├── x86/
      └── hephaistos.exe
      

      ⚠️ If you don't know where Hades is, Hephaistos can try to give you a tip by auto-detecting from Steam and Epic Games configuration files: just run hephaistos.exe. Note that you still have to move the files to the Hades directory manually before continuing.

    • Microsoft Store Hades/ ├── Content/ │ ├── Content/ │ ├── ja/ │ ├── Hades.exe │ └── ... ├── [hidden file] E0A69B86-F3DD-416D-BCA8-3782255B0B74 ├── [hidden file] ... └── hephaistos.exe > ⚠️ If you don't know where Hades is, just reinstall Hades from the Microsoft Store: you can then choose where Hades will be located. > Note that you still have to move the files to the Hades directory manually before continuing.
macOS
  • Download hephaistos-macos.zip.
  • Extract the archive. You should get an hephaistos executable.
  • Move hephaistos to Hades main directory. Hephaistos must be sitting right next to the default directories (Steam / Epic Games):
    Hades/
    ├── Game.macOS.app/
    └── hephaistos
    

    ⚠️ If you don't know where Hades is, Hephaistos can try to give you a tip by auto-detecting from Steam and Epic Games configuration files: just run hephaistos. Note that you still have to move the files to the Hades directory manually before continuing.

Linux
  • Download hephaistos-linux.zip.
  • Extract the archive. You should get an hephaistos executable.
  • Move hephaistos to Hades main directory. Hephaistos must be sitting right next to the default directories (Steam):
    Hades/
    ├── Content/
    ├── x64/
    ├── x64Vk/
    ├── x86/
    └── hephaistos
    

    ⚠️ If you don't know where Hades is, Hephaistos can try to give you a tip by auto-detecting from Steam configuration files: just run hephaistos. Note that you still have to move the files to the Hades directory manually before continuing.

[Advanced] Python
  • Download hephaistos-python.zip.
  • Extract the archive. You should get hephaistos, hephaistos-data and sjson directories.
  • Move all directories to Hades main directory. Hephaistos must be sitting right next to the default directories (see Windows / macOS / Linux entries above for more details).

Usage

Once Hephaistos is placed in the proper directory, you can use it in two ways:

  • [Easy] Directly run Hephaistos and follow the interactive instructions: see Interactive mode for detailed help.
  • [Advanced] Use Hephaistos subcommands from the command line: see CLI usage below.

Interactive mode

  • Windows: run hephaistos.exe
  • macOS / Linux: run hephaistos
  • Python: run python -m hephaistos

When running Hephaistos in interactive mode, Hephaistos will guide you through the steps:

Hi! This interactive wizard will help you to set up Hephaistos.
Note: while Hephaistos can be used in interactive mode for basic usage, you will need to switch to non-interactive mode for any advanced usage. See the README for more details.

Current version: v1.x.y
Latest version: v1.x.y

Pick an option:
1. Patch Hades using Hephaistos
2. Restore Hades to its pre-Hephaistos state
3. Check current Hades / Hephaistos status
4. Exit
Choice:

Type 1 to pick the patch option. Hephaistos will again prompt you for your resolution and HUD preferences, and then patch Hades:

INFO:hephaistos:Using resolution: (3840, 1600)
INFO:hephaistos:Using '--scaling=hor+': computed patch viewport (2592, 1080)
INFO:hephaistos:Using '--hud=expand': HUD will be expanded horizontally / vertically
INFO:hephaistos:Patched 'x64\EngineWin64s.dll'
INFO:hephaistos:Reading SJSON data (this operation can take time, please be patient)
...
INFO:hephaistos:Installed Lua mod to 'Content\Mods\Hephaistos'
INFO:hephaistos:Patched 'Content\Scripts\RoomManager.lua' with hook 'Import "../Mods/Hephaistos/Hephaistos.lua"'

Press any key to continue...

⚠️ Reading SJSON data can take time depending on your CPU and hard drive, please be patient 

Hades binaries are now patched to work with the chosen resolution. Start the game and try it out for a bit.

Once done, use Hephaistos again, but this time type 2 to pick the restore option:

INFO:hephaistos:Restored backups from 'hephaistos-data\backups' to '.'
INFO:hephaistos:Discarded hashes at 'hephaistos-data\hashes'
INFO:hephaistos:Discarded SJSON data at 'hephaistos-data\sjson-data'
INFO:hephaistos:Uninstalled Lua mod from 'Content\Mods\Hephaistos'

Hades binaries are now restored to their pre-Hephaistos state.

Do note that every time it receives an update, Hades will automatically revert to its default resolution, and Hephaistos must be reapplied. If in doubt, type 3 to pick the status option and check the current Hades / Hephaistos status.

This concludes the tutorial. I hope you'll enjoy Hephaistos 🥳

CLI usage

  • Windows: run hephaistos.exe -h
  • macOS / Linux: run hephaistos -h
  • Python: run python -m hephaistos -h

Hephaistos is mostly self-documented via the CLI help. Run hephaistos -h to find the available subcommands (patch, restore, etc.) which themselves are documented (e.g. hephaistos patch -h).

Add the -v flag to print information about what Hephaistos is doing under the hood. The flag may be repeated twice (-vv) to display debug output.

Patching Hades using Hephaistos

Adjusting 3440 and 1440 with your own resolution:

hephaistos patch 3440 1440

ℹ️ You can safely repatch multiple times in a row as Hephaistos always patches based on the original files. There is no need to restore files in-between.

HUD

Hephaistos supports the following HUD resizing modes (click on items for more details):

expand (default)

Expand the HUD horizontally and vertically, i.e. HUD will scale with screen size. Static HUD elements will be repositioned to their intended location for the new screen size, e.g. health indicator will be in the bottom left, resource indicator will be in the bottom right.

hud_21-9-vanilla hud_21-9_expand

center

Keep HUD in the center of the screen with the same size as the original HUD, i.e. screen size will change but HUD will not move.

hud_21-9-vanilla hud_21-9_center

You might want to use --hud=center for 32:9 or wider resolutions.

Scaling

Hephaistos supports the following scaling algorithms (click on items for more details):

hor+ (Hor+ scaling, default)

Expand aspect ratio and field of view horizontally, keep vertical height / field of view. This is the default scaling used by Hephaistos for aspect ratios wider than 16:9 (e.g. 21:9), and recommended for general usage as it strives to keep the experience as close to the original as possible.

scaling_21-9_vanilla scaling_21-9_hor+

vert+ (Vert+ scaling, default)

Expand aspect ratio and field of view vertically, keep horizontal height / field of view. This is the default scaling used by Hephaistos for aspect ratios taller than 16:9 (e.g. 16:10), and recommended for general usage as it strives to keep the experience as close to the original as possible.

pixel (pixel-based scaling)

Expand field of view in all directions without applying any scaling, disregarding aspect ratios. This scaling is not recommended for general usage as it effectively "zooms out" the camera and thus does not keep the experience close to the original, but it's fun if you have a big screen and want to see more of the screen at once.

scaling_21-9_vanilla scaling_21-9_pixel

Use --scaling=pixel if you wish to use pixel-based scaling.

Custom resolution

By default, Hephaistos patches a custom resolution in the ProfileX.sjson configuration file by updating its WindowWidth/WindowHeight and X/Y values.

This has two advantages:

  • Ensure the game runs at the preferred resolution.
    • Useful when inadvertently switching to a wrong resolution from the game settings.
    • Useful when playing Hades on a secondary monitor.
  • Allow running the game in windowed mode at a specific size.
    • Useful for choosing your own window size in windowed mode.
    • Useful for spanning the game window over multi-monitor without Eyefinity / Surround.

Neither of these are possible in the vanilla game: only the resolutions from the main display are offered from the game settings and the game window cannot be freely resized.

Use --no-custom-resolution if you wish not to force custom resolution through ProfileX.sjson.

Restoring Hades to its pre-Hephaistos state

hephaistos restore

Checking Hades / Hephaistos status

hephaistos status

Patching Hades again after a game update

Every time it receives an update, Hades will automatically revert to its default resolution, and Hephaistos must be reapplied. Trying to repatch after a game update will be blocked:

> hephaistos patch 3440 1440
ERROR:hephaistos:Hash file mismatch: 'XXX' was modified.
ERROR:hephaistos:Was the game updated? Re-run with '--force' to discard previous backups and re-patch Hades from its current state.

And status will confirm this:

> hephaistos status
Hades was patched with Hephaistos, but Hades files were modified. Was the game updated?

Since the game was updated, the previous backups can be safely discarded. Use --force to repatch and create new backups:

hephaistos patch 3440 1440 --force

Miscellaneous options

Hades directory

By default, Hephaistos assumes that it has been placed in the main Hades directory. If it fails to detect Hades files, it will try to auto-detect Hades location from Steam and Epic Games configuration files and ask to be relocated.

You may use --hades-dir to manually specify where Hades is located, e.g. if you want to store Hephaistos and its files in a different location than the Hades directory.

Mod Importer

Hephaistos is compatible with Mod Importer1 (>= 1.3.0). If Hephaistos detects it is available, it will run modimporter to register / unregister itself during patch and restore operations, instead of manually editing Content\Scripts\RoomManager.lua.

This can be bypassed with --no-modimporter, in which case Hephaistos will not run modimporter even if detected.

Under the hood

Hades uses an internal 1920x1080 viewport with static scaling (i.e. it can only played at 16:9, no matter the display resolution).

To bypass this limitation, Hephaistos patches the game's files with an ad-hoc viewport computed depending on chosen resolution and scaling algorithm:

> hephaistos patch 3440 1440 -v
INFO:hephaistos:Using resolution: (3440, 1440)
INFO:hephaistos:Using '--scaling=hor+': computed patch viewport (2580, 1080)
INFO:hephaistos:Using '--hud=expand': HUD will be expanded horizontally / vertically
INFO:hephaistos:Patched 'x64\EngineWin64s.dll'
...
INFO:hephaistos:Installed Lua mod 'hephaistos/lua' to 'Content/Mods/Hephaistos'
INFO:hephaistos:Patched 'Content/Scripts/RoomManager.lua' with hook 'Import "../Mods/Hephaistos/Hephaistos.lua"'

> python -m hephaistos patch 1280 800 -v
INFO:hephaistos:Using resolution: (1280, 800)
INFO:hephaistos:Using '--scaling=vert+': computed patch viewport (1920, 1200)
...
  • Backends' engine DLLs are hex patched to expand the resolution and camera viewports.
  • Resource SJSON files are patched to resize / move around GUI elements.
  • Gameplay Lua scripts are extended with a Lua mod recalculating sizes / positions of GUI elements.

ℹ️ Hephaistos is compatible with Mod Utility2 (>= 2.2.0). If available, it will leverage ModUtil hook functions rather than its own custom hooks. This makes Hephaistos more compatible with other ModUtil-based mods if they also are hooking onto the same functions as Hephaistos (though it still won't magically fix conflicts or new GUI elements from other mods that Hephaistos wasn't tailored to).

While patching, Hephaistos stores:

  • A backup of the original files.
    • Allows restoring Hades to its pre-patch state if need be.
  • File hashes of the patched files.
    • Allows detecting any outside modifications made to the files -- mostly for detecting game updates.
    • Allows detecting if we are repatching a previously patched installation, in which case the original files are used as basis for in-place repatching without an intermediate restore operation.
  • (If patching an SJSON) A JSON-serialized dict of the deserialized original SJSON data.
    • Speeds up in-place repatching as we avoid the need to deserialize the original SJSON data again (which is very slow, while deserializing the JSON is instantaneous).

Everything is stored under the hephaistos-data directory.

Why did you make this, and how did you know what to patch?

I love Hades and am an ultrawide player myself. I decided to try my hand at modding ultrawide support by decompiling Hades and reverse-engineering the viewport logic just to see if I could, and here we are 😄

See this blog post for more details about Hephaistos' genesis.

Footnotes

  1. Mod Importer (GitHub / Nexus Mods) is a tool helping to manage mods and register / unregister them with Hades.

  2. Mod Utility (GitHub / Nexus Mods) is a mod-library helping mods integrate not only with Hades but also with other mods.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].