http://robowiki.net/w/api.php?action=feedcontributions&user=Badchicken&feedformat=atomRobowiki - User contributions [en]2022-12-04T01:22:47ZUser contributionsMediaWiki 1.34.1http://robowiki.net/w/index.php?title=Talk:Linear_Targeting&diff=18282Talk:Linear Targeting2011-01-29T03:44:35Z<p>Badchicken: </p>
<hr />
<div>{{CreditForOldWikiArticle<br />
| sectionname=Example of Noniterative Linear Targeting<br />
| oldpage=LinearTargeting/NanoLinearTargeting<br />
| author=[[User:Kev|Kev]]<br />
}}<br />
<br />
<br />
----<br />
<br />
I find the noniterative targeting 100% accurate aside from walls if you replace the 13 with a 10. I was fooling around with the code to try and make it more accurate, and I made a discovery!<br />
New code:<br />
<syntaxhighlight><br />
double absoluteBearing = getHeadingRadians() + e.getBearingRadians();<br />
setTurnGunRightRadians(Utils.normalRelativeAngle(absoluteBearing - <br />
getGunHeadingRadians() + (e.getVelocity() * Math.sin(e.getHeadingRadians() - <br />
absoluteBearing) / 10.0)));<br />
setFire(3.0);<br />
</syntaxhighlight><br />
Does anyone else get the same results? I hope so. If it does, I'll be... remembered! For a very small thing... But... But I'll be like, on a very small scale, like [[User:ABC|ABC]], like all of the "Robocode scientists", I will have made a discovery! I'll be so happy with myself! =')<br />
--[[User:Awesomeness|Awesomeness]] 22:39, 16 March 2009 (UTC)<br />
<br />
Also, I have found that if it remains 13, but the firepower is adjusted to 2.0, it is also 100% accurate.<br />
--[[User:Awesomeness|Awesomeness]] 22:43, 16 March 2009 (UTC)<br />
<br />
This isn't something new. In the formula the 13 represents the speed of the bullet. The original formula ''assumed'' a firepower in the general area of 2.33. For a firepower of 3.0 the accurate value is 11, and for firepower 2.0 the accurate value is 14. It probably should be mentioned alongside the code though but it's generally been assumed that people knew what the 13 was. See [[Robocode/Game Physics]] for more information. --[[User:Rednaxela|Rednaxela]] 23:39, 16 March 2009 (UTC)<br />
<br />
=( Oh well... lol --[[User:Awesomeness|Awesomeness]] 00:40, 17 March 2009 (UTC)<br />
<br />
<br />
Ok, this is kind of unrelated, but all you guys here are experts at trigonometry,and although I go to a VERY advanced school, I'm only 13, and I have a limited understanding. I am making a java application totally unrelated to Robocode. Say I have this scenario:<br />
<br />
I've made a dot that moves around with the arrow keys, but I want another dot to follow it. I've made the first dot move according to the arrow keys, and I could make the follower dot's movement simple, but I want it to move DIRECTLY towards the arrow key mover dot. To do this I need two things:<br />
<br />
-A method returning a double and taking parameters x, y, x2, and y2 giving the angle in radians between them in comparison to vertical. For example, if x and y are 0, 0 and x1 and y2 are 2, 2, then the angle you'd get is 2.35619449, or 135 degrees in radians.<br />
<br />
-A way to get the change in x and y when given an angle. It returns x and y and takes a double called angle. For example, if the angle was 90 degrees, (in radians, though, of course) then it would return 1, 0, if it was 180 degrees, it'd return 0, 1, and if it was 270 degrees it'd be -1, 0.<br />
<br />
Sorry if this is confusing... Someone help, please!<br />
<br />
: Well I don't know the exact wiki protocol, so I won't touch this page, but since is too unrelated I ''moved'' the conversation to your [[User_talk:Awesomeness | talk page]], and I will answer over there. --[[User:Zyx|zyx]] 01:22, 29 March 2009 (UTC)<br />
<br />
Do the formulas on the page take into account the time it takes for the gun to turn?<br />
If so, where? Thanks! {{unsigned:Badchicken}}<br />
<br />
: No, it does not. But normally we aim every turn, and mostly the gun can be aligned in one tick, thus it doesn't need to account for gun turn. --[[User:Nat|<span style="color:#099;">Nat</span>]] [[User talk:Nat|<span style="color:#0a5;">Pavasant</span>]] 00:34, 3 January 2011 (UTC)<br />
<br />
Could someone tell me the problem with the following code? My bot seems to always fire into a wall.<br />
<br />
<syntaxhighlight><br />
public void onScannedRobot(ScannedRobotEvent e) {<br />
// Replace the next line with any behavior you would like<br />
double gunHeat = getGunHeat();<br />
if(gunHeat==0){<br />
turnRight(Utils.normalRelativeAngle(e.getBearingRadians() + getHeadingRadians()));<br />
boolean asdf = false;<br />
double bTime = 0;<br />
double time;<br />
double baddieX = 0, baddieY = 0;<br />
double eventBearing = Utils.normalRelativeAngle(getHeadingRadians() + e.getBearingRadians());<br />
if(eventBearing<Math.PI/2 && eventBearing>0){<br />
baddieX = getX() + Math.sin(eventBearing)*e.getDistance();<br />
baddieY = getY() + Math.cos(eventBearing)*e.getDistance();<br />
}<br />
if(eventBearing>Math.PI/2 && eventBearing<Math.PI){<br />
baddieX = getX() + Math.cos(eventBearing-90)*e.getDistance();<br />
baddieY = getY() + Math.sin(eventBearing-90)*e.getDistance();<br />
}<br />
if(eventBearing>Math.PI && eventBearing<Math.PI*3/2){<br />
baddieX = getX() + Math.sin(eventBearing-180)*e.getDistance();<br />
baddieY = getY() + Math.cos(eventBearing-180)*e.getDistance(); <br />
}<br />
if(eventBearing>Math.PI*3/2 && eventBearing>Math.PI*2){<br />
baddieX = getX() + Math.cos(eventBearing-270)*e.getDistance();<br />
baddieY = getY() + Math.sin(eventBearing-270)*e.getDistance();<br />
}<br />
double predictX = baddieX;<br />
double predictY = baddieY;<br />
double predictAngle = 0;<br />
double angle = Utils.normalRelativeAngle(e.getHeadingRadians() - eventBearing);<br />
time = 0;<br />
a:while(time<400){<br />
if((angle>Math.PI/4 && angle<Math.PI*3/4) || (angle>Math.PI*5/4 && angle<Math.PI*7/4)){<br />
predictY += e.getVelocity()*Math.sin(e.getHeading());<br />
predictX += e.getVelocity()*Math.cos(e.getHeading());<br />
} else {<br />
predictX += e.getVelocity()*Math.sin(e.getHeading());<br />
predictY += e.getVelocity()*Math.cos(e.getHeading());<br />
}<br />
time++;<br />
bTime = (Math.sqrt((getX()-baddieX)*(getX()-baddieX)+(getY()-baddieY)*(getY()-baddieY)))/11;<br />
i:if(Math.abs(time-bTime)<1){<br />
if(predictX<0 || predictY<0) break i;<br />
asdf = true;<br />
break a;<br />
}<br />
}<br />
if(asdf){<br />
if(getX()-predictX>0 && getY()-predictY>0){<br />
predictAngle=Math.atan((getX()-predictX)/(getY()-predictY));<br />
}<br />
if(getX()-predictX<0 && getY()-predictY>0){<br />
predictAngle=Math.atan((getX()-predictX)/(getY()-predictY))+Math.PI/2;<br />
}<br />
if(getX()-predictX<0 && getY()-predictY<0){<br />
predictAngle=Math.atan((getX()-predictX)/(getY()-predictY))+Math.PI;<br />
}<br />
if(getX()-predictX>0 && getY()-predictY<0){<br />
predictAngle=Math.atan((getX()-predictX)/(getY()-predictY))+Math.PI*3/2;<br />
}<br />
turnGunRightRadians(-getGunHeadingRadians()+predictAngle);<br />
setFire(3);<br />
<br />
}<br />
}<br />
<br />
<br />
<br />
<br />
<br />
}<br />
<br />
</syntaxhighlight><br />
<br />
thanks!<br />
<br />
-[[User:Badchicken|-Badchicken]] 01:32, 29 January 2011 (UTC)<br />
<br />
== Problem with "Walls" only at the bottom wall? ==<br />
<br />
I wrote a bot that uses circular targeting, basically the same as written on the [[Circular Targeting]] page. Now I let my bot fight "Walls". It always wins, but I noticed that, when Walls is running along the bottom wall (only there), the algorithm doesn't seem to be accurate. It rather looks like head-on-targeting.<br /><br />
Since circular targeting should do the same as linear targeting in that situation, I tried the WaveSurfingChallengeBot B, and he's got the same problem versus "Walls". Okay, I know that the algorithm doesn't behave so nicely when the enemy is moving to a wall, but why does it just fail at the bottom wall then, and not at others?<br /><br />
Thanks in advance!<br />
<br />
Well Kenran, I suggest you try to output the iteration to the debug screen or to a file to see where it's going wrong. I think it's most likely the code thinks Walls is driving into a wall and cutting it off, or something. :) --[[User:Positive|Positive]] 20:05, 30 November 2009 (UTC)<br />
<br />
Thanks for your answer. I did some testing now, and I found out what the problem actually is. If the enemy is directly at the bottom wall, the enemyPosition that has to be calculated before is getting a false rounding, there enemyPosition.getY() is 17.99...<br /><br />
Substituting 18.0 by e.g. 17.9 fixes the code and Walls is being hit everywhere :-) Should I edit the page with that? --[[User:Kenran|Kenran]] 17:01, 1 December 2009 (UTC)</div>Badchickenhttp://robowiki.net/w/index.php?title=User:Badchicken&diff=18279User:Badchicken2011-01-29T01:41:07Z<p>Badchicken: Created page with 'I'm am more or less a beginning Robocoder...I'm mostly here to ask for help =P'</p>
<hr />
<div>I'm am more or less a beginning Robocoder...I'm mostly here to ask for help =P</div>Badchickenhttp://robowiki.net/w/index.php?title=Talk:Linear_Targeting&diff=18277Talk:Linear Targeting2011-01-29T01:32:55Z<p>Badchicken: </p>
<hr />
<div>{{CreditForOldWikiArticle<br />
| sectionname=Example of Noniterative Linear Targeting<br />
| oldpage=LinearTargeting/NanoLinearTargeting<br />
| author=[[User:Kev|Kev]]<br />
}}<br />
<br />
<br />
----<br />
<br />
I find the noniterative targeting 100% accurate aside from walls if you replace the 13 with a 10. I was fooling around with the code to try and make it more accurate, and I made a discovery!<br />
New code:<br />
<syntaxhighlight><br />
double absoluteBearing = getHeadingRadians() + e.getBearingRadians();<br />
setTurnGunRightRadians(Utils.normalRelativeAngle(absoluteBearing - <br />
getGunHeadingRadians() + (e.getVelocity() * Math.sin(e.getHeadingRadians() - <br />
absoluteBearing) / 10.0)));<br />
setFire(3.0);<br />
</syntaxhighlight><br />
Does anyone else get the same results? I hope so. If it does, I'll be... remembered! For a very small thing... But... But I'll be like, on a very small scale, like [[User:ABC|ABC]], like all of the "Robocode scientists", I will have made a discovery! I'll be so happy with myself! =')<br />
--[[User:Awesomeness|Awesomeness]] 22:39, 16 March 2009 (UTC)<br />
<br />
Also, I have found that if it remains 13, but the firepower is adjusted to 2.0, it is also 100% accurate.<br />
--[[User:Awesomeness|Awesomeness]] 22:43, 16 March 2009 (UTC)<br />
<br />
This isn't something new. In the formula the 13 represents the speed of the bullet. The original formula ''assumed'' a firepower in the general area of 2.33. For a firepower of 3.0 the accurate value is 11, and for firepower 2.0 the accurate value is 14. It probably should be mentioned alongside the code though but it's generally been assumed that people knew what the 13 was. See [[Robocode/Game Physics]] for more information. --[[User:Rednaxela|Rednaxela]] 23:39, 16 March 2009 (UTC)<br />
<br />
=( Oh well... lol --[[User:Awesomeness|Awesomeness]] 00:40, 17 March 2009 (UTC)<br />
<br />
<br />
Ok, this is kind of unrelated, but all you guys here are experts at trigonometry,and although I go to a VERY advanced school, I'm only 13, and I have a limited understanding. I am making a java application totally unrelated to Robocode. Say I have this scenario:<br />
<br />
I've made a dot that moves around with the arrow keys, but I want another dot to follow it. I've made the first dot move according to the arrow keys, and I could make the follower dot's movement simple, but I want it to move DIRECTLY towards the arrow key mover dot. To do this I need two things:<br />
<br />
-A method returning a double and taking parameters x, y, x2, and y2 giving the angle in radians between them in comparison to vertical. For example, if x and y are 0, 0 and x1 and y2 are 2, 2, then the angle you'd get is 2.35619449, or 135 degrees in radians.<br />
<br />
-A way to get the change in x and y when given an angle. It returns x and y and takes a double called angle. For example, if the angle was 90 degrees, (in radians, though, of course) then it would return 1, 0, if it was 180 degrees, it'd return 0, 1, and if it was 270 degrees it'd be -1, 0.<br />
<br />
Sorry if this is confusing... Someone help, please!<br />
<br />
: Well I don't know the exact wiki protocol, so I won't touch this page, but since is too unrelated I ''moved'' the conversation to your [[User_talk:Awesomeness | talk page]], and I will answer over there. --[[User:Zyx|zyx]] 01:22, 29 March 2009 (UTC)<br />
<br />
Do the formulas on the page take into account the time it takes for the gun to turn?<br />
If so, where? Thanks! {{unsigned:Badchicken}}<br />
<br />
: No, it does not. But normally we aim every turn, and mostly the gun can be aligned in one tick, thus it doesn't need to account for gun turn. --[[User:Nat|<span style="color:#099;">Nat</span>]] [[User talk:Nat|<span style="color:#0a5;">Pavasant</span>]] 00:34, 3 January 2011 (UTC)<br />
<br />
Could someone tell me the problem with the following code? My bot seems to always fire into a wall.<br />
<br />
<syntaxhighlight><br />
public void onScannedRobot(ScannedRobotEvent e) {<br />
// Replace the next line with any behavior you would like<br />
turnRight(Utils.normalRelativeAngle(e.getBearingRadians() + getHeadingRadians()));<br />
boolean asdf = false;<br />
double bTime = 0;<br />
double time;<br />
double eventBearing = getHeadingRadians() + e.getBearingRadians();<br />
double baddieX = getX() + Math.sin(eventBearing)*e.getDistance();<br />
double baddieY = getY() + Math.cos(eventBearing)*e.getDistance();<br />
double predictX = baddieX;<br />
double predictY = baddieY;<br />
double predictAngle = 0;<br />
double angle = Utils.normalRelativeAngle(e.getHeadingRadians() - eventBearing);<br />
time = 0;<br />
a:while(time<400){<br />
if((angle>Math.PI/4 && angle<Math.PI*3/4) || (angle>Math.PI*5/4 && angle<Math.PI*7/4)){<br />
predictY += e.getVelocity()*Math.sin(angle)/4;<br />
predictX += e.getVelocity()*Math.cos(angle)/4;<br />
} else {<br />
predictX += e.getVelocity()*Math.sin(angle)/4;<br />
predictY += e.getVelocity()*Math.cos(angle)/4;<br />
}<br />
time++;<br />
bTime = (Math.sqrt((getX()-baddieX)*(getX()-baddieX)+(getY()-baddieY)*(getY()-baddieY)))/11;<br />
if(Math.abs(time-bTime)<1){<br />
asdf = true;<br />
break a;<br />
}<br />
}<br />
if(asdf){<br />
if(getX()-predictX>0 && getY()-predictY>0){<br />
predictAngle=Math.atan((getX()-predictX)/(getY()-predictY));<br />
}<br />
if(getX()-predictX<0 && getY()-predictY>0){<br />
predictAngle=Math.atan((getX()-predictX)/(getY()-predictY))+Math.PI/2;<br />
}<br />
if(getX()-predictX<0 && getY()-predictY<0){<br />
predictAngle=Math.atan((getX()-predictX)/(getY()-predictY))+Math.PI;<br />
}<br />
if(getX()-predictX>0 && getY()-predictY<0){<br />
predictAngle=Math.atan((getX()-predictX)/(getY()-predictY))+Math.PI*3/2;<br />
}<br />
turnGunRightRadians(-getGunHeadingRadians()+predictAngle);<br />
setFire(3);<br />
<br />
<br />
<br />
}<br />
<br />
</syntaxhighlight><br />
<br />
thanks!<br />
<br />
-[[User:Badchicken|-Badchicken]] 01:32, 29 January 2011 (UTC)<br />
<br />
== Problem with "Walls" only at the bottom wall? ==<br />
<br />
I wrote a bot that uses circular targeting, basically the same as written on the [[Circular Targeting]] page. Now I let my bot fight "Walls". It always wins, but I noticed that, when Walls is running along the bottom wall (only there), the algorithm doesn't seem to be accurate. It rather looks like head-on-targeting.<br /><br />
Since circular targeting should do the same as linear targeting in that situation, I tried the WaveSurfingChallengeBot B, and he's got the same problem versus "Walls". Okay, I know that the algorithm doesn't behave so nicely when the enemy is moving to a wall, but why does it just fail at the bottom wall then, and not at others?<br /><br />
Thanks in advance!<br />
<br />
Well Kenran, I suggest you try to output the iteration to the debug screen or to a file to see where it's going wrong. I think it's most likely the code thinks Walls is driving into a wall and cutting it off, or something. :) --[[User:Positive|Positive]] 20:05, 30 November 2009 (UTC)<br />
<br />
Thanks for your answer. I did some testing now, and I found out what the problem actually is. If the enemy is directly at the bottom wall, the enemyPosition that has to be calculated before is getting a false rounding, there enemyPosition.getY() is 17.99...<br /><br />
Substituting 18.0 by e.g. 17.9 fixes the code and Walls is being hit everywhere :-) Should I edit the page with that? --[[User:Kenran|Kenran]] 17:01, 1 December 2009 (UTC)</div>Badchickenhttp://robowiki.net/w/index.php?title=User_talk:Badchicken&diff=18275User talk:Badchicken2011-01-28T23:31:58Z<p>Badchicken: </p>
<hr />
<div>{| width="100%" style="background: white; " <br />
| valign="top" width="60%" style="border: 2px solid #000; padding: .5em 1em; -moz-border-radius: 1em; -webkit-border-radius: 1em; border-radius: 1em" |<br />
'''Welcome!'''<br />
<br />
Hello, {{BASEPAGENAME}}, and welcome to [[RoboWiki]]! This place contains a wealth information about [[Robocode]], from [[Head-On Targeting|basic]] to [[Wave Surfing|more advanced]]. I hope you enjoy creating robots and being a robocoder!<br />
<br />
If you are posting a comment on this wiki, please [[wikipedia:Wikipedia:Signatures|sign]] your messages using four tildes (<nowiki>--~~~~</nowiki>); this will automatically insert your username and the date stamp. If you are not familiar with MediaWiki, these links might help you out:<br />
* [[wikipedia:How to edit|How to edit]] on [[wikipedia:|Wikipedia]], [[metawikipedia:Cheatsheet|Cheatsheet]] and [[metawikipedia:File:MediaWikiRefCard.pdf|Reference Card]] of MediaWiki on the [[metawikipedia:|Meta Wikipedia]].<br />
* [[RoboWiki:ReadMe|Readme]] page.<br />
If you need [[Help:Help|help]], check out the [[Robocode/FAQ|frequently asked questions]] or ask it on this page. Again, welcome!<br />
<br />
—— [[User:Nat|<span style="color:#099;">Nat</span>]] [[User talk:Nat|<span style="color:#0a5;">Pavasant</span>]] 00:29, 3 January 2011 (UTC) <br />
|}<br />
<br />
thanks for the info :)<br />
<br />
--[[User:Badchicken|-Badchicken]] 23:31, 28 January 2011 (UTC)</div>Badchickenhttp://robowiki.net/w/index.php?title=Talk:RobocodeRepository&diff=18018Talk:RobocodeRepository2011-01-02T20:47:06Z<p>Badchicken: </p>
<hr />
<div>Looks like Robocode Repository is a little outdated. The last update seems to be from 2006... [[User:Urgood2|-- Josh S]] 14:54, 30 April 2010 (UTC)<br />
<br />
Supposedly a new version is being worked on, but nothing has been heard recently. This robocode-developers mailing list thread [http://groups.google.com/group/robocode-developers/browse_thread/thread/a8b8fedb6998d591/6a4aea8a21dc37e7 here] probably gives the best synopses of the current situation with it. --[[User:Rednaxela|Rednaxela]] 16:00, 30 April 2010 (UTC)<br />
<br />
I can't seem to get to the site..., is the server down?</div>Badchickenhttp://robowiki.net/w/index.php?title=Talk:Linear_Targeting&diff=18017Talk:Linear Targeting2011-01-02T19:35:26Z<p>Badchicken: </p>
<hr />
<div>{{CreditForOldWikiArticle<br />
| sectionname=Example of Noniterative Linear Targeting<br />
| oldpage=LinearTargeting/NanoLinearTargeting<br />
| author=[[User:Kev|Kev]]<br />
}}<br />
<br />
<br />
----<br />
<br />
I find the noniterative targeting 100% accurate aside from walls if you replace the 13 with a 10. I was fooling around with the code to try and make it more accurate, and I made a discovery!<br />
New code:<br />
<syntaxhighlight><br />
double absoluteBearing = getHeadingRadians() + e.getBearingRadians();<br />
setTurnGunRightRadians(Utils.normalRelativeAngle(absoluteBearing - <br />
getGunHeadingRadians() + (e.getVelocity() * Math.sin(e.getHeadingRadians() - <br />
absoluteBearing) / 10.0)));<br />
setFire(3.0);<br />
</syntaxhighlight><br />
Does anyone else get the same results? I hope so. If it does, I'll be... remembered! For a very small thing... But... But I'll be like, on a very small scale, like [[User:ABC|ABC]], like all of the "Robocode scientists", I will have made a discovery! I'll be so happy with myself! =')<br />
--[[User:Awesomeness|Awesomeness]] 22:39, 16 March 2009 (UTC)<br />
<br />
Also, I have found that if it remains 13, but the firepower is adjusted to 2.0, it is also 100% accurate.<br />
--[[User:Awesomeness|Awesomeness]] 22:43, 16 March 2009 (UTC)<br />
<br />
This isn't something new. In the formula the 13 represents the speed of the bullet. The original formula ''assumed'' a firepower in the general area of 2.33. For a firepower of 3.0 the accurate value is 11, and for firepower 2.0 the accurate value is 14. It probably should be mentioned alongside the code though but it's generally been assumed that people knew what the 13 was. See [[Robocode/Game Physics]] for more information. --[[User:Rednaxela|Rednaxela]] 23:39, 16 March 2009 (UTC)<br />
<br />
=( Oh well... lol --[[User:Awesomeness|Awesomeness]] 00:40, 17 March 2009 (UTC)<br />
<br />
<br />
Ok, this is kind of unrelated, but all you guys here are experts at trigonometry,and although I go to a VERY advanced school, I'm only 13, and I have a limited understanding. I am making a java application totally unrelated to Robocode. Say I have this scenario:<br />
<br />
I've made a dot that moves around with the arrow keys, but I want another dot to follow it. I've made the first dot move according to the arrow keys, and I could make the follower dot's movement simple, but I want it to move DIRECTLY towards the arrow key mover dot. To do this I need two things:<br />
<br />
-A method returning a double and taking parameters x, y, x2, and y2 giving the angle in radians between them in comparison to vertical. For example, if x and y are 0, 0 and x1 and y2 are 2, 2, then the angle you'd get is 2.35619449, or 135 degrees in radians.<br />
<br />
-A way to get the change in x and y when given an angle. It returns x and y and takes a double called angle. For example, if the angle was 90 degrees, (in radians, though, of course) then it would return 1, 0, if it was 180 degrees, it'd return 0, 1, and if it was 270 degrees it'd be -1, 0.<br />
<br />
Sorry if this is confusing... Someone help, please!<br />
<br />
: Well I don't know the exact wiki protocol, so I won't touch this page, but since is too unrelated I ''moved'' the conversation to your [[User_talk:Awesomeness | talk page]], and I will answer over there. --[[User:Zyx|zyx]] 01:22, 29 March 2009 (UTC)<br />
<br />
Do the formulas on the page take into account the time it takes for the gun to turn?<br />
If so, where? Thanks!<br />
<br />
== Problem with "Walls" only at the bottom wall? ==<br />
<br />
I wrote a bot that uses circular targeting, basically the same as written on the [[Circular Targeting]] page. Now I let my bot fight "Walls". It always wins, but I noticed that, when Walls is running along the bottom wall (only there), the algorithm doesn't seem to be accurate. It rather looks like head-on-targeting.<br /><br />
Since circular targeting should do the same as linear targeting in that situation, I tried the WaveSurfingChallengeBot B, and he's got the same problem versus "Walls". Okay, I know that the algorithm doesn't behave so nicely when the enemy is moving to a wall, but why does it just fail at the bottom wall then, and not at others?<br /><br />
Thanks in advance!<br />
<br />
Well Kenran, I suggest you try to output the iteration to the debug screen or to a file to see where it's going wrong. I think it's most likely the code thinks Walls is driving into a wall and cutting it off, or something. :) --[[User:Positive|Positive]] 20:05, 30 November 2009 (UTC)<br />
<br />
Thanks for your answer. I did some testing now, and I found out what the problem actually is. If the enemy is directly at the bottom wall, the enemyPosition that has to be calculated before is getting a false rounding, there enemyPosition.getY() is 17.99...<br /><br />
Substituting 18.0 by e.g. 17.9 fixes the code and Walls is being hit everywhere :-) Should I edit the page with that? --[[User:Kenran|Kenran]] 17:01, 1 December 2009 (UTC)</div>Badchicken