Adding Bots to non Coop maps

Ask questions, discuss ideas, get answers

Adding Bots to non Coop maps

Postby datoneer » Sun Dec 06, 2009 6:59 pm

OK this is a carry over from that other site. I am attempting to add Bots to Berlin CTF Desertcombat. It has gone so well this morning that i want to throw my PC into the street. So here is what the original poster posted...

OK, check this out... i'll be using Kursk TDM as an example:

in the tdm.con file, add "run ai v_arg1" right before you run objectspawns.con so it looks like this:

Code: Select all
run tdm/SpawnpointManagerSettings

run tdm/SoldierSpawnTemplates
run tdm/SoldierSpawns

run tdm/ObjectSpawnTemplates
run tdm/ControlPointTemplates

if v_arg1 == host
   run ai v_arg1
   run tdm/ObjectSpawns
   run tdm/ControlPoints
else

endIf


then, in the file AI.con, you need to add two lines at the top:

Code: Select all
run AI/AIdefault.con v_arg1
run AI/AIbehaviours.con v_arg1


If your map doesn't have an AI.con, then check in the cherry BF version of the map (if this is a mod that just doesn't have the AI.con, then that means noone has made a coop version of the map... go make one!!)

Now, open the game.rfa of either your mod or from cherry BF. your looking for two files and a directory with 4 files. They are:

Bf1942/Game/AIdefault.con
Bf1942/Game/AIbehaviours.con
Bf1942/Game/AI/Strategies.con
Bf1942/Game/AI/radio.con
Bf1942/Game/AI/prerequisites.con
Bf1942/Game/AI/conditions.con


Extract all of these and put them (keeping the same directory structure) in your map RFA.

For example, now in my kursk map, i have:

Bf1942/levels/Kurks/AI/AIdefault.con
Bf1942/levels/Kurks/AI/AIbehaviours.con
Bf1942/levels/Kurks/AI/conditions.con
Bf1942/levels/Kurks/AI/prerequisites.con
Bf1942/levels/Kurks/AI/StrategicAreas.con
Bf1942/levels/Kurks/AI/Strategies.con
Bf1942/levels/Kurks/AI/AI/Strategies.con
Bf1942/levels/Kurks/AI/AI/radio.con
Bf1942/levels/Kurks/AI/AI/prerequisites.con
Bf1942/levels/Kurks/AI/AI/conditions.con


This will get bots in the map, but they wont do anything, and that's because the weapons their holding have no AI stuff on them (for some reason, if you dont run COOP, they dont get run).

Just include the AI files for any weapons you have in any of your kits. For this modded version of Kursk, i have no vehicles and sniper kits only, so here's what i needed (put this at the end of TDM.con, or Conquest.con for CQ mode):

Code: Select all
rem you need these two no matter what
include ../../../../../objects/items/basekit/ai/objects.con
include ../../../../../objects/soldiers/common/AI/Objects.con

rem include all weapons:
include ../../../../../objects/HandWeapons/EliteKnife/AI/Weapons.con
include ../../../../../objects/HandWeapons/Tabuk/AI/Weapons.con
include ../../../../../objects/HandWeapons/KnifeAllies/AI/Weapons.con
include ../../../../../objects/HandWeapons/M82/AI/Weapons.con
include ../../../../../objects/HandWeapons/M25/AI/Weapons.con
include ../../../../../objects/HandWeapons/Browninghipo/AI/Weapons.con
include ../../../../../objects/HandWeapons/KnifeAxis/AI/Weapons.con
include ../../../../../objects/HandWeapons/GrenadeAllies/AI/Weapons.con
include ../../../../../objects/HandWeapons/M9_beretta/AI/Weapons.con


Now your set! repack your map as a _002 or whatever, and up it to your server, and look at dee bots go!


this is what i have done and all i get is an Epic CTD on map load at about 2/3 completion
first my CTF.con
Code: Select all
run Ctf/SpawnpointManagerSettings

run Ctf/SoldierSpawnTemplates
run Ctf/SoldierSpawns

run Ctf/ObjectSpawnTemplates

if v_arg1 == host
run ai v_arg1
run Ctf/ObjectSpawns


rem ----- Host
rem ----------------------------------------------------------------------------
   rem *** CREATE FLAG BASES ***
   object.create usbase
   Object.absolutePosition 1798.74/38.306/1943.2
   Object.Rotation 0/0/0

   object.create gebase
   Object.absolutePosition 1697.61/38.306/1781.07
   Object.Rotation 0/0/0

rem ----------------------------------------------------------------------------
else

rem ----- Join
rem ----------------------------------------------------------------------------
   rem *** CREATE FLAG BASES ***
   object.create FlagPole
   Object.absolutePosition 1798.74/38.306/1943.2
   Object.Rotation 0/0/0

   object.create FlagPole
   Object.absolutePosition 1697.61/38.306/1781.07
   Object.Rotation 0/0/0
rem ----------------------------------------------------------------------------
endIf


include ../../../../../OBJECTS/items/basekit/ai/objects.con
include ../../../../../objects/soldiers/common/AI/Objects.con

include ../../../../../OBJECTS/handweapons/ak47/AI/weapons.con
include ../../../../../OBJECTS/handweapons/ak47gp30/AI/weapons.con
include ../../../../../OBJECTS/handweapons/AKS-74u/AI/weapons.con
include ../../../../../OBJECTS/handweapons/APlandmine/AI/weapons.con
include ../../../../../OBJECTS/handweapons/Browninghipo/AI/weapons.con
include ../../../../../OBJECTS/handweapons/C4/AI/weapons.con
include ../../../../../OBJECTS/handweapons/Car-15/AI/weapons.con
include ../../../../../OBJECTS/handweapons/Common/AI/weapons.con
include ../../../../../OBJECTS/handweapons/GrenadeAllies/AI/weapons.con
include ../../../../../OBJECTS/handweapons/KnifeAllies/AI/weapons.con
include ../../../../../OBJECTS/handweapons/KnifeAxis/AI/weapons.con
include ../../../../../OBJECTS/handweapons/Landmine/AI/weapons.con
include ../../../../../OBJECTS/handweapons/M4/AI/weapons.con
include ../../../../../OBJECTS/handweapons/M9_beretta/AI/weapons.con
include ../../../../../OBJECTS/handweapons/M16/AI/weapons.con
include ../../../../../OBJECTS/handweapons/M16a2/AI/weapons.con
include ../../../../../OBJECTS/handweapons/M25/AI/weapons.con
include ../../../../../OBJECTS/handweapons/M82/AI/weapons.con
include ../../../../../OBJECTS/handweapons/M203/AI/weapons.con
include ../../../../../OBJECTS/handweapons/M249/AI/weapons.con
include ../../../../../OBJECTS/handweapons/Medpack/AI/weapons.con
include ../../../../../OBJECTS/handweapons/Mk23/AI/weapons.con
include ../../../../../OBJECTS/handweapons/Mortar/AI/weapons.con
include ../../../../../OBJECTS/handweapons/Mortar_deploy/AI/weapons.con
include ../../../../../OBJECTS/handweapons/Mortar_weap/AI/weapons.con
include ../../../../../OBJECTS/handweapons/MP5/AI/weapons.con
include ../../../../../OBJECTS/handweapons/MP5sd/AI/weapons.con
include ../../../../../OBJECTS/handweapons/PKM/AI/weapons.con
include ../../../../../OBJECTS/handweapons/PSS/AI/weapons.con
include ../../../../../OBJECTS/handweapons/remington/AI/weapons.con
include ../../../../../OBJECTS/handweapons/Repairpack/AI/weapons.con
include ../../../../../OBJECTS/handweapons/RPG/AI/weapons.con
include ../../../../../OBJECTS/handweapons/RPG7/AI/weapons.con
include ../../../../../OBJECTS/handweapons/SA-7/AI/weapons.con
include ../../../../../OBJECTS/handweapons/Saiga12k/AI/weapons.con
include ../../../../../OBJECTS/handweapons/Sandbag/AI/weapons.con
include ../../../../../OBJECTS/handweapons/Skorpion/AI/weapons.con
include ../../../../../OBJECTS/handweapons/Smaw/AI/weapons.con
include ../../../../../OBJECTS/handweapons/SmokeGrenade/AI/weapons.con
include ../../../../../OBJECTS/handweapons/Stinger/AI/weapons.con
include ../../../../../OBJECTS/handweapons/Stingermissle/AI/weapons.con
include ../../../../../OBJECTS/handweapons/Tabuk/AI/weapons.con
include ../../../../../OBJECTS/handweapons/VSS/AI/weapons.con

include ../../../../../objects/handweapons/Bar1918/AI/weapons.con
include ../../../../../objects/handweapons/Bazooka/AI/weapons.con
include ../../../../../objects/handweapons/Binoculars/AI/weapons.con
include ../../../../../objects/handweapons/Colt/AI/weapons.con
include ../../../../../objects/handweapons/Common/AI/weapons.con
include ../../../../../objects/handweapons/Detonator/AI/weapons.con
include ../../../../../objects/handweapons/DP/AI/weapons.con
include ../../../../../objects/handweapons/ExpPack/AI/weapons.con
include ../../../../../objects/handweapons/GrenadeAxis/AI/weapons.con
include ../../../../../objects/handweapons/JohnsonLMG/AI/weapons.con
include ../../../../../objects/handweapons/K98/AI/weapons.con
include ../../../../../objects/handweapons/M1Garand/AI/weapons.con
include ../../../../../objects/handweapons/MP18/AI/weapons.con
include ../../../../../objects/handweapons/MP40/AI/weapons.con
include ../../../../../objects/handweapons/No4/AI/weapons.con
include ../../../../../objects/handweapons/Panzershreck/AI/weapons.con
include ../../../../../objects/handweapons/riflebulletclip_m1/AI/weapons.con
include ../../../../../objects/handweapons/Sg44/AI/weapons.con
include ../../../../../objects/handweapons/Thompson/AI/weapons.con
include ../../../../../objects/handweapons/Type5/AI/weapons.con
include ../../../../../objects/handweapons/Type99/AI/weapons.con
include ../../../../../objects/handweapons/Walther938/AI/weapons.con


Next my AI.con
Code: Select all
rem ************** LEVEL SPECIFIC AI SETTINGS ***************************

run AI/AIdefault.con v_arg1
run AI/AIbehaviours.con v_arg1

aiSettings.setWorldMapSize 2048 2048
aiSettings.viewDistance 55
aiSettings.setInformationGridDimension 32

rem ********************** START THE AI *********************************

rem *** Init AI using current settings ****
ai.init 2


rem *** init Botmanager ***
AIBotManager.setLodLevelTicks 6 6 6
AIBotManager.setLodLevelPriority 3 3 3
AIBotManager.setPlannedDecisionMakingThreshold 0.5 0.5 0.5
AIBotManager.setUnplannedDecisionMakingThreshold 0.3 0.4 0.4
AIBotManager.setDecisionMakingInterleave 2 2
AIBotManager.setSensingQuotient 1 1
AIBotManager.setSystemQuotient 40 40 20

rem *** Strategic map dimension, MUST BE DONE BEFORE CREATING SAI! ***
ai.saiMapXDimension 64
ai.saiMapYDimension 64

rem *** Create Strategic AI ***
ai.createSAI


rem *** Enabled or disabled as default ***
ai.saiEnable 1
rem game.showAIstats 1


run AIPathFinding.con

run AI/StrategicAreas.con

rem *** L;oad and set strategies for each side ***

run ai/conditions.con
run ai/prerequisites.con
run ai/Strategies.con

ai.addSAIStrategy 1 west
ai.addSAIStrategy 1 east
ai.addSAIStrategy 1 south
ai.addSAIStrategy 1 north
ai.addSAIStrategy 1 wide
ai.addSAIStrategy 1 finalPush
ai.addSAIStrategy 1 breakOut

ai.addSAIStrategy 2 west
ai.addSAIStrategy 2 east
ai.addSAIStrategy 2 south
ai.addSAIStrategy 2 north
ai.addSAIStrategy 2 wide
ai.addSAIStrategy 2 finalPush
ai.addSAIStrategy 2 breakOut



I did everything exactly as the tutorial said and nothing... Frustrated to beyond right now.
Image

Image
User avatar
datoneer
 
Posts: 23
Joined: Mon Oct 26, 2009 1:47 am
Location: Prosser, Wa

Re: Adding Bots to non Coop maps

Postby freddy » Sun Dec 06, 2009 10:49 pm

i did put some bots in conquest coral sea once, but it was a long time ago now so dont remember exactly the procedure. if you want i can upload that map somewhere so you can take a look at it.
User avatar
freddy
 
Posts: 1247
Joined: Sun Oct 18, 2009 4:58 pm

Re: Adding Bots to non Coop maps

Postby datoneer » Sun Dec 06, 2009 10:58 pm

that would be great.. This has been nothing but frustration all day. Thanks
Image

Image
User avatar
datoneer
 
Posts: 23
Joined: Mon Oct 26, 2009 1:47 am
Location: Prosser, Wa

Re: Adding Bots to non Coop maps

Postby freddy » Sun Dec 06, 2009 11:09 pm

User avatar
freddy
 
Posts: 1247
Joined: Sun Oct 18, 2009 4:58 pm

Re: Adding Bots to non Coop maps

Postby datoneer » Sun Dec 06, 2009 11:18 pm

Thanks Freddy,, Oh BTW wth are those demon rabbits on your sig?
Image

Image
User avatar
datoneer
 
Posts: 23
Joined: Mon Oct 26, 2009 1:47 am
Location: Prosser, Wa

Re: Adding Bots to non Coop maps

Postby datoneer » Mon Dec 07, 2009 2:28 am

OK i gave up on CTF for now. I got Conquest to work. Now the next question... This probably is not SSM is it?
Image

Image
User avatar
datoneer
 
Posts: 23
Joined: Mon Oct 26, 2009 1:47 am
Location: Prosser, Wa

Re: Adding Bots to non Coop maps

Postby freddy » Mon Dec 07, 2009 3:27 pm

sure it is ssm 8-)

edit: try use the debugger if you havent already, its nifty on reporting errors

edit2: i think the demon rabbits is from some game originally?
User avatar
freddy
 
Posts: 1247
Joined: Sun Oct 18, 2009 4:58 pm

Re: Adding Bots to non Coop maps

Postby MR PINK BALLS » Mon Dec 07, 2009 6:18 pm

datoneer wrote: wth are those demon rabbits on your sig?


They are RABBIDS
Image Image

I <3 Ironmen
User avatar
MR PINK BALLS
 
Posts: 267
Joined: Sun Oct 18, 2009 4:01 pm

Re: Adding Bots to non Coop maps

Postby POTAmatt » Mon Dec 07, 2009 9:21 pm

OK i gave up on CTF for now. I got Conquest to work. Now the next question... This probably is not SSM is it?

Freddy's right. It's definitely SSM. I know. I've done hundreds at this point. CTF, CQ, ObjectiveMode, etc.
If you're adding bots to BOTH CQ and CTF modes, then it gets a bit trickier because you'll probably want different strategies, strategic areas, etc for each mode. Can you post your AI.CON and CTF.con?

P.S. Hiya fellas! FoOK just let me know where you've all been hiding since the mass exodus from SSM.COM!
POTAmatt
 
Posts: 89
Joined: Mon Dec 07, 2009 9:09 pm
Location: New Yawk

Re: Adding Bots to non Coop maps

Postby Dennis|8749236 » Wed Dec 09, 2009 5:20 pm

You don't have AI file writed, you will get an error, you must rewrite Strategies.con, if you don't, bots will go to the wrong position(the pos are not Control Point)
What is the meaning of Life?? (Don't think about it!)
User avatar
Dennis|8749236
 
Posts: 239
Joined: Sun Nov 29, 2009 6:02 am
Location: Earth

Next

Return to 1942 Modding Discussion

Who is online

Users browsing this forum: No registered users and 39 guests

cron