Trying to make a DnD command line utility

Hello all. I like to GM DnD and am currently in a lull where I’m not GMing and writing a campaign or adventure. I figured I could use this time to find or build my perfect utility for running a session. I have a github with a lot of really hot garbage code here. The readme has most of the main goals I have for this project, but I’ll expound a bit here.

I have a lot to say, but I’ll ask my main questions upfront. My main issue is I have no idea how to build the parser, let alone a DB, or a video game.

  1. How to I get what I imagine is essentially a custom shell with DnD specific commands up and running? I don’t want to have to issue the GMcli command with every time I want to issue a command like with typical linux commands. If I have to have it that way then I can get used to it.
  2. I want to be able to edit an easily readable list of these commands (jsons) to allow for as many aliases as I like.
  3. Should I use an SQLdatabase for storage. A hyperlinked word document is much easier to run a session with.

The idea is to create a program that gives me the ability to quickly input and track monster, boss, player health, turn order, abilities and more. I’m using a hex map for my world and treating each hex as an object with fields. The fields are related like a database where a city has an id, districts have ids and parent city ids, structures have ids and parent district ids.

The prompt should look something like this as it waits for your input:
GMcli>
you could do things like generate a quick encounter via:
GMcli>new encounter level=4 hexid=05.22 name=bleh
it would check the hex for the biome and generate monsters/NPCs based on that biome and level.
It would spit out encounters until I accept one, then it would save it for use later.
when the time comes I want to start combat with:
GMcli>start bleh
It would then spit out the list of enemies I’m running and their stats/abilities, prompting me for each unit’s initiative. I’d roll init for the monsters/NPCs the old fashioned way and supply it.
add players to initiative:
GMcli>bleh>player init=20
it would then cycle thru turns
GMcli>bleh>kobold1>
GMcli>bleh>player3>
Damage players
GMcli>bleh>kobold1>dmg=5 player1
Heal monsters
GMcli>bleh>kobold3>heal=7 kobold1
stuff like that.
Even adding monsters in the middle of combat
GMcli>bleh>player2>add monster name=gorgon1 level=3 str=+2 int=+3… initiative=3
I’d even want to be able to make special bosses with phases that I can activate. Or lair actions and encounter countdown timers.

The idea ballooned pretty quickly into essentially attempting to program a video game inside a SQLite database via a poorly planned and maintained python and SQLAlchemy abomination.

It was getting way to boated and complicated. I realized managing the amount of information I was trying to put in the database via only a command line interface was going to be a difficult learning curve for me to make. I’d much rather have the notes and information in a well hyperlinked and maintained set of Word documents that I can freely open and edit easily or share with others who won’t have the program, then control the session and procedural data through the utility. It would save to a word document with hyperlinks and bookmarks to the important stuff for fast information lookup.

My problem is I don’t know how to write code very well. I don’t know what methodology for planning code is out there. I’m all over the place with writing it and there are tens of unsolved problems with my three stacks of code I have. Nor do I know what tools already exist out there.

Any help at all is appreciated. Maybe I’m going about this the complete wrong way?

1 Like

Q: is this more a programming project, or more a need for something to run a campaign with?

If it is a programming project primarily: go nuts. more power to you.

If it is a GM campaign management issue, check out what is available on ios and android.

There are a heap of really good utilities already for this. One of my GMs was running one on his ipad, i can check if it is IOS only and the name of it if you like?

1 Like

Write things down!
Make a list of features you need and a seperate list of optional features wich you may ad later on.
In case of CLI, you don’t need to think about a menu structure as much, still would not hurt to make a “mind map” of the options.

Some programming languages get you up and running really quickly (Processing, Python, Ruby, etc.), others require more work to get something presentable (C/C++, Java, etc.)

You are not writing anything mission critical here, as long as it works, it works.

The only other thing i’d suggest if you are learning to code is to try to walk before you try to run.

If you can’t figure out how to implement something but want to eventually just put a fake stub in there and come back to it later. At least you’ll feel like you’re getting somewhere, in actual fact are making some sort of progress, and you can figure out how you want to make it work later/as you get more experience.

Otherwise it can feel all too massive and overwhelming.

yeah please do. at the very least I could get inspiration from the features they have and stuff. Also I really haven’t found an app that fits what I need in a hex based DnD setting. I have a map made but i havent found anything that lets me store information based on hex.

good idea. thanks. I am running into a lot of issues where in order to solve problem 1 it requires building some new infrastructure, which then spawns its own problem which requires new infrastructure. On and on down the rabbit hole it goes sometimes.

1 Like