Brainworks: Quake3 AI Rewrite

Locked
tedv
Posts: 2
Joined: Sun Dec 02, 2007 9:36 pm

Brainworks: Quake3 AI Rewrite

Post by tedv »

Most people here probably don't know this, but on and off for the past 6 years I've been working on a full rewrite of the Quake 3 AI code, named "Brainworks". I'm working on an official release version (which will come with source code), but I need a wider range of testing for things like "How accurate should the bots shoot?" and things like that.

Here's a link to the current install version: http://tedvessenes.googlepages.com/brai ... 0.92.2.zip
Just unzip that from your Quake 3 directory and it should be setup. There are more directions in the included readme.txt file.

The original goal for the bot's skill level was this:

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

If you really want to help test this, try playing against each kind of bot and let me know if they fit that criteria or not. I plan on tweaking a few aiming related constants based on your feedback.

By the way, for testing purposes, this release has fixed aiming levels for all bots of the same skill. For example, a skill 3 Mynx will shoot exactly as well as any other skill 3 bot. The final release will have a greater differentiation of aiming skill based on the bot's actual personality. I just forced all of them to aim like an average skill X bot to provide a common testing framework.

There is an issue where Bot's don't use the Railgun as much as they should. They attack well with it, but generally don't choose to use it. Without getting into too much detail, the issue is caused by a foundational design choice in the weapon selection algorithm which turns out to be incorrect for the railgun. I want to know if the bots are still fun to play against even with this bug, or if an official source code release should get delayed until I can fix the bug.

At any rate, let me know what you think. I'll be incorporating your feedback into the official release.
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Re: Brainworks: Quake3 AI Rewrite

Post by ^misantropia^ »

Sounds interesting. I'll be sure to check it out as soon as I have a little time to spare.
ix-ir
Posts: 192
Joined: Wed May 16, 2007 9:43 pm

Re: Brainworks: Quake3 AI Rewrite

Post by ix-ir »

The bots seem to turn up to armours to some extent which is much better than the id bots although they need a full armour looping behaviour. They also make intelligent choices to retreat from what I can see.

The weapon choice code needs a major overhaul, it's hard to judge the bot's accuracy because the Xaero 5 bot I played only used PG (90%) and SG for the remainder. You need to fix the weapon selection code including RG or the bots will always have a huge achilles heel.
v1l3
Posts: 822
Joined: Wed Apr 02, 2003 8:00 am

Re: Brainworks: Quake3 AI Rewrite

Post by v1l3 »

It's nice to see your still going on it. I still have v0.91 Beta version that you put out in whatever year it was 2002..2003 can't remember for sure, but I was wondering if any other things were worked on rather than just the aiming. I popped in the Doom bot level 4 and 5 and I thought it was better than last version, though the aiming seems a little to precise at moments when it shouldn't. I'm used to playing Cpma bots(I dunno whether you've tried them), but you have to keep movement constantly going with small quick attacks while not stopping movement. There were moments where it barily saw me and it was hitting me. If you were online against a human, the only player that can always pull that off is an aimbot since no one can see everywhere all the time.
Doom didn't stick to the same weapon all the time..where in the last version he just stuck to the LG all the time. That was good...though I didn't try the other bots so I'm not sure how they do.
I personally haven't played the regular Q3 bots as I've changed everyone's files to be as hard as Xaero or slightly harder than that.
I set up my bots like this:

(Favorite weapon to least favorite)RL, RG and BFG same,LG,PG,SG,GL,MG

I think the bots should determine what weapon it wants to use based on how far they are away from you. Also weapon combos..like RL to knock you up falled with a RG slug for example. Though I've noticed they do somewhat do that already..like with using the MG when far away.

Jumping at 1.0(Which would be on constant..obvious) Q3 standard bots only jump if they are close to you, where it is nice if they also jump at moments when they are far away from you also. Jumping definitely makes them louder which could be good or bad. It would be more human in my opinion...as far as an elite player..for skill 4 or 5. Plus jumping gives them more access to certain parts on whatever map, yet gives them a bad possibility of falling into drop offs or falls to oblivion..or space maps for example. So I dunno alot of that has to do with how good the mapper clipped the map off or not..or just chance.

I have crouch at 0...I personally only use crouch when I'm either zooming my RG from long distants, or walking near an edge to a drop off.

I've turned camping and chatfragging(easy fragger) off, as a respective player would do neither..well people camp sometimes..I just don't.

I personally have all of the bots use the same mind and have three different versions...which with normal Q3 can only be the alteration of weapon choice/pick-ups..past that there really isn't much more choices to do with the regular one. I'm sure that you could could come up with more options..as you already have somewhat.

Though it may be terrible for me to say this, I dunno but...I recommend that you download Cpma and play against the level 6-100 bots and fix the bots so they RL-jump, and don't drowned, and not falling into death points like drops or lava yet keep them more focused towards regular Q3 play rather than promode play. They have alot of good aspects yet alot of bad with it also, but at this point they are considered to be the near best that can ever be done for a Q3 bot. They may have many attributes that you might find helpful and also give you some good idea's. Plus...these sort of things are a sort of competition when it comes to one mod to the next..so..I guess take that as you will. :smirk:

Hopefully anything of what I've just commented on is helpful at all.
tedv
Posts: 2
Joined: Sun Dec 02, 2007 9:36 pm

Re: Brainworks: Quake3 AI Rewrite

Post by tedv »

ix-ir wrote:The weapon choice code needs a major overhaul, it's hard to judge the bot's accuracy because the Xaero 5 bot I played only used PG (90%) and SG for the remainder. You need to fix the weapon selection code including RG or the bots will always have a huge achilles heel.
The code doesn't have some factor in there that says "don't use the railgun very often". Instead you provide it a description of all weapons (damage, reload time, weapon spread, splash radius, etc) and it determines which weapons are best to pickup and use.

The problem is that I originally defined all weapon analysis in terms of DPS (damage per second), not TTD (time to death). This is a problem for the railgun, which has low DPS even with good accuracy, but great TTD. That's because the first shot costs 0 seconds while each shot thereafter costs 1.5 seconds. You only need 1.5 seconds to deal 200 damage, which is a DPS of 133, but the bots think of the railgun as 66 DPS (times their accuracy, of course). I'm planning a rewrite of both the item pickup and weapon selection to handle this problem, but it's still rather complicated. To see how the DPS model can have issues, consider the following weapon selection situation:

The bot estimates the target will die after taking 200 damage. It has 70% accuracy with the railgun and 30% accuracy with the plasma gun.

Railgun DPS: .7 * 100 / 1.5 = 47 DPS. Target dies in 4.2 seconds
Plasma DPS: .3 * 20 / .1 = 60 DPS. Target dies in 3.3 seconds

That plasma number is relatively accurate, but the railgun number is way off. Here's how it should be calculated:

2 hits in 2 shots: 49% chance, 1.5 seconds
2 hits in 3 shots: 42% chance, 3 seconds
2 hits in 4 shots: 5% chance, 4.5 seconds
2 hits in 5 or more shots: 4% chance, 6+ seconds

The expected time to death is the weighted average of these times, or around 2.5 seconds. (The actual calculation involves a geometric series.)

With this analysis, you can see that the railgun is the right weapon, but the bot does the calculation incorrectly and decides the railgun isn't worth using. An analogous section in the item pickup code makes the bot determine the railgun isn't worth picking up either.

I'm still thinking about how to properly model this, but I at least understand why things are wrong and what the correct behavior should look like.
v1l3 wrote:I popped in the Doom bot level 4 and 5 and I thought it was better than last version, though the aiming seems a little to precise at moments when it shouldn't. I'm used to playing Cpma bots(I dunno whether you've tried them), but you have to keep movement constantly going with small quick attacks while not stopping movement. There were moments where it barily saw me and it was hitting me. If you were online against a human, the only player that can always pull that off is an aimbot since no one can see everywhere all the time.
That feature is actually based on an old set of original Quake 3 bot code. The code magically makes bots have worse accuracy against targets that are moving more than X units per second in the world. No, I'm not making that up. Obviously there are two huge flaws with this model.

A) The movement isn't projected onto the aiming player's view sphere. If someone is moving directly towards you, the ideal yaw and pitch you aim at doesn't change, so it's very easy to hit them. Think of aiming at a player who's at the very top of a jump pad's launch arc. Easy. But the game considers this "movement", so the accuracy is just worse. Making accuracy worse here doesn't make sense.

B) Players can move in a straight line and be easy to aim at despite their movement, because of how predictable they are. Bots should not have worse accuracy against players moving in a straight line either.

I suspect that CPMA just increased accuracy against players who stand still and decreased accuracy against players who move. That would provide the behavior you describe.

Regarding issues of a bot barely seeing you and hitting you, that sounds like an issue with the awareness engine. I wrote code that analyzes things like line of sight and sounds to track players. A bot knows the location of a tracked player for X seconds after it's not received any tracking data. (So if you duck behind a corner, the bot doesn't just forget about you unless it doesn't see or hear anything for X seconds. I think X is between 3 and 5.)

Now there are two possible issues. I might not have put a field of view check on the line of sight check, which should obviously be fixed. The other possibility is that some sound effects should not be considered so "loud" that they make the bot gain awareness of a target, but are still "loud" enough that they refresh awareness of an already known target. Maybe the footstep sound is considered so loud that bots always know where you are when you make noise, which really doesn't feel fair. Of course, if you fire a weapon, they should instantly gain awareness of where you are.

On the subject of just adding changes to CPMA, I don't think that's an option. When I say that Brainworks is a full rewrite of the bot code, I mean it. Except for some portions of the chat code, literally everything has changed. Right now, the AI code is 50% of the server side source code by bytes as well as 50% of the server side files. (For reference, the original AI code was 4 files and a little over 5% of the server side code base.) Just from your descriptions, I'm sure CPMA is using features that I've long since gutted and rewritten.
rgoer
Posts: 798
Joined: Sun Aug 17, 2003 7:00 am

Re: Brainworks: Quake3 AI Rewrite

Post by rgoer »

I saw that the official version 1.0 was released--gonna give it a try tomorrow

http://brainworks-ai.blogspot.com/
w0rt3x
Posts: 51
Joined: Thu Dec 20, 2007 5:01 pm

Re: Brainworks: Quake3 AI Rewrite

Post by w0rt3x »

Yeah, Ill have to try this, especially when there's almost no normal players i can play around...
foralarx2k3
Posts: 306
Joined: Wed Feb 01, 2006 9:56 pm

Re: Brainworks: Quake3 AI Rewrite

Post by foralarx2k3 »

Wow, interesting. Bit too early to comment after only one game .. I'll have to play it more ... but it's certainly different.
My Maps: [url=https://lvlworld.com/review/id:1911]Steep Learning Curve[/url], [url=https://lvlworld.com/review/id:1905]Reckless Abandonment[/url], [url=https://lvlworld.com/review/id:1955]The Rage[/url], [url=https://lvlworld.com/review/id:2409]The Immortal Coil[/url]
w0rt3x
Posts: 51
Joined: Thu Dec 20, 2007 5:01 pm

Re: Brainworks: Quake3 AI Rewrite

Post by w0rt3x »

I know I don't have a lot of experience, but I'm pretty sure bots lvl 3 are too weak - I just beat (20-0) a lvl3 Doom @ pro-q3dm6, while I get my ass kicked at a public server (at least in normal duels).

But overall nice work, bots look a lot more humanlike, and intelligent at lvl 5 too.
User avatar
Eraser
Posts: 19177
Joined: Fri Dec 01, 2000 8:00 am

Re: Brainworks: Quake3 AI Rewrite

Post by Eraser »

Will download this and try it somewhere the coming days. If I don't forget, I'll write my findings here :)
User avatar
Eraser
Posts: 19177
Joined: Fri Dec 01, 2000 8:00 am

Re: Brainworks: Quake3 AI Rewrite

Post by Eraser »

ok, i never responded.... did download it though.
One thing I don't understand though, is that the PK3 is called brainworks.pk3. If I understand Q3's pk3 system correctly, the files in brainworks.pk3 are overruled by the files in pak0.pk3 because they have a "higher" filename (when ordered alphabetically). I suppose the bots only work when you put it in a seperate mod directory.
User avatar
Eraser
Posts: 19177
Joined: Fri Dec 01, 2000 8:00 am

Re: Brainworks: Quake3 AI Rewrite

Post by Eraser »

Allrighty, I just put the brainworks.pk3 in a brainworks mod folder, loaded the mod, played about 50 seconds and then I got this error message:

Image
Lieutenant Dan
Posts: 1151
Joined: Mon Jul 24, 2006 2:25 am

Re: Brainworks: Quake3 AI Rewrite

Post by Lieutenant Dan »

Good to see people still working on Quake 3 :up:
Locked