Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 87 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 2
Category: CoD2 Scripting
Scripting and coding with Call of Duty 2.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Astar (A*) In Cod2
r00t_
General Member
Since: Dec 15, 2010
Posts: 51
Last: May 16, 2011
[view latest posts]
Level 3
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
Share |
IzNoGoD
General Member
Since: Nov 29, 2008
Posts: 694
Last: Nov 10, 2012
[view latest posts]
Level 6
Category: CoD2 Scripting
Posted: Friday, Jan. 21, 2011 06:52 pm
It is already working, if i believe selbie. He claims to have astar working, and i think he speaks the truth. So, to refer to your question, it should be possible to make it.
It will be a hell of a undertaking though.
Good luck with it.
Share |
BraX
General Member
Since: Apr 29, 2008
Posts: 413
Last: May 26, 2012
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Friday, Jan. 21, 2011 07:20 pm
Astar alghoritm was already implemented to CoD4's PEZboT Mod and probably also in CoD2's MeatBot.
Share |
r00t_
General Member
Since: Dec 15, 2010
Posts: 51
Last: May 16, 2011
[view latest posts]
Level 3
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.
Share |
IzNoGoD
General Member
Since: Nov 29, 2008
Posts: 694
Last: Nov 10, 2012
[view latest posts]
Level 6
Category: CoD2 Scripting
Posted: Friday, Jan. 21, 2011 10:20 pm
please, reread the tutorial about astar. It can be used with waypoints. In the tutorial they take a map (divided into squares), which are in fact "waypoints"
Share |
r00t_
General Member
Since: Dec 15, 2010
Posts: 51
Last: May 16, 2011
[view latest posts]
Level 3
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 [drink]), please, let me know what you think would be the optimal way to achieve my goal?
Share |
IzNoGoD
General Member
Since: Nov 29, 2008
Posts: 694
Last: Nov 10, 2012
[view latest posts]
Level 6
Category: CoD2 Scripting
Posted: Saturday, Jan. 22, 2011 10:52 am
the mesh they use in the tutorial are just squares. Every square is connected to its neighbours, and the middle of the square is from where astar starts calculating. Thus, it is a waypoint method, where all waypoints are placed int he middle of the squares, and in which all waypoints are connected to max 8 other waypoints.
Share |
BraX
General Member
Since: Apr 29, 2008
Posts: 413
Last: May 26, 2012
[view latest posts]
Level 5
Im a fan of MODSonair
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.
Share |
r00t_
General Member
Since: Dec 15, 2010
Posts: 51
Last: May 16, 2011
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Sunday, Jan. 23, 2011 04:29 am
I'm beginning to understand. This is making a lot more sense after the last two comments. I understand now that waypoints will make the A* algorithm a lot more practical. Thanks. And if you have more comments or ideas about this, don't hesitate to mention.
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 Scripting

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»