Shinobi Life Online

Art Category => Programming => Topic started by: Kakashi Natsu on August 10, 2016, 22:01:01

Title: Chase Script idea
Post by: Kakashi Natsu on August 10, 2016, 22:01:01
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.
Title: Re: Chase Script idea
Post by: Artemis on August 10, 2016, 22:12:12
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.
Title: Re: Chase Script idea
Post by: 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
Title: Re: Chase Script idea
Post by: Dragon6624 on August 11, 2016, 01:33:26
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


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.
Title: Re: Chase Script idea
Post by: Kakashi Natsu on August 11, 2016, 02:20:15
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.
Title: Re: Chase Script idea
Post by: Dragon6624 on August 11, 2016, 02:50:33
What about a set of two radii, one of which can be obscured by obstacles and covers the front half of the Skeleton. The other could then cover the entirety of the Skeleton, but only be activated by the player Walking/Running within it's parameters -- and following this, it then prompts said Skeleton to rotate it's primary radius ((Its 'line-of-sight')) around towards the direction of the disturbance?

Why does the enemy simply stop moving? If possible, wouldn't it be wiser to have it wander about the area? ((Although, obviously avoiding objects that would tamper with its path-finding))
Title: Re: Chase Script idea
Post by: Kakashi Natsu on August 11, 2016, 03:03:19
i actually have something like that.
Title: Re: Chase Script idea
Post by: Dragon6624 on August 11, 2016, 14:12:49
Sounds like you're good to go then.