Robo Home | BlackPearl | Changes | Preferences | AllPages

All of this information below pertained to Pearl when she was a PatternMatcher. Pearl is no longer trying that voodoo. This page is only here for historical purposes and the off hand chance that someone should find anything here remotely useful. -- |jim

As I have mentioned above, I seem to be off by a tick in my projection. Anyone have any hints or suggestions to provide?

Check if the RooseveltPMC page has some hint that could help you with this. If I recall correctly it had the same troubles a while. -- PEZ

For quite some time i was sure that i had a problem in my projection, but it actually turned out to be my matching. Problems i have encountered:

As hopefully a helping hand here is the code i use for my matching (it's probably not as efficient as it could be, but i'm not that fussy):

  public int findStartIndex()
        if(counter < MAX_SEARCH_INDEX) return -1;
        int currentVal = MAX_SEARCH_INDEX / 2;
        int nextVal = MAX_SEARCH_INDEX / 4;
        int bestVal = 0;
        int bestIndex = -1;
        int startIndex = -1;
        String search;
        while(nextVal >= 1)
            search = recentString.substring(MAX_SEARCH_INDEX - currentVal);
            startIndex = historyString.toString().lastIndexOf(search);
            if(startIndex > 0)
                bestIndex = startIndex;
                bestVal = currentVal;
                currentVal += nextVal;
                currentVal -=nextVal;
            nextVal /= 2;
        return bestIndex + bestVal;

it works by doing a binary search type process to find the actual length of the match. It seems to me at least to be fairly self explanatory (but i wrote it and understand my own sense of twisted logic). Feel free to use it, ignore it or laugh at it... Brainfade


I am having no luck so I am going to post this here in the hopes that some one else can see what I am missing. I think the error is in the projection part. I have cut out some of the movement and other parts that have no bearing on the targeting part. Cutting and pasting this into the robot editor and changing the package should result in a bot that fires (poorly). I have pretty heavily monitored the pattern creation portion and I am pretty sure that part is sound. I have also watched the pattern buffer, the match String and the projected movement String and they all seem to be OK. as far as I can tell the movement projection is good but if you pitch this bot against SpinBot it can not hit it very well. I guess what I am saying is that anything could be suspect.

Note: I know that the pattern matching as written here only matches the first instance of a found pattern in the movement buffer. I can get past this part if I can simply get it to match effectively against a simple periodic bot like SpinBot. I also know that it can spill off the end of the pattern as well.

** I cut out all the code here. If you want to see it the bot has been released OpenSource.

-- jim

If you initialize projX and projY to eX and eY and then change eX to projX in "projX = eX + Math.sin(baseHeading) * dist" (and the same for the Y) you'll see yourself hitting SpinBot in no time. You won't see yourself BEATING SpinBot when standing still and firing 0.5-power bullets, though. I also changed "if (getGunHeat() <= getGunCoolingRate?())" to getGunCoolingRate?()*2 and took out the waitFor call, and that helps against PatternBot (which I assume you're trying to beat, too, since you have a stationary pattern-matcher firing 0.5-power bullets. Of course, some of your other problems, like accounting for new rounds and stuff, are going to have to go in there to beat PatternBot probably. -- Kawigi

I think you'll find it hard to judge the projection accuracy if you only use a 10 tick match. LeachPMC used 600+ ticks. Then when you have gotten a good index against PatterBot? you can lower the match length since no real bots should show such predictability. -- PEZ

...and few bots are doing the same thing internally for 600 ticks (except for ones called "SpinBot"). -- Kawigi

Kawigi You are a genious. It is so obvious once you pointed it out. Thanks for looking at it. It is not perfect in its matching vs. PatternBot but it is very close now. Now to tighten up some lose ends and see if I can get over the %100 mark in the PMCIndex. PEZ what I am really after is the chance to do a PM gun and more importantly see what can be done to exploit them. Starting small against predictable bots points out errors in my approach. I am hoping to learn a few things during this excercise that can translate into a Jekyl that is harder for a PM bot to hit. I think I have found one thing already. More to come later. I would also like to note that Pearl can not be called a SlowBot even though it is doing Pattern Matching. I am getting 1600+ FPS minimized on my trusty Think Pad 600. We will see how it goes once I start handling more than one match at a time. Even if I cut my frame rate in half I will still be more than pleased. -- jim

Of course, you're also catching indexing exceptions instead of preventing them. Granted, though, you're probably not throwing nearly as many as Fhqwhgads used to. -- Kawigi

There's something wrong with BlackPearl's energy management or something. Sometimes it just stops shooting. This makes it outsurvive Gouldingi with some margin since Gouldingi can't hit BlackPearl very much. But G still wins the battle because BP doesn't collect enough bullet damage points. See if you can fix that before tobe runs the last minibot challenge and you might have the bot that takes Gouldingi's top 10 qualifying spot. -- PEZ

PEZ, Do you know which version? The .50 version had a huge skipped turn problem that caused me to miss events. When you are shooting and turning your radar in an onScannedRobot event that is not good. The .51 version should address this. If it does not I will need to look further. -- jim?

PEZ, Upon further review I see it in the .51 version too. Thanks for the heads up. -- jim

I tracked this problem down. It looks as if I forgot to check in a change before I built the jar for upload. As I have an Ant task that does the build, including a CVS checkout, I got an old version in the upload. That means the version you are working with has a pattern buffer of over 20K chars to sift through. That makes Pearl incredibly slow and skip turns badly. I am away from my CVS source right now but will upload a new version some time this afternoon (4:00PM EST). Thanks again for the catch. -- jim

PEZ, I have uploaded .52. This should correct the non-firing problem. Unfortunately firing expends energy and survival is no longer my strong suit =^> Hope it gets fixed in time for the challenge. -- jim

It seems to be beat my new Tityus in any case. Hope I am lucky and can avoid BlackPearl in the final MiniBotChallenge. =) -- PEZ

I find that encouraging. I am also happy to see that it has not made the SlowBot list. =) jim

Robo Home | BlackPearl | Changes | Preferences | AllPages
Edit text of this page | View other revisions
Last edited December 7, 2003 5:31 EST by Sparafucil3 (diff)