Raised This Month: $12 Target: $400
 3% 

Entity chase player without stuck


Post New Thread Reply   
 
Thread Tools Display Modes
Natsheh
Veteran Member
Join Date: Sep 2012
Old 06-05-2020 , 03:17   Re: Entity chase player without stuck
Reply With Quote #11

its a bit odd check if a good path to go from point 1 to point 3 knowing the ability to skip point 2.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-06-2020 , 03:14   Re: Entity chase player without stuck
Reply With Quote #12

Guys, you can try to come up with all kinds of weird/hacky ways or fixes on top of fixes.
They will not work properly and you will end up with spagetti code.

The proper way is to implement a pathfinding algorithm like a* in a module. It can't be done in a plugin because the needed data structures are missing in pawn.
__________________
HamletEagle is offline
supertrio17
Senior Member
Join Date: May 2020
Location: Serbia
Old 06-06-2020 , 14:08   Re: Entity chase player without stuck
Reply With Quote #13

Quote:
Originally Posted by HamletEagle View Post
Guys, you can try to come up with all kinds of weird/hacky ways or fixes on top of fixes.
They will not work properly and you will end up with spagetti code.

The proper way is to implement a pathfinding algorithm like a* in a module. It can't be done in a plugin because the needed data structures are missing in pawn.
If that is true, then the best answer to this question is already answered, you must make checkpoints for every map you wish this plugin to work on.

Last edited by supertrio17; 06-06-2020 at 14:08. Reason: typo
supertrio17 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-07-2020 , 03:07   Re: Entity chase player without stuck
Reply With Quote #14

Quote:
Originally Posted by supertrio17 View Post
If that is true, then the best answer to this question is already answered, you must make checkpoints for every map you wish this plugin to work on.
This is not what I said. Waypoints are a possible solution but they require manual setup for every map.
__________________
HamletEagle is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 06-07-2020 , 04:25   Re: Entity chase player without stuck
Reply With Quote #15

One could also just alter the friction when they touch certain objects so they cannot get stuck and instead bounce off and hopefully keep going.
__________________
DJEarthQuake is offline
supertrio17
Senior Member
Join Date: May 2020
Location: Serbia
Old 06-07-2020 , 09:00   Re: Entity chase player without stuck
Reply With Quote #16

Quote:
Originally Posted by DJEarthQuake View Post
One could also just alter the friction when they touch certain objects so they cannot get stuck and instead bounce off and hopefully keep going.
Um, I'm not an expert, but wouldn't that make them look dumb. This thread was started because they looked dumb.
supertrio17 is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 06-07-2020 , 10:12   Re: Entity chase player without stuck
Reply With Quote #17

Quote:
Originally Posted by supertrio17 View Post
Um, I'm not an expert, but wouldn't that make them look dumb. This thread was started because they looked dumb.
Monsters are supposed to have special edge handling. Friction is low cost on CPU.
__________________
DJEarthQuake is offline
Vieni
Member
Join Date: Apr 2018
Old 06-07-2020 , 10:50   Re: Entity chase player without stuck
Reply With Quote #18

I think you should check if the npc's slow, if it is, save it's angle, so we can use it in all the thinks.
After saving it, you should shoot like 5tracelines based on the npc's height(Flying stuff can block npcs either) and save the one, which's vector end position is near enough to block the npc. If there's no traceline like that, simply turn it around to look for someone else to catch(if there's no more enemies, I'd simply let him be there, or give them jumps[maybe the human is on a car or something]).

So, we have the height on which the npc's blocked, so we only gotta give some turning to our npc and check the traceline from the origin height calculation to the saved angle if the distance has increased enough to turn on the enemy. This still can be buggy, but much more less than now.

Oh, and i even would build something to it, what calculates if the player is on a heigher place than the npc, so you can give it jumps by it before the traceline stuff.

Last edited by Vieni; 06-07-2020 at 10:52.
Vieni is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:17.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode