Forum > Programming

Chase Script idea

(1/2) > >>

Kakashi Natsu:
For our game we have enemies that can chase you. SHould the chase be based off player position or whether the enemy can see you or not.

Artemis:
I'm not really sure what you mean in this thread, but if you mean there should be a function that automatically chases an enemy, I disagree.

Why not have a button that locks on to the enemy you're pointing/facing at and you could follow them that way, but having a script that automatically tails someone just seems too easy.

Kakashi Natsu:
let me try to be clearer of what i have right now, I walk around, if i get in proximity of the enemy and in his view point, he starts to chase me, that donts seem very realitic expecially since its a skeleton. most enemies i will face will be pack animals, wolves, skeletons, Soldiers

Dragon6624:

--- Quote from: Kakashi Natsu on August 10, 2016, 22:51:47 ---let me try to be clearer of what i have right now, I walk around, if i get in proximity of the enemy and in his view point, he starts to chase me, that donts seem very realitic expecially since its a skeleton. most enemies i will face will be pack animals, wolves, skeletons, Soldiers


--- End quote ---

If you're looking for the *Utmost* realism, it should be based off of both...sort of. The *paramount* function to detect you should always be through direct line-of-sight -- however, if your player is that sort of idiot who just runs around a lot, there should also be a function for [Insert_Foe_Here] to notice you through 'sound'; i.e. If you are running/walking near an enemy instead of crouching or standing still, they will be able to detect you through some sort of detection-circumference...preferably after a few seconds of consistent running/walking ((and for the sake of realism, you could probably say 2 -- 2 full seconds is more than enough for the player to be blatantly attempting to get caught...or just be spotted for being naive)).

Once they hear the player, the instinctual reaction should be to *rotate towards the source of the noise's last known position*; however, if the player is cunning enough, they should be able to avoid being caught by hiding the entirety of their body -- either through physically hiding behind an obstacle, or managing to escape out of range of the enemy's line-of-sight. Presumably, the enemy will then wander about the area, searching for the signs of this 'intruder' for another 20-30 seconds, before returning to their routine task.

If you have the talent to kick it up a notch, you might also consider certain summons (such as the said "Skeleton", or another example being a "Golem") *only* being able to detect the player in the event of a magical ability or artifact being used/carried within their detection-range. This'd make for some intense moments in which you might be raiding a dungeon, only to have to leave behind an artifact as it would attract the attention of several out-of-your-league "Lich-Knights" (taking a liberty there for the sake of the argument, I've no clue what you'll be adding to your game outside of the above stated creatures) who happen to be guarding the exit. Or, you could always be avaricious and risk the danger for the reward.

Hope this helps.

Kakashi Natsu:
Sounds like an awesome plan, but sadly all i have is this so far, the player enters the enemy's  radius, and it follows the plyaer until the player leaves the radius of the enemy. then the enemy stops moving.

Navigation

[0] Message Index

[#] Next page

Go to full version