Skip to content

improved enemy core hypothesizing #3

Closed

Description

@subodhbgwt

add this field to player.init() near self.attackPos:
self.attackHypothesisIndex = 0

and then replace the opening determine attack destination section of attack in main with:

w = ct.get_map_width()
h = ct.get_map_height()
x = self.teamCore.x
y = self.teamCore.y

coreHypotheses = [
Position(w - 2 - x, h - 2 - y), # rotational symmetry
Position(w - 2 - x, y), # reflection across vertical axis
Position(x, h - 2 - y), # reflection across horizontal axis
]

def nextAttackHypothesis() -> None:
self.attackHypothesisIndex = (
self.attackHypothesisIndex + 1
) % len(coreHypotheses)
self.attackPos = coreHypotheses[self.attackHypothesisIndex]
self.attackMoveTimeout = 0
self.pf.reset()

if self.enemyCore is not None:
self.attackPos = self.enemyCore
elif self.attackPos is None:
self.attackPos = coreHypotheses[self.attackHypothesisIndex]
self.attackMoveTimeout = 0

then change the no infra timeout:
if self.attackMoveTimeout > 20:
changeAttackPos(ct)

to:
if self.attackMoveTimeout > 20:
nextAttackHypothesis()

Activity

  1. added a commit that references this issue on Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions