r/Modding • • 10d ago

Question Adding a forced level cap to a pokemon game

I am in the process of modding Pokemon Sword using PKNX, and I’d like to add a forced level cap if possible. With very brief research, I see that I cannot do that with just PKNX. If it is possible, how would I go about adding a forced level cap into the game?

2 Upvotes

1 comment sorted by

1

u/Bluetails_Buizel 5d ago

Short answer: not with pkNX alone. pkNX edits RomFS data (trainers, encounters, items, text), and the level cap logic isn't stored there. The EXP gain and level-up flow is handled in the game's executable (ExeFS), so a forced cap needs a code mod, not a data edit.

Some context: vanilla SwSh's badge-based "level cap" is only an obedience/catch limit, not a hard cap. One of the established hacks (Divine Sword & Blessed Shield) says outright in its release thread that they couldn't force a level cap within the game's limits. Back then it wasn't really doable without code patching. Someone asked the same question on Project Pokemon (editing the 20/25/30/.../55 caps) and got no replies.

What exists now:

  • PokeFeurRandomSWSH (GitHub / Nexus) has a real EXP-blocking level cap. EXP stops the moment a Pokemon would go over the cap. It has several modes: gym/Champion caps, a soft story cap, a strict "next boss's highest level" cap, and an ordered major battles mode. It's built on exlaunch and Lincoln-LM's swsh-mods-exl, and it runs as a runtime module, so it needs your exefs dump too. Limitations: 1.3.2 only, Windows + Ryujinx is the documented setup, and the caps are read from the teams it generates. It's mainly a randomizer, so whether you can use only the cap module on top of your own pkNX edits isn't documented. Ask on their Discord before you commit to it.
  • If you want to build it yourself into your own hack, the route is exlaunch. Lincoln-LM's swsh-mods-exl is an exlaunch project for SwSh 1.3.2 with source available. It already hooks game functions (shininess, the level-cap catch/shiny lock in its uncap_level mod, etc.), so it's a good base to learn from. You would hook the function that grants EXP or applies a level-up and clamp it to a cap based on badge count or a story flag. This needs C++, the devkitPro/exlaunch toolchain, and some reverse engineering in Ghidra/IDA to find the right functions. There's no ready-made tutorial for this specific hook that I could find.
  • Simpler ExeFS patching (IPSwitch .pchtxt) is also possible. For example, someone recently made Rare Candies infinite by patching the executable's level-up/candy routing. A static patch can't easily read badge count, though, so for a cap that changes with progress, exlaunch is the better fit.
  • Low-effort fallback: EXP cheat codes exist (multipliers, disable Exp Share). A 0x/no-EXP toggle you turn on yourself at the cap works, but it's manual and not "forced".

Practical notes:

  • Use game version 1.3.2. pkNX expects it, and both exlaunch projects above are 1.3.2 only.
  • Your pkNX edits are RomFS and an exlaunch mod lives in ExeFS, so they should be able to coexist as separate mod folders. Test it anyway.

Sources:
https://github.com/JonatanUHC/PokeFeurRandomSWSH
https://www.nexusmods.com/pokemonswordandshield/mods/14
https://github.com/Lincoln-LM/swsh-mods-exl
https://github.com/shadowninja108/exlaunch
https://gbatemp.net/threads/pokemon-divine-sword-blessed-shield-version-1-1-major-update-exp-candies-return.590250/
https://projectpokemon.org/home/forums/topic/59598-swsh-remove-adjust-level-cap
https://projectpokemon.org/home/profile/155634-matroskin/content/
https://projectpokemon.org/tutorials/rom/switch-pokemon-games-hacking-tutorials_158/
https://fearlessrevolution.com/viewtopic.php?t=15399

~Researched by Claude Opus 5.5