Welcome to Crestfall Gaming

Register now to Crestfall Gaming. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

Sign in to follow this  
Followers 0
Darkrasp

Darkrasp's Blog 11/27/2017

If you know your current player position, his velocity (which in your case is the vector pointing in the player travel direction), and the frequency with which the AI updates (you say it's twice per second), you can predict where the creature will see you in the next time iteration, and have him move there, or a bit forward, instead to your current position.

The predicted position simply becomes s = s0 + v * t, where s0 denotes your current position (vector), v your velocity (vector) and t your timestep (scalar). You can adjust the "how far along the line" bit with some additional coefficient with which you multiply the v * t part.

This is just an idea, it's not tested, it might not be compatible with the implementation, so yeah, just an idea.

3

Share this post


Link to post
Share on other sites
8 hours ago, blairo said:

<math>

I did consider using a velocity to plot the destination point, which isn't that tough considering mob running speed is almost always 7.5, and player run speed is almost always 7.0.  Obviously that will change if you are hasted and/or slowed, or swimming, or backpedaling, etc.  Some mobs are also particularly fast or slow.  You could just use the default values, or implement handling to get the dynamic run speed at the time from the unit and use that.  However..

What I found was that in most cases we were talking about 30-40 yards as the maximum distance between players and mobs.  Mob aggro range maxes out at 45 yards unless there are special circumstances (there's a boss in ZF, for example, that is aggro'd by an area trigger).  The longest range player abilities you can aggro with are 41 yards.  Typical aggro range for mobs is about 20 yards.

If the mob is only looking at where you are going to be in 0.5 seconds, then it's not heading to a point far enough away from you to effectively cut the corner.  That point is always going to be 3.5 yards or less ahead of you, which is within melee range and won't produce a good result.  Multiplying that by some "additional coefficient" is effectively what I'm doing, I'm just basing it on the distance between the units instead of using move velocities, which I feel would be a waste of processor time considering the relatively short distances involved.  The visual difference between the two methods is negligible, and I already have all the information I need for the task available in that scope.

It's a fair point though.  If I can get this working the way I want it to, making that change wouldn't be difficult, it's just a question of how it preforms when you have a few hundred mobs, or a few thousand, all doing that simultaneously.

1

Share this post


Link to post
Share on other sites

Funnily enough, the Atlantiss Team working on the Netherwing Private Server release an update and a video yesterday showing their solution to this exact problem. Maybe if it gets too frustrating you can bounce ideas of them to try and find the right direction.

Here is a link to the update if you haven't seen it already.

 

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0