PDA

View Full Version : how to add bots with fritzbots



viktwaar
24th Jan 2009, 23:16
hey you guys,

i am making a map for ET wolfenstein, and now i want to add some bots

i've downloaded fritzbots and planted in my Enemy territory folder.
when i start ET i can select the fritzbot mode. i open my own map via console.

but then i don't know how to add a bot. i'm in my own level with the fritzbots mod, but i don't now how to add a bot.

before fritzbots i had bobots but that's crap.

please help, greetz viktwaar

th0rn3
25th Jan 2009, 00:24
Never heard of those, but afaik all bots need to have waypoints. Do you have waypoints set for your map?

viktwaar
25th Jan 2009, 00:52
i don't know what waypoints are, so i guess i don't have them. can you explain?
do you need them with fritzbots or with Bobots?

shagileo
25th Jan 2009, 01:36
I can remember that Fritzbot or bobot (gotta check that out) gave some tutorials on how to make such waypoints. I got to warn you, they're pretty complicated and take a lot of time to create.
So go to the Fritz/Bo Bot site and search for some tutorials. You can also try to download some sample waypoint files to understand the world of waypointing a bit.

TomTom7777
25th Jan 2009, 05:18
Waypoints are not as complicated as mapping, and once you understand waypointing you can play with bots after one evening of adding some waypoint nodes and action hints. Waypointing involves creating 2 files. One which you create inside the map with a waypoint editor. The second file is a script file controlling what the bots will chose to do as the match evolves.

FritzBots are fairly easy to do on basic maps, but supporting vehicles levers/buttons, etc are advanced topics and will take more learning and time. There is an extensive English wiki (http://wiki.bots-united.com/index.php/Category:Fritzbot_ET)(username wiki, password nospam) and forum (http://forums.bots-united.com/forumdisplay.php?f=53) where you can PM (http://forums.bots-united.com/private.php?do=newpm&u=4071) me.

th0rn3
25th Jan 2009, 08:53
^ AbovePost too short...

viktwaar
25th Jan 2009, 10:42
this is all very helpfull.
thanks.

but i get this error too.
when i try to spawn a bot in my map (/addbot timmy)
i get this: can't add bot - no path file available!!

what does this mean?

thanks in advance

greetz viktwaar

TomTom7777
25th Jan 2009, 11:10
The path file is the .nav File you create with the in-game waypoint editor. It defines by nodes and connections where the FritzBot can go to get to objectives. It also defines the action that the bot wil do at an objective. This wiki article (http://wiki.bots-united.com/index.php/Fritzbot_ET_Intro_to_Waypointing) shows a birds eye view of the nodes and connections.

If you want to just have the FritzBots go around and fight you need to create a .nav file with navigation nodes, connected together and a small number (2 or more) of roam actions placed alongside the navigation nodes.
You also need a FritzBot aiscript file with the minimum 5 lines;

bot_SightDist 1700 //how far the highest skill bot can see on this map

spawnflag_is_priority 0 //should bots focus on spawnflags?

cmdpost_is_priority 0 //are cmdposts critical on this map?

construct_is_priority 0 //should engs focus more on constructibles

map_has_vehicle 0 //does this map have a tank or a train?

The first line is important otherwise the bots run around so nearsighted they hardly fight. As last I read Bobots shoot at anything within 4000 units by default making them very hard to deal with. FritzBot ET sets the distance normal bots can see by the aiscript so they can be more human especially on foggy maps. Values are generally good between 1500 and 2000, with a few maps needing larger values.

Oh btw if you have created a .nav and see that error when you reload, check that sv_pure = 0 and if not set it and try again.

viktwaar
25th Jan 2009, 11:30
you can make an AIscript with the fritz waypoint tool, right?
and in wich folder do you have to save your AIscript?

TomTom7777
25th Jan 2009, 12:20
aiscripts can be made with notepad or any text editor. Hobbit's waypointing tool (WaypointTool.exe) has a few special features for making aiscript files (keywords in color, right-click keyword help, error flags...). But if you don't have Microsoft Dot-Net 2.0 installed then start with notepad.

aiscripts go in Wolfenstein - Enemy Territory\fritzbot\bots\scripts as described in the main FritzBot ET wiki (http://wiki.bots-united.com/index.php/FritzBot_ET#Installation_of_additional_files).

Btw waypointing desert7 will be fairly easy. You will want to learn about (http://wiki.bots-united.com/index.php/FritzBot_ET_Creating_Waypoints) and use the following .nav actions;
action_dynamite (obj: 4), action_defuse (5), action_roam (12), action_mg42camp (18), action_construct_major (19), action_plant_construct (32) and action_cmdpost (22).
You will also want to learn about the following aiscript keywords;
node_connect, node_disconnect, activateAction, deactivateAction, if_construct_built_false, if_construct_built_true, if_allied_cp_built_true, if_allied_cp_built_false

Once you read and understand how to add nodes, add connections (http://wiki.bots-united.com/index.php/Fritzbot_ET_Basic_Waypointing), add actions, and the minimum items above you can waypoint desert7 in a few hours.

stealth6
25th Jan 2009, 12:54
wouldn't it be better to ask this on the fritzbot forums? I am sure they will have far more knowledge about the bots then us :D

viktwaar
25th Jan 2009, 15:40
when i use the AI script from tomtom7777
the spawned bots are just standing there and arent doing anything.
i guess it has something to do with the AI script?

viktwaar
25th Jan 2009, 15:41
i forgot to say i haven't made a good waypoint yet.

(sorry for my f#@$%cked up english)

TomTom7777
25th Jan 2009, 16:14
It has to do with the lack of nodes, lack of node-connections and lack of actions to perform. The nav file (like this partial nav (http://www.geocities.com/cameronbr/User/viktwaar123/index.html)) contains the actions to get the bots out of the spawns and the connected nodes to tell them what path(s) they can take. When they are not actually shooting at each other they can only move along the nodes

viktwaar
25th Jan 2009, 16:50
ok, but they don't shoot on me. when i'm an allie and i stand in front of an axis he doesn't shoot on me or something like that.

TomTom7777
25th Jan 2009, 17:16
for desert7.pk3 as example;
files needed as follows
fritzbot/bots/scripts/desert7.aiscript
fritzbot/bots/maps/desert7.nav
open console type:
/sv_pure 0
/fs_game fritzbot
/devmap desert7

/bot_pause 0
/node_editor 1
/node_vis 1
/vid_restart

/addbot

If the only bots shooting are fieldops then the aiscript or bot_SightDist is bad

viktwaar
25th Jan 2009, 17:22
ok, thanks

but now i have made 4 nodes. and when i spawn a bot it doesn't folow the path. he just repeats the same message. do you have to do more than only plant some nodes to make a bot folow the path?

viktwaar
25th Jan 2009, 17:42
my bot says he can't find a goal.
i don't know how to get a goal in my map?

TomTom7777
25th Jan 2009, 17:43
yes there needs to be at least 2 actions (goals) that are active, that the bot can perform, that the bot can find by following the connections between nodes starting close to him and going unbroken to where the actions are.

the simplest actions are roam actions
stand near a connected node open console and type
/action_add 12 12 70 1023 1 0 0
and a yellow line appears showing the presence of a numbered action (as seen in the wiki (http://wiki.bots-united.com/index.php/Fritzbot_ET_Intro_to_Waypointing#Action_Hints).)

Now if the bot is more than about 500+ units from any and all nodes or if the node is not connected to other nodes reaching an action the bot may suicide or zombie.

viktwaar
26th Jan 2009, 00:55
it works! thanks.

but is raom action just an action to meet eachother and to fight? (sorry for my bad english)
do you need to have these in your map or isn't it necessary?

when i put in an dynamite action it says i have to give it an entity, what's that, has it something to do whith GTKradiant?

TomTom7777
26th Jan 2009, 11:29
roam actions are used to ensure bots will patrol over to the node closest to a roam action. When the one action is set as a roam action for both teams then it can ensure that that area will be fought over. But roam actions do have other uses. I recommend at least 2 roams be active in waypoints at any time (in addition to any camp actions). Every class of bot needs an available action or it will stay where it is and complain about goals

Most actions that are objectives must be associated with the related map entity. The action_ent number identifies which map entity (existing in the bsp file or create-d in the map script) the action will listen to. For example; a construct command post action (22) (http://wiki.bots-united.com/index.php/FritzBot_ET_Creating_Waypoints#action_cmdpost) must be set to the entity of the trigger_objective_info of the command post. That way the build final and death events of the command post are listened to by the bots and the aiscript. The console command /viewent (view nearest entity in fritzbot menu) is the easiest way to find the ent number to use. But beware the wrong number may crash ET when the bots join, so save often

viktwaar
26th Jan 2009, 15:36
ok, i have given the console the command /viewent, the entity of my wall that must be blown up is 74.
when i give this command /action_ent 0 74 (0 is the number of the action) it means that the action is linked to my wall right? i have placed a roam action behind the wall.

but my bots just want to go to that roam action! they do not blow up the wall, they're just running against the wall!



this is exactly what i've done:

/action_add
add action 0
/action_allies 0 4 (4 means dynamite, blow up the wall in this case, right?)
/viewent

found entity: trigger_objective_info EntNum: 74
/action_ent 0 74




what am i doing wrong?
my bots just want to go to that roam action. maybe i can delete the roam action so that the bots should more "focus" on the dynamite action?

TomTom7777
26th Jan 2009, 19:52
Ok the copy of desert7 that I have agrees with your viewent of 74.

an action must be active (available) for the bot to attempt it. There are 3 ways to make an action active at the start of the match.

1- set goaltracker 0
/action_goal 0 0

- or -
2- set active by the aiscript
default
{
activateAction 0
}

- or -
3- group the action with other actions /action_group 0 1 and activate the group in the aiscript

default
{
activateAction_group 1
}

You will also want to set the defuse action too
/action_axis 0 5
And make the action remain active until complete
/action_active 0 1
(action_active does not activate, it prevents deactivation by other objective actions)

and maybe restrict the radius if the plant needs to be closer to the wall (ex. /action_radius 0 40)

BTW the action parameters can be combined when you first add the action
/action_add <action_axis#> <action_allies#> <action_radius#> <action_ent#> <action_active#> <action_group#> <action_goal#>
So the main door /view_ent of 84, means you can add a dynamite-defuse action there by
/action_add 5 4 40 84 1 2 0
Or if you want to delay its activation until after the wall
/action_add 5 4 40 84 1 2 -1
then activate in the aiscript
action 0 //triggered when wall is dynamited
{
activateAction_group 2 //move on to the main door
}

viktwaar
27th Jan 2009, 21:08
ok, thanks. my bots works.
but there's another thing. i have focused more on scripting and this is my aiscript:



MAPTYPE 0

bot_SightDist 1700 //how far the highest skill bot can see on this map


spawnflag_is_priority 0 //should bots focus on spawnflags?

cmdpost_is_priority 0 //are cmdposts critical on this map?

construct_is_priority 1 //should engs focus more on constructibles

map_has_vehicle 0 //does this map have a tank or a train?

action 0
{
node_connect 87 88 true
node_connect 88 87 true
deactivateAction 0
}


action 1
{
node_connect 92 93 true
node_connect 93 92 true
deactivateAction 1
}



#EOF





everything goes fine when i start up my map and wait for the 60 warmup seconds.
but after the warmup ET crashes, i get this error "ET.exe is not working anymore."
i guess it has something to do with the aiscript, but i don't know what it is.

thank in advance, viktwaar

viktwaar
27th Jan 2009, 21:22
i found out it has nothing to do with my script.
i think it has something to do with the nav.file.
but the Waypoint's tool says everything is fine.
is there a limit of action in your map?

TomTom7777
27th Jan 2009, 22:57
MAPTYPE # is not used in FritzBot ET (http://wiki.bots-united.com/index.php/Fritzbot_ET_waypointing_tutorial#Writing_the_Aiscr ipt). It is only used in RTCW FritzBots. Also note that FritzBot for RTCW uses different numbers for action types.

The most likely cause of ET crashing (http://wiki.bots-united.com/index.php/FritzBot_ET_Creating_Waypoints#Waypoint_Troublesho oting) is a bad Ent number. All red nodes should be 1023 (default) except for check/spawn flag nodes (none that I saw in desert7). All yellow nodes should match the map entity they are associated with (i.e. the correct trigger_objective_info entity number for dynamite, defuse, command post, and construct actions ). Actions not needing ent numbers should be 1023 (default)

BTW dynamite actions on normal dynamite objectives do not need things like your deactivateAction 0. Because they are connected to func_explosives, they are one time only. If you see your engineers planting dynamite at an already blown objective then the Action_ent number is likely incorrect.

In rare cases a mapper uses a func_construct with a one-time dynamite objective (probably having changed it from a construction objective). Using a action_plant_construct generally fixes those cases. On desert7 all the dynamite objectives I saw were regular style func_explosive connected so you don't need this fix.

An alternate way to detect the dynamite going off is to monitor the associated func_explosive with a event_explode action. For instance at the wall on the copy of desert7 that I have, I can add the following (above the dynamite action previously added)

/action_add 34 34 10 75 1 0 0

I like to monitor the func_explosive for the aiscript for a couple of reasons. It avoids a rarely seen bug in dynamite actions that are set to goal -1, and it does not have to be activated by the aiscript.

twt_thunder
30th Jan 2009, 19:34
why fritzbots and not omni-bots?