Thursday, August 02, 2012

Notoriously Databased v0.25

So much for esxprecting a fairly easy process to get the turn resolution complete. It's been over 15 hours, but finally is taking shape. Lots of effort in outputting stories as they will be the main interface for players to see what happened, and lots of code comments. I think it's teaching year 12 IPT that has made me comment more. It's a good thing, but adds time ...

Resolution Phases

  1. Validate the turn
  2. Town Raids.
  3. Hero attacks on Dungeon. 
  4. Attacks by other Characters.
  5. Returning trops.

Hero Attacks on the Dungeon

The main component of the game will be dealing with the escalating amount of heroes attempting to rid you from the world. in this section there's not too much to do. The Heroes' level will be dictated by the last turn's notoriety, or be found by a level 1 scout if no notoriety. The tricky part is absorbing the amount of damage to the fortifications and elites. I'd solved this earlier in the spreadsheet, but the different variable types made this a little interesting.

Attacks by other Characters

 When other characters attack, there is the chance that more than one will be attacking at the same time. If this is the case, they first all try to get past the fortifications, then combine strength to take on the dungeon. If there are any survivors they fight it out so that only one returns with the treasure. In the case of a draw (both sent the same amount of minions), the prisoners overpower them and escape back to the city. The outcome is that the dungeon is definitely wiped one way or another, and the attackers either havethe winning troops return or lose everything. Once again converting elite strength to overall strength and back again is a right royal pain, but having elites adds an additional way of spending money so I hope it'll be worth it.

Returning Troops

The raiding parties and attacks on other dungeons come back in this phase. Since there are data models set up to hold the results of these raids, it's simply a case of looking for any relevant data and integrating it to the next dungeon state.  There is also an opportunity to clean up the amount of minions ready for the next turn, dig out any new space, build any fortificaitons, or bring back the ransom.

Quite happy how the whole process turned out. Now to debug and make the stories more visible and enable a simple of triggering an end of turn.