Dewwy's Blog

Mechanical Cataphract

In my previous post I talked about the potential to automate the data management and some rote tasks that a referee of a game of Cataphract necessarily has to go through. I have seen several different attempts at automating parts of this in different ways. Almost all involve a discord bot that reports data to discord channels from a Google Sheet. This covers some of the reporting requirements very well, but leaves something to be desired in terms of data organisation. If you want to edit the data, you have to wade through your folders of google sheets.

To solve the visual/spatial information portion of the problem (keeping track of entities on a map, moving entities around on the map, sending slices of the map to player commanders as scouting reports) the most powerful solution I have seen so far involves scripting on top of Foundry.

Foundry is a self-hosted virtual tabletop. A virtual table-top (VTT) is software that allows people to play (primarily) tabletop role-playing games such as Dungeons & Dragons online. A VTT simulates the experience of being gathered around a physical table by providing tools for maps, tokens, dice, character sheets, and rules automation, accessible remotely through a web browser or app. Foundry is a very good choice for this problem. Honestly I'm kicking myself for not thinking of it first.

So far, all of the Foundry implementations I have seen have been built inside a pre-existing module, usually Dungeons & Dragons 5th Edition. A module in Foundry is a plug-in which extends the functionality; the core app provides a map space and user management. A module is added on top to provide automation for a particular game-system or part of a game system. There is probably a lot to be gained by someone creating a Foundry module specifically for Cataphract. I may attempt this myself in the future but I have no experience developing for Foundry. Then again, I have no previous experience making anything with a GUI at all, including what I am about to share with you.

Mechanical Cataphract is a work in progess cross-platform desktop app for referee's of the game Cataphract. I'm actively developing it and making good progress. I have a working data-model and most data-entry and view features are implemented, as well as some of the automations I see as most valuable. At time of writing, it includes:

  • An editable hex map with roads, rivers, and terrain types.
    • Selectable hexes. On selection, terrain, faction control, population, and forage information are provided and editable.
    • Armies, commanders, and messages are displayed with icons in the hex that is their current location, and are selectable by mouse click.
    • Selectable overlays for displaying additional hex information directly on top of the map: faction control, population, times foraged, and weather.
    • Ability to set manually or compute a path for an army/commander/message, and display it on the map.
  • A summary panel, with tabs for factions, armies, commanders, and messages. Items in the summary panel are selectable, opening a seperate detail panel which surfaces all information on the selected item to be viewed or edited, as well where automation helpers for that entity are found.
  • Detail panel automation helpers: supply consumption, casualty application to all brigades in an army by percentage.
  • Map level automation helpers: Foraging (updates counter for number of times selected hex's have been foraged), uses selected hex population values to generate supplies, and provides them to an indicated army.
  • Game state automation: Game time tracked and advancable by button press. Currently includes automated supply consumption for each army at the same time each day, and automated movement of armys, commanders, and messages along their set path if they have one.

The following features are currently planned in future development:

  • Automated scouting report generation: Provide a rendered slice of the map according to the scouting range of a selected entity as an image file.
  • Automated pathfinding: Find shortest route between two selected hexes.
  • Automated movement: Provide a path (or generate one with automated pathfinding) for an entity, and automate movement along that path as game time is advanced.
  • Automated weather.
  • Automated message delivery: Using automated pathfinding and movement systems.
  • Discord bot integration.

When complete, Mechanical Cataphract will be a stand-alone desktop app that a referee can run with minimal additional set-up, at no cost (not requiring you to purchase the Foundry VTT), providing space for all of the data entry, organisation, and automations consolidated in one place. There will necessarily be some set-up required as the user will need their own Discord bot if they wish to use the Discord integrations (which are by no means required). However setting up a Discord bot is a quite short and uncomplicated process. As features near completion, I will share follow-up articles demonstrating their use. When near feature complete I plan to run a short game for testing, which I will be advertising on the Cataphract Rally Point Discord.

When using the Discord integration this app will function like a self-hosted server accessible by the admin through a GUI, and to players only through a Discord bot API. As such, for the test game my hosting solution is going to be to leave my personal PC running 24/7. I have some ideas for transitioning to running on an external server; the entire app could also function via command line, avoiding the need to be able to remote view the GUI, but I am keeping this off my roadmap for now. As the app is quite light and cross-platform it should run perfectly fine on any old laptop you have around, so you can keep it running in a corner somewhere on that laptop, rather than powering your tower PC (and its huge fan and sleep killing blue LEDs, if you're anything like me) all night as you try to sleep.

If you're interested in taking a look at the code so far go here. I try to keep it buildable so if you want to spin it up and test it go ahead. The UI.. leaves a lot to be desired as it currently stands, currently focussed on getting functionality in before making sure everything is presentable. You will likely find some bugs if you do this.

31 January 2026