Monday, May 10, 2010

Laptops on a plane, some things take longer than you'd expect...

So last week I went home for a family member's college graduation and had the joy of bringing my new laptop along. Hacking on code for 3-4 hours makes plane trips seem faster and airport waits suck less. Here's whats new:

  • In skill tree can select/deselect nodes, which change color
  • Selecting new nodes on dialog exit will add them to a list the player has, which is persisted.
  • On next open of skill tree, previously selected nodes show up a new color and can not be removed
  • A dialog appears when you exit with new nodes, asking to confirm the changes
  • Initial work on dependency information, so you can require some skills for another
It was that second to last item that took the longest. The problem with nice generic framework code is that sometimes it is hard to add new things. In this case, it was one dialog bringing up another dialog which refused to be dismissed until a choice was made. On selection, it had to communication back to the original dialog the choice made. Make all that a generic dialog for any two button dialog, and that's what I implemented.

This isn't that hard if you have one of the sub-dialogs run a message pumping (draw, blit, read keystrokes) loop, but that is something I have vowed never to do again. It took 5 or 6 classes and a bit of thinking, but it works now.

Things to do until skills can be considered "good enough" for this release:
  • Finish up dependency information on skills
  • Make selected skills do something: add spells, increase stats, allow equipment, improve spells
  • Make skill tree take skill points to select nodes, reward these for level ups, so create exp for player

No comments: