Code mods

Jump to navigation Jump to search
Revision as of 20 March 2013 at 18:43.
The highlighted comment was created in this revision.

OK, I've looked over the code. Even on a regular compiler you should be able to get this under 250, just use the gun with the hard-coded distances, then make chancesOfReversing final, since you aren't changing the contents anywhere.

However, with my tuned compiler/shrinker setup, I have this bot down to 237 bytes.

I'm using Jikes as a compiler, and then I post-process the .jar with ProGuard to shrink another 1 to 4 bytes off.

I modded the first gun to also take distance into account on everything except the match position and added setAdjustGunForRobotTurn(true);, after compile and shrink it is a healthy 249.

Here it is: [1]

    Skilgannon22:27, 19 March 2013

    Huge thanks.

    Using a hard-coded distance in the pattern reconstruction was the main accuracy issue. Now that that's fixed, I think the 5 bytes required for the setAdjust would be better spent on Miked0801's char based energy monitoring.

    I've decided to make this bot separate from Epeeist; and release it under the package sheldor.jk.nano. Any ideas for the new name?

      Sheldor23:39, 19 March 2013

      char based energy monitoring? What advantages does it offer?

      For names, how about Cutlass or Yatagan?

        Skilgannon09:01, 20 March 2013

        Ah, I see, using the unsigned property to wrap negative numbers so you don't need an extra comparison! Smart! Ok, that is in, total codesize 247 =) I just need your input on a name, and we're ready to go! Although, I think the whether-to-reverse decision could be improved by using a bigger divisor and different values in chanceOfReversing.

          Skilgannon09:41, 20 March 2013
           

          How's "Sting" for a name? It's small, blue, and extremely painful. :) If that's already taken, the Kukri is another great small sword/large knife. But, if you don't like either of them, go ahead with "Yatagan;" I like the sound of it.

          How's this for a description?
          <botname> v1.0.0 by Sheldor and Skilgannon. 03/20/2013
          <Short description of namesake>
          Codesize: 247 Bytes without any colors.

          You're probably right that using different reverse probabilities would help against certain bots, but that sounds like a lot of hand-tuning, so let's save that for the next version.

          Once you've packaged it, go ahead and add it to the literumble, and then post the source code on the wiki, under <botname>/Source.

            Sheldor14:25, 20 March 2013

            Think I'll go with Yatagan, I'll package when I get home. Although I found a bug in the one optimization I did, so I'm going to have to find something else to shrink, it is at 251.

              Skilgannon14:33, 20 March 2013

              I might've found something to shrink. Here it is:

              Change the chancesOfReversing to 30, 15, and 0; and then, change this line from:

              direction *= (chancesOfReversing.charAt(deathCount) - (2 * Math.random()));
              

              to:

              direction *= (chancesOfReversing.charAt(deathCount) / integer - Math.random());
              

              I didn't compile, so I don't know if it will work.

                Sheldor14:53, 20 March 2013
                 

                That will be integer division, so won't give fractional results. I'll find something though.

                  Skilgannon15:13, 20 March 2013
                   

                  One byte down, one to go!

                    Skilgannon17:27, 20 March 2013
                     
                     
                     
                     

                    Uh oh, I'm getting a StringIndexOutOfBounds exception. Did you do something to the PM string?

                      Sheldor01:15, 20 March 2013

                      Ah, forgot to increase the minimum look-ahead distance for the PM, now that it isn't limited to 14 ticks of history. Fixed.

                        Skilgannon08:11, 20 March 2013
                         

                        So is user1.user2.* the "new hotness" naming style for collaborative bots instead of wiki.* ? Or is it a subtle distinction between specific team-ups and totally wide-open bots? I kind of like the wiki package, though I also kind of thing it should be 'robowiki'. (I put RoboRunner in 'robowiki.runner' package.)

                          Voidious20:43, 20 March 2013