[Home]FloodGrapher

Robo Home | Changes | Preferences | AllPages

/FirstVersion /Design (if anyone cares) /TroubleShooting


FloodGrapher 2.0 is now released! Here's a screen shot of the released version on my computer:

Download it from the RobocodeRepository: http://www.robocoderepository.com/BotDetail.jsp?id=2027

Versions since FloodGrapher 2:

About FloodGrapher 2.0:

FloodGrapher is a graphing utility to help people optimize their movement against GuessFactorTargeting.

The roots of FloodGrapher

The first FloodGrapher was a hack to look at the data files saved by FloodMini 1.3. I originally made it to both debug FloodMini's gun and FloodHT's movement. I made small changes to it a few times, Jim started using it, and eventually I released a version that has since become probably more widely used than Iiley's SmogPainter, and became the base of PEZ's RoboGrapher. It was sloppily coded and not really meant to do anything besides read FloodMini's data, but the options available made it one of the most useful robot development tools available. The main disadvantage as it gained usage is that FloodMini became "The Test Bot" - every new robot would spend thousands of rounds fighting FloodMini before even being tested against other bots, which meant that many bots were somewhat optimized specifically against FloodMini, which doesn't do much for FloodMini's ratings :-p.

Version 2.0

This is the version of FloodGrapher that is meant to be used. As useful as the original was, it wasn't really written to be used by other people, and it lacks extensibility. The new graphing utility was completely written from the bottom up as basically a new program under the same name (but a different package), and it will hopefully grow to become the ultimate Robot development utility (and won't be bound to FloodMini, so hopefully people will stop releasing bots that beat it. Fat chance, eh?)

Installation

To install FloodGrapher, just extract it into your robot directory. It will extract most of its files into kawigi\tools\ and kawigi\resource\, and then it will leave a .sh file and a .bat file in the robot directory to run the program. The startup files assume that robocode.jar and codesize.jar are in the parent directory of the robots directory where FloodGrapher was extracted, so if that's not the case, you'll have to change the script you use.

Support for Multiple Graphs

Any number of graphs can be displayed on the new FloodGrapher at the same time, on top of each other. These graphs could be on different segments and come from different bots.

Extensibility / Plugin support

This version was also made with extensibility in mind. It has a plugin interface which can be made to make it open files saved by other robots. All you need to do is write a class that manages the UI for each segmentation axis and one to open the file and convert it to a data object (which mostly involves converting the data into a multi-dimensional array of doubles and saying what order the segmentations are in by creating the other objects). I suspect it will take about 30 minutes to an hour for most people, depending on how familiar they are with Swing components and GUI design. I recommend taking a look at how I did it with FloodMini to help you get started. Hopefully, a lot of people will write modules for it, while they're at it.

Aside from file formats, there is also a plugin interface for the GUI, allowing people to write useful little tools and integrate them with FloodGrapher.

A New Robot

A new robot (which has been designed but not yet written) will come with the grapher and will probably be the most readily configurable robot ever written. It will have a config file that can be used to change distancing, movement, energy management, and data segmentation. New segmentations, movements, and power management schemes can be written and added to the robot without changing or recompiling the robot. They are configured by editing the robot.ini file in its data directory, using /FloodScript, FloodGrapher's configuration "language".

Other utilities?

There is room for more modules and utilities to be built into FloodGrapher. Included with it currently are:

In the future, I could see such expansions as:

Please feel free to give suggestions, ask questions, etc. here on the wiki.

A Request

Now, I have one simple request for those that have used FloodGrapher and will use this one - please contribute! If you're testing and you write your own file format classes for your own robots, send them over. If you have an idea for a GUI module, try writing it and send it my way for the next release. If you find little problems, report them, or even fix them yourself and tell me how you did it. If you're experimenting with new segmentations, submit them for the next release. Many such things could be added with very little effort, just as you see the need for them.

On a side, just because I'm curious, let me know if you've used it and what robots' movement has somehow been a product of FloodGrapher, maybe on a page like /Users?.


Comments / Questions

What can I say. This might be the most useful fat client tool for us bot makers sinse RoboLeague! Thanks for giving all this time away to us for free. -- PEZ

Very nice! I am using it right now to desgn my next MX movement. :-) I'll release a self-graphing tool to go with it in a few days time (it'll probably use the Flood 1.4 data format though... lazy. :p ) -- Jamougha

Will it use the same segmentation as FloodMini 1.4? -- Kawigi

Wow, this is the first tool I've been able to get to work to help test bots. This is awesome. Hmm, Immortal's movement isn't THAT bad. -- Alcatraz

Yes, for now at least. Although I may use a much less strict wall approach segment. If I change the segmentation then I'll write my own plugin. (It might be cool to have one segment represent waves, and another real bullet hits, so you can see if a bot is picking up on a segment or not...) -- Jamougha

Hmmm... I was thinking about building an option like that into the FloodGrapher robot, too. -- Kawigi

The Repository did something screwy with it, so I uploaded it again and updated the link at the top of the page. I also took the liberty of making a couple minor bugfixes. -- Kawigi

I'm trying to make a fileformat plugin for Recrimpo, and have reached the limit of my java knowledge. I have my stats in an int array, you want it in a double array, and apparently:

"An expression of type "int[][][][]" cannot be cast into type "double[][][][]""

Do I have to use nested for loops and convert each int separately, or is there a better way? Thanks. -- Tango

Second question: When adding the different segments to the scheme, do you just ignore the GF segment? If so, does it do the conversions from indexes to GFs automatically? -- Tango

Added Narcissus to the repository. Tango, I think you're supposed to create your own plugin for Recrimpo. No idea how that works, though. :-) -- Jamougha

Yes, I know, that's what I'm trying to do. I've got everything done, except for the converting to doubles bit. I could do it using for loops, but that would be very ugly, so I would like to avoid it if possible. -- Tango

What's ugly about using loops? I think it's the only way to do this, but you might find methods to use in the Arrays class. Look it up in the JavaAPI. -- PEZ

I've gone and done it using for loops for now, but have 2 problems. 1) It won't let me select the top option for any of the segments (after i've select something else) 2) It doesn't display the graph, which is something of a major flaw. I've just modified the segments that came with it, so I can't see anything that would cause problem 1, and I can't think of anything that would cause problem 2 either. -- Tango (PS You can download it here:[1])

Yeah, you need to basically copy your array into an array of doubles if you save an array of ints. Look at FloodMini14Format?.java tp see a good general-purpose way to do it. And your assumption is correct that you don't need to put a segmentation in your scheme for the guess factors, because I want to have an array left to display. About it not displaying - it displays fine for me, but it won't actually show up until you generate an event (hit the refresh button or change one of the selection boxes or something). I suppose this is a sort of weakness that I should address. Another is that it throws a null pointer exception if no segments are selected. But on that note, it appears to be throwing that exception in your velocity segmentation if I try to select segments with velocity more than 3 or something. As far as not letting you select the top option, I only see that with max distance, which should never be 0 anyways (and it looks like you can't select it because when you do it gets that NullPointerException). So stuff for me to fix here, too... -- Kawigi

Strange... you're seeing different things to me. I've tried refreshing it, etc. and it still displays nothing, and I can't select any of the top options. I guess I'll do some more testing, and look more closely at the CLI. -- Tango

It's displaying fine now... strange... it is throwing a lot of exceptions, I need to look into that... thanks for your help. -- Tango

It seems the grapher isn't receiving any data. The data is definitely there, because it get's displayed sometimes, and the only stuff my code does is sort out the segmentation, so I can't see how anything I've done could make graph.getData() return null, yet your graphs work fine, which indicated your code works. It's all confusing me... I'll look again tomorrow when I'm less tired. -- Tango

But mine also get the NullPointerException in rare cases - but only if you pick a maximum distance or BFT segmentation that is less than or equal to the minimum. As far as what causes problems with your other segmentations, I'm just not sure what's going on :-\ -- Kawigi

Has anyone else had a go at this yet? Tomorrow I will make a plugin for Falcon (i'll have to add saving to it), that should be as simple as I can get. Start simple, and work up, is one of the best ways to find where it goes wrong. -- Tango


Any body intrested in BeanShell? script implemented in FLood grapher. If more people intrested in that I can code it when I have time. -- SSO?

What kinds of things do you think it would be useful for? -- Kawigi


Hrm, I haven't had a good look at this yet, do you think it's possible to write a weakest segment finder that runs all the possible segment combinations and shows you your top 5 or whatever weakest segments (or all segments with peaks more than some threshold above your all segments graph)? -- Kuuran

Should be easy. I'm not sure how FloodGrapher does it all, so I'm not sure, but nested for loops to check each segment, and use the peak hit rate that it already calculates, and find the max. I'll look into it this evening, if no-one's got their first. -- Tango

Yeah, I think that's something worthwhile in the next version - the problem is that it will normally come up with segments that have very little data in them or something. With the stats from FloodMini and FloodGrapher, I can figure out how many samples are in there, but with robots using rolling averages, this isn't as obvious. -- Kawigi

That's not too big of a problem, just something to be aware of when analyzing the data it gives you. Or you can always include a threshold for minimum number of samples when it's available (just have rolling average guns fill whatever method is called to determine number of samples with return -1; and add a case). For that matter, is there some reason the new grapher doesn't tell you how many samples the results you're looking at are from when the data is available? It's a bit disconcerting to not be sure whether the huge spike I see in many top movements with this new segment is just because it's a barren segment or because I can nail people hard with it.. -- Kuuran


For a segment I want to plug into FloodGrapher I need information about bullet hits on the opponent, is there any way to get at this? -- Kuuran

I'm not sure I understand, can't you use the onBulletHit?() method? -- Tango

% time spent in this segment would be very helpful. No sense in trying to flatten a segment that only occurs on one or two ticks in a 100 round battle. :-) --David Alves

@Tango - yeah, but onBulletHit? requires that you modify FloodGrapher.

@Kuuran - make up a solution and I can add it to the next version. -- Kawigi


Ok, so Im an idiot, how do I make this work? I assume I need to run a battle between my robot and some FloodGrapher test bot, but since I cant find this bot, I am not really sure how it works... -- Jokester

Ok, so using FloodGrapher might not be the easiest thing, but it beat the hacked-up version that people were using before that ;-)

FloodMini 1.4 is a fine test bot with a FloodGrapher plugin (but it's not necessarily accurate, since it fires waves every scan). The preferred way it to use kawigi.tools.FloodGrapher, which comes in the zip file with the grapher. Just unzip the zip file in your robots directory, and run it from there, and the robot should be there. -- Kawigi

THIS IS AMAZING! I searched for something like this before, since I figured someone had to have made it, but never found it! Nice. But I don't know how to use it. I unzipped it into my robots directory, changed the .bat file to point to the new location of the robocode jars, and double-clicked the bat file. Now it's just sitting there, looking like it should be running but not showing anything. -- Simonton


Robo Home | Changes | Preferences | AllPages
Edit text of this page | View other revisions
Last edited August 24, 2007 14:47 EST by Voidious (diff)
Search: