Simple Bullet Shadowing Surfer

Jump to navigation Jump to search
Edited by author.
Last edit: 12:00, 18 May 2019
Both Diamond and Gilgalad use bullet shadows but IIRC Gilgalad's code was optimized for speed and made it harder to understand.
If you plan on using bullet shadows with bins(Slightly less effective), both DrussGT and WhiteFang use it.
DrussGT calculates all the shadows before hand while WhiteFang calculates them when the bullet overlaps the wave(Easier to implement and shorter code).
BTW, anybody setting wave dangers as done below?
Position danger = (bulletPassed ? 0: chanceOfBulletCollision) * dangerWithoutShadows

Edit: fix a mistake

Dsekercioglu (talk)08:51, 13 May 2019

This is not correct, although I've made the same mistake the first time thinking about this.

The catch point is that, even if your bullet passed safely, you know the intersection must contain no bullet, so the shadow of the bullet still exists

Xor (talk)06:01, 17 May 2019
Sorry, I fixed the code.
My point was: Wouldn't it be smarter to deduct (100 - x) percent of the danger if the chance of the bullet colliding is x percent.
Dsekercioglu (talk)12:01, 18 May 2019

This is incorrect, because bullet shadow has nothing to do with whether bullets collide or not — it’s all about information. You know perfectly you won’t get hit in the shadow, so danger is 0. You still get hit by the part outside of shadow in the incoming wave though.

Xor (talk)07:51, 19 May 2019
Let's say we have wave1(distanceTraveled 300) and wave2(distanceTraveled 100).
I shoot a bullet and it is calculated that it will intersect with wave2 at the x point so I set the danger to 0.
The bullet collides with the bullet that is on wave1 and the spot on wave2 isn't safe anymore.
Dsekercioglu (talk)10:19, 19 May 2019

Okay, I think I get it. Would the formula be

 PositionDanger = bulletPassedWave == true ? 0 : normalDanger

And if you are surfing multiple waves, you can estimate the chance that the wave2 will have a shadow by calculating in the percent chance the bullet will collide and add that to your calculations. Of course, once wave1 breaks, you can know for sure whether the position is 100% safe or not.

Slugzilla (talk)14:54, 19 May 2019
 

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:BasicSurfer/Simple Bullet Shadowing Surfer/reply (9).