how to mod brogue ----------------- table of contents - part 1: workflow - part 2: demon chicken (warm-up) - part 3: trimming out useless stuff - part 4: simple staves wait, what's brogue? brogue is a roguelike game with complex mechanics and better graphics than most other ascii art-based roguelikes. while the more modern user interface makes it easer to get into than a similar game like angband, brogue is still very complicated and difficult to master, which of course makes it a fun and addicting way to waste time. if you're reading this, of course, you probably already know what brogue is. and if you don't, go play it! enjoy the learning curve ^^ why mod brogue? have you ever thought "what if I enchanted this staff 100 times?" or "what if I added my favorite monster from #{mythology/fictional universe}?" or "what if there were classes in brogue, like in nethack?" whatever it is you want to do, it's probably possible considering brogue is open-source. of course, you do need some computer knowledge, amateur C programming abilities, and decent grepping skills. even if you don't have those, this tutorial may still be informative enough that you can go and mod brogue after reading it. there are a few brogue mods already out there, with the two most thorough being gbrogue and unbrogue. both these mods add and enchance all sorts of content, and the mod I'll be making for this tutorial (which is also kind of a devlog, since I'm learning as I go along here) will do the same, but probably to a lesser extent. here are two other reasons to mod brogue, which require much less explanation: - it's a good learning experience (dealing with other people's code, etc) - it's like making your own roguelike, but someone else wrote all the boilerplate uh oh there's no official way of modding brogue -- no lua api, no custom bytecode, no json files for monsters/items, etc. you pretty much have to hack around in the game's code to change things. unfortunately, this means that there isn't yet a method for mixing multiple mods together (like what hatsune miku's minecraft has). while I could take a detour and crack open brogue's bumpy shell, wedge a lua vm into the game's raw meat, and then seal it back up with duct tape, that would be impractical. brogue doesn't have a an easy-to-use api -- instead, everything just exists within a soup of methods, structs, #defines, etc. still not convinced? take a look at this:$ wc -l src/{brogue,platform}/*.{c,h} 3742 src/brogue/Architect.c 361 src/brogue/Buttons.c 1718 src/brogue/Combat.c 301 src/brogue/Dijkstra.c 2629 src/brogue/Globals.c 582 src/brogue/Grid.c 4785 src/brogue/IO.c 7407 src/brogue/Items.c 410 src/brogue/Light.c 847 src/brogue/MainMenu.c 4357 src/brogue/Monsters.c 2478 src/brogue/Movement.c 426 src/brogue/PowerTables.c 175 src/brogue/Random.c 1324 src/brogue/Recordings.c 1327 src/brogue/RogueMain.c 100 src/brogue/Sqrt.c 2579 src/brogue/Time.c 234 src/brogue/IncludeGlobals.h 3185 src/brogue/Rogue.h 227 src/platform/curses-platform.c 222 src/platform/main.c 411 src/platform/platformdependent.c 645 src/platform/tcod-platform.c 886 src/platform/term.c 29 src/platform/PlatformDefines.h 25 src/platform/platform.h 36 src/platform/term.h 41448 total*41.448kloc go brrrrrrrrr* whenever this tutorial mentions parts of the code, I'll be sure to provide line numbers since most source files are inordinately large. the lines will of course be approximate, due to various small hacks and formatting edits I try out. *hacker news voice* I don't like the way you're implementing this, please stop cool, go somewhere else. not that I'll ever have the clout to attract hn/lobste.rs trolls (besides the hypothetical ones I write into section headers).