Author |
Topic: Astar (A*) In Cod2 |
r00t_ |
|
General Member Since: Dec 15, 2010 Posts: 51 Last: May 16, 2011 [view latest posts] |
|
|
Category: CoD2 Scripting Posted: Friday, Jan. 21, 2011 04:49 pm |
|
I am going to attempt this undertaking. So I need to apply the a* algorithm to an object so that it goes toward a player. I already kinda have an idea of how i'm going to do this ingame, but I wanted to know what you guys thought. Like, I want to do all the scripting and coding, of course. But wanted to know if you had any ideas of how to make A* work in cod2.
If you don't know what A* is, you can read this great article about it: Here
Thanks |
|
|
|
IzNoGoD |
General Member Since: Nov 29, 2008 Posts: 694 Last: Nov 10, 2012 [view latest posts] |
|
|
|
BraX |
|
General Member Since: Apr 29, 2008 Posts: 413 Last: May 26, 2012 [view latest posts] |
|
|
|
|
r00t_ |
|
General Member Since: Dec 15, 2010 Posts: 51 Last: May 16, 2011 [view latest posts] |
|
|
Category: CoD2 Scripting Posted: Friday, Jan. 21, 2011 07:30 pm |
|
BraX writes...Quote: Astar alghoritm was already implemented to CoD4's PEZboT Mod and probably also in CoD2's MeatBot.
I do not believe this is correct. I cannot speak for PEZboT because I'm not familiar with it, but MeatBot, to the best of my knowledge, uses waypoints pre-calculated for each map.
EDIT: PEZboT does not use the Astar algorithm, it uses waypoints. I googled it and the first link gave it away.
So back to my question, I didn't ask if it would be possible, I asked if anyone had ideas about writing it with the limited capabilities of cod2 script writing. |
|
|
|
IzNoGoD |
General Member Since: Nov 29, 2008 Posts: 694 Last: Nov 10, 2012 [view latest posts] |
|
|
|
r00t_ |
|
General Member Since: Dec 15, 2010 Posts: 51 Last: May 16, 2011 [view latest posts] |
|
|
Category: CoD2 Scripting Posted: Saturday, Jan. 22, 2011 01:58 am |
|
If you are talking about nav meshes, then no, that is not what true astar is. My original question on this thread was more intended to get people's ideas on how I can check for obstacles in a cod2 map? As in, how can a sort-of-bot check it's surroundings for walkable paths?
However, if you think I'm totally crazy (which i've been in the past ), please, let me know what you think would be the optimal way to achieve my goal? |
|
|
|
IzNoGoD |
General Member Since: Nov 29, 2008 Posts: 694 Last: Nov 10, 2012 [view latest posts] |
|
|
|
BraX |
|
General Member Since: Apr 29, 2008 Posts: 413 Last: May 26, 2012 [view latest posts] |
|
|
|
Category: CoD2 Scripting Posted: Saturday, Jan. 22, 2011 11:08 am |
|
r00t_ writes...Quote: BraX writes...Quote: Astar alghoritm was already implemented to CoD4's PEZboT Mod and probably also in CoD2's MeatBot.
I do not believe this is correct. I cannot speak for PEZboT because I'm not familiar with it, but MeatBot, to the best of my knowledge, uses waypoints pre-calculated for each map.
EDIT: PEZboT does not use the Astar algorithm, it uses waypoints. I googled it and the first link gave it away.
So back to my question, I didn't ask if it would be possible, I asked if anyone had ideas about writing it with the limited capabilities of cod2 script writing.
True but you cannot calculate way points in game, even in SP you have to place path nodes "waypoints" on your map, after that you have to connect them with g_connectpaths commands.
Now lets back to MP.. you have to add waypoints and connect them if you want to use A* alghoritm. Vaild waypoint should have origin, rotation info and should also be linked to another waypoint.
Here is explained picture how to connect these paths.
"WP" are waypoints and red lines connect them to generate path, thats what we use in ROTU mod and thats what PEZBOT and MEATBOT use. |
|
|
|
r00t_ |
|
General Member Since: Dec 15, 2010 Posts: 51 Last: May 16, 2011 [view latest posts] |
|
|
|