Skip to content
OpenRACPublic

About

Mods for Ratchet & Clank.

Resources

Stars

5 stars

Watchers

0 watching

Forks

Repository files navigation

Mods for Ratchet & Clank on OpenRAC

Mods for OpenRAC's native PC port of Ratchet & Clank (PAL and NTSC-U), installed and switched on or off in the OpenRAC launcher's Mods tab. A game with no mods on plays as the PlayStation 2 game does. They come in two kinds (docs/port/MODS.md, section 11):

  • native mods: a small library the game loads at start, built with OpenRAC's mod SDK for each system. It is a program and runs with the game's rights; the launcher says Runs code on this computer;
  • script mods: Luau files the game runs in a sandbox, the same files on every system and nothing to build. They reach only what the game exposes to scripts; the launcher says Runs scripts (sandboxed).
Mod Kind What it does Discs
lock-strafe native Strafe as in the later games: Up Your Arsenal's lock-strafe with weapons that fire ahead, Going Commando's strafe while L2 or R2 is held PAL, NTSC-U
button-swap script Swaps two buttons: Cross and Square, Circle and Triangle, or L1 and R1 PAL, NTSC-U
keyboard-mouse native Keyboard and mouse: WASD, mouse camera, click to fire, right click held for the Quick Select, number keys and wheel for weapons; every action rebindable in the launcher, with presets; a gamepad keeps working PAL, NTSC-U
item-randomizer native Shuffles the gadgets, weapons, vendor stock, gold bolts and infobots, with logic so every seed can be finished; seed codes to share, a spoiler log PAL, NTSC-U
difficulty native A slider for everything: enemy count, damage both ways, enemy and Ratchet speed, weapon and ammo prices, ammo per shot, max ammo, bolt drops, health; presets Easy, Retail, Hard, Brutal and a seeded Chaos PAL, NTSC-U
live-splits native Splits a LiveSplit timer as the player goes from planet to planet: the mod talks to LiveSplit's own server and splits at every planet, so a speedrunner does not touch the timer PAL, NTSC-U
dualsense native A PlayStation 5 DualSense's own buttons as extra PlayStation 2 buttons (the touchpad, the microphone button, the DualSense Edge's paddles), its light bar showing Ratchet's health, a vibration when Ratchet is hit, hits something, breaks a crate, picks something up or finds a gold bolt, and a feel of its own for each weapon in the motors PAL, NTSC-U
ammo-max native At the vendor, buying ammo starts at the most you can buy (the rounds the weapon has room for, or as many as your bolts pay for) instead of 1; Down still lowers it PAL, NTSC-U
xbox-icons native The game's PlayStation 2 button icons as an Xbox controller's, in the game's own style: A, B, X, Y on its dark buttons, LB, RB, LT, RT PAL, NTSC-U
multiplayer native Online multiplayer, first step: a Multiplayer item in the main menu, under Load Game, whose pages are the game's own menus: it connects to an OpenRAC server, finds or creates a party (or joins one by its code) and shows the lobby with your launcher name. Nothing of the game is played together yet. Needs OpenRAC's mod interface 1.7 PAL, NTSC-U

Installing a mod

From the launcher: open Mods, choose Add from a link, and paste https://github.com/OpenRAC/rac1-mods. The launcher lists the mods here with what each is for and whether your game can load it; Install downloads a native mod built for your computer, or a script mod, from the latest release and checks it against the release's SHA256SUMS. It is listed for the game, on; choose its settings and Play (settings count from the game's next start). The launcher offers updates when a newer release comes out, unless you keep the version you have.

By hand: download the mod's .zip from this repository's Releases (one archive holds the mod for Windows, Linux and macOS), then in the launcher's Mods, Add a mod, and choose it.

A mod that cannot load (another game, a disc it does not know, an OpenRAC whose mod interface is older than the mod's) says why on its row, and the game starts without it. Purist mode in the launcher's Settings starts the game with no mods at all. If the game stops with mods on, its crash report names them: try again without them before reporting it to OpenRAC.

A native mod is a program: it runs with the game's rights. Install native mods from sources you trust. A script mod runs in the game's sandbox; the game stops one that errs or runs too long, and says which.

Making your own

The modding guides cover everything: getting started from the SDK's template to a mod players install by pasting your repository's link, script mods in Luau and native mods in C or C++, settings, hooks and their stable ids, and releasing with a tag. They also ship in the SDK's archive, under docs/.

Building

Script mods need no build. For the native ones you need CMake 3.20 or newer, a C and C++17 compiler (Clang, GCC or MSVC), Ninja (optional) and Python 3. No copy of OpenRAC: the mods build against the released mod SDK (the headers, the CMake package and the packaging script), the version and SHA-256 that sdk.lock pins, which tools/fetch_sdk.py downloads into .sdk/.

git clone https://github.com/OpenRAC/rac1-mods.git
cd rac1-mods
python3 tools/fetch_sdk.py                                    # the pinned SDK, checked, into .sdk/
cmake -S . -B build -G Ninja
cmake --build build
ctest --test-dir build                                        # each mod's tests
python3 .sdk/openrac-mod-sdk-1.3.0/tools/package_mod.py build/package/* -o dist   # dist/<id>-<version>-<platform>.zip
python3 .sdk/openrac-mod-sdk-1.3.0/tools/package_mod.py button-swap -o dist        # dist/button-swap-1.0.0.zip, a script mod

To build against another SDK (a newer one, or sdk/ in a checkout of OpenRAC while the interface changes), pass -DOPENRAC_SDK=<its folder>. A new SDK release is taken by changing sdk.lock's version, url and sha256 (the release's notes give the hash).

On Windows, run these in a "x64 Native Tools Command Prompt" of Visual Studio (or leave out -G Ninja and add --config Release to the build and -C Release to ctest). The SDK's README has the details for each system, and docs/port/MODS.md how mods work: the interface, the manifest, the hook points, how the launcher and the game load them.

To try a build without packaging it, add the mod's folder (build/package/<target>) in the launcher's Mods tab.

The build workflow, the SDK template's file for file, builds and tests every native mod on macOS, Linux and Windows for each change, packages each platform's build, joins them into one archive per mod, packages each script mod as it is, and lists every archive's SHA-256 in SHA256SUMS. Releasing is a tag: v<version> publishes the release the launcher installs from, with <id>-<version>-<platform>.zip, <id>-<version>.zip and SHA256SUMS.

Adding a mod

A folder of its own, with its openrac-mod.json, its sources and a README.md. A native mod also has a CMakeLists.txt that calls openrac_add_mod() (copy the SDK's template), and an add_subdirectory() line in the top CMakeLists.txt; a script mod is its manifest and .luau files (copy template-script), which the workflow finds by itself. Commits follow Conventional Commits, with the mod's id as the scope: feat(lock-strafe): ....

What a mod may use of the game is what the port offers it: the hook points of the SDK's openrac/games/rac1.h (and, for scripts, types/rac1.d.luau). One it needs and the port lacks is a change to OpenRAC first (a hook row in the disc's libraries.tsv).

Nothing from the game's discs (code, data, text, pictures) goes into this repository.

License

The mods here are GPL-3.0-or-later, as OpenRAC's port (LICENSE). The OpenRAC mod SDK they are built with is MIT, so mods elsewhere may choose their own license; tools/fetch_sdk.py and .github/workflows/build.yml are the SDK's files and keep its MIT notice.

About

Mods for Ratchet & Clank.

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages