j131 learned movement: real bullet-endpoint resolution (TR_LEARNED_REAL_EVENTS, default off) + exact-geometry Gate A/B (inversion NOT fixed; state still the constraint)
This commit is contained in:
@@ -620,6 +620,15 @@ method onBulletHitWall*(bot: ModularBot, e: BulletHitWallEvent) =
|
||||
bot.strafeMover.removeBulletNear(e.bullet.x, e.bullet.y)
|
||||
bot.surfMover.removeBulletNear(e.bullet.x, e.bullet.y)
|
||||
bot.learnedMover.removeBulletNear(e.bullet.x, e.bullet.y)
|
||||
# Real wall endpoint of an ENEMY bullet. On the running server (0.35.5) a
|
||||
# BulletHitWallEvent is delivered only to the bullet's OWNER
|
||||
# (`addPrivateBotEvent(bullet.botId, ...)`), so this branch is a no-op live;
|
||||
# it is wired so a server that exposes enemy wall hit-points feeds the
|
||||
# exact-geometry wave resolution instead of the arrival-deadline proxy.
|
||||
if e.bullet.ownerId != getMyId():
|
||||
discard bot.learnedMover.resolveEnemyBullet(
|
||||
e.bullet.x, e.bullet.y, degToRad(e.bullet.direction),
|
||||
e.bullet.ownerId, bot.tick, false)
|
||||
|
||||
method onBulletHitBullet*(bot: ModularBot, e: BulletHitBulletEvent) =
|
||||
discard bot.resolveOwnBullet(e.bullet.bulletId) # bullet-vs-bullet: free the slot
|
||||
@@ -630,6 +639,13 @@ method onBulletHitBullet*(bot: ModularBot, e: BulletHitBulletEvent) =
|
||||
bot.strafeMover.removeBulletNear(e.bullet.x, e.bullet.y)
|
||||
bot.surfMover.removeBulletNear(e.bullet.x, e.bullet.y)
|
||||
bot.learnedMover.removeBulletNear(e.bullet.x, e.bullet.y)
|
||||
# `e.bullet` is OUR bullet; `e.hitBullet` is the bullet it struck. When that
|
||||
# is an ENEMY bullet, the event exposes its real endpoint + heading - a real
|
||||
# resolution for a wave that would otherwise wait for the deadline.
|
||||
if e.hitBullet.ownerId != getMyId() and e.hitBullet.bulletId != 0:
|
||||
discard bot.learnedMover.resolveEnemyBullet(
|
||||
e.hitBullet.x, e.hitBullet.y, degToRad(e.hitBullet.direction),
|
||||
e.hitBullet.ownerId, bot.tick, false)
|
||||
|
||||
method onHitByBullet*(bot: ModularBot, e: HitByBulletEvent) =
|
||||
# Feeds the ram bullet-rain abort window. Accumulate REAL ENERGY (the server's
|
||||
@@ -637,6 +653,11 @@ method onHitByBullet*(bot: ModularBot, e: HitByBulletEvent) =
|
||||
# energy/turn rate (see movements/ram_decision.bulletDamage).
|
||||
bot.ramDmgAccum += bulletDamage(e.bullet.power)
|
||||
bot.moveTracker.registerHit(e.bullet.power, e.bullet.direction, getX(), getY())
|
||||
# A real ENEMY bullet hit us: its endpoint (our impact point) + heading give
|
||||
# the wave's EXACT straight line, so resolve and drop that live wave now.
|
||||
discard bot.learnedMover.resolveEnemyBullet(
|
||||
e.bullet.x, e.bullet.y, degToRad(e.bullet.direction),
|
||||
e.bullet.ownerId, bot.tick, true)
|
||||
|
||||
proc enemyEnergyForReport(bot: ModularBot): float =
|
||||
## Last-scanned energy of the enemy the report is about (current target,
|
||||
|
||||
Reference in New Issue
Block a user