Increasing Missile Speed:
This line appears to make no sense at all!! Looking at it, ~v9 will
always equal ~v9, so the beep command will never happen.
The reason for this line's inclusion is that it can actually increase
the speed of the missile!!
Note: to fully understand the concept of sub-clicks,
have a look at Philip's tutorial.
Here's how:
The way AI Wars deals with missiles is that they move 4 spaces when
first launched, a further space for every line of code that is processed
while they are still active, and a further 4 spaces at the end of each
cybug's turn (assuming they have not collided with anything). Therefore,
this code:
-
launch missile
-
move forward
-
move forward
... is not really very efficient. The missile
will travel 4 spaces in the click. In the next click, it will travel one
space for the move forward
command and four spaces at the end of the click. The same for the next
click. So in 3 full clicks, the missile will only travel 4 + 5 + 5 = 14
spaces.
Consider instead if the cybug's code looked like
this:
-
launch missile
-
assign v1 50
-
assign v1 50
-
assign v1 50
-
assign v1 50
-
assign v1 50
-
assign v1 50
-
assign v1 50
-
assign v1 50
-
assign v1 50
-
move forward
Here, the missile travels 4 spaces when first launched.
The next click contains 10 commands, so the missile travels 10 spaces,
and a further 4 at the end of the click. So in this example, the missile
has travelled 4 + 10 + 4 = 18 spaces in just 2 clicks (a significant improvement,
which gives the enemy less chance to get out of the way).
Note: the maximum number of sqaures that a
missile can travel in one click is 14 (apart from the first one, in which
it always travels 4 squares) so if you missiles are not going this far,
you might try altering your code to change the situation.
So, if that made any sense, you should realise that this extra command
makes sure that Torque uses all his subclicks fully, and makes the missile
travel one extra square.
By the way, "beep" is a very useful debugging command. Instead of having
to trawl through a debug report, which slows the battle down when it is
being created, you can just run a battle and listen to whether your cybug
beeps when it should.