It’s not all sunshine and roses or whatever the expression is…
The last week or two were spent making “builders” to help my make my villagers (and other monster type things) behave how I want them to.
As you can see I ended up needing a bunch of panel of info to make a quest builder. This allows me to make quest steps of all different types (kill things, collect things, find a special thing, speak to someone or go to a err special place). I can order them or allow them to be done simultaneously along with set any relevant text dialogue for the various NPCs.
This was a large (and not particularly exciting) slab of coding but hey, it’s done now. So now I can add 1 or more quests to an NPC.
In other news I had to do something about the bounding area of an roaming enemy. They can roam around in their area just fine but what about if they’re attacked (and therefore start to run after you) and get to the edge of their area? Well my solution was to allow them to go to twice the side of their bounding area once they’re attacked and if they get to the edge of that (ie that would probably mean you’ve run away) they will give up and spin around and head back to their area. While they’re heading back they’re also unattackable. This is pretty much how it works in Final Fantasy 14 and Everquest (not sure about World of Warcraft as I’ve never played it) and various other RPGs. I’ve never been 100% happy with that solution but the alternative aren’t that great either (monsters that chase you forever or you being allowed to just stand outside the monsters area and pick them off from range).
We have a new NPC type too. Female Peasant Roamer NPCs. Handily I found a way of using the same skeleton from the Male Peasant NPC so therefore I can use the same animation. At least as a base anyway, I can always tweak it.
This then means I need a “roamer builder”. She can’t just randomly roam around like a mad woman or zombie so she’ll need to follow a “script”. For now it’ll be moving from A to B, pause for x time, turn left/right. She can play a selected animation along with each step. With those step types I should be able to make her wander around the village in an eventual loop. Much like the West World characters although she won’t be quite as intelligent.
Some smaller stuff. The player now hold’s he weapon properly and I added a sparkle to follow his weapon when he attacks, like so:
Oh and when a monster is killed it now updates the quest journal with a message to say that the player needs to kill more or that they’ve finished that step of the quest (also with a green tick). I’ll need to make it so you get your reward soon!
And finally the slope is now checked to prevent you walking up sheer surfaces although that’s not perfect yet since you can turn at a shallow angle to the surface and creep up it slowly but I’ll fix that later by checking the slope angle (as suggested by a nice guy on the Monogame forum).
Until next time..