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

Members Online

»
0 Active | 40 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
Page
Next Page
subscribe
Author Topic: Making a More "Rough" Bot...
r00t_
General Member
Since: Dec 15, 2010
Posts: 51
Last: May 16, 2011
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Friday, Jan. 14, 2011 03:15 am
attachment: image(394.9Kb) image(366.5Kb) image(274.2Kb)
Here's the idea. Another cod2 scripter has just come out with his very own gametype "zombiebots". Those of you who only patch cod2 to 1.2 would know what I'm talking about.

I'm not going to get into how the whole gametype is played, but it does involve "bots". But not the type of bots those of you in patch 1.3 think I'm talking about. I'll get more into that a little later.

Here is where I (and hopefully you) come in. As a HUGE learning experience in modding and scripting, I have decided to try to mimic this gametype as much as I can (mostly because the original scripter doesn't give out his scripts [crazy]).

(This is A LONG discription of the gametype, please feel free to scim through it. The picture info is down at the bottom of this post, and the pictures are attachments. I have been quite thorough in my explanation so I don't confuse anyone.) So back to the logistics of the gametype. Picture this: an XMODEL of a "zombie" is what consists of the "looks" of these "bots". They aren't animated or anything, just xmodels. Next, picture a custom map that is a giant rectangular prism (tall). The game is played inside the prism. There are ramps circling around the walls of the prism. All the players that connect to the gametype are cast off all on one team (the allies). And technically no one is on the axis team. Zombies (bots) all spawn down on the floor at the very bottom. Now picture this: The bots are not animated, but they do face in the direction they are moving. So, once they spawn, they "move" to the bottom of the ramp and begin making their ascent up the spiral ramp. The "allies" are trying to prevent the bots from reaching the top of the "prism" and thus killing all the allies. Bots kill allies by touching them. Allies kill bots by shooting them. If an ally somehow gets behind a bot, the bot knows to turn around and move toward the ally until he dies. Then the bot continues its ascent to the top.

Here's is my initial concern and problem that i face in mimicking this gametype: I have no idea how to put the properties of a normal player into a bot. I.E. how does the bot handle an event such as getting shot. I know that in tdm.gsc there is an entire function that is called everytime a player is shot, but how does a bot get the same properties as the player would?

I believe I have a good understanding of how to handle the bots overall movement. But then again, I don't understand how to check if a bot is touching an ally to administer damage to the player.

To help understand more about bots, I downloaded meat bot for patch 1.3. The code is confusing and the comments are in another language, so it is hard to get through it. Not to mention those bots are completely "player-like". I am just looking for some sort of damage event handler and some way to check what it's touching.

That's all for now. If you've made it this far, I thank you. I'm sure this isn't going to be a "here's the answer to your question and now do it" kind of thread. So I'll be patient with the responses I get.

Thanks again.

ATTACHED PHOTOS!
1st - Picture of the spiral ramps. Shot from the middle-ish.
2nd - Picture of the very top. Armaments and weapons are up there for the allies to use.
3rd - Picture of the very bottom. The zombie spawn all over the floor, and make there way to the start of the ramp.
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. 14, 2011 09:11 am
1. The pathfinding routine you are looking for is astar, or a*.
2. The bots can be damaged because the map includes several trigger_damages which are linked to the xmodel.
3. To make the bots have an animation, they need to be players. Give them different weapons for different animations (create animations for each weapon)

As said, huge learning experience for sure.
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. 14, 2011 11:23 am
I'm actually not looking for the bots to have animation, because with the number of bots spawning it would drop everyone's fps by a substantial margin. This is also the reason the bots don't leave behind corpses.

And I don't know what you mean by "astar" or "a*".

But, thanks for the response
Share |
liltc64
General Member
Since: Feb 12, 2007
Posts: 906
Last: Oct 22, 2012
[view latest posts]
Level 7
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Friday, Jan. 14, 2011 01:23 pm
by the looks of lack of skill you have with scripting i dont think you should take on such a task for this is for more advanced modders. you should start out with something more simpler so you dont start bashing your head threw your wall.
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. 14, 2011 02:44 pm
http://www.policyalmanac.org/games/aStarTutorial.htm
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. 14, 2011 04:37 pm
liltc64 writes...
Quote:
by the looks of lack of skill you have with scripting i dont think you should take on such a task for this is for more advanced modders. you should start out with something more simpler so you dont start bashing your head threw your wall.


Thanks for your concern mate. But if this does get out of hand, I will surely put the idea to rest until I am more capable of the undertaking.

As for now, I'll do the best I can, probably referring to these forums A LOT [casanova]
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. 14, 2011 05:13 pm
This is also how I picture the movement part of the script for the bots (in pseudo script)

if( bots-z-coordinate >= a-player's-z-coordinate ) // I have come up with this after careful observation of the bot's movement from the original gametype.
{
bot moveto( player-origin );
}

I know this is not even close to what the script is going to look like. But roughly, I think the idea is going to work. And before all you haters out there respond to this saying "THAT'S SOOO WRONG YOU NOOB!!"... Well I know it's wrong. It's pseudo code...
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. 14, 2011 05:23 pm
You rly should observate more carefully.

The bots use something called astar, its an algorithm for pathfinding (someone told me).
I had a chance to look at the source code, and, damn, thats hard to code. (deleted the code afterwards, had no use for it back then)
The bots dont move to a player. They calculate their path using waypoints, and get the lowest "cost" move to a player. iirc, the code would work with non-square maps too.

ps: follow the link in my previous post
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. 14, 2011 07:56 pm
Oh I see. Sorry for not considering your post. I did however look at the link, but didn't spend much time checking it out because I already had an idea in my head of how I wanted to go about making the zombies move. But after some time thinking about my idea and the pseudo code for it, I don't think it will work. Just as you have said [duh]

I will look much more closely at the link you posted and see if I can't make that cod2 compatible [casanova]

And you mentioned that you had a chance to look at the source code for something. What was the source code for? zombiebots gametype? the astar algorithm?

Thanks again for the help. The link you posted looks great, must've been hard to find [lol]
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. 14, 2011 08:59 pm
The source code was indeed the astar algorithm for cod2.
I didnt use it back then, as i didnt understand how it worked, and how to call it.
I only use scripts i wrote myself (egotripping here :P)
Share |
Restricted Access Topic is Locked
Page
Next Page
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

»