A simple C++ console game that is a discrete simulation of an RPG-like battle encounter.
So, when I initially started this I set out to incorporate what I have been learning from my AI classes into it – I figured I’d be able to make some awesome alpha-beta pruning algorithms since I had the week off from coding. However, I quickly realized that making this would not be as easy as I thought; I thought making this would be a mere day’s work, but after documenting down the design of the game it became clear that the scope of this game was way too large to manage in just a day. So I spent a few days on it mostly working on building the framework for the game – which ironically was mostly based off design concepts that I picked up while using the Unreal Engine. I finally made it to being able work on building the AI, but unfortunately I was pretty much out of time for being able to work on this since I had to get back to working on my current project – Lucidity – and school stuff. So, I quickly made a sorry excuse for a heuristic – I know, it’s really bad – that calculates the best move and functions reasonably for the most part. I’ll probably return to working on this again at some later time, since it has the framework laid out to be improved upon – who knows, maybe one day this will turn into an actual game!
View the Source: https://github.com/jheard901/Text-Based-Encounter
Rules of the game:
-Two teams (1 is player, the other is AI)
-The first team to die loses
-Draws occur if a team escapes
Each character has four actions that can be choosen: Attack, Defend, Charge, Flee
Attack inflicts damage to another character and has a chance to critically hit for 3x damage.
Defend mitigates 50% of damage taken and has a chance to counter attack the attacking character for 200% of that damage.
Charge increases critical hit and counter chance based off whether or not the character took damage earlier.
Flee has a character a chance to escape combat which will conclude the encounter if successful. Taking damage earlier reduces the odds of escape.
In the future, my priority would be on tuning the AI to be much better than it is. It honestly was rushed, and I think there is a lot more that can be done to tweak it to be nice. Besides that, there is also the option to work on adding in online multiplayer to the game, but I think it would take quite a bit of time to add in considering my limited net coding knowledge (WinSock 2.0). The actual values used for setting stats (based off difficulty) needs some tweaking as well.