NPCs that do more than look pretty

 
Ket is a cold cat
Arashi and Ket dicuss the situation

This is a multi-screenshot endeavor today. 

Thanks to help from the XNA forums (most notably mtnPhil and scoy), I managed to get my light code running even more efficiently, so it can handle a significant number of light sources before any slowdown occurs.  You’ll see at the end of this blog post what I mean. 

Here to the left is a screenshot detailing my work from this evening: NPC interactions!  This is the heart of RPGs and surprisingly took til this late date to finally begin implementing it.  Part of the reason (and something else I’ve begun coding) is I didn’t have the quest/objective progress planned out.  This is just the first stage here, where basic flags are triggered (usually linked with usecode scripts), and there is now a usecode script that checks to see if a flag has been triggered.  If yes, it executes usecode1, if no, it executes usecode2.  

Arashi is happy to see a flag
Arashi and Ket discover a checkpoint banner

 What that means is, like here in the above screenshot, Arashi is talking to Ket after just stepping outside the tent.  They haven’t found much information yet so Ket is obviously curious what is going on.  Now we wander around to the end of the trail…Which triggers a flag that this is the right way back to the Kinshutai stronghold.  Oh, and this is one of the other things I coded today: checkpoints!  Arashi automatically triggers progress checkpoints whenever she sees one of these Foxfire flags, and if she dies, it brings her back to that point.  By the end of tonight’s programming session, Arashi will be able to use the checkpoint flags to teleport to any other flag she has seen, as a method of quick transportation, as well as select a previous checkpoint as her “home point”.  I also finally coded Arashi’s death sequence, since before reaching zero hit points did nothing.  I didn’t want to make death too frustrating in this game, so for now other than your position in a dungeon, nothing is lost, and any keys or gates opened stay open which will be useful for deeper mazes where you can open shortcuts. This may change slightly when the game is closer to done (feel free to throw any suggestions at me in the meantime). 

 
 
Now back to the original topic, NPC interactions.  Like I said, approaching this checkpoint also sets a minor quest flag. Now when we talk to Ket… 
 
Ket seems a bit more positive
 
His dialog has changed (it checks to see if that flag was tripped and switches accordingly).  This is just the beginning of the possibilities, but now they are in place.  Also, I was bored and dropped all my inventory (which consisted of a ring and 7 lanterns), and turned the lanterns on to create the scene here… I should note that lanterns aren’t automatically “on” by default.  Compare the middle screenshot to this one – all the changes were done using the game engine itself (not pre-planned).  Now I just need to get around to designing more fun things to play with!

About Astrael

A long-time independent game developer that was lucky(?) enough to have grown up with the gaming industry. I am a programmer, a game designer, a concept and pixel artist, a music composer, and a novelist. This has been my dream for as long as I can remember, and I am determined to take advantage of every talent I hope I have to make it happen!