Nene/Understanding
This article is about understanding Nene, the reluctantly top-10 robot.
Contents
General
Originally Nene was not designed to be a top anything robot. Her codebase was originally a experimental codebase where I shoved any interesting bits of code. Which made it a development platform.
Radar
Nene's radar was designed to be as efficient as possible. When a round starts the radar controls movement, gun and radar control. This is because at this point it does not know where the enemy is. The robot then spins all parts so that its radar will turn towards the center of the battlefield. Which is a slightly more efficient method of its initial scan.
Once it finds the enemy, it determines if it can get another scan without having to turn any other parts of the robot. If not it enters the radar correction mode. This only occurs on the first initial scan. It will reverse the direction of its gun and turn so that its radar doesn't lose sight of the target. This is required because we were turning the gun and the body to give it a much greater then average scan radius in the first place.
After this is completed, the radar gives up control of the gun and body to the targeting and movement respectively.
Structure
Nene has a non-standard robot design. Every class extends the previous class, and it is built up like a tower. This allows data define din previous classes to be used in later ones. Such as enemyAbsBearing, and other such values. However despite this benefit, the design is somewhat clunky and difficult to manage in many cases. It is easy to forget which class something is defined in. I would not recommend this design to anyone else.
Movement
Victory Dance
If there are no waves of any kind in the air, and the enemy robot is dead. Nene does a simple victory dance where she stops all forward/back movement and spin in place while randomly changing colors.
Waveless Movement
At the start of the round or when there are no waves of any kind in the air, Nene enters a special waveless movement mode. This mode is mainly used to keep her distance from enemies and walls.
This movement is a simple Minimum Risk Movement, which is similar to what I had used earlier in my robot Seraphim for the same purpose. The movement avoids the enemy robot and avoids going to close to the walls. It will eventually settle somewhere between the enemy and the walls. However it has a special code to prevent it from getting trapped in a corner.
This is important because its surfing movement, while intelligent enough to avoid getting caught in a corner itself. Isn't intelligent enough to figure a way out of a corner if it is already there (such at the start of a round) and dodge bullets at the same time. Which would often mean it would end up dying quickly on the start of a round in some rare cases.
Unlike a melee Minimum Risk Movement, this movement is used only for finding a superior position on the battlefield for its surfing movement, rather then dodging bullets itself.
Surfing Movement
Nene's movement is both at the same time very simple and very complex. It eschews a movement flattener. But it also has Gun Heat Waves, Bullet Shadows and Precise Intersection.
Nene is a true surfer. It calculates the GuessFactor range it would cover when a wave would pass it, and determines the risk at that position by way of precise intersection and kNN. It then moves in the direction which it considers least dangerous.
It considers 3 different possible moves. Forward, Back and Stop.
Maximum Escape Angle
Nene uses the standard asin(8 / waveSpeed) method to determine maximum escape angle. It however also multiplies this by the direction, to avoid having to handle it separately. It does not multiply this by any factor, such as 1.1 or 1.2. The robot did not clamp GF values to -1 to 1, which means a multiplier is unneeded.
It does however clamp shadow factors to -1.1 to 1.1. This is done mainly for improving the visual display of bullet shadows when painting rather then for any kind of mechanical benefit.
Driver
As with most true surfers. It uses a driving algorithm to determine how it will move. This is encloses within its predictMove method. It is fairly simple in that it determines takes an orbit center that it then tries to drive around at a certain distance. It reduces its maximum velocity if it is moving too quickly when approaching a wall, to better avoid hitting it.
Distancer
Its distance function is fairly simple. Under or over it it has a minimum/maximum distance and a maximum turn which will be achieved at that distance. This allows it to avoid turning to sharply away when close to an enemy, or too sharply towards when to far away.