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

Getting the Navigational distance between two points (L4D2)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bainshie
Junior Member
Join Date: Jun 2010
Old 09-02-2010 , 05:22   Getting the Navigational distance between two points (L4D2)
Reply With Quote #1

Hey.

Well I'm still working on my item spawning system for L4D2, and it's almost there. I just have one issue.

basically right now what I'm doing is looping through all the item spawns at the beginning, finding the ones I want and saving the entity indexes.

Then I rand get the next pill percentage, and when the players reach that percentage, I get the closest spawn that's in front of the players, and then replace that with whatever item I want.

Now currently I'm getting the distances between the entity and players with the usual vector distance functions. However this has issues with maps such as Dead Center.

What I'm looking for is a way to find the walking distance between two points, not the distance as the noclip bird flies.
Bainshie is offline
Master53
Veteran Member
Join Date: Dec 2009
Old 09-02-2010 , 06:26   Re: Getting the Navigational distance between two points (L4D2)
Reply With Quote #2

PHP Code:
native Float:GetVectorDistance(const Float:vec1[3], const Float:vec2[3], bool:squared=false); 
__________________
Master(d)



Master53 is offline
Bainshie
Junior Member
Join Date: Jun 2010
Old 09-02-2010 , 06:47   Re: Getting the Navigational distance between two points (L4D2)
Reply With Quote #3

Yea that's the function I'm currently using. The issue is it isn't the actual walking distance.

P__________B
A

For instance if P is the player, and A and B are items, item A is closer with the above function, but B is closer in navigational terms (Since you can't actually go through the floor ingame)

Basically I'd guess that there's some kind of AI navigation function that lets you find out the navigational distance between two points.
Bainshie is offline
AtomicStryker
Veteran Member
Join Date: Apr 2009
Location: Teutonia!!
Old 09-02-2010 , 09:30   Re: Getting the Navigational distance between two points (L4D2)
Reply With Quote #4

There is not. The game creates some weird cache for Bot Navigation, and unless you Assember-Hack into it youre not gonna get distances out of it.
AtomicStryker is offline
dirka_dirka
Veteran Member
Join Date: Nov 2009
Old 09-02-2010 , 10:34   Re: Getting the Navigational distance between two points (L4D2)
Reply With Quote #5

your probably going to have to create some sort of trace that filters world entities in the z axis.. but you will probably get into trouble when they are on a stairwell (nothing in front, just above/below).

either that or just ignore any spawns that are X units above/below the survivors, and if you cant find anything in range - keep checking (eventually they will change their vertical height).
dirka_dirka is offline
Reply



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 06:24.


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