marvster Posted May 14, 2014 Share Posted May 14, 2014 Many top-down (role playing) games live from NPC movement to deliver some vividness to the player.But how to properly set this up? My basic idea was:- if npc is not moving, let roll some dice with a random number generator and a very little humble chance to win (<0.1%) each update- if the random number is chosen, generate a random number for x and y in respect of it's avaible range and set this as a target to move to and set him to move.- in each update move toward the target- if the distance between the npc and the target undergoes a certain threshold or npc collides, set him to non moving. This might work some how, but has the effect that they will go wild. But some NPC with special abilities (merchants etc), must be found with a specific range. I could just negate the cords, after he finishes moving, but this looks very unnatural, as the NPC starts moving in star-formation. Anyone has an idea how to solve this? And has anyone an idea how the algorithm choosed can be optimized? Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.