Difference between revisions of "SimpleBot/Understanding SimpleBot"

From Robowiki
Jump to navigation Jump to search
(→‎Movement: add details)
Line 24: Line 24:
 
Currently SimpleBot is using two trees in its movement, one is called SimpleTreeView, another is called NormalTreeView. SimpleTreeView uses three attributes, BulletFlightTime, LateralVelocity and TimeSinceDeceleration, whereas NormalTreeView is using BulletFlightTime, LateralVelocity, Acceleration, ForwardPreciseMaxEscapeAngle and ReversePreciseMaxEscapeAngle.
 
Currently SimpleBot is using two trees in its movement, one is called SimpleTreeView, another is called NormalTreeView. SimpleTreeView uses three attributes, BulletFlightTime, LateralVelocity and TimeSinceDeceleration, whereas NormalTreeView is using BulletFlightTime, LateralVelocity, Acceleration, ForwardPreciseMaxEscapeAngle and ReversePreciseMaxEscapeAngle.
  
In movement it's very different from guns. In gun you know a lot about enemy movement, and all you need to do is to select one firing angle. But in movement, you know only your own movement, and there bullets that hit you (or hit your bullets).  
+
In movement it's very different from guns. In gun you know a lot about enemy movement, and all you need to do is to select one firing angle. But in movement, you know only your own movement, and their bullets that hit you (or hit your bullets).  
  
 
Since you know only a little, if you are using a lot of attributes, the result may be very close to random, as those irrelevant attributes would take control. Instead, you may want to break attributes to some combinations, and combine the result later.
 
Since you know only a little, if you are using a lot of attributes, the result may be very close to random, as those irrelevant attributes would take control. Instead, you may want to break attributes to some combinations, and combine the result later.

Revision as of 17:23, 28 August 2017

SimpleBot Sub-pages:
SimpleBotVersion History - Understanding SimpleBot

SimpleBot is originally a bot created to test other bots, therefore everything is made as simple as possible. But soon I found myself in love with SimpleBot for its cleanness and simplicity. Then I decided to stay with SimpleBot, and always keep everything simple.

Gun

SimpleBot is using only one gun, which is a traditional kNN gun with gaussian kernel density. The attributes I use are BulletFlightTime, LateralVelocity, Acceleration, ForwardPreciseMEA, ReversePreciseMEA, TimeSinceDeceleration, and CurrentGuessFactor. Those attributes are the most useful attributes I've found in the past years, and they are also used by a lot of bots, etc. DrussGT, Gaff. Credit will give to Skilgannon in his great DrussGT/Understanding DrussGT, where I first see those attributes a few years ago.

In kernel density (which affects the performance a lot) I use max overlay area, say, I extend every recorded GuessFactor to a GuessFactor range, based on bot width at current distance, then see where they overlap the most. This is different from DrussGT, as I don't record precise bot width at wave intersection (being imprecise may decrease performance, but it's simple ;)). I use these approach as it's faster than iterating through every pair of two GuessFactors. And it's closer to robocode physics as well.

To eliminate the effect of irrelevant situations, I use gaussian distribution as weights and give the most weights to those within the average distance of the cluster. Cluster size is simply sqrt(totalSize), as this will make my gun a statistical gun when there's not so much data (when I don't know its movement well), and a pattern matcher when there's enough data. Using gaussian distribution greatly helps these process as well, as the average distance would be great when there's not so much precise match, whereas the average distance will be tiny when the situation is already faced a lot of time.

Currently I don't use any manual decay, as with so many attributes, it's already hard for a new situation to be the same as an old situation (and newer situations are easier to match newer situations, if its movement is adaptive), which works like some hash algorithm.

Movement

SimpleBot's movement is simple — it selects a few GuessFactors and try to avoid them. One is the most recent hit, the others are from trees, where one tree gives one GuessFactor.

Currently SimpleBot is using two trees in its movement, one is called SimpleTreeView, another is called NormalTreeView. SimpleTreeView uses three attributes, BulletFlightTime, LateralVelocity and TimeSinceDeceleration, whereas NormalTreeView is using BulletFlightTime, LateralVelocity, Acceleration, ForwardPreciseMaxEscapeAngle and ReversePreciseMaxEscapeAngle.

In movement it's very different from guns. In gun you know a lot about enemy movement, and all you need to do is to select one firing angle. But in movement, you know only your own movement, and their bullets that hit you (or hit your bullets).

Since you know only a little, if you are using a lot of attributes, the result may be very close to random, as those irrelevant attributes would take control. Instead, you may want to break attributes to some combinations, and combine the result later.