Difference between revisions of "Archived talk:User:Nat 20090620"

From Robowiki
Jump to navigation Jump to search
m
 
(No difference)

Latest revision as of 04:51, 8 October 2009

       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.     
Archived Talk:
Nat2009/04/06 - 2009/06/20

Old discussion archived, page is a lot smaller. » Nat | Talk » 11:12, 6 April 2009 (UTC)


Why I can't download robot from repository with my Firefox? I can download with IE, but my download manager is linked with Firefox. » Nat | Talk » 06:56, 11 April 2009 (UTC)

It works fine in Firefox here, to me it sounds like your download manager might be the issue. --Rednaxela 14:47, 11 April 2009 (UTC)

It's FlashGet via FlashGot. Just look at raw HTTP request sending, it actually work, but Firefox deesn't open its download windows :-( Saw some interesting header:

HTTP/1.1 302 Moved Temporarily

... which should be ...

HTTP/1.1 302 Found

... instead. This may course error I think. (also typo in header) » Nat | Talk » 15:33, 11 April 2009 (UTC)


(Is there any general discussion page?)

Just want to know, are there any female robocoder? (Don't count Martin's Family here) » Nat | Talk » 08:28, 11 April 2009 (UTC)

For a time Chase-san's sister was robocoding, also I mentioned robocode to one female friend and recently she started toying with it a little, but I'm unsure if it'll hold her interest for long or if she'll become involved with the robowiki comunity --Rednaxela 14:47, 11 April 2009 (UTC)

This mean none of you are female, right? In fact, I mentioned robocode to a lot of people in Thailand. Guys seem interest, but girls never ever interested :-( Anyway, I still can't bring any Thai to robocode community, or even start programming AdvancedRobot (they stuck with Robot) (until I finish translate Thai RoboWiki I think) » Nat | Talk » 15:33, 11 April 2009 (UTC)


Hi, can I correct the grammatical mistakes on your user page? --HUNRobar 16:09, 26 May 2009 (UTC)

Yep, please do. I written it in a time when I don't really good at grammar, and I'm lazy to correct it later. Thanks. » Nat | Talk » 09:05, 27 May 2009 (UTC)

Thank you very much! I didn't even realize how much the mistake are there! I realize that you make 2 mistakes, which I fixed. I also realize that you fix the thing that commented out too! » Nat | Talk » 14:46, 27 May 2009 (UTC)

And "how much the mistake are there" should be "how many the mistakes are there" just so you know. Since "much" and "the mistake" are used for singular things, and "are there" is plural, and plural is what you meant :) --Rednaxela 15:02, 27 May 2009 (UTC)
Ahh! Thanks for pointing. Please do this again when you notice it. I need to improve my English grammar skill because Thai grammar is completely difference thing. » Nat | Talk » 15:24, 27 May 2009 (UTC)
Err, I wasn't looking and made a typo, "how many mistakes are there" is what I meant, that "the" doesn't belong in plural :) --Rednaxela 15:47, 27 May 2009 (UTC)

Yes, I didn't realise that it was commented out, I just checked every pieces of texts. :) --HUNRobar 14:52, 27 May 2009 (UTC)

The Wisdom of Crowds

Do anyone have a copy of this book? If anyone has, please explain briefly about it? Actually, I want a soft copy of it, but it has 366 pages. I've search through Google Books but no preview available, and search though my country book store but same result too. » Nat | Talk » 06:02, 10 April 2009 (UTC)

Do anyone have a copy of this book?

Please answer! Do anyone have any copy of this book? Don't feared to answer the simply 'No'!! » Nat | Talk » 06:13, 18 April 2009 (UTC)

Then, no I have not. :p --zyx 07:23, 18 April 2009 (UTC)
Thanks :S Actually, my question is meant to be answered by Rednaxela, PEZ (if he is active) and Voidious, and maybe some of old-era robocoders. :-) » Nat | Talk » 07:43, 18 April 2009 (UTC)
No. Although I'm not sure how much it would help, as I doubt there is much mathematics in it, but rather just case studies showing where it is effective. --Skilgannon 09:09, 18 April 2009 (UTC)
I hope it make me more understand on crowd. I can't tell I really understand it. If any one can expend it, I would be really appreciated, or I'll be more appreciated if I can have soft copy of it. » Nat | Talk » 09:56, 18 April 2009 (UTC)
That book is actually an attempt to show that a large crowd of people is smarter than a shorter group of experts, it will give you no information on how or when anything works. Also the author is a journalist not a scientific in any aspect, and is mostly oriented to social psychology, which means is about people and groups of persons. I thought you wanted to read it for personal entertainment. I didn't read it, but the book was kind of a big hit when it came out, so I have read reviews, and even though most reviews have been positive, all negative reviews seem to agree that the book doesn't convince anyone who disagrees with that premise. You can read the excerpt on that link you posted, and some of the negative reviews on Amazon or anywhere else, and I think it should give an idea of that book is about. --zyx 11:40, 18 April 2009 (UTC)

I have not read the book either, but I can give you a general idea of how "Crowd Wisdom" works, as far as I understand it. In Robocode, we often create systems where we have several pieces of data that we combine together -- summing multiple buffers in a GuessFactor / VisitCountStats gun, multiple attributes in a DynamicClustering gun, multiple guns in a VirtualGuns array. We often weight them and tune the weights.

A crowd system would more likely have a lot more elements, and would not weight them. The idea being that a diverse set of inputs will have inherent "wisdom", and weighting it is not so necessary or helpful. I would say that Dookious and DrussGT both use this idea to some extent, with a very high number of buffers in gun and/or movement (at least compared to older bots like Ascendant and CassiusClay). Dooki's movement uses 34 buffers, unweighted (not counting the flattener). I think DrussGT uses more. One issue is that in Robocode, rarely is your data all independent, so you inherently weight certain data if you're not careful (eg, if you used velocity and lateral velocity). It can be a tricky thing to apply this concept to Robocode. Does that help?

--Voidious 16:07, 18 April 2009 (UTC)

Thanks Voidious, and sorry for late reply. It look like you have successfully compress all discussion on the old wiki page in one paragraph. Again, thanks » Nat | Talk » 13:48, 21 April 2009 (UTC)

Short distance?

Distancing is one of important part of robot. Almost every robot will keep its distance about 400-550 depend on author. Some may have dynamic distancing, too. But, I think, do short distance have advantage? I try to move closer to enemy. If he try to controlled his distance too, he will step backward, and I will step forward, and he will step again backward. This can result in getting cornered (for enemy). Anyone has ideas? » Nat | Talk » 10:33, 11 April 2009 (UTC)

There are a variety of reasons for long distances being used, but perhaps the most significant, is that long distances like that tend to be rather advantageous when your bot has better targeting/movement than the opponant, and short distances better when your bot is known to have inferior targeting/movement. This is due to short distancces resulting in more 'lucky' hits. Since people usually try to make bots with targeting/movement better than the vast majority of bots, they'll tend to use long distances because that helps against the majority of bots on the field. --Rednaxela 14:47, 11 April 2009 (UTC)

The reason I think this because of Shadow (!!!) He get Phoenix stuck in corner (but not enough to trigger his corner escape mode) for a long time by distance at about 300, Phoenix usually stay at 475. Perhaps my new robot will take 325 a try. OK, I understand about long distance, but too long distance is not very good, huh? » Nat | Talk » 15:33, 11 April 2009 (UTC)

I believe The main disadvantage of too long distance when your targeting/movevment is better than the enemy's, is that it forces you to have too much wall-interaction/smoothing, which makes one more predictable. --Rednaxela 18:28, 11 April 2009 (UTC)

Melee GuessFactor

Following text is an early discussion copied from Shadow/ShadowsMeleeGun on the old wiki

Just a question, how can you do a Play-It Forward with missed scan? Or you just interpolated? And does this work for GF, too? --Nat

Yes, you can interpolate. If you use a 'fast' play it forward method that uses uses absolute locations you can just linearly interpolate because any error will be completely corrected the next time a real scan is read. I wouldn't suggest using GF for melee, although it definitely works... Kev's bot for example. -- Skilgannon

I'm trying some DC-GF in melee. I know it definitely works because of Conriantumr?, which do interpolate, too. About the "And does this work for GF, too", I don't mean interpolate, I mean to project each GF and do same thing as ABS mentioned. Another thing, if I put 100 Shadows into one 1000x1000 battle, will it skip a ton of turns? --Nat

Yes, this method would work with GFs instead, the trouble is it won't hit bots like Walls Spinbot etc as well as PIF. You just need to turn it into an absolute angle, stick them all in an array or some other equivalent, and weight them by distance. -- Skilgannon

End of an early discussion


Some tough on this. If we use enemy heading, enemy relative heading as input for DC (or as a segment), will it hit Walls or SpinBot better? You just think as same as mine (OK, I'ven't read your comment on angle before), trying to implements this on TheRiver :-) » Nat | Talk » 09:36, 15 April 2009 (UTC)

Getting DC with GF to hit SpinBot is very difficult, you need to segment on relative heading (or lateral+advancing velocity) and distance and only fire at the 1 closest previous scan. Hitting Walls with GF is easy, I think corner-distance and lateral-velocity are the most important. If you are using Play-It-Forward SpinBot should get hit always no matter what you segment on, but Walls would probably be the same as GF, although perhaps more accurate if you do bounds checking to eliminate possible angles. I don't think enemy heading (not relative) is ever really useful. --Skilgannon 20:16, 15 April 2009 (UTC)

OK, since usual melee bots won't move perpendicular to us, is it a good ideas to segment on a thing that relative to me? Such as Lateral Velocity, Advancing Velocity? I have tough of some kind of melee wave, if I always fire a wave at center of the battle, collect the GF. When fire, projected enemy location from center of field and get firing angle. Will this way hit wall/spinbot/corner movement better? » Nat | Talk » 07:03, 16 April 2009 (UTC)

If you want to stick with GFs then you need to segment on stuff relative to you, yes. Lateral/Advancing velocity works, as well as velocity/offset. I don't think that melee center wave idea will work, because you won't know at which point along the GF to shoot if you are not at the center. This is why Play It Forward is such an effective technique in melee, because it is not dependant on where you are situated. Also, if you are using Play It Forward, it is not necessary to use attributes for the gun that are relative to you, and that might add 'noise' to the gun data. --Skilgannon 09:27, 18 April 2009 (UTC)

I'm not talking about GF vs. PIF here :-) I know what effective DC-PIF is, as top 4 melee bots use it (Shadow, Aleph, Tron and Tron) For the center wave, to know firing angle, just project enemy location (by distance from center and translated GF, of course) Then simply do atan2() to find firing angle. Yes, I want to stick with GF, but not the same way as 1v1. I believed Shadow do segment on absolute angle, distance last x ticks and other. I say no relative because, say lateral velocity, will not be the same if you aren't in same position in melee, but in one-on-one, you move perpendicular to enemy so lateral velocity will be the same. Unless we stationary, hitting corner movement would be hard for GF since it doesn't care where you are, it just care where corner is. I need some stick point to keep stats, and since most melee movement will move parallel to walls (or, in another work, perpendicular to center of battlefield) so center would be good ideas. I'm thinking about Leteral/Advancing velocity that seen from center of field.

I have crazy opinion on this now, I'm trying to create DC-PIF from DC-GF :D

» Nat | Talk » 09:47, 18 April 2009 (UTC) (PS. Anyway, I'ven't implementing this yet, and will not do in near future, as I'm going out for 4 days)

The trouble with this is that it assumes the enemy is orbiting around the center, which may not be true. How about if you store additional information with your GF, eg the ratio of distances between time-at-fire and at every tick for +-80 ticks afterwards? Then you could take into account non-center-orbiting movements, and still know how far out on the guess factor to fire at, you just iterate using your bullet and the point at that ratio of distances along the GF, until your bullet has traveled far enough. --Skilgannon 12:26, 18 April 2009 (UTC)

He he.. I think I'll have two guns. One fire from center, another one fire likes traditional GF gun. The distance to projected is (now) exactly distance from enemy to center :/ I can't think of better way now. About distance ratio, corner could be a problem. Usually, a normal melee robot (don't count some pattern nanobot melee here) will grab the corner asap, so that shouldn't be problem. --Nat (PS. No melee wizard around here? ABC?)

Are robocoders absent on weekends?

Are you all robocoders absent on weekends? On weekdays, almost all question asked between 19:00 EST to 23:00 PST get answer quickly. But almost all question asked on weekends will get answer on Monday. » Nat | Talk » 14:02, 3 May 2009 (UTC)

Just because I'm not answering questions doesn't mean I'm not Robocoding. =) In fact, it often means that I am! --Voidious 17:20, 3 May 2009 (UTC)
Thanks. Voidious, actually the "question answering" part is meant to Rednaxela =D » Nat | Talk » 09:27, 4 May 2009 (UTC)
Me too, I usually answer more questions when I don't have time to write code :P. --zyx 17:54, 3 May 2009 (UTC)
If you don't have time writing a code then which time you spent on the wiki? I think you should say (type?) "when I don't want to write code" » Nat | Talk » 09:27, 4 May 2009 (UTC)
I too, tend to actually robocode more on weekends, and wiki less :) --Rednaxela 18:03, 3 May 2009 (UTC)
Thanks. That clarify thing out =D I think that I will get a response as "weekends is for family" » Nat | Talk » 09:27, 4 May 2009 (UTC)
I do almost all my Robocoding, and wikiing, on the weekends, because I never have time at school. --Awesomeness 20:47, 3 May 2009 (UTC)
I too as student so I understand you, but I usually finished homework at school and spend the night for robocoding, before my mother forced me to sleep... » Nat | Talk » 09:27, 4 May 2009 (UTC)

How many hours can Notebook run before it getting explode?

Hey all, last day I turn my laptop on at 13:00 ICT (UTC+0700). I start my client for both roborumble and meleerumble. I working on it 'till 22:30 ICT and I went to sleep, leaving my clients run for a whole night. I open my lid of my laptop again at 13:00 ICT today (note that the computer isn't turned off yet) to see I've uploaded around 10,000 battles (for both melee and 1v1). Will my notebook computer explode if I let it run for another night? (Time since turned on: 37 hours; current time here is 20:27 ICT; Notebook: Dell 1537) » Nat | Talk » 13:29, 4 May 2009 (UTC)

It depends on the laptop, of course, but I don't think so. I might recommend placing it on a hard/flat surface (as opposed to a couch or a pillow), so that air can get underneath it and it is less likely to overheat. Then again, if your laptop does get very hot and you are worried about it, there's no harm in letting it rest a while. =) There seem to be a lot of RoboRumble clients running these days. --Voidious 14:24, 4 May 2009 (UTC)

Thanks for you suggestion. It is on my semi-messy desk so I think it is flat enough. The reason that I'm not putting it on the rest is I want to maintain my position on this page It isn't really hot since it is in my bedroom (with a/c) but I've heard that someone who running notebook like a server make the laptop too overheat and broken, or probably the adapter will catch in a fire before. I think I can let it run for another night before put it in the rest. May I ask you Voidious, how many clients you are running? It is too fast for only one client to upload the result that fast. » Nat | Talk » 15:12, 4 May 2009 (UTC)

I have one client going full time (on an old PC running Linux), and when I'm sleeping or at work, I have two more running on my MacBook. I ran lots and lots of Robocode on my MacBook for the first 1.5 years I had it, and one of its fans broke (started sounding like a jet engine). But I got it repaired and it has been fine since then. --Voidious 15:35, 4 May 2009 (UTC)

My client runs on an old XP laptop that's only used for RoboRumble. I have it propped up to increase airflow and let it rest 60s between each iteration for more cooling. I find that the rumble is really tough on hard drives (both from heat and constant data-saving) -- I've had two crashes and have to repair the file system every time it reboots. My MBP is much faster but I use it for roboresearch mostly. If I run I client on it I always use a ramdisk for the robotcache to speed things up and save on wear & tear. --Darkcanuck 15:52, 4 May 2009 (UTC)

I have 4GB of ram which is enough from Windows, Robo/MeleeRumble client and whole cache/temp. But sadly I can only access 3GB because the limit of 32-bits operating system, and I haven't ever seen any ramdisk program for windows. =( » Nat | Talk » 16:23, 4 May 2009 (UTC)
I also started using a ramdisk (good old tmpfs) for that purpose since I saw Darkcanuck mention his doing so. As far as windows, google searching reveals: this, this, this, and more. ;) --Rednaxela 00:18, 5 May 2009 (UTC)
Wow! Thanks! Bit I think I need to install ramdrive later after I put my up-for-45-hours notebook to rest. » Nat | Talk » 02:48, 5 May 2009 (UTC)
How large should I create for the ramdrive? Should I copy a whole robocode program to the ramdrive? I'm very curious. » Nat | Talk » 07:11, 5 May 2009 (UTC)
I used 200MB, which was enough to hold the .robotcache with plenty left over. But on windows you'll need to copy the whole robocode directory to the ramdisk, so expect to use a lot more. Maybe 500MB? And yes, you have to copy everything to the ramdisk every time you re-initialize it. With .robotcache, robocode did this work for me, which was nice. Note that my XP laptop doesn't use this trick since I don't have enough memory to do this and run a client. :) --Darkcanuck 15:27, 5 May 2009 (UTC)
On the Macs/Linux you can use Symbolic Link, right? I just found interesting ideas here that Windows Vista also support Symbolic Links! I think I can move only .robotcache to the ram drive =) And the robocode core is not so big, it just around 10MB or so. The robots directory is around 88MB on my machine (including .robotcache). » Nat | Talk » 15:41, 5 May 2009 (UTC)
Question: Do you need to copy file in and out ramdrive everytime you turn on/shut down your computer? » Nat | Talk » 13:03, 5 May 2009 (UTC)
Yeah, stuff in RAM only exists while the machine remains on, so you have to re-copy each time you start up or reboot. You'd need to copy the whole Robocode directory to it and then run RoboRumble from the RAM drive, so you'd need enough space to hold that directory, probably a couple hundred megabytes. --Voidious 14:54, 5 May 2009 (UTC)
Thanks! I now set up RAMDRIVE with 256MB. My 3GB ram can hold it =D » Nat | Talk » 15:14, 5 May 2009 (UTC)

Nooooo... I hate Windows Update! I just recently lost over 5000 uploads that I ran over night in my ramdrive because the windows update automatically restart itself at 3:00! Oh... » Nat | Talk » 07:02, 14 May 2009 (UTC)

That surely is a loss, but when I saw a "noooooo" in the "How long can a Notebook..." section I thought you found out how long it did run before exploding. So I'm actually glad you only lost some battles and not the notebook ;-). --zyx 07:28, 14 May 2009 (UTC)
Thanks, actually I now figure out that the notebook will never explode unless someone put some gunpowder inside it (and the electricity will automatically spark them). Sorry that I make you misunderstand. =P But actually, if I ran it too much and my parents figure out, I probably still lost my notebook. =D » Nat | Talk » 07:48, 14 May 2009 (UTC)

Melee/Team rumble

I use username "Nat" for roborumble client before, that time I uploaded around 21k roborumble battles, then I switch to username "Nat_1614". just recently (3 May 2009) I switched back to username "Nat" again and starting running RoboRumble and MeleeRumble simultaneously. ~170 hours running and I've uploaded ~104000 battles! Event though I have only a computer, and it's my working computer, too. It is not-so-powerful notebook. Say, I can passed Voidious, who has more than one clients running, # of uploaded with Melee Rumble.

Do not care above, it just something-I-wanted-to-shout-out =P

Now, the thing. Any body running Team Rumble recently? I've notice that many team .jar file was broken. Do anyone have same problem? And when client fought battle with broken .jar, the rumble will freeze there (if you look at this page, you will see Nat uploaded 3 battles for Team Rumble, but I ran the client all night!) » Nat | Talk » 09:54, 13 May 2009 (UTC)

Currently I'm not really running any rumble clients because I can't really spare much cpu-cycles at the moment. But I tried to run team rumble about 4 times before, and it seemed to do nothing, maybe because of what you said. I thought I had to fix something, but since there are not much changes to the team participants and GrubbmGait was running a client I didn't try to fix it. --zyx 13:06, 13 May 2009 (UTC)
Just a note that for melee, every battle results in 45 uploads (more if there are mini/micro/nano pairings) whereas for 1-on-1 every battle equals 1 upload. So you can't really compare the number of uploads since users contributing to melee will get way more uploads. This is taken into account in the monthly and last-30 tables. Thanks for contributing! :) --Darkcanuck 14:22, 13 May 2009 (UTC)
Actually I known that. When I run a client overnight without upload (because my dad turn the wireless router off at night), it took me up to hours to upload the result. Say I ran 60 iterations, 3 battles per iteration equal to 270 battles, multiply by 45 uploads equal to 1350, which will take me at least 2 hours and 15 minutes to uploads it all since the server will delay for 1 second before return. Darkcanuck, it you can take off that delay it would be good! =P » Nat | Talk » 14:29, 13 May 2009 (UTC)
I shortened the delay to 0.5 seconds maybe about a month ago. With the number of clients uploading right now, I think the server will overload if I let you guys upload at full speed. :) I've already had to do several table repairs in the past week. --Darkcanuck 15:03, 13 May 2009 (UTC)
Really, maybe another 0.5 seconds spent on data transferring or something (I can count a second between each upload). Maybe some cron task to repair/optimize the table hourly will better? Anyway, I'm wonder what is the long delay that sometimes occur during uploading? » Nat | Talk » 15:16, 13 May 2009 (UTC)
That long delay is the server desperately trying to keep up with a high number of concurrent uploads. We all have our limits. :) --Darkcanuck 16:02, 13 May 2009 (UTC)

Java Logger

Not related to Robocode but... As I'm creating Robobot, I'm needing Logger. Anyone can give me step-by-step on how to use Logger? (the output redirection part, not the logging part) And, if you don't know please said 'no'. » Nat | Talk » 11:45, 21 May 2009 (UTC)

Question

I have an older version of Robocode (1.6.1 Beta 2 for now since I can't figure out how to update the damned thing under Linux) and I'm trying to call the getGunHeat() method, and the compiler is freaking out. If you can eighter help me figure out what I'm doing wrong or help me update robocode on Linux, I'll gladly appreciate it --Jacob Litewski 04:00, 4 June 2009 (UTC)

Can you tell me what exactly happen? Is the compiler just hang forever or showing some errors? But the installation, I think just install the new version over the old one is fine. » Nat | Talk » 12:31, 4 June 2009 (UTC)

If you installed Robocode using the debian/ubuntu repositories, uninstall that version, it's not officially supported. Instead go to the Robocode homepage, download the latest version, and try that. You simply extract to somewhere in your home directory and run from there. If you want to compile you need to either: install the sun-java6-jdk package from the repository or install jikes from the repository. While it is possible to compile jikes using the built-in editor, to do this you need to first install gcc and c++ header files, so you might as well just download jikes/sun jdk and install those. Once you've done all that, make sure that robocode.jar is in the classpath, that you are calling getGunHeat() from inside a robot (not an external class) and that you are not calling it from a static context. Hope this helps =) --Skilgannon 14:51, 4 June 2009 (UTC)

The compiler says:

/home/jacob/.robocode/robots/hackhalotwo/GravityWave.java:60: cannot find symbol
symbol  : method getGunHeat()
location: class robocode.ScannedRobotEvent
        if(e.getGunHeat() == 0.0) {

Thank you Skilgannon, I'll try that. --Jacob Litewski 14:59, 4 June 2009 (UTC)

FWIW, my RoboRumble Linux machine was totally crashing every day or two with the Sun JRE, and it has been mostly stable since switching to OpenJDK. Double clicking the install JAR in Ubuntu doesn't run it like it does on Mac/Windows, but you can right-click it to run it with Java and it installs properly. As for that error, it's because getGunHeat() is a method for the Robot / AdvancedRobot classes. You can't see an enemy's gun heat from the scan event. To see your own gun heat, call getGunHeat() from within your robot class, or call robot.getGunHeat() from another class. The external class would need a reference to the AdvancedRobot (a lot of bots do this, including all my MegaBots, if you want to see examples). --Voidious 15:09, 4 June 2009 (UTC)

Yeah, Voidious is correct. You cannot detect enemies' gunheat unless you track them yourself. Or, as I said (wrote?) to someone before, there will be a lot of melee surfers around today =) » Nat | Talk » 15:25, 4 June 2009 (UTC)

  • Yes, as Nat said, you can't just call getGunHeat() for an enemy. What you have to do is see how long ago they fired, and what size bullet they fired, and then figure out what their gunheat was when they fired and how much it's decreased since then. In DrussGT I keep a running tally of what the enemy's gunheat is so that I can start dodging them just before they fire. --Skilgannon 16:07, 4 June 2009 (UTC)

Surf multiple waves

How can I surf multiple waves using True Surfing? (I mean, not Path Finding) » Nat | Talk » 06:45, 6 June 2009 (UTC)

Well I'm not sure what path finding is, but here is how I do it.
  • Surf the first wave and store every location with it's danger.
  • Sort them by danger (just to speed up the search).
  • For each location surf the second wave and keep only the minimum danger.
  • Compose danger using first.danger and second.danger, and keep track of the lowest.
  • Stop the search if first.danger is already bigger than the best composed danger found.
To compose the danger you might add them, maybe weight them, I'm still not sure the best way, I'm currently simply adding them. Note that YersiniaPestis doesn't do it like this, but is because it's been a slow bot and I don't have the ticks to surf the second wave, so it only tries a guess but doesn't really surf the second wave. --zyx 06:57, 6 June 2009 (UTC)
So you need to surf the second wave using the tick in future? I've considering the thing you mentioned for a while (since I read DrussGT's Path Finding code (I know DrussGT isn't true Path Finding, but it does the same thing if there are less than 3 waves)), but never, never sure how to implement it. » Nat | Talk » 07:29, 6 June 2009 (UTC)
Wow, I'm really surprised YersiniaPestis has such a high ranking with surfing the second wave. What does "so it only tries a guess" mean Zyx? --Rednaxela 15:10, 6 June 2009 (UTC)
For each location surfing the first wave, it calculates the factor window for the second wave, expand it by 0.2(I think) on each side, and calculate the danger for that window. --zyx 15:55, 6 June 2009 (UTC)
Actually I just checked and it seems I already dismissed that way. I don't expand it anymore, the danger for the second window is the danger of the factor window where the first wave is to pass. --zyx 16:53, 6 June 2009 (UTC)
I'm pretty sure that's what CassiusClay does. --Skilgannon 22:44, 6 June 2009 (UTC)

What Dookious does is surf until the first wave hits, then branch again, and surf until the second wave hits, taking the minimum danger branch of the second wave and adding it to the first. What I do in Wintermute is surf until the first wave passes, then branch, but for every tick of surfing the second wave, I also branch off a 'stop' option to see what the danger would be stopped. I take the minimum of all the 'stop' options and the 'continue' option, for all the branches, as the second wave danger for that first wave branch. What CassiusClay does (AFAIK) is just surf the first wave, but factor in the second wave's danger at that point for the first wave. These are all for TrueSurfing, for DrussGT (which is GoTo surfing) I do what Zyx described above. --Skilgannon 10:59, 6 June 2009 (UTC)

Thanks. Well, I do know what DrussGT does, but I don't know what do do in true Surfing, that's why BlackHole 0.1.11 go that low in rumble for the really-crazy-and-buggy 2nd-wave surfing. Thanks again. » Nat | Talk » 11:19, 6 June 2009 (UTC)

RougeDC does multi-wave surving the same way that Dookious does, except, that it surfs ALL waves, and uses precise wave intersection. As far as weighting the waves it weights dangers inversely to how long it is till the danger occurs. --Rednaxela 15:10, 6 June 2009 (UTC)

Movement Predictor

I've just test my precise predictor (I wrote it a long time ago, but never use or test before). This is base on rozu's one.

	public static class PredictionStatus extends Point2D.Double {
		private static final long serialVersionUID = 4116202515905711057L;
		public final double heading, velocity;
		public final long time;

		public PredictionStatus(double x, double y, double h, double v, long t) {
			super(x, y);
			heading = h;
			velocity = v;
			time = t;
		}
	}

	public static PredictionStatus predict(PredictionStatus status,
			double goAngle, double maxVelocity) {
		double x = status.x;
		double y = status.y;
		double heading = status.heading;
		double velocity = status.velocity;

		int moveDir = 1;

		// goAngle here is absolute, change to relative bearing
		goAngle -= heading;

		// If angle is at back, consider change direction
		if (Math.cos(goAngle) < 0) {
			goAngle += Math.PI;
			moveDir = -1;
		}

		// Normalize angle
		goAngle = M.normalRelativeAngle(goAngle);

		// Max turning rate, taken from Rules class
		double maxTurning = Math.toRadians(10d - 0.75 * M.abs(velocity));
		heading += M.limit(-maxTurning, goAngle, maxTurning);

		double goingDirection = M.sign(velocity);

		// If velocity is exceed allowed velocity or velocity and moveDir have
		// difference sign
		if (Math.abs(velocity) > maxVelocity || velocity * moveDir < 0) {
			// slowing down
			velocity -= goingDirection * 2;
		} else {
			// accelerate
			velocity += goingDirection;
		}
                velocity = M.limit(-maxVelocity, velocity, maxVelocity);
		
		x += M.sin(heading) * velocity;
		y += M.cos(heading) * velocity;

		return new PredictionStatus(x, y, heading, velocity, status.time + 1l);
	}

M class is a gateway to Math class, with the FastTrig and robocode.util.Utils integration. I wonder why this isn't work. I test with Komarious and this result in very swinging predicted positions. Help please! » Nat | Talk » 10:21, 6 June 2009 (UTC)

I'm not sure if this is the only problem but when checking for maxturning you need to take the abs of the velocity. Also, you should add moveDir (which is the direction you want to go) to velocity, not goingDirection. That way you don't need to subtract, and it automatically accelerates you in the right direction. Your 'goingDirection' is 0 when your velocity is 0 (from M.sign()), so adding it to accelerate does nothing. I've made the changes in the code, just diff it. --Skilgannon 10:52, 6 June 2009 (UTC)

Thanks for your help! Yes, those aren't only problems, the main problem that make the predicted positions swing is because the PredictionStatus I feed to the this predictor use getHeading(), not getHeadingRadians(). How silly I am! » Nat | Talk » 11:43, 6 June 2009 (UTC)

And, actually the only wrong part is the turn rate. The goingDirection variable is need, as is the max velocity checking part. (M.sign() is not Math.signum(), but is BasicSurfer's sing() function (or Komarious' in this case)) Without that, the maxVelocity checking part (which make this code difference to rozu's code) will not work. But thank you anyway. » Nat | Talk » 13:00, 6 June 2009 (UTC)

Data Density

I'm wonder if I can do this in fast way. Let see, I have this samples which data spread into two clear groups (not equally). I want to find a way to split the samples into 2 sets. Like, if data are spread over, but the maximum density is around -0.4 and 0.3, I want to split at 0 or nearby. I know I can just check the density linearly and recursively, but that cost much! (I know that it look like O(n), but to find really precise point it may take O(n2). I want it O(log n), where n is the number of sample) Do anyone know how can do this in way faster than O(n)? (I actually mean O(n) here, not O(n2) or O(kn) where k is number of recursivation) My head once remind me of BST, but after reconsidering, I can't find the way to do this with that BST. » Nat | Talk » 13:32, 12 June 2009 (UTC)

The problem you're describing, is basically a simple variety of Cluster analysis. No truely accurate ways, to my knowledge are faster than O(n), in fact this page lists none faster than O(n log n) ever, most being O(n2) or slower. Though... if you just want a quick hack that doesn't care at all about accuracy... you could always just average the value of each set and take the mean to be the dividing point... As an aside, this reminds me of the gun prototype I have called "StainedGlass" which I really should try to improve... --Rednaxela 14:44, 12 June 2009 (UTC)

It is the part of my new Dynamic Segmentation gun. No need for the accuracy, just make sure I didn't just separate the vast majority of the data =) Anyway, I don't understand "you could always just average the value of each set and take the mean to be the dividing point" at all. Care not explain more? What is the "each set" mean? » Nat | Talk » 15:09, 12 June 2009 (UTC)

Well, to clarify, what do you mean by "data spread into two clear groups"? Is it known what data is in what group? Or what? --Rednaxela 02:27, 13 June 2009 (UTC)

Graph-robocode-density.jpeg

(mspaint is quite annoyed sometimes =() » Nat | Talk » 05:37, 13 June 2009 (UTC)

Ahh, so you mean the two groups are clear from a human looking at the graph, are not aready known to the algorithm, I see. Yes, then what is in question is indeed a good example of Cluster analysis. You're not going to get something accurate in faster than O(n log n) I don't think, but yeah, there are lots of faster tough guesses you could experiment with. I would suggest you consider perhaps... use the average value of any local maxima in the curve? --Rednaxela 06:22, 13 June 2009 (UTC)

You mean to do some moving average and select the lowest? That would take O(kn). Wait... I just think of new ideas. Well, the data I store is the GF. If I sort the data, then diff each item with the last one. Choosing the largest diff will be the least density. If I do sort the data when I'm inserting, this take only O(n). Well, the sort is O(n log n) anyway. But if I round the GF to most of 5 decimal number and perform radix sort... » Nat | Talk » 06:53, 13 June 2009 (UTC)

Creating debugging windows in Robocode

I'm wondering. Since my new segmentation tree require a debugging windows (to draw a tree) IS there any way to create JFrame in robot? I've try with -DNOSECURITY but no luck. Help! » Nat | Talk » 11:06, 13 June 2009 (UTC)

Adoptable rolling depth

Well, while taking shower about a week ago, I come up with this ideas. Currently I can't find any benefit doing this, but I feel that this is useful...

OK, now get to the point, "Adoptable rolling depth". Basically, it mean that you adjust the rolling depth of your (vcs?) stats base on enemy 'adoption rate'. I think of keeping track of tuned normalize hit rate, enemy or you base on what stats you are adjusting. By keeping track of several hit at difference time, you can figure out the enemy adoption rate. Say, if the last round your your hit rate is around 10% with very high rolling depth (say 5000). Then this round your hit rate drop to around 3% Then you figure out that the enemy had adopted their movement, so you may reduce your rolling depth. Say 2000 this time, the next round you get ~7% hit rate so you may adjust to be more lower. You may keep track of the last 100 bullets, last 100 non-firing bullets and so on. If the hit rate at difference time isn't the same it mean that enemy is adopting their gun/movement. » Nat | Talk » 13:12, 18 June 2009 (UTC)

Wiki bot or my bot?

I just finished the (almost) Wave Surfing and GuessFactor targeting microot. It work quite well, but the original gun/movement code is Falcon/WaveSnake by PEZ/Kawigi/Kev. Yes, I do tuned it up yet not much, for now. But the main code is still their, and I bet that all of you can merge it up like me easily. I feel guilty if I released it under package 'nat.micro'... Should I release this robot under package 'wiki.micro'? » Nat | Talk » 15:16, 19 June 2009 (UTC)

For a micro? Probably not. Your call though. Pretty much all the nanos would be wiki if that were the case...

--Miked0801 15:26, 19 June 2009 (UTC)

Yeah, it's your call. I'd probably make it wiki if I was just going to combine them and leave it, but if I intended to keep improving it, I'd put it in my own package. As long as you give credits and keep it RWPCL (since Falcon is), there's no reason to feel guilty. =) --Voidious 15:33, 19 June 2009 (UTC)
Thanks. I'll release my bot now. It is now just a prototype anyway. Have a lot of room to spare. (200 bytes to spare is quite large, isn't it?) » Nat | Talk » 15:42, 19 June 2009 (UTC)