.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Developer's Farm > General Bot Coding
General Bot Coding See what a pain it is to get those little mechs shooting around

Reply
 
Thread Tools
The ultimate aiming algorithm ?
Old
  (#1)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default The ultimate aiming algorithm ? - 14-01-2004

I wonder if you guys already thought about this.

Currently the only feedback that our bots have to control their aiming is of 2 types:
1°) Whether their crosshair is on the enemy or not yet
2°) Whether there is some recoil to the gun to correct or not

Nevertheless playing with the bots for some time you all noticed that it was not sufficient yet to be perfectly human-like. It does not "feel" good.

In earlier versions of my WIP bot I had tried to simulate the "screen resolution" by snapping the bot's crosshair to the nearest angle corresponding to a pixel on the screen, that is, the bot's field of view being 90° width, snap it to portions of 90/1024 degrees horizontally, and for the vertical 60°, snap it to portions of 60/768 degrees vertically. However although this was a definite improvment it did not feel "perfectly good" either.

I believe the crosshair movement is not faulty, because since Killaruna and Aspirin invented the algorithm that I put in the BotAim plugin, the bot's crosshair movement has never been more human-like, especially when coupled with a system to make movement on the vertical axis influence on the horizontal one and vice-versa. The BotAim plugin algorithm is nearly perfect, I don't want to change it. I believe it's rather a matter of missing something like common sense.

I was thinking about the way we humans lock on and fire at a target. The bots lock on target quite well already using the existing algorithms. But what lacks to them is a correction of their target point according to the actual bullet hit points. If you aim right on the head of your enemy and pull the trigger, and that you notice that your bullets go left, you will move your crosshair RIGHT. And vice versa. It is not a problem of recoil, because recoil always lift the weapon in the same direction ; it's rather a problem of correcting by hand the weapon's inaccuracy.

Would it be possible to hook on the last TraceLine the bot fired to have it determine the bullet hit point, estimate the angle between real and ideal, and then modify the aiming angles in consequence ? What do you think is lacking to our current aiming algorithms ?

Gentlemen, DISCUSSION:



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."

Last edited by Pierre-Marie Baty; 14-01-2004 at 21:16..
  
Reply With Quote
Re: The ultimate aiming algorithm ?
Old
  (#2)
botmeister
Ex-Council Member
 
botmeister's Avatar
 
Status: Offline
Posts: 1,090
Join Date: Nov 2003
Location: Canada
Default Re: The ultimate aiming algorithm ? - 15-01-2004

My bot enhancer aiming does not use feed back but the results in terms of accuracy are very good.

Although not always human like, some of it is. The bots will aim directly at bone coordinates, which is what skilled people tend to do. For example, when a human wants to aim at a players head, he aims directly at the head, he does not estimate where the head is as some aiming algos do. Also, the bots will use tactics that humans use and weapons knowledge, such as burst firing depending on distance from target and type of weapon. The bots will stop moving, and crouch (sometimes) when aiming (depends on target distance and weapon type), for sniping, the bots will use the scope much like a human would - rarely zooming 100%, and not zooming when at close range, waiting for target to stabailze before firing, etc.

The problem with all the methods I use, other than the bone coordinate aiming, is it has to be painstakingly programmed into the code, which requires a lot of knowledge of the dynamics of weapon firing, and a lot of trial and error testing. The results are very good, but the coding and testing is a huge effort, and not transferable to other games, and it can be broken if the game dynamics changes after a new release of the game.

If true feed back can be done, then I'd modify the aiming algo to introduce learning, so that the feed back would be used to adjust some of the firing parameters based on distance, weapon used, etc. Perhaps a simple nerual net would do the trick, or evolved parameters.

I do know that you could easily detect what part of a player was hit (in games like CS anyway) using a traceline, but that does not help for shots that completely miss. Also, the traceline method may indicate a perfect hit, but the random game dynamics may lead to a miss, meaning the traceline method won't always produce valid results. You could however, look to see if a players health dropped as a means to tell if the shot hit the target, but that would be very unreliable.

Perhaps you could look for messages that say where the impact sprites are to be displayed?

A good place to look is to see how those stats programs are able to tell how many shots hit a target, etc.


Maker of the (mEAn) Bot.Admin Manager

"In theory, there is no difference between theory and practice. But, in practice, there is." - Jan L.A. van de Snepscheut
  
Reply With Quote
Re: The ultimate aiming algorithm ?
Old
  (#3)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: The ultimate aiming algorithm ? - 15-01-2004

That's exactly what I was saying: instead of FIRING a TraceLine in order to try to evaluate where the bullet went, just USE the results of the last TraceLine that the engine fired for THIS BOT. In my bot code each player structure has a slot where I record what was the TraceResult of the last TraceLine that was fired from them (i.e, when pentIgnore was the player's edict), by hooking pfnTraceLine I catch both the tracelines that my OWN bot code sends, AND the tracelines that the game itself sends. That's how stats plugins do too, at least I can't conceive a better way.



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: The ultimate aiming algorithm ?
Old
  (#4)
botmeister
Ex-Council Member
 
botmeister's Avatar
 
Status: Offline
Posts: 1,090
Join Date: Nov 2003
Location: Canada
Default Re: The ultimate aiming algorithm ? - 15-01-2004

I always found the stats plugins to be very inaccurate for determining hits, but perhaps I'm wrong.

But, if the traceline that the engine sends are the ones that are accurate (determine actuall hits and misses) then technically you can get some feed back.


Maker of the (mEAn) Bot.Admin Manager

"In theory, there is no difference between theory and practice. But, in practice, there is." - Jan L.A. van de Snepscheut
  
Reply With Quote
Re: The ultimate aiming algorithm ?
Old
  (#5)
A$$A$$IN
Guest
 
Status:
Posts: n/a
Default Re: The ultimate aiming algorithm ? - 21-01-2004

One thing I've always found lacking in bot aiming algorithms is the concept of increasing accuracy over time. If a human has 1/3 of a second to aim at a target, the accuracy level will be fairly low. But allow 3 seconds of aiming, and most humans can consistently make headshots, unless the target is moving randomly. What I would regard as "human-like" is a system that has a dynamic jitter factor that logarithmically decreases to basically zero over a period of about 3 seconds or so (depending on skill level) if the bot is not moving or changing the angle it is facing (vertically or horizontally) more than a small amount. This can be fairly easily done by giving the jitter factor a half-life (no pun intended) of approximately 1 second. So if the max jitter factor is X, after 1 second it will be .5X, after 2 seconds it will be .25x, etc. If the bot starts moving, or turns more than say 30 degrees vertically or horizontally, then the jitter factor starts over at its maximum value and the bot has to restart the aiming process.

Currently Realbot (the bot I've had the most experience with lately) is very deadly at close range, but can be fairly easily sniped at long range, because the jitter factor in the aiming seems to be a constant based on skill level. (I'm basing this premise on watching bots in first-person view.) At close range, the bots get a lot of quick headshots, but at long range, they shoot around you and you can take your time and pick them off with a sniper rifle unless they connect with a lucky shot. This rewards bad tactics (standing still in the open for long periods of time engaging the enemy repeatedly) because you are no more likely to die standing still than you are if you move. Against humans, staying still in the open is a bad mistake, especially if engaging a sniper.
  
Reply With Quote
Re: The ultimate aiming algorithm ?
Old
  (#6)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: The ultimate aiming algorithm ? - 21-01-2004

Quote:
Originally Posted by A$$A$$IN
What I would regard as "human-like" is a system that has a dynamic jitter factor that logarithmically decreases to basically zero over a period of about 3 seconds or so (depending on skill level) if the bot is not moving or changing the angle it is facing (vertically or horizontally) more than a small amount. This can be fairly easily done by giving the jitter factor a half-life (no pun intended) of approximately 1 second. So if the max jitter factor is X, after 1 second it will be .5X, after 2 seconds it will be .25x, etc. If the bot starts moving, or turns more than say 30 degrees vertically or horizontally, then the jitter factor starts over at its maximum value and the bot has to restart the aiming process.
Well this is exactly what I was doing before with RACC, and that's also the "alternate aiming algorithm" that I put in the BotAim plugin. Unfortunately this method does not adapt well at all with moving targets, because in such cases you'll quickly realize that the bot's crosshair NEVER gets on the enemy. Anyway I thought all modern bots already had this sort of time-feedback in their aiming algorithm ; if RealBot doesn't, then it must be one of the rares who do.

I'd be curious to see what the BotAim plugin gives on a RealBot. Anyone to try this ?



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: The ultimate aiming algorithm ?
Old
  (#7)
botmeister
Ex-Council Member
 
botmeister's Avatar
 
Status: Offline
Posts: 1,090
Join Date: Nov 2003
Location: Canada
Default Re: The ultimate aiming algorithm ? - 21-01-2004

All the bots I ever played against have distance as their biggest weakness, some more so than others. No matter what bot you play against, I think you'll find that the best way to kill them is to snipe at them from a distance.

I found that there's a lot more to aiming well at a distance than just fixing a steady cross hair on the target. Factors such as movment, crouching, jumping, zooming method, burst fire frequency, type of weapon in hand, and the aiming algorithm, will all work together and affect how good a bot is at taking out opponents at a distance. Even with great aiming, how a bot moves around during combat is at least 50% of the equation.

You can try my mEAn mod to see how well a bot can shoot at a distance. I think its pretty darn good, but still no match against a skilled human player.

I'm working on a version which will allow you to turn individual enhancements on by team, that way you'll be able to compare the results.


Maker of the (mEAn) Bot.Admin Manager

"In theory, there is no difference between theory and practice. But, in practice, there is." - Jan L.A. van de Snepscheut
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com