Improving the bots

Developer discussion of experimental fixes, changes, and improvements.

Moderators: Nexuiz Moderators, Moderators

Improving the bots

Postby Ed » Tue Sep 30, 2008 10:42 am

There have been a couple of discussions about how good/bad the bots are recently.

I know that a lot of people don't care about the bots but they do make the single player mode and for a new player to immediately start playing with real players online without having learnt the weapons and movement would be folly. I really don't see why so many people do that. If the bots were more realistic they could also be used to make empty servers less empty so that there's a point for real players joining them. Once one real player is in a game, there's much more chance of others joining.

The bots actually work quite well in the single player maps as these maps are generally set up well for the bots with a decent set of waypoints. The fact that most 3rd party maps do not have waypoints means that you forget the bots even remotely being able to join in the game properly. If mappers were to put in waypoints, the game becomes much better with bots. I think the waypoint format could actually be improved by having more than one kind of waypoint. Different marker types could be used to define places where a bot should jump or laser jump, or to define the defensive boundaries around a base in CTF. Prioritisation on different point type by situation would make them much better for CTF. Once a bot has a flag, it's number one priority must be to get the flag back to base.

The bots do not react that humanly currently. As an example, if a bot is on it's own and you move yourself to a position some way vertically above a bot, the bot can see you before you have opened fire. This is just not realistic. A real player would not see the player unless they were looking up and on the point of the player above opening fire, they would look up and dodge, perhaps taking some time to locate the player before opening fire. The observancy of a bot needs to take in to account things like level a lot more. Currently the bots 'look' up and down just as well as they do in plane. A good example of this done well is the Reaperbot for Quake which on easy or normal difficulty has reduced ability to look/aim up and down. This is in line with new human players who take time to get used to mouselook.

Another problem with the bots currently is that they are not individuals. Looking at the current bot code in bots.qc, the names of bots are taken from a simple list and are independent of the model or any kind of play characteristics.

What I though of as a first step to improve this area is to define the bots externally. Have, say, a .bot file that specifies the bot. Initially this could just be a [botname].bot file which is blank and would only be used for the bot code to find bot names. By renaming, deleting or creating new .bot files you would adjust the pool of bot names available. This would allow silly tricks like naming bots after contacts in your instant messaging client, or after tracks in the playlist of your media player or after the headlines in an RSS feed. It would also mean that mappers could make map specific bots.

The first bit of info to then use the .bot format for would be to list the player model to load for that bot. This would mean that bots names would become a character rather than just a random name.

The next things to specify would be play characteristics for a bot. Weapon preference, agility, aim, observancy, agression, suicidal tendencies, teamplay etc. All ability would still be scaled by the difficulty setting. This would require massive changes to the bot code so that these values are used. I can envisage things like making bots reply to firendly fire in different ways. Ones who are good at teamplay would immediately message their own team to say 'Same team' whereas really uncooperative ones would return fire in a fit of anger until the firing stops. Agility could also be used to determine whether a bot uses advanced movement like laser jumps or jump boosting to get around the map.

Any comments on this lot?
Ed
Forum addon
 
Posts: 1172
Joined: Wed Mar 01, 2006 12:32 am
Location: UK

Postby Sepelio » Tue Sep 30, 2008 3:50 pm

Might take a look at this for more ideas/guidance

http://leesvoer.com/zooi/projects/gladi ... .shtml.htm

Thats the Quake 2 Gladiator bot plugin. Its quite good as far as I remember, used to use it years ago. Allows you to customise the bots etc.
Possibly not the worst mapper in the world.

A blog of random pish:
http://xeno.planetnexuiz.com/blog/?author=5
Sepelio
Forum addon
 
Posts: 1101
Joined: Tue Jun 27, 2006 7:57 pm
Location: Scotland

Postby MirceaKitsune » Tue Sep 30, 2008 9:08 pm

What a coincidence, I was just looking for a topic to report some bot AI issues and found this newly made one. I agree with all that was said, and I also do care about the bots and find them a very important part of the game. If no one is online on a server you can play on, or you want to train yourself or just play but not with other people, bots are the ones to turn to. Bots are even there for you when you can't win on a server and feel the need to go butcher someone who doesn't fight back too much :D Also, you might want to note this topic I made a while ago about bot AI issues in mission based gametypes.

On the side of bot editing, I was hoping there might be a bot editor in the game actually. It could be something just like the one in UT classic, where you popup a bot editing window, visit a certain bot then edit that bot's name, model, the two colors, and once that will exist combat / movement / intelligence preferences, just like you edit yourself from Player Setup. Also a bot rooster is another thing I encouraged and wished for, in which you could specify exactly with which bots to play with in a mach and organize teams of bots manually in team games rather then have a random bot join in.

I was wondering though... aren't there any open-source bot AI engines out there? Something like a pre-made bot system just like physics engines can be found and used separately. Something like what Sepelio just posted is the idea.

Anyway like I said in the first line I wanted to report 3 bot issues I found during Deathmatch games and found this topic the best. I know there are many problems with bots currently but these are some more severe issues because they cause bots to get stuck in certain places on the map and not move any more. These are the three things I seen:

1 - There are spots on certain maps where bots cannot grab the paths from, and in such situations the bot will camp somewhere and not know what to do. When I came across such a bot he hardly even looked at me and tried to shoot towards me... I was able to shoot that bot down in a second on the Advanced difficulty without him moving a muscle. That's probably a map issue too but in order to avoid this every bot should always have somewhere to try and go to from every point he may get to on the map.

2 - I noticed an issue in another map where a bot who was normally running around and picking up items suddenly bumped into a wall and continued trying to get through it. Basically, the bot kept sitting in place and running into that wall forever, of course until he seen me and went on to shooting me. To avoid this, I think there should be a check so if a bot tries to follow a certain path but gets stuck into a surface and tries to run through it for more then 1 second, the bot then returns and seeks another path to go through to avoid this situation.

3 - One of the most probably known bot camping issues; If a bot jumps on a jump pad which doesn't have a sideways destination (throw the bot / player on another surface rather then back on the jump pad / straight vertically), the bot will just sit there and jump up and down on that pad forever because he doesn't attempt to move while in the air. Bots here should normally go towards another path node / item while being thrown up by the jump pad, to avoid staying there forever and bouncing up and down.
MirceaKitsune
Keyboard killer
 
Posts: 593
Joined: Thu Aug 14, 2008 6:48 am
Location: Romania - Bucharest

Postby take_this_cup_of_poison » Thu Oct 02, 2008 12:29 pm

I put waypoints in my maps. I wish the bots were smarter and more efficent with CPU though. On some of the bigger maps I have to set bot_ai_strategyinterval to 10000.

Also once a bot gets shot off a path, it gets stuck running into a wall forever trying to get back on. It doesn't understand the wall is not moving nor is it.
take_this_cup_of_poison
Banned
 
Posts: 198
Joined: Sun Jan 20, 2008 2:25 am

Postby mand1nga » Sat Nov 15, 2008 2:08 pm

Hey guys, I'm making a list of tasks for improving the bot AI based on other messages in the forum and my own experience (I have trained my aim a lot using bots). I'm willing to contribute to the project by improving the bots reusing the existing codebase, so this is what I plan to do. However it would be great to discuss about this list so the tasks can be shared among other developers (hey I'm not a developer yet), and maybe updating the development wiki with this.

Weapon combos
It would be nice if bots with a skill lever higher than X can make weapon combos

Better weapon choosing AI
Now the bots are sticking too much to the rocket launcher, even for far distances, or at least for distance where it is obvious that a nex shot will make more damage. This should be improved.

Custom weapon priority
I like this idea a lot, it should allow us to fine tuning the bot behaviour without too much effort. Also this shouldn't be hard to do at code level. Basically we have a custom list of best weapons depending of the distance to the enemy. If this is set then the AI for choosing weapons is disabled. It should depend on a set of cvars like this:

bot_ai_distance_bounds "200 800"
bot_ai_weapon_prority_near "A B C D ... "
bot_ai_weapon_prority_mid "A B C D ... "
bot_ai_weapon_prority_far "A B C D ... "

Skill range concept
Even looking at the code it is not clear to me how to tune the "skill" variable. I'll try to make a better coverage of this variable at code and documentation level. Now if a set a skill level of 99 the bot can be aiming at me without firing at all. Please correct me if I'm making bad assumptions here.

Movement
Don't get stuck
Detect when a bot got stuck, then at least return to the path it was following previously.

Don't stand still
If the bot can't see any waypoint, at least choose any path and keep moving.

Don't stick to other players/bots at close distances

Bunny hoping / strafe jumping support

Laser jumping
Yes I know this is extremely hard to do.

Visibility
Now the bots can see enemies up to 10000 units of distance. This should be a cvar instead so mappers can limit bot visibility for large maps, or as a quick workaround for maps with fog.


Item Pickup
Pickup of dropped weapons
It seems that the bots can't see dropped weapons at all.

Teamworking
When playing in a team, bots should know what weapons/ammo its partners have, then pickup more or less items based on this.

Fun
Basic talking, taunting, laughing at enemy fall damage, weapon juggling :)

Other
Support for electro secondary + primary attack and stuff like this.

Some days ago I've started learning Quake C and looking at the Nexuiz codebase, now I I have some basic support for weapon combos, but still have a way to go for reaching production quality. Needless to say the bot code is very complex, but I think I can do most of this list on my little free time. I'll keep you posted about any progress on this area.

Please let me know your thoughts

Cheers
Last edited by mand1nga on Fri Nov 21, 2008 9:21 pm, edited 3 times in total.
mand1nga
Alien trapper
 
Posts: 321
Joined: Mon May 12, 2008 12:19 am

Postby mand1nga » Fri Nov 21, 2008 2:05 am

Well this is the first patch of this series of improvements: http://pastebin.com/f2210d1d4

It covers the following issues (explained):

Custom weapon priorities for bots:
* Customized bot behaviour
This allow players to customize a little more the bot behaviour. Also this can be used for campaign levels. It adds the following cvars:

Code: Select all
set bot_ai_custom_weapon_priority_distances "200 700" // Define close and far distances in any order, the bots will detect middle distances automatically.
set bot_ai_custom_weapon_priority_far "9 7 13 6 4 3 2 1" // Desired weapons in any order. Up to the max ammount of weapons available in the system
set bot_ai_custom_weapon_priority_mid "14 7 6 4 3 2 1" // same as previous
set bot_ai_custom_weapon_priority_close "7 14 3 2 1" // same as previous


I don't know if it needs a further explanation, if you have any question just shoot. However if this patch is fine I would be glad to document these variables in detail.
If these variables are set, this algorithm takes precedence over the previous one. If no weapon is chosen by this method then the bots will try to use the classic method.

* Trying out new weapons
This way you can get a bot using the seeker, hlac or any other weapon instantly without making any custom code for it.

Weapon combos:
You can enable weapon combos for the existing and custom weapon priority algorithms using the following cvars

Code: Select all
set bot_ai_weapon_combo 1 // Enable weapon combos
set bot_ai_weapon_combo_threshold 0.3 // Try to make a combo N seconds after the last attack


However the weapon combo support for the existing weapon choosing algorithm is a little limited, it only supports weapons with long, known refire times. I would like to have some feedback from the developers about my work before making it better.

Please tell me what you think about this.

I will upload a video showing the bots under these changes very soon :)

Cheers
Last edited by mand1nga on Fri Dec 12, 2008 8:30 pm, edited 2 times in total.
mand1nga
Alien trapper
 
Posts: 321
Joined: Mon May 12, 2008 12:19 am

Postby Ed » Fri Nov 21, 2008 10:23 am

These patches look like a nice idea. Hope they can be put in SVN for some broader testing.

How can the bots tell which weapons are comboable? Do they know that they can detonate rockets with nearby hagar or mortar blasts? Will they understand that electro spamming can give massive combos?
Ed
Forum addon
 
Posts: 1172
Joined: Wed Mar 01, 2006 12:32 am
Location: UK

Postby mand1nga » Fri Nov 21, 2008 4:27 pm

mand1nga
Alien trapper
 
Posts: 321
Joined: Mon May 12, 2008 12:19 am

Postby mand1nga » Fri Nov 21, 2008 4:33 pm

Ed wrote:How can the bots tell which weapons are comboable? Do they know that they can detonate rockets with nearby hagar or mortar blasts? Will they understand that electro spamming can give massive combos?


Hey Ed, any weapon with a refire time greather than bot_ai_weapon_combo_threshold can be used by the bots for doing a combo.

About rocket detonations I think the bots are not aware of which weapon the enemy has. About the electro spamming I'm not sure, I will check the code later.
mand1nga
Alien trapper
 
Posts: 321
Joined: Mon May 12, 2008 12:19 am

Postby [-z-] » Fri Nov 21, 2008 6:12 pm

Nice, they are looking / behaving a lot better now. The only other things I would add to your list is a heightened awareness to what their teammates are doing. They are currently very selfish, run in straight lines towards items and are often hard to predict. In terms of teammates, I wish they would be more passive and give the players more of a chance. Which sort of relates to spawning and taking items, annoying as hell.
[-z-]
Site Admin and Nexuiz Ninja
 
Posts: 1794
Joined: Mon Nov 13, 2006 12:20 am
Location: Florida

Next

Return to Nexuiz - Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron