Page 1 of 1

Improve Anti-KS

Posted: 18 Sep 2009, 02:51
by Scarya
The Anti-KS system should be improved.
Sometimes if you teled and a monster is chasing a player but doesn't hit, kore can't recognize this as ksing (or am I missing something?). This will be useful for all range chars.

But how to solve the problem? Maybe analysis of player and monster movement like comparing move vectors.

Re: Improve Anti-KS

Posted: 21 Sep 2009, 17:57
by Scarya
I thought a lot about this and my conclusion is the analysis of some vectors.
So first we should have the vector: monster->player [MP] (it''s the distance between monster and player)
Now we look at the moving direction of the monster we like to attack and compare it with MP.

So this can't be enough. We can calculate the angle between those vectors.
Image

If a (alpha) is lower than 60° the monster is probably chasing the player.

I hope somebody else can contribute on this.

Re: Improve Anti-KS

Posted: 22 Sep 2009, 22:30
by kali
Remember that this equation will be recomputed more than a hundred times per second everytime there is a monster around. You might need a simplified version that would fuzz around the value (preferably using just modulus division and/or integers) and providing a good enough estimate.

Otherwise we'd be wasting a lot of cycles just to compute a relatively trivial detail.

Also, are we talking about a specific moment in time? I don't think even a human can judge if another player is chasing a monster as soon as he warps to that place. Perhaps we should just have a second of delay to "observe" their interaction and decide after that. I believe the current algo is: if player is moving towards the monster, that monster is tainted and should not be attacked.

Re: Improve Anti-KS

Posted: 25 Jun 2011, 19:29
by markjames
I have been facing the problem in player and monster movement like comparing move vectors?
PLZ, somebody tell me about this in detail as who can i improve?

Re: Improve Anti-KS

Posted: 09 Jun 2012, 13:19
by erss
Well, there is also the problem where a mage is casting against a monster for the first time, and openkore ks it. Maybe it could somehow be solved if the bot waits a little before attacking a monster if such monster is in front of a fire wall, ice wall, etc to make sure such monster is not the one being attacked by the mage/wizard.