I'm trying to implement a 'Town Guard' feature seen in Oblivion and other classic RPG's: when the player commits a crime (shoplifting, hitting a harmless commuter etc.), a couple of guards soon show up to arrest him. But they don't just appear from thin air, they tail the player starting off from their barracks, so the player has a chance to evade them.
What's the best way to implement this?.. Thanks.
Follow the game Development on Twitter https://twitter.com/Fore_Lore_Games
or check out the face book page here https://www.facebook.com/ForeLoreGames
I'd also use a NavMesh set up so your guards can path correctly to your player, and set up some kind of escape criteria for your player - either based on time evading your guards or on distance from guards so they don't endlessly come after you.
Will do it this way, but perhaps GiL would also like to chip in. :)
(Instead of ''ubiquitous Town Guard'', the title should probably read ''global Town guard''.)
Another way could be making use of factions. E.g. having the guards already in town and crimes lowering the sympathy until they become your enemies. Or change the faction of the guards to an enemy faction after a crime.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!