http://robowiki.net/w/index.php?title=Infinity/Understanding_Infinity&feed=atom&action=historyInfinity/Understanding Infinity - Revision history2024-03-28T13:30:13ZRevision history for this page on the wikiMediaWiki 1.34.1http://robowiki.net/w/index.php?title=Infinity/Understanding_Infinity&diff=37399&oldid=prevMultiplyByZer0: MultiplyByZer0 moved page Melee Strategy/UnderstandingInfinity to Infinity/Understanding Infinity: Make it a subpage of the bot2017-08-09T19:29:25Z<p>MultiplyByZer0 moved page <a href="/wiki/Melee_Strategy/UnderstandingInfinity" class="mw-redirect" title="Melee Strategy/UnderstandingInfinity">Melee Strategy/UnderstandingInfinity</a> to <a href="/wiki/Infinity/Understanding_Infinity" title="Infinity/Understanding Infinity">Infinity/Understanding Infinity</a>: Make it a subpage of the bot</p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 19:29, 9 August 2017</td>
</tr>
<!-- diff cache key wikidb:diff::1.12:old-14734:rev-37399 -->
</table>MultiplyByZer0http://robowiki.net/w/index.php?title=Infinity/Understanding_Infinity&diff=14734&oldid=prevMiked0801: First pass Infinity tutorial2010-02-01T20:05:15Z<p>First pass Infinity tutorial</p>
<p><b>New page</b></p><div>[[Infinity]] was my best nano melee bot for a long time until I shrank [[DustBunny]] enough to improve its aim. It's general strategy is to immediately run to an edge (hopefully a corner, but any edge is fine) and then move in a box pattern. I'll go into the details below.<br />
<br />
=== Classes ===<br />
[[Infinity]] is a nano - 99% of its code is in the onScannedEvent:<br />
<br />
=== Functions ===<br />
OnDeath clears the radar minimum scan distance to help with new battle target aquisition.<br />
OnHitWall resets my movement length. This is how I know when I'm on the edge of the battlefield instead of ramming someone.<br />
OnScanned is the rest.<br />
<br />
=== Globals ===<br />
* <tt>movement</tt> How far to travel each leg of the square. Set huge to begin with to hit a wall.<br />
* <tt>lastHeading</tt> wasting space here.<br />
* <tt>lastTarget</tt> Name of the closest scanned robots. How I know who to aim at when it comes time to lock.<br />
* <tt>lastDistance</tt> Closest robot to me this scan.<br />
<br />
=== Radar ===<br />
InfiniteRadarLock when gunHeat is > 1, locks onto lastTarget when less than 1 so our aim is good. Resets lastDistance upon firing to make sure we are aiming at the closest bot.<br />
<br />
=== Gun ===<br />
<pre><br />
setTurnGunRightRadians(robocode.util.Utils.normalRelativeAngle(absoluteBearing - getGunHeadingRadians() + <br />
Math.max((1 - e.getDistance() / (GUN_FACTOR+100)),0) * <br />
Math.asin(e.getVelocity() / 11) * Math.sin(e.getHeadingRadians() - absoluteBearing) )); <br />
</pre><br />
<br />
Basically, the closer to our target, the closer to a 1.0 guess factor we use. GUN_FACTOR is 500 so, at distance 0, full lead, at distance 600 and beyond, 0 lead. Assume full power bullets (11), so we tend to fire higher at higher guess factors than you would expect due to energy management.<br />
<br />
=== Energy Management ===<br />
Fire based on your own energy level divided by the distance to target. Basically, fire hard when you have energy, conserve if you do not, don't fire at opponents > 500 pixels. I've tested adding a 0 energy check, but it hurts my score.<br />
<br />
=== Movement ===<br />
Run to an edge, then move in a 90 degree box psattern. The exact length of each leg is very important! The area you traverse must be large enough that Head on Targeting has very low hit ratio while small enough that full linear/circulr targeting will be fooled as well. But! You must also make sure the length of each leg isn't too big as it will draw fire from more robots as well. Triangles work well, but have a higher chance of moving directly at an attacking bot (bad), More corners than a square make you traverse too large an area and makes you a target of opportunity too often and makes it more difficult to dodge linear/circular aim.<br />
<br />
==== Overall thoughts ====<br />
[[Infinity]] does well because its movement defeats head on targeting, linear/circular targeting at beyond 200ish range, and because it locks onto the highest threat it can find (the closest person!) It also does not fire at an enemy unless it had a decent chance of hitting - this version I believe that range was around 500ish. That change, while hurting my overall bullet score, boosts me way up in overall score. It only works though if he's the only one doing it. When 2 or more bots do this, the bonus in suriving is lost.<br />
[[Category:Tutorials]]<br />
[[Category:Strategy]]</div>Miked0801