If you read my post last week, you’ll know I was rather excited about the fact that my NPCs were pretty much all working, and life was wonderful. Except as I’m finding out more and more with this project, that sense of “it’s done” is in fact, a lie.
This project I’ve embarked on is somewhat complicated, but I didn’t quite appreciate just how much my little bits and pieces would need to intertwine. For example, I said that my next big job is to start the dialogue system, which meant I was going to have to really start getting to grips with XML etc. Which to be honest, was rather terrifying for me. So I thought, I know, I’ll put that off by making sure my dialogue boxes spawn correctly etc, then I can think about the text that’s going into them.
Easy right? Just a case of adding in a few more bits of code? Nope.
The player character was one of the first things I put into this game. It’s a pretty simple system, just uses Tile Movement’s default controls so I don’t really have to think about the keyboard too much. (That will obviously change if I decide I want to tackle gamepad support or custom key bindings.) But for all intents and purposes, it worked. The guy moved, the animations moved correctly with him. It was fine.
That is, it was fine until I tested the interaction system (that will bring up the dialogue boxes) a bit more thoroughly. I realised then that there was nothing stopping the player from starting a conversation and then just walking away. And that’s just rude! So, I needed to go back and re-evaluate how the player character worked to try and come up with the best way of factoring in this newly required behavior. Which is when someone suggested (I’m sorry I can’t remember exactly who, it’s been a long week!) that I should probably be using states for my player, in the same way I had for the NPCs.
So fast forward to the current state of the project, my player character now has a ‘Talking’ state in the same way the NPCs do, it serves exactly the right purpose. The player now has to wait until the dialogue functions have finished before the state changes back to ‘Standard’ and their movement is re-enabled.
It probably sounds obvious to more seasoned game developers, but I keep forgetting just how much each mechanic affects everything else. This definitely won’t be the last time I come back to a mechanic I’ve already implemented because I’ve added something in somewhere else. It’s just another learning point I didn’t even consider!
As for the game we played this week, Healer’s Quest has so far proven to be tricky at times, and hilarious. I don’t think I’ve ever laughed so much in a character creation process! You should definitely check it out if you’ve not come across it. I’ll be playing it again on Thursday too!