Archived talk:User:Darkcanuck 2008-01-07

From Robowiki
Jump to navigation Jump to search
       Archive        This is an archive of past discussions. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page.     

Heya, welcome to the RoboWiki! Care to tell us a bit about yourself and/or your bots? Nice handle, by the way. I'm originally from Buffalo - that almost makes us neighbors, eh? =) Feel free to ask questions, I think it's generally a pretty open and helpful community. Cheers, -- Voidious

Thanks for the welcome. I'll fill in this page with a bit more about me and create a page for Leon shortly. I do have a burning question though: I added Leon to the melee rumble yesterday and he appears to be doing very poorly. Almost as if he's throwing an immediate exception or being disabled by the robocode engine. I've done a lot of testing in my local client (using the packaged jar) and can't reproduce the problem. Anyone know what's going on or how I can debug a rumble-specific problem? -- Darkcanuck

Just wondering, is your bot compiled 1.5 compatible? That might be the problem. -- Skilgannon

I had problems running RoboRumble (probably from incompatible bots) on my Mac under Java 1.5 so I actually run it using the SoyLatte BSD port of Java 1.6. But everything's compiled with the default 1.5 javac. Hmmm, I'm just testing a battle under using 1.5 and the skipped turn count is pretty bad - maybe the Rumble client is more sensitive to turn length? -- Darkcanuck

  • For what it's worth, the rumble client uses the same Robocode engine and configuration, so it shouldn't be any more sensitive. You can run from your RoboRumble directory and run battles in that same space to check into issues like this. -- Voidious
  • I'm running from my robocode directory -- I only have one installation of version 1.5.1 and do all my testing with that. -- Darkcanuck

Yeah, that could be it. If your bot goes 5 seconds without calling execute(); it gets disabled. See if you can optimize any of your functions, particularly things that are in nested loops. As another trick, Math.sqrt(x) is faster than Math.pow(x,0.5), and x*x is MUCH faster than Math.pow(x,2). -- Skilgannon

  • Nice tip! My only Java experience is from robocode, so I didn't know about that. Should speed up my NN code, which is where Leon spends most of his time anyway. I may whip up a 1.01 version with this change, see if that helps. Do you know if Point2D.Double's distance() function has similar performance issues? -- Darkcanuck
  • Well, it's always preferable to compare squared distances (ie. distanceSq() ). But beyond that it's just calling Math.sqrt(), AFAIK. The main place where it's important to increase speeds in in the nested loops. Caching results for distances that you use more than once is another good technique. Calling sqrt() isn't going to make your bot a SlowBot unless you are calling 500+ per turn. But my opinion of a SlowBot may not be everybody else's =) -- Skilgannon

I will try running your bot in a melee battle when I get home and I'll let you know if I see any problems. I'm also on a Mac, using the default Java 1.5. I see that GrubbmGait is currently running his melee rumble client (we really should more prominently link this Who's Uploading Now page), so maybe he'll see this and be able to test your bot on his system, too, as it seems likely those results are coming from him. -- Voidious

  • I ran a melee rumble client overnight a few days ago, so I think many of those battles are from me. Interestingly, there are a few cases where Leon won, just nowhere near enough to pull him out of the basement. -- Darkcanuck
  • I started my client about 13:30 GMT on January 4th, and at seems that Darkcanuck gives no problems on my system. Maybe I can run some 'dedicated battles' to counteract on your about 8 bad battles. -- GrubbmGait
  • Thanks, the last 300+ battle results are closer to my expectations. Which means its my rumble client causing the problem. I'll try a dedicated rumble install, see if that helps. -- Darkcanuck
    • I checked and it is indeed your client. There are some more bad results for f.e. Fermat and Hatamoto. Please check if your has enough memory preserved (384 or more). -- GrubbmGait
    • It indeed is strongly advised to have separate installs for the rumble and own development. On one install there must only run one thing at the time. If you have the power to run f.e. a one-on-one and a melee rumble at the same time, they should run in separate installs. -- GrubbmGait
    • Ah, the RAM is a good point. I think the defaults to 512 and the defaults to 256. That could definitely make the difference for a neural net bot, I'd think. By the way (if you didn't know already), feel free to post a new version once you're confident in your RR client posting good results. You may not have seen many new versions posted recently with the holidays and all, but it's definitely commonplace to release new versions frequently. Good luck! -- Voidious
    • I already had all of my scripts set to use 512M memory, so that's not the issue. Set up a fresh install of 1.5.1 and RoboRumble still dies under OS X. I'm hesitant to run any more sessions using SoyLatte if its creating bad results for other bots too. Leon 1.01 is out, sped up some NN code with Skilgannons' tips. -- Darkcanuck
      • I used 1.4.7 for meleerumble and upgraded today to 1.4.9 (on WinXP though). Maybe that version is more stable on OS X. -- GrubbmGait
      • I'm actually still using 1.4 for the RoboRumble. It seems anything past 1.4.4 or so throws some weird exceptions on my Mac (for the rumble, but not for Robocode). I haven't tried anything past like 1.4.9, I don't think. -- Voidious
    • Ok, so I've compiled Robocode 1.4(.0) and the rumble seems to work ok under OSX. Is there anything I should watch out for before uploading results? I don't mind corrupting Leon's results, but don't want to harm anyone else's. -- Darkcanuck

For what it's worth, I am also getting some minor skipped turn problems, dwarfed by a missed scan problem (turn passes without new info). I get about 2 of the former and a dozen or more of the latter every round, on average. I've recently done a major rework of my bot though, so I am inclined to suspect my code. I am using Java 6, compiling with 1.5 compliance, and using Robocode 1.5.1. I noticed a pretty precise value for the CPU constant in the config file. Is there a way to override that so nothing times out (for testing purposes)? -- Martin

  • You can edit the file and fill in a larger value for it. The only drawback is that it will run slightly slower (when minimized). -- GrubbmGait
  • I've tried doubling the cpu constant and it helped a bit with skipped turns during some of my debugging. I haven't noticed any missed scans, although I haven't been looking for them specifically. -- Darkcanuck
  • The missed scans problem is a coding error, as I expected. Upping the cpu constant to 4 billion has removed the skipped turn issue for now. -- Martin

Did I mention that I'm happy to see Leon stabilize in 36th place? Just what I was hoping for, a top-40 result. -- Darkcanuck

There are no threads on this page yet.