Archived talk:User:Nat 20090406

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

Just wanted to say welcome, and glad you're already making yourself at home. :-) Best of luck with your bots! --Voidious 21:59, 3 January 2009 (UTC)

Thanks, Voidious for your warm welcome! Therefore, I think my robots have the best luck already :) (How many time you see 3-months-experienced robocode programmer has his robot in top 10?) --Nat 07:51, 4 January 2009 (UTC)

Hey, I have problem with the old wiki! I can't update participant list! Does anyone know what happen? --Nat

Maybe you're running into the protection the old wiki had against edits which modify too many external urls at once? It did have an anti-spam measure where edits that added/changed too many urls would silently be dropped. If this is it could can just spread your editing of the list over multiple edits to make it work --Rednaxela 17:41, 17 February 2009 (UTC)

  • Thanks, I will move all my bot to my new download page (http://nat.robothai.net/robots/) I'm changing 6 urls on Participants page and 3 urls on MeleeParticepants page. I soon found out that the limit is 2 urls. I have one question to ask, is it your code? If it is, could you increase that? I must scroll to bottom of the page to edit it again. » Nat | Talk » 13:52, 18 February 2009 (UTC)

Hi, I've read about your competitions. You are very lucky to have such contests in you country. And the prizes are nice, too. ;) --HUNRobar 17:45, 17 February 2009 (UTC)

Thanks, Robar! » Nat | Talk » 17 February 2009 (UTC)

Hi, which bot did you participated in the one-on-one competition, where you got 2nd? I'm curious. ;) --HUNRobar 19:12, 4 March 2009 (UTC)

Do you mean the my country competitions? OK, not a bot on the wiki, and I'll not released that bot =) » Nat | Talk » 23:54, 4 March 2009 (UTC)

If you really want to know, it's pre-BlackHole version. Use modified version of DCBot gun and very buggy wave surfing movement that act like flattener is always enabled. Now, it is BlackHole, really. » Nat | Talk » 07:50, 5 March 2009 (UTC)


Hi! I saw you uploaded nano.AW at almost the same time I did with nano.Prestige. :) Great one, but not better than Prestige. :P Take a look at fighting each other, both in rankings and battles. ;) --HUNRobar 20:43, 18 February 2009 (UTC)

Like almost all my nano bots, it fully fooled PM! Like almost my nano bots again, it use WeekendObsession's gun. It my test bot to your AOM idea. I not expect much, it stuck at wall often. » Nat | Talk » 09:51, 19 February 2009 (UTC)


Will my robot run in time if I

  • Execute 3 Waylander Pattern Matching Guns
  • Perform a gaussian bin smoothing over 240 float VCS buffers
  • Build over 240 K-d Tree cluster.

in each ticks? I won't tell you what do I do with the result data until I finish one of my bot. Just want to know. If it can't run in time, will it if only 240 VCS + 120 DC or or 180 VCS + 90 DC or 120 VCS + 60 DC? 10:35, 23 March 2009 (UTC)

Heh, probably not for any of the numbers you suggest, that's WAY too out there I think. Of course, feel free to test the limits :) --Rednaxela 14:06, 23 March 2009 (UTC)

That was I feared. Actually, there are 1600 Float VCS buffers. Just forget, I do not have to build cluster and execute PM every turn or update all VCS buffer, just an enemy fire turn (yes, that for movement!!!) Only 400 VCS buffers need to update every turn. I'm sure VCS can, but the DC can't... New plan have 1600 VCS and 20 DC and 3 PM. Averaged Memory Usage: 200MB. Will this version run? » Nat | Talk » 00:45, 24 March 2009 (UTC)

In my experience is hard to know without testing, I had a code with 0 skip turns normally, added a very small code(very deep inside some nested loops), but like 3 comparisons and 2 additions, and it started skipping like crazy. So I strongly suggest testing the limits and and maybe using some profiler to analyze the bottle necks. --zyx 01:16, 24 March 2009 (UTC)

Anyone have super computer? I need a Super Computer with at least 600GB of ram right now because I just rewrite BlackHole buffer system. That result to my question above.

The finest, highest segment contains 2,829,103,200 bins. It is double so it consumes ~170GB. With all buffers, it requires ~600GB (or 599.78GB, really) of RAM. You need -Xmx614400MB (or -Xmx600GB if JVM accept) to run it. The 200MB I calculated above is certainly wrong. I always get ....... is not start in 32768ms... giving up. from current BlackHole.

So answer is: Yes it will run in robocode-specific time, but it doesn't have enough startup time to allocate all those gigabytes. Don't even try, if it successfully initialize, both your hard disk and RAM will throw java.lang.StackOverflowError!

» Nat | Talk » 13:08, 24 March 2009 (UTC)

I think, more correctly, it *might* run in robocode specific time. I doubt it. But yeah. Now you know why DrussGT only has 100 regular surfing buffers, each with a maximum of 5 different dimensions. Be aware that DrussGT skips the occasional turn just with 100 buffers, 1x DC, 1x PM, and 1x a *very* simple VCS buffer. --Skilgannon 14:01, 24 March 2009 (UTC)

Oh, I doesn't know that DrussGT have maximum of 5 dimensions! Actually, I found that DrussGT have 105 regular surfing buffers and 53 flattener buffers. » Nat | Talk » 00:13, 25 March 2009 (UTC)

Yes but the first 5 regular buffers are almost very lightly segmented, as are the first 3 flattener buffers. --Skilgannon 12:03, 25 March 2009 (UTC)


Just wonder about BasicSurfer, is it getVelocity() * Math.sin(getBearingRadians()); to calculate myself lateral velocity? After I do some math and realize that it should be getVelocity() * Math.sin(-Math.PI - getBearingRadians()); instead. Am I wrong? » Nat | Talk » 11:51, 25 March 2009 (UTC)

They are the same thing. sin(-x) = -sin(x) and sin(PI + x) = -sin(x). So sin(x) = -sin(PI + x) = sin(-PI - x) --Skilgannon 12:03, 25 March 2009 (UTC)

It seem that I need to concrete more in my math class! Anyway, I found the mistake in Chase-san RobotState class that I start using. One more, does cos(-PI - x) same as cos(x)? » Nat | Talk » 12:15, 25 March 2009 (UTC)

No, cos(-PI - x) = -cos(x). --zyx 14:13, 25 March 2009 (UTC)

Thanks! Anyway, I'm getting confused about the Lateral Velocity and Advancing Velocity, is it calculate by:

// Enemy
double enemyLatVel = e.getVelocity() * Math.sin(e.getHeadingRadians() - getHeadingRadians() - e.getBearingRadians());
double enemyAdvVel = e.getVelocity() * -Math.cos(e.getHeadingRadians() - getHeadingRadians() - e.getBearingRadians());
// Me
double myLatVel = getVelocity() * Math.sin(e.getBearingRadians());
double myAdvVel = getVelocity() * Math.cos(e.getBearingRadians());

? Actually, I haven't learn trig in my school yet. » Nat | Talk » 02:43, 26 March 2009 (UTC)

I think it may be correct, but because there are many ways to calculate them, from the periodic and symmetric properties of sin and cos, let me try and explain how I calculate them and why, hopefully it will help design your own way(or be certain is already correct):
double bearing = getHeadingRadians() + e.getBearingRadians();
// Enemy
double enemyLatVel = e.getVelocity() * Math.sin(e.getHeadingRadians() - bearing);
double enemyAdvVel = e.getVelocity() * Math.cos(e.getHeadingRadians() - bearing);
// Me
double myLatVel = getVelocity() * Math.sin(e.getHeadingRadians() - (bearing + Math.PI));
double myAdvVel = getVelocity() * Math.cos(e.getHeadingRadians() - (bearing + Math.PI));

My code will at least give enemyAdvVel with opposite sign as yours, but for me a negative AdvVel means getting closer, and I think in yours means getting further away. Either way the important thing to know is the meaning of it's sign, the magnitude is the same. After having the enemy velocities formulas, is easy to change it to yours, as you can see all I do is change his velocity and heading for mine, and instead of bearing I use (bearing + Math.PI), which would be a vector pointing in the opposite direction. But if you print to console the values you get, worry about the sign, if it gives the correct sign always is most likely correct, the magnitude is usually correct. For me LatVel is <0 counter-clock wise and >0 clock wise. And AdvVel is <0 approaching and >0 retreating. Hope it helps. --zyx 05:06, 26 March 2009 (UTC)

Thanks, that the same, except the advvel sign, really. » Nat | Talk » 05:38, 26 March 2009 (UTC)

  • Your welcome :). --zyx 06:03, 26 March 2009 (UTC)

I don't know how poor my old laptop is. I just brough new laptop, Dell Studio 1535 and I can watch 30 Shadow fough with 10 TPS while my old loptop can do only at 1 TPS. I now give robocode 1.5GB so my robot can consume more memory ;) » Nat | Talk » 00:34, 30 March 2009 (UTC)

  • Have in mind no one else will give Java that much memory, so even if you can use more memory in your tests it will very likely fail or skip many turns on the rumble. --zyx 01:46, 30 March 2009 (UTC)
  • Hehe, I now use 1024 instead because normal robot skipped too much turn on that because it can't allocate mempry in time. :-) » Nat | Talk » 11:57, 31 March 2009 (UTC)

I nominate this page for messy talk page award (see here) ;)

After first preview:

WARNING: This page is 30 kilobytes long; some browsers may have problems editing pages approaching or longer than 32kb. Please consider breaking the page into smaller sections.

I have been warned! I need to archive this talk page, really. Just want keep it for few days more before archive.

» Nat | Talk » 14:13, 5 April 2009 (UTC)

I now grow to 31 kilobytes ;) » Nat | Talk » 17:34, 5 April 2009 (UTC)

You probably don't need to worry about the 32kb thing actually. Some googling indicates that only Netscape Navigator <= 4.76 and Opera <= 6.04 are affected by such a limit, and who the heck uses those these days? :P --Rednaxela 17:47, 5 April 2009 (UTC)

It is now 34KB! I, still, need to archive this page. It really difficult to find a place here (just before first question) to place general talk, at least for me. ;) Actually, I still use Netscape Navigator 4.46 in my just-broken-last-year, old-and-poor Win95 notebook. Anyway, it is broken already! » Nat | Talk » 18:11, 5 April 2009 (UTC)

Robocode Question

To all robocoders, I've some question:

  1. How many of you still active? I have some list that I post to Robar, but I really know how many are they?
  2. David Alves start developing roborumble.org since 2007, 2 years passed, nothing happen! Where is him
  3. Are still Paul, Kawigi, David Alves and many more remember robocode?
  4. Is ABC take a break from robocode?
  5. Are Voidious and other robocoder still active or semi-active?
  6. Are there anyone except me, Robar and CrazyBassoonist‎ still developing their robot? Almost every bot is the same as last six months.

These are stupid questions, but feel lonely in this robocode world now. I'm almost last user entered robocode community. (Not sure on which me or CrazyBassoonist is last.) I've read on (mostly) quality articles by Paul, Kawigi, David Alves, ABC and many others. (these 4 people is one who I want to talk to) Thanks. » Nat | Talk » 13:52, 18 February 2009 (UTC)

I'm active, as is Rednaxela. I haven't been doing much with my bots mostly due to lack of time. In the limited time for testing that I have had, the changes that I tried didn't help, so I haven't released a new DrussGT. My melee wavesurfing algorithm is about half completed. So far I can keep track of all the waves that get (or may have been) fired. I still have to add some logic for deciding which wave hit a bot based on which firing bot gets an energy bonus. But it's already a monster... --Skilgannon 14:58, 18 February 2009 (UTC)

Like Skilgannon noted, I'm active. Well, as far as David Alvis and roborumble.org, it's a matter of life being busy and getting in the way. See this post for more information. Paul/Kawigi/David I don't know details of indeed haven't been active. ABC did make some tweaks to Shadow a few months ago I believe so not entirely inactive, not to mention he put significant effort into hosting a temporary RR server during the transition between the old one and DarkCanuck's one, and also is to credit for nice things like the shiney LRP graph on DarkCanuck's server. Some like Kev have been mostly sleeping, though Kev was briefly awoken by LunarTwins taking the crown he held in TwinDuel, and also to make a multiple choice pattern matcher in attempt to take the micro crown. GrubbmGait while inactive in 2008, has here expressed intent to be more active in 2009. As far as "still developing their robot", I believe a number of people, such as myself are not actively working on any robot we already have released much, but instead are slowing working on new robots/ideas. Personally class is keeping me rather busy, but I am squeezing in some Robocoding time, which I was earlier spending on SaphireEdge and more recently on the SaphireSlippers (speaking of which I just had some promising results for yesterday). --Rednaxela 15:30, 18 February 2009 (UTC)

Will ABC go back and tweaking shadow after DrussGT dethrone its PL throne? » Nat | Talk » 04:37, 27 March 2009 (UTC)

If you tell me that DrussGT defeats Shadow in a 1000 round battle, then yes, I probably will. :) --ABC 09:44, 27 March 2009 (UTC)

Please to see you around here! Here some result from running battle (round 134 of 1000, v1.7.1, no preloaded data)

1st jk.mega.DrussGT 1.3.6 0 / 10446 (0 / 54%) 0 / 3850 770 0 / 5094 0 / 731 0 / 0 0 / 0 79 54 0
2nd abc.Shadow 3.83c 9 / 8665 (100 / 45%) 0 / 2700 540 9 / 4903 0 / 522 0 / 0 0 / 0 56 77 0

Hope it will tell you something :-) But I'm not very sure the result will look like this in round 1000. (full result will be post here as soon as it finish) Current PL king is now DrussGT! » Nat | Talk » 10:16, 27 March 2009 (UTC) » Nat | Talk » 10:16, 27 March 2009 (UTC)

You won't believe me, but some round (I see at round 419), Shadow have 2.8 energy while DrussGT have 110.2. Yes, that much » Nat | Talk » 10:22, 27 March 2009 (UTC)

Hope it make you come back :-D » Nat | Talk » 10:54, 27 March 2009 (UTC)

DrussGT-Shadow-Score.jpg

That's not a conclusive win, it's a tie. And 3.83c is not Shadow's best version in terms of rumble ranking. I think I'll maybe wait for that melee wavesurfing DrussGT, now that should prove a big challenge! :) --ABC 11:56, 27 March 2009 (UTC)

Actually if you discard first 100 rounds score, it is really tie! But, which is best? Anyway, DrussGT 1.3.6 is only bot I known that can kill Shadow 3.83c in both Rumble and 1k rounds battle. » Nat | Talk » 12:14, 27 March 2009 (UTC)

Melee wavesurfing

In reply to your question:

I think I must keep track of enemy gunheat instead of energy drop.
I also think that TrueSurf is impossible for extend-robot so I
''must'' use goto-style surfing. Anyone have idea?

Here are my thoughts:

In some ways, I would say the challenge is similar to that of melee wavesurfing which I've been thinking about, because in both you cannot keep a constant radar lock. I'd agree that you need be tracking gunheat in order to get reasonable precision with it. Here's the way I'd do it:

  • Every time you see the enemy, do energy based calculations to see if they've fired since you last saw them, and if so, how powerfully they fired.
  • Use gunheat tracking which presumes they always fire as soon as possible, in order to estimate WHICH tick tick they fired on and place the wave accordingly.
  • In the event that they don't fire between times that you've seen them and their gunheat is 0, then your gunheat tracking data for the next time they fire is invalid for sure, and you'd either have to presume they fired in the middle of the time you didn't see them OR start making waves for every tick they could have fired during. Generally, this would not be an issue because this would only happen if they stopped firing.
  • To know where they fired from you need to use interpolation of their location of course

That's the approach I'd take to melee/extend-robot wavesurfing anyways. Really, I'd say the only difference between melee goto wavesurfing, and extend-robot wavesurfing, would be that the extend-robot also wouldn't be able to turn while moving forward or scan while moving. The basic challenges in the algorithm seem the same to me.

--Rednaxela 21:14, 4 February 2009 (UTC)

Well, I think melee wavesurfing is too hard ;) I had seen melee wavesurfing challenge, and I saw that almost index is under 1! Turning doesn't take too long if velocity is zero but I must have a very unique precise predictor. In order to get enemy fire time if his/her gunheat is still zero, I think I'll use statistic-base algorithm. I also think that some bot doesn't fire until its gun correctly aligned. I think I must use the onHitByBullet plus some enemy gun projection in order to place wave correctly. Here are some more of my ideas for it (which can add to your above):

  • Don't remove waves until it fully out of battlefield.
  • If you get hit by bullet, calculate how many tick it flight and set new gunheat.
  • In a rare case of 2 bullets were flight during missing scans, I don't know how to do!

» Nat | Talk » 12:26, 5 February 2009 (UTC)

The2XXXClub

Just asking, I think now, all those The2XXXClub are harder to entered since now, we can create a strong robot with copy and past from this wiki! Ot, maybe some problem on Darkcanuck's ELO calculation. Should we change from ELO rating to Glicko-2 system there? I know that it MUCH over than the ELO rating. Or we need The8500Club (note the APS score!) :) » Nat | Talk » 19:38, 22 February 2009 (UTC)

When the set of pairings is incomplete, Glicko-2 is the most accurate, and when the set of pairings is complete, it gives the same ranking as APS so far as I can see. Therefore I do think that Glicko-2 is the best system. As far as changing club names, I don't think we need to: What I think needs to happen, is Darkcanuck adjust the parameters of the Glicko-2 so that values match the existing clubs and such, after all the Glicko-2 algorithm itself doesn't specify the scaling ;) --Rednaxela 19:54, 22 February 2009 (UTC)

So I can enter The2000Club if my Glicko-2 reating reach 2000 even the ELO does not? If that so, the club will be a LOT larger :) (top 42 bots are in there with Glocko-2) » Nat | Talk » 13:05, 23 February 2009 (UTC)

No no, that's not what I mean, I mean that Darkcanuck shoud tweak the scaling of the Glicko-2 scores so they mroe closely match the most stable ELO ones in general. --Rednaxela 14:31, 23 February 2009 (UTC)

The exactly question I'm asking is, the ELO rating are LOT harder, still we will use that ELO for the club? » Nat | Talk » 15:17, 24 February 2009 (UTC)

I think the Glicko-2 should be scaled so that DrussGT is ~2150 and RaikoMX ~2030. It seems that with the ELO as more battles are run it tends to compress the ratings. --Skilgannon 19:10, 24 February 2009 (UTC)

Multiply the Glicko-2 by 0.98 is good. DurssGT at 2141 and RaikoMX at 2021 or multiply the ELO there by 1.02 should be fine for now, shall it? » Nat | Talk » 19:29, 24 February 2009 (UTC)

No, the ratings 'center' at 1600. So multiplying the Glicko-2 'spread' by ~0.939 would be correct. --Skilgannon 19:57, 24 February 2009 (UTC)

So if I get 2026 Glicko-2, can I assume that I've a ticket for The2000Club? » Nat | Talk » 20:14, 24 February 2009 (UTC)

Just saw this... I did scale the Glicko-2 ratings to match ELO's std.dev a while back (see Darkcanuck/RRServer/Updates, Nov30) at Skilgannon's suggestion. It seems they've continued to drift apart, which is a problem that is likely to continue. APS is the only truly stable measure, so perhaps that would be a better club grouping? If you want things on the server tweaked, add them to the server's talk pages, because I don't always search the entire wiki... --Darkcanuck 06:21, 26 March 2009 (UTC)

New Thai RoboWiki

Hi, I'm now getting the new thai robowiki (http://wiki.robothai.net/) running. I'd want to know who is this wiki administrator? I'd like him/her to just process one database query for me (I talk to you, Voidious) :)

INSERT INTO `(whatever prefix or not)interwiki` VALUES('th','http://wiki.robothai.net/wiki/$1',0,0);

That's all, I just want the interlanguage link between two wikis. I've finish set up on my wiki. You'll see that English link at the language box in the left :) » Nat | Talk » 17:39, 1 March 2009 (UTC)

About compiling robots

Hi! I took a look at OcnirpSNG and WeekendObsession in NetBeans and I was totally surprised! My codesize calculated Ocnirp 250 bytes and WeekendObsession 253 bytes. But both of them are under-250 byte nanos! I'm really wonder what you compile your robots with. I have my new nano with 250 bytes, so it's very crucial for me. --HUNRobar 21:01, 1 March 2009 (UTC)

Apparently compiling with Jikes shaves a few bytes off sometimes. I never bother though because it's only a small number --Rednaxela 21:39, 1 March 2009 (UTC)

Note, I use eclipse to compile my robot. Don't know what compiler it use, but it seem that it can reduce more codesize =D » Nat | Talk » 12:11, 2 March 2009 (UTC)

Hurray! I made an Eclipse project for my bots and almost all of them gained 2-4 bytes! I think I must figure out something to develop on them. For instance, my new nano is 247 bytes now. --HUNRobar 19:14, 2 March 2009 (UTC)

Symbolic Dynamic Segmentation

Have anyone work with Symbolic Dynamic Segmentation? I just finish 3 hours writing/debugging my Symbolic Dynamic Segmentation gun and it's extreme slowly. At first, I use a log of 10,000 firing waves over 17 segments. It skip every turn since round 16. Now, I use log of 1,000 firing waves over 7 segments, skip a couple of turns for every 10 rounds. Do anyone have any ideas on improved the performance? I'll post the source after I finished running my TC2K7. » Nat | Talk » 13:46, 10 March 2009 (UTC)

  • I haven't tried Symbolic Dynamic Segmentation, but maybe this algorithms can help you String Search Tutorial. --zyx 16:17, 10 March 2009 (UTC)
  • Note: SDS doesn't search within a long string, but search within a list of strings. I'll try to reimplements it as one large string, but I must figure out how first... » Nat | Talk » 13:47, 11 March 2009 (UTC)
    • To implement it as one large string you'd need to either 1) compress each data point to fit within 16 bits, 2) make certain characters of the string use characters never used in other parts, or 3) you'd need add a "marker" character to either the start or end of each data point. Note, this might possibly be lower performance, if you use builtin string searching with option #2 or #3. This is because the string functions would compare unaligned spots too. Note, I say "might", because it could still be faster if the optimization of the builtin string functions is good enough. --Rednaxela 15:24, 11 March 2009 (UTC)
      • That is what I think, prefix a segment with special character (say (char)255), then perform a String.indexOf(). In order to find the GF, record hit bin before that special character. After reading, I think it is now PM-GF, not SDS. One thing I know, Virus have 10,000 log recorded. It use ordinary array where I use LinkedList :( I'll try ArrayList and if see can increase the log size... » Nat | Talk » 01:36, 12 March 2009 (UTC)
  • I think that instead of make it one large string, you can tweak the algorithm to work. Let's say you have M strings, and N[i] is the size of string i, you can do something like:
function Knuth_Morris_Pratt(text[][], pattern[])
{
  build_failure_function(pattern[]); 
  i = 0;
  j = 0;
  k = 0;
  for( ; ; ) {
    if(j == N[k]) {
      if ( ++k >= M ) break; // we reached the end of the last string
      else i = j = 0; // Reset state to empty string, and point to the start of the string
    }
    if(text[k][j] == pattern[i])
    ...
  }
}
  • If modified to use multiple string, I think the String.equals() is faster anyway. I currently use equalsIgnoreCase(), but with same segment generate function, using equals() does same math but faster? I think I'll move this discussion to my research page. » Nat | Talk » 01:36, 12 March 2009 (UTC)

Virtual gunheat-based Wave

Hi, Rednaxela and Skilgannon. What is advantage of virtual enemy wave that fire two tick before energy drop detect? I can't think any advantage of this. » Nat | Talk » 08:14, 27 March 2009 (UTC)

It gives you 2 extra ticks of surfing time, so you can get to a slightly higher GF than other surfers. --Skilgannon 11:34, 27 March 2009 (UTC)

Just for when there are no active wave, right? Do you have any rating diff between having this and not having this? » Nat | Talk » 11:55, 27 March 2009 (UTC)

No, this is enabled permanently, even when other waves are in the air. I thought it might help for second wave surfing, so I left it in. Perhaps I should disable it if there are 3 waves in the air already, for better execution speed. I think it might confuse guns that wait until their gun is aimed by moving and then making them want to aim elsewhere, so they fire less often. My first few versions of this were buggy, so I'm not sure what the actual rating diff is. --Skilgannon 14:09, 27 March 2009 (UTC)

Robocode Physics

Just curious about Robocode Physics, two questions here:

  • When bullet fire, where it really fire? The discussion on the old wiki make me confused, is this correct? (each line is each tick)
  1. Robot called setFire(double). Bullet place at distance -bulletVelocity behind current location
  2. Robot move to next location. Now bullet is at robot old location.
  3. Robot move. Bullet is bulletVelocity far from the position last 2 ticks.
Correct? I not sure bullet fire from first or second tick.
  • Incorrect. It goes like 1a) Stuff happens 1b) Robot calls setFire(double), 2a) Robot moves to next location, and bullet is placed at the new location, 2b) Robot thinks some more, 3a) Robot moves more. Bullet is now bulletVelocity from the position the robot was at after 2a. The "a" parts are the physics engine running and the "b" parts are the robot code processing and are listed seperately to clarify. On a related note, once on the old wiki, in the context of enemywaves, ABC stated it basically like this "tick -2: enemy decided where to fire, tick -1: enemy fired, tick 0: energy drop detected". --Rednaxela 17:23, 5 April 2009 (UTC)
  • So bullet come from where the robot is a tick after fire, right? The discussion that confused me is about robocode physics. It said that when fire, bullet place at -bulletVelocity so it may have some collisions before actually bullet fire. Now, I know that this is incorrect. Thank you very much. :-) » Nat | Talk » 17:34, 5 April 2009 (UTC)
  • It's more like this technically: setFire() is the tick BEFORE firing, and the bullet comes from where the robot is at the tick DURING firing (meaning the tick after setFire()). Also, the bullet being placed at -bulletVelocity was basically just a way of saying that you should make your wave's radius -bulletVelocity on the tick which you call setFire(), because the tick you call setFire() is the one BEFORE firing and want the radius to be 0 during actual firing. --Rednaxela 17:43, 5 April 2009 (UTC)
  • Is this processing order of robocode correct? Some old discussion confused me again.
  1. Battlefield (re)draw (onPaint(Graphics2D) called)
  2. Robot process until taking action (calling execute())
  3. Time is updated (time++; getTime())
  4. Bullets move and check for collisions (any events put in events queue)
  5. Robots move (heading, acceleration, velocity, distance, in that order, any events put in events queue)
  6. Robots perform scans (and collect team messages) (any scan or message received events put in events queue)
  7. Robots process events queue, in this order:
    1. WinEvent, SkippedTurnEvent
    2. StatusEvent
    3. CustomEvent
    4. RobotDeathEvent
    5. BulletMissedEvent
    6. BulletHitBulletEvent, BulletHitEvent
    7. HitByBulletEvent
    8. HitWallEvent
    9. HitRobotEvent
    10. ScannedRobotEvent
    11. PaintEvent
    12. DeathEvent
  8. Battlefield (re)draw (onPaint(Graphics2D) called)
  9. Go to steps 2.
Correct? But, where onMessageReceived call? Directly when received or put int event queue, too?

Thank you in advance. » Nat | Talk » 14:13, 5 April 2009 (UTC)

  • That's mostly correct. DeathEvent though is the LAST event processed, and you forget StatusEvent exists (StatusEvent is a very nice thing), and yes onMessagedRecieved goes in the event queue too. Actually, in current robocode at least, onPaint ALSO goes on the event queue even though you don't get the event object itself. See the list of subclasses of robocode.Event. For full list of event priorities, see this glorious page! :D --Rednaxela 17:35, 5 April 2009 (UTC)
  • Just found where priority is lists. Actually, I think I found it already, but my Chrome don't navigate to correct method, instead it scroll to bottom of page. These priority list is from RobocodeSG page from old wiki, as I can't find current priority anywhere. Does it mean that battlefield is paint before onDeath process? » Nat | Talk » 18:11, 5 April 2009 (UTC)
  • Well, it means that Robocode asks the robot what to paint before onDeath, but I'd guess it doesn't actually paint it on the screen until later. Note that in current versions of robocode, the the Graphics2D object isn't a normal java one, it's a 'proxy' type one that queues calls to it, to send to the screen later and also record in replay files, etc. --Rednaxela 18:47, 5 April 2009 (UTC)
There are no threads on this page yet.