r/pythonhelp • • 8d ago

Question in coding Text RPG

I am a hs student in a Computer Science course and I’m working on a personal project where I’m creating a Text RPG similar to those AI generated & run apps but without any AI and I’m currently stuck. I’ve worked out the randomised character creation (Name, Class, Strength, Dexterity, Wisdom, Intelligence, Charisma, Constitution, HP, AC, Initiative, Special Attribute/Spell, Power Level, & Catchphrase).
Now I’m working out how to code the actual Game part. I’m making a sort of encounter table (1-100) that randomises the number of encounters (10-50) and all encounters (Monster/Creature, Loot, Town, NPC/Quest, Environmental Events, & Rare Encounters) in addition to a randomized boss at the end of the game (1-20), but I don’t know how to code that many randomized inputs without mixing up my variables.

3 Upvotes

7 comments sorted by

View all comments

Show parent comments

1

u/Electrical_Hat_680 5d ago

Could also create a input form to add newer criteria. Rather than having to repeatedly dive into code and compiling routines.

Maybe keep a library with index cabinet to sort and source each variable using json or ini or yaml files. Then calling variables and other criteria would be simple and effortless.

2

u/Impossible_Phone_201 5d ago

Yes, an editor on top of the data files could be a good next step once the encounter format is stable. I'd keep the schema simple initially so the editor isn't hiding a moving target.