You are browsing as a guest. Sign up (or log in) to start making projects!

11h 27m 14s logged

Devlog: Building a Roguelike RPG in Pure Python

The original goal was pretty simple: build a fully playable terminal roguelike from scratch in one Python file. No game engine, no outside frameworks, just the standard library and a lot of free time.

Most of the systems worked fine on their own for a while. Combat felt decent, dungeon generation was working, and items loaded correctly. But getting everything to actually work together was way harder than expected. FOV, enemy AI, status effects, and saving all needed to talk to each other and there were a lot of moments where killing an enemy would crash the save, or a spell would try to hit something that didn’t exist anymore.

That couldn’t stay broken once boss fights and multi-floor progression needed to actually function. So most of the work became just making all the pieces cooperate reliably.

The Goal

For the game to actually feel good:

  • Procedural dungeons should feel different every single run
  • Combat should have real depth, resistances, crits, status effects and all that
  • Enemies should do more than just walk straight at you
  • The save system should handle any game state without breaking
  • Bosses should actually feel scary, not just be big HP sponges

For the code side:

  • Everything needs to serialize to and from JSON cleanly
  • No weird dependency loops between the combat engine, dungeon, and player

What Changed

The dungeon generator now uses BSP room placement instead of just scattering rooms randomly. Enemy AI got split into 9 different behavior types including chase, patrol, ranged, ambush, support, berserk, flee, guard, and idle, instead of one giant mess of if statements. Status effects now tick on both the player and enemies every turn separately. I also completely rewrote the FOV using shadowcasting across all 8 octants which honestly took way longer than it should have.

What Actually Broke

Pretty much everything had issues at some point.

  • The shadowcasting FOV has a bug on the northeast octant where some walls stay invisible when they should be visible. Still figuring that one out.
  • Saving in the middle of combat sometimes drops enemy status effect potency on reload. The duration saves fine but potency resets to 1 for some reason.
  • The floor 6 shop occasionally spawns completely empty if the floor RNG hits a certain seed. No idea why yet.
  • Boss loot is guaranteed to drop but sometimes lands on a wall tile if the boss dies in a bad spot.

What’s Next

Fixing the FOV bug, patching the save and load status issue, and adding actual targeting for spells so they stop just auto hitting the nearest visible enemy. After that probably more boss phases and a high score system.

It’s playable and honestly pretty fun. Just not finished yet.

0
3

Comments 0

No comments yet. Be the first!