Spec: Phantom Meteor Gravity Movement — bullet dodging via learned danger field #116
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem Statement
EvoBot currently has no intelligent movement system. Against bots with statistical or evolved guns, standing still or moving randomly makes EvoBot an easy target. Traditional wave surfing is effective but discrete (pick bin A or B) and widely used. We want a continuous, physics-based movement system that learns the enemy's aim patterns and dodges accordingly.
Solution
Implement a phantom meteor gravity movement system. When the enemy fires, spawn a spread of phantom bullets ("meteors") across the possible escape angle arc, weighted by a learned danger histogram. The bot moves by summing repulsive forces from walls, phantom bullets, and the enemy bot. Over time, the danger histogram learns where the enemy aims, and the bot naturally gravitates toward safe GF zones.
This gives wave surfing's statistical learning with gravity movement's smooth, continuous, non-linear paths — harder to predict and aim at than discrete wave surfing.
User Stories
Implementation Decisions
F = weight × K_bullet / dist²directed away from phantom position. K_bullet is a tunable constant.F = K_wall / dist²directed away from nearest wall point. Applied from all four walls independently.F = K_enemy / dist²directed away from enemy. Optional mild attraction at long range to maintain fighting distance (spring force around preferred distance).libs/gravity.nimcontaining the gravity engine, phantom tracking, danger histogram, and force computation. EvoBot.nim calls it each tick fromrun()oronScannedBot.Testing Decisions
What makes a good test
Tests assert external behavior: given a force configuration, does the bot move in the expected direction? No mocking internal force calculations.
Seam 1: Gravity engine (primary)
Feed known phantom positions, wall positions, and bot position into the gravity engine. Assert:
Seam 2: Danger histogram learning
Feed a sequence of wave-pass events with known GF bins. Assert:
Prior art
tests/handler_seam_v2.nim— assert-based self-check pattern. New tests follow the same style.Out of Scope
Further Notes