General AI/Bot Question.

Please use this forum to ask all your MoHAA Bots questions / discussions

Moderator: Moderators

Post Reply
Splaetos
Major General
Posts: 730
Joined: Tue Jan 20, 2004 2:55 pm
Contact:

General AI/Bot Question.

Post by Splaetos »

OK guys, I know nothing about AI in practice, only various things that I have read. I am confident I COULD set up the whole map im making for bot play, but I dont really want to.

however, the map is supposed to be an objective based on assasination, so could someone give me some basic info on AI in multiplayer? Does none of it work? Some of it? I know I can place a model, and I should be able to give that model health and set the allies/win to key on his death, but can I do anything else without using the bot system and setting up a bunch of pathnodes?

What I would like would be to spawn him in one of 4 heavily guarded rooms, give him an smg, and maybe let him move a little(but i dont really care if he does or not, the point is for the axis to defend him, not for him to defend himself.)

I'm just starting to mess with this stuff, but it seems to me(though ive never read it stated) that AI stuff doesnt work in multiplayer, hence the whole bot system. I read the entire bot manual =) but mostly its advanced concepts that will not enter into my map, ad I do not intend to ever spawn ANY bot other then this one target.

Any advice/info would be greatly appreciated.

PS - in order for someone to use bots, you ahve ot include the jv_bot.pk3 in a zip with your map pk3 correct? and the server must also have it in the main folder?
When I am king, you will be first against the wall~
Image
Krane
Lieutenant General
Posts: 782
Joined: Sat May 31, 2003 4:18 pm
Location: California, USA
Contact:

Post by Krane »

Bots needs info_pathnodes to navigate. If you don't want your bot to move AT ALL, you don't need them...For MP bots, there's jv_bots01.pk3 :wink: ! And to make them react you'll need some scripting.

Yes, both server and client must have jv_bot01.pk3 inside their main folder! Works wonderfully :D !
Image
M&M
General
Posts: 1427
Joined: Sun Sep 14, 2003 1:03 am
Location: egypt
Contact:

Post by M&M »

not entirely correct.if u need an advanced bot use the jv bot system,but if u need a stupid bot,i think it can be done .cause i saw a map which has an ai that shoots any1 that comes into his room (which is very small) ,but he doesnt move at all.the problem is i dont know how,its probably scripted :wink: .so probably u can make 1 which can shoot any1 in his room ,i dont know how u can make others gaurd him though (did u mean other axis bots or players?)
Image
Splaetos
Major General
Posts: 730
Joined: Tue Jan 20, 2004 2:55 pm
Contact:

Post by Splaetos »

All i want the AI to do is spawn in a room, and shoot at the opposite team if they come at him.

The axis players will be guarding him, as he is the objective.
When I am king, you will be first against the wall~
Image
Krane
Lieutenant General
Posts: 782
Joined: Sat May 31, 2003 4:18 pm
Location: California, USA
Contact:

Post by Krane »

If you place a ai_german_whatever, he will not play any animations, but if you place a ai_multiplayer_german_whatever (jvbots :wink: ), he will react and shoot all allies! :shock:

You need jv_bot01.pk3 anyway!!

btw: to spawn a geman officer (ex.), add these lines to your map script right below level waittill spawn:

Code: Select all

local.defender = spawn script_model "targetname" "defender1"
local.defender model "models/human/multiplayer_german_elite_gestapo.tik"
local.defender solid
local.defender origin "0 0 0"
you'll need jv_bot01.pk3 inside your main folder!

Hope that helps! :)
Image
Splaetos
Major General
Posts: 730
Joined: Tue Jan 20, 2004 2:55 pm
Contact:

Post by Splaetos »

ok, explain this to me like I was a 5 year old...


is "targetname" "defender 1"

what you put in the script?

I copied that stuff, and changed the origin, and it spawned a blank model, but nothing else. I havent gotten into the AI bit yet, but I will today or tomorrow.
When I am king, you will be first against the wall~
Image
Krane
Lieutenant General
Posts: 782
Joined: Sat May 31, 2003 4:18 pm
Location: California, USA
Contact:

Post by Krane »

Just copy everything that is inside the black box and paste right below this line:

level waittill spawn

It should look like this:
level waittill spawn

local.defender = spawn script_model "targetname" "defender1"
local.defender model "models/human/multiplayer_german_elite_gestapo.tik"
local.defender solid
local.defender origin "0 0 0"
The "targetname" "defender1" means that I'm giving the bot a targetname so you can manipulate him through script later, got it? You don't need this, but, trust me, you'll need this sooner or later. 8-)

Again, this method requires jv_bot01.pk3 inside your main folder. We're spawning a jvbot, not a regular ai.

To spawn a regular ai, like M&M said, change the line that says:

local.defender model "models/human/multiplayer_german_elite_gestapo.tik"

to:

local.defender model "models/human/german_elite_gestapo.tik"

But this ai will not play any animation, will look like a statue...

I strongly recommend, if you use jvbots, that you put this line above the first "end" you find in your script (from top to bottom):

waitthread global/jv_bots/jv_mp_ai.scr::enable 0 0 0 0

Hope that helps!
:)
Image
Splaetos
Major General
Posts: 730
Joined: Tue Jan 20, 2004 2:55 pm
Contact:

Post by Splaetos »

well that text just popped up an empty suit when it did work, but then again I wasnt calling the bot script anywhere that I am aware of. I will try it once I get my maps to start compiling again.

I know that I need the name, I cant use an isalive loop to end the match if he has no name =)
When I am king, you will be first against the wall~
Image
Splaetos
Major General
Posts: 730
Joined: Tue Jan 20, 2004 2:55 pm
Contact:

Post by Splaetos »

bleh including all this info jsut put bot information my screen and didnt spawn the one bot I want.

I DONT want bot info taking up space on my screen, I dont much like bots, and I dont want to spawn anything but the target I want destroyed.

I jsut want a german target, in a room(1 of 3 but once i get set on how to spawn it, a radom location shouldnt be too hard) he should shoot at allies with a weapon I give him, and when he dies, the allies will win.
When I am king, you will be first against the wall~
Image
M&M
General
Posts: 1427
Joined: Sun Sep 14, 2003 1:03 am
Location: egypt
Contact:

Post by M&M »

i AM sure there is a bot that can shoot at u and stand in his place without using the jv bots,ill try playing with the map and decompiling it 2 c how its done .then il tell u ofcourse :wink:
Image
M&M
General
Posts: 1427
Joined: Sun Sep 14, 2003 1:03 am
Location: egypt
Contact:

Post by M&M »

here is the proof,i got a few screens 2 prove im not imagining.im sure thee is no jv bots in the script ,it was actually not working and i fixed the script.as a precation i removed the jv_bots.pk3 file as well.also when i decompiled the map and seen the ai ,it was an ai_german_panzer_oberzuchute or something like that

here are the screens.
1st pic:this is an ai that just stands there and gives a few animations and i think he also talks,i tossed him a nade :wink: and i heard screaming but he didnt die(i believe he was warning me,not sure since it was in german),and he never spoke or played any animations ,guess he was scared :D Image
2nd pic:this is the ai i was talkin about ,it appears he is not the one who kills u ,u just stand infront of him in the death zone and u suddenly die :? however he also gives animations and keeps talking but since its all in german i dont know what in hell he is talkin about

Image

3rd pic:i guess u know what happened :wink:
Image
4th pic:this is the bastard after i gave him a few shots :wink: ,also after i shot him with a nonlethal hit he stopped talkin and playing animations (scared 2?) Image

5th pic:this is the other bastard after i lethat shot with the gun in the head :wink:
Image

i hope this has helped,this map is multiplayer deathmatch and its called airb (or atleast thats what the name of the bsp is)if u cant find it and u want the map i could send it 2 ya :wink: [/img]

edit:oh the ai looked like a suite in mohradient also :wink:
Image
Splaetos
Major General
Posts: 730
Joined: Tue Jan 20, 2004 2:55 pm
Contact:

Post by Splaetos »

yea my ai shouts at you if your allied, but he wont shoot at you =)

thanks for looking into it tho.
When I am king, you will be first against the wall~
Image
M&M
General
Posts: 1427
Joined: Sun Sep 14, 2003 1:03 am
Location: egypt
Contact:

Post by M&M »

well,u could make a trigger that hurts u ,or kills u like the author of the map did,when u stand infront of him (in the trigger zone) u die like in the 3rd screenshot.if u dont want instant death maybe u can fiddle with it and make it hurt u by time as if he is shooting u.u wont get the animations of firing but at least uve got urself a dumb ai that can defend himself without using the jv_bots which should reduce the .pk3 size significantly :wink: .if u do want the firing animations i guess u should ask some1 more advanced like krane,he probably knows how 2 trigger animations and stuff. :wink:
Image
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

M&M wrote:without using the jv_bots which should reduce the .pk3 size significantly :wink:
It saves you 134 kB :?
Image
M&M
General
Posts: 1427
Joined: Sun Sep 14, 2003 1:03 am
Location: egypt
Contact:

Post by M&M »

well,thats 2 minutes at least 4 me on a 56kbs :P ,besides he said he wanted a dumb ai who jsut stands there,jv_bots are obviosly much smarter .
Image
Post Reply