Recipe card · Personal project

Infinite Stamina, a mod for R.E.P.O.

A C# mod that removes stamina drain in the co-op game R.E.P.O. Published on Thunderstore, it has been downloaded 384,452 times.

Context
Personal project
Date
February 2025
Team
Solo
Result
384,452 downloads
The Infinite Stamina mod logo as it appears on Thunderstore: a yellow lightning bolt outlined in green and red
The mod's logo on Thunderstore
Why this dish?

The need

In R.E.P.O., a co-op game built with Unity, the player's stamina drains as soon as they sprint or slide. The idea of the mod: make it unlimited, without touching the game's files.

Preparation

What I built, step by step

  1. Understanding the game without its source codeAnalyzing the game's assembly (Assembly-CSharp) to find the class that handles the player, PlayerController, and the stamina-related fields.
  2. Creating the pluginA BepInEx plugin (the mod loader the game uses) that initializes at launch and applies the patches.
  3. Changing behavior at runtimeWith Harmony, a postfix runs after the player's Update and FixedUpdate methods: if they are sprinting or sliding, stamina goes back to its maximum.
  4. PublishingPackaging the mod and publishing it on Thunderstore, the game's main modding platform, where it installs in one click with a mod manager.
PlayerStaminaPatch.cs
[HarmonyPatch(typeof(PlayerController))]
class PlayerStaminaPatch
{
    [HarmonyPatch("Update")]
    [HarmonyPatch("FixedUpdate")]
    [HarmonyPostfix]
    static void InfiniteStaminaPatch(PlayerController __instance)
    {
        if (__instance.sprinting || __instance.Sliding)
        {
            __instance.EnergyCurrent = __instance.EnergyStart;
        }
    }
}
Chef's tips

Technical challenges and solutions

  • Modifying a game without its code

    The problem
    R.E.P.O.'s source code isn't available, so it can't be modified directly.

    My solution
    Patch the methods at runtime with Harmony. The game's files are never modified and the mod can be uninstalled at any time.

  • Changing only what's needed

    The problem
    An overly broad patch could break other game mechanics.

    My solution
    The patch only acts in two specific situations, sprinting and sliding. Everything else about the player's behavior is unchanged.

Tasting

The result

Published on February 28, 2025, a few days after the game's early access release, the mod has 384,452 downloads on Thunderstore (as of November 25, 2026).

Next time

What I learned

A few dozen lines of code can serve hundreds of thousands of players. This project taught me to read and understand other people's code and to ship for real users.

A possible next step: a BepInEx configuration file to choose a stamina multiplier rather than infinite stamina.