Bullet Shielding

Jump to navigation Jump to search

Sorry for the confusion caused. I just named things the wrong way. When I say segment intersection, I mean the safe area generated by the intersection of those segments, like in bullet shadowing. What I wonder is if, in a perfect universe where computers can compute with perfect precision, two bullets laying on opposite rays would collide or not. Note that the lines actually intersect, so the segments. The safe area, though, degenerates to a single point. So my doubt was like: Robocode actually checks for an intersection of those segments or for a non-degenerate safe area?

Note this degenerated from an actually valuable discussion into a stupid curiosity. :P

Rsalesc (talk)04:26, 30 August 2017

Robocode doesn't care about that safe area at all. In segment intersection algorithm, The first thing is to determine whether they are on the same line. If so, robocode just ignores the intersection. This behavior look strange at first, but it is friendly to those who new to robocode. This way they (when trying two stationary robot, etc. sample.Fire) won't confuse — why my robot collides its bullet with another all the time?

Xor (talk)04:31, 30 August 2017

Yeah, I was just interested in the behavior. Thank you again, that was pretty enlightening and makes total sense, it would be stupid if those bullets collided. Gotta take some time to make sure I understand all the Robocode mechanics.

Rsalesc (talk)04:46, 30 August 2017
 

After a long night, I just have to say that Bullet Shielding is the hardest thing... ever. You deserve a huge prize, man.

Rsalesc (talk)11:09, 30 August 2017

Thanks ;) Anyway, are you trying to build your own BulletShielder? Worth mention that a lot of good shielders are open source (although I haven't looked into any of them yet).

Xor (talk)13:51, 30 August 2017

Yes, I was. I started reading the tutorial, but I found it really counter intuitive, so I decided to go by the bullet shadowing approach (or very similar to it). I looked at EnergyDome after struggling for a few hours, just to notice that the only difference was the use of Virtual Guns and the multi-movement thing. So it was doing pretty much the same thing I was for the intersection. I got happy and thought I was going to find where my bug could be. At this point I couldn't even shield a single bullet, so the VG thing was not a game changer. It turns out that I couldn't fix it. I'm just supposing it's in the actual intersection algorithm, since I can't even shield against Tracker after moving a fraction of a pixel. It should work easily if was doing things right, correct?

Rsalesc (talk)14:17, 30 August 2017
Edited by author.
Last edit: 14:25, 30 August 2017

Even if your algorithm is correct, it won't work with wrong target. You could try SimpleBot 0.022c, which uses traditional HOT (for stationary bot) with random fire power. If the algorithm is all right, it would at least shield a lot.

Xor (talk)14:22, 30 August 2017
Rsalesc (talk)14:24, 30 August 2017

Just added a link to it ;) Just forgot that It is never released.

Xor (talk)14:26, 30 August 2017

You do not have permission to edit this page, for the following reasons:

  • The action you have requested is limited to users in the group: Users.
  • You must confirm your email address before editing pages. Please set and validate your email address through your user preferences.

You can view and copy the source of this page.

Return to Thread:Talk:Oculus/Movement/reply (25).

No, it's not enough. Anything below 1e-8 can be considered as round-off errors, and the firing range you shadowed is much much bigger. You may try some debug graphics to see if everything works as expected, say, if they collide at calculated point.

Xor (talk)15:12, 30 August 2017
 

That could be enough to cause a miss if you aren't moving to intersect the bullet. I think you should check what the predicted width of your shielded area is, and compare that to EnergyDome. It is a balance moving when you make the shot to get a bigger intersection area, because that means learning guns might learn your movement and not shoot HOT anymore. But not moving at all means your intersection width might be too small to be able to hit if enemies are predicting their movement.

Skilgannon (talk)21:27, 30 August 2017

Also remember that even if they aren't predicting their next location, if they make a shot while they are standing still (eg changing direction) then their aiming will be at your center and you will need to move when you fire to intercept the bullet.

Skilgannon (talk)22:14, 30 August 2017
 

Yes, this is crucial. But in my experience, when I set the threshold to 1e-14, it works pretty well — If the angle between your bullet and their bullet is below 1e-14, move. Else, don't move.

I also tried to take how good the intersection into account (etc. if the intersection is below 0.1, also move), but no improvement at all.

Therefore I think it's not because 1e-16 caused the miss — even 0 is not enough, when the angle is below 1e-14, the game just ignores the intersection.

Xor (talk)12:30, 1 September 2017