Bot A.I. Question

Discussion for Level editing, modeling, programming, or any of the other technical aspects of Quake
Post Reply
wVmikeVw
Posts: 7
Joined: Wed May 30, 2007 3:07 am

Bot A.I. Question

Post by wVmikeVw »

Is there anyway to alter the AI of bots in the game [QA3]? And just for clarity I don't mean by using brushes that repel/attract bots, but like making specific pathes for them to follow, changing their sight and hearing range or altering how they react to certain events (ie. how to chase after a player they've "spotted") , those kinds of things.
Magnus
Posts: 529
Joined: Wed Feb 16, 2005 6:38 pm

Post by Magnus »

Most of the changes you want can be made in each bot's botfile. Open the bot's .pk3 and find the files that end in c.c i.c and w.c. No need to mess with the t.c as this is the bots chat responces.

In the c.c you will be able to change the bots various skills and change how likely they are to do certian things.
The values are 0.00 for no skill or no chance they will do a cartian thing and 1.00 for full skill and a 100% chance they will do a certian thing.

Only values between 0.00 and 1.00 will be recognised.

Example:

CHARACTERISTIC_NAME "Deity"
CHARACTERISTIC_GENDER "male"
CHARACTERISTIC_ATTACK_SKILL 0.98
CHARACTERISTIC_WEAPONWEIGHTS "bots/deity_w.c"
CHARACTERISTIC_AIM_SKILL 0.98
CHARACTERISTIC_AIM_ACCURACY 0.98
CHARACTERISTIC_VIEW_FACTOR 0.98
CHARACTERISTIC_VIEW_MAXCHANGE 360
CHARACTERISTIC_REACTIONTIME 0.02

CHARACTERISTIC_CHAT_FILE "bots/deity_t.c"
CHARACTERISTIC_CHAT_NAME "deity"
CHARACTERISTIC_CHAT_CPM 200
CHARACTERISTIC_CHAT_INSULT 0.4
CHARACTERISTIC_CHAT_MISC 0.4
CHARACTERISTIC_CHAT_STARTENDLEVEL 1.0
CHARACTERISTIC_CHAT_ENTEREXITGAME 1.0
CHARACTERISTIC_CHAT_KILL 0.4
CHARACTERISTIC_CHAT_DEATH 0.4
CHARACTERISTIC_CHAT_ENEMYSUICIDE 0.4
CHARACTERISTIC_CHAT_HITTALKING 0.4
CHARACTERISTIC_CHAT_HITNODEATH 0.4
CHARACTERISTIC_CHAT_HITNOKILL 0.4
CHARACTERISTIC_CHAT_RANDOM 0.4
CHARACTERISTIC_CHAT_REPLY 0.4

CHARACTERISTIC_CROUCHER 0.04
CHARACTERISTIC_JUMPER 0.98
CHARACTERISTIC_WEAPONJUMPING 0.08
CHARACTERISTIC_GRAPPLE_USER 0.7

CHARACTERISTIC_ITEMWEIGHTS "bots/deity_i.c"
CHARACTERISTIC_AGGRESSION 0.9
CHARACTERISTIC_SELFPRESERVATION 0.95
CHARACTERISTIC_VENGEFULNESS 1.0
CHARACTERISTIC_CAMPER 0.05

CHARACTERISTIC_EASY_FRAGGER 0.5
CHARACTERISTIC_ALERTNESS 0.98

CHARACTERISTIC_AIM_ACCURACY_MACHINEGUN 0.95
CHARACTERISTIC_AIM_ACCURACY_SHOTGUN 0.95
CHARACTERISTIC_AIM_ACCURACY_ROCKETLAUNCHER 0.97
CHARACTERISTIC_AIM_ACCURACY_GRENADELAUNCHER 0.95
CHARACTERISTIC_AIM_ACCURACY_LIGHTNING 0.95
CHARACTERISTIC_AIM_ACCURACY_PLASMAGUN 0.95
CHARACTERISTIC_AIM_ACCURACY_RAILGUN 0.98
CHARACTERISTIC_AIM_ACCURACY_BFG10K 0.96
CHARACTERISTIC_AIM_SKILL_ROCKETLAUNCHER 0.97
CHARACTERISTIC_AIM_SKILL_GRENADELAUNCHER 0.95
CHARACTERISTIC_AIM_SKILL_PLASMAGUN 0.95
CHARACTERISTIC_AIM_SKILL_BFG10K 0.96

CHARACTERISTIC_FIRETHROTTLE 0.98

In the i.c you can set how attracted to an item a bot is or how much they "want" it.
The #define W is how attracted they are to it if they don't have the item yet and the #define GWW is how attracted they are to the item if they already have it.
Values above 200 or 300 can get messy and you really need to get to know what you are doing before you attempt any values above 300. Values above 400 are not recomended and can cause stupid behaivior in the bot further limiting their actions.


#define FS_HEALTH 3
#define FS_ARMOR 3

//initial weapon weights
#define W_SHOTGUN 50
#define W_MACHINEGUN 20
#define W_GRENADELAUNCHER 30
#define W_ROCKETLAUNCHER 200
#define W_RAILGUN 400
#define W_BFG10K 175
#define W_LIGHTNING 80
#define W_PLASMAGUN 90

//the bot has the weapons, so the weights change a little bit
#define GWW_SHOTGUN 40
#define GWW_MACHINEGUN 10
#define GWW_GRENADELAUNCHER 05
#define GWW_ROCKETLAUNCHER 197
#define GWW_RAILGUN 396
#define GWW_BFG10K 173
#define GWW_LIGHTNING 59
#define GWW_PLASMAGUN 69

//initial powerup weights
#define W_TELEPORTER 70
#define W_MEDKIT 89
#define W_MEGAHEALTH 398
#define W_QUAD 399
#define W_ENVIRO 199
#define W_HASTE 174
#define W_INVISIBILITY 100
#define W_REGEN 125
#define W_FLIGHT 03

//initial armor weights
#define W_REDARMOR 397
#define W_YELLOWARMOR 198
#define W_ARMORSHARDS 60

//flag weight
#define FLAG_WEIGHT 196

Lastly the values in the w.c should match those in the i.c for more consistant and accurate behaivior. Youy only need to change the values for the gauntlet and grapple here the rest of the values you can copy from the i.c.

#include "inv.h"

#define W_GAUNTLET 04
#define W_SHOTGUN 50
#define W_MACHINEGUN 20
#define W_GRENADELAUNCHER 30
#define W_ROCKETLAUNCHER 200
#define W_RAILGUN 400
#define W_BFG10K 175
#define W_LIGHTNING 80
#define W_PLASMAGUN 90
#define W_GRAPPLE 58

Some of the changes you mentioned are not going to be changeable witout actually changing the core programing for the game and bots in the source code i.e a mod.

Hope this helps. :)
Uh, well....good luck with that. :shrug:

[img]http://i57.photobucket.com/albums/g228/Magnus3204/forumheader.jpg[/img]
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Post by obsidian »

The AI source code was not released in the SDK, so any higher level modding isn't possible. You'd have to hack it out from scratch. What Magnes posted is the bot's character files, which defines a few characteristics of a bot used as part of its fuzzy logic. But that's a long far cry from actually changing their game logic.

Jean Paul van Waveren did write his thesis on the Q3A bots, so it should be of interest to you. Link below:

http://www.kbs.twi.tudelft.nl/Publicati ... n-MSc.html
wviperw
Posts: 334
Joined: Sat Mar 17, 2001 8:00 am

Post by wviperw »

The AI source code should be in the game source that was released though...
[url=http://www.goodstuffmaynard.com]Good Stuff, Maynard![/url]
Todtsteltzer
Posts: 93
Joined: Thu Nov 28, 2002 8:00 am

Post by Todtsteltzer »

If you're looking for a mod that makes bots smarter, you may give the bot mod Brainworks a try or switch to CPMA, but there's not much you can do in a map to alter the AI of the bots.
From the Brainworks readme:
====================
This is a beta version of the brainworks Q3A mod, the mod designed to
give Quake 3 Arena bots working brains. It is a complete rewrite of
all the Artificial Intelligence used by the bots. Brainworks includes:

- Sound and visual awareness system
- Randomized dodging in battles
- Avoidance of incoming missiles
- Strafejumping
- Improved enemy aiming (based on human compensation model)
- Goal and score-based selection of item pickups
- Timing of item respawns
- Dynamic weapon selection (based on weapon accuracy)
- Redesigned internal goal selection
- Redesigned internal aim selection
- Redesigned Teamplay logic
- Rewritten chat code
- Redesigned internal logic infrastructure
- MANY MANY fixes for bugs in original Q3A bot code

Some features only apply to bots of a certain skill level. For example,
skill 1 and 2 bots have access to almost none of those features, whereas
skill 5 bots use all of them.

The goal of Brainworks is to make Quake 3 Arena bots as human-like as
possible. With that in mind, the following human equivalents were set
as the "goal for realism" for each bot.

Skill 1: Someone who has played Q3A for less than 2 weeks
Skill 2: Someone who has played Q3A for less than 3 months
Skill 3: Average player on a public server
Skill 4: The best player on a public server
Skill 5: A clan player who plays in professional tournaments

Obviously it's harder to make realistic skill 5 bots than skill 1 bots,
but we've done everything we can in a reasonable amount of time to
reach these five goals for realistic bots.
Magnus
Posts: 529
Joined: Wed Feb 16, 2005 6:38 pm

Post by Magnus »

Todtsteltzer wrote:If you're looking for a mod that makes bots smarter, you may give the bot mod Brainworks a try or switch to CPMA, but there's not much you can do in a map to alter the AI of the bots.
From the Brainworks readme:
====================
This is a beta version of the brainworks Q3A mod, the mod designed to
give Quake 3 Arena bots working brains. It is a complete rewrite of
all the Artificial Intelligence used by the bots. Brainworks includes:

- Sound and visual awareness system
- Randomized dodging in battles
- Avoidance of incoming missiles
- Strafejumping
- Improved enemy aiming (based on human compensation model)
- Goal and score-based selection of item pickups
- Timing of item respawns
- Dynamic weapon selection (based on weapon accuracy)
- Redesigned internal goal selection
- Redesigned internal aim selection
- Redesigned Teamplay logic
- Rewritten chat code
- Redesigned internal logic infrastructure
- MANY MANY fixes for bugs in original Q3A bot code

Some features only apply to bots of a certain skill level. For example,
skill 1 and 2 bots have access to almost none of those features, whereas
skill 5 bots use all of them.

The goal of Brainworks is to make Quake 3 Arena bots as human-like as
possible. With that in mind, the following human equivalents were set
as the "goal for realism" for each bot.

Skill 1: Someone who has played Q3A for less than 2 weeks
Skill 2: Someone who has played Q3A for less than 3 months
Skill 3: Average player on a public server
Skill 4: The best player on a public server
Skill 5: A clan player who plays in professional tournaments

Obviously it's harder to make realistic skill 5 bots than skill 1 bots,
but we've done everything we can in a reasonable amount of time to
reach these five goals for realistic bots.
WOW this sounds exactly like the bots I created a few years ago. They were able to wear the CPMA bots out even in the special maps that were optimised to make those bots better.

My bot's had all of the improvements described in their readme. Hmmm... :paranoid:
Uh, well....good luck with that. :shrug:

[img]http://i57.photobucket.com/albums/g228/Magnus3204/forumheader.jpg[/img]
ix-ir
Posts: 192
Joined: Wed May 16, 2007 9:43 pm

Post by ix-ir »

What do you mean Magnus? The Brainwerkz bots beat CPM bots? AFAIK only cpm3a and cpm18r are optimized at all and only in terms of roams and cluster portals that would aid all bots.
Magnus
Posts: 529
Joined: Wed Feb 16, 2005 6:38 pm

Post by Magnus »

ix-ir wrote:What do you mean Magnus? The Brainwerkz bots beat CPM bots? AFAIK only cpm3a and cpm18r are optimized at all and only in terms of roams and cluster portals that would aid all bots.
Well I have never pit my bots against the brainworks bot, but Todtsteltzer mentioned the CPMA bots being better than the vanillia Q3A bots. CPMA boasted the most highly skilled bots in Q3A at one time and I built bots that would wear the CPMA bots out.
As for the optimisation of the maps CPMA said that to get the full effect of how skilled their bots were you needed to play them in a few mentioned maps that were optimised for them.
Uh, well....good luck with that. :shrug:

[img]http://i57.photobucket.com/albums/g228/Magnus3204/forumheader.jpg[/img]
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Post by obsidian »

wviperw wrote:The AI source code should be in the game source that was released though...
Was it? I thought that both bots and bspc.exe source codes were not released. I could be wrong.
wviperw
Posts: 334
Joined: Sat Mar 17, 2001 8:00 am

Post by wviperw »

obsidian wrote:
wviperw wrote:The AI source code should be in the game source that was released though...
Was it? I thought that both bots and bspc.exe source codes were not released. I could be wrong.
Looking in my q3\source\ directory right now and I'm seeing botlib and bspc folders full of files so I'm assuming everything is covered.

Magnus: You have a link to your bots? I guess I don't remember hearing about yours.

And as far as the measure of a good bot, it's not just about which bot can beat all the other bots... it's trivial to create a bot that has perfect aim but it's very difficult to create a challenging, human-like bot that is fun to play against.
[url=http://www.goodstuffmaynard.com]Good Stuff, Maynard![/url]
Magnus
Posts: 529
Joined: Wed Feb 16, 2005 6:38 pm

Post by Magnus »

wviperw wrote:Magnus: You have a link to your bots? I guess I don't remember hearing about yours.
Yea very few people got their hands on the bots I created. The first 3 were crated for a mod Reefsurfer, Survivor, myself and a few others I can't remember (no offence) were working on called "The Hidden". They were argueing in a thread about weather a bot could be made totally invisible. Obsidian had been teaching me a lot about shader scripting so instead of jumping into the arguement I just created 2 bots that were actually invisible and posted them. From there I was invited to join the mod team.
Reef said that the weps would be limited to SG, MG, GL and Gauntlet. So I startred to learn about changing a bots wepon weights.
Oddly the project just stopped. I made a few maps and bots and sent a link to them to Reef but never heard back from him and didn't see him on the forums for quite a while. The next 2 came out with a mod called TRX or as a seperate download named Rocx and Rocxie. These along with 8 others were made when I first started realy messing with trying to make the bots better. I got to where playing any of the bots on nightmare was easy and boring so I wanted to see if they could be made to be more of a chalenge. I kept playing with their programming and finally made them seem to have some level of "intelligence".

Actually I belive it was Todtsteltzer that first showed me how to toy with the bot files and what all the values in them meant. Thanks man! :icon14:

As far as a link not anymore. The quake 3 site they were on has since been turned intro a formula 1 raceing site. The owner changed what he was into I guess and thus changed the subject of his site.
I submitted them to pollycount and got an email telling me they were amaizing, but because I did not change the animations and or model frame any they could not post them on their site they said I could submit the skins though and strongly suggested that I do that.
Don't get me wrong. The pollycount guys were realy nice about it and it had been their rules for a long time, but I spent so much time on their skill, personality, reactions, chat lines and stuff that I couldn't bring myself to just submit some skins and I am still to this day not very educated in model animation so....

Oh well. :icon7:
wviperw wrote:And as far as the measure of a good bot, it's not just about which bot can beat all the other bots... it's trivial to create a bot that has perfect aim but it's very difficult to create a challenging, human-like bot that is fun to play against.
Very true. I don't think any bot considering their current programing limitations will ever be as good as a pro skilled player.

As far as what I said above I just meant that it was odd that there is a mod that provides bots with improvements that I already made to them years ago.
I don't actually think they took my programming for their mod as my bots were not popularly available.
I was just joking around thus the paranoid thing.
Magnus wrote: Hmmm.... :paranoid:


:p
Uh, well....good luck with that. :shrug:

[img]http://i57.photobucket.com/albums/g228/Magnus3204/forumheader.jpg[/img]
Post Reply