Multi-Rush AI

A small disclaimer: this page talks about the most complicated AI presented on the Pixel Perfect Guide. It delves into the world of end-game strategies with all of their complexity. Check out the home page for more basic guides if you’re just starting out. The guide below will be useful once you have a good understanding of rush AI, Python 3 researched, and at least three 100% rushers.

If you enjoy the content on this site, please consider supporting the hosting costs and time it takes to write new articles. You can paypal me though paypal.me/pixelperfectguide Whether or not you donate, you can always contact me@pixelperfectguide.com or on discord as rigging. I would love to hear feedback or chat about cool AI!

Why Multi-Rush

The rush ability in pixel starships is one of the most powerful because it allows you to front-load damage at the start of the battle. “Multi-rush” simply means using multiple rushers to rush a room in quick succession. Using multi-rush to punch through the enemy shield quickly or land boarders within the first few seconds will allow you to cripple the enemy ship. Just remember that multi-rush strategies are aggressive and that if your first assault fails, you will probably lose because many of your crew abilities have been used already. Rush crew are not good for a long battle because they need all of their training and items to give ability power. There are four common multi-rush strategies you can use:

Ion Rush – The ion cannon is the most powerful weapon in the game and its long reload time means that it’s a great candidate for rushing. A multi-rushed ion cannon can create insane DPS.

Hangar Rush – A hangar with five craft out has the best DPS in the game. Getting all craft deployed at the start of the battle is very powerful, and you can turn the hangar off quickly to save power. As a side benefit, it synchronizes the shots from the crafts so that you are more likely to score hull damage.

Teleport Rush – Rushing boarders is more aggressive than the first strategies because you are committing both a rush crew and a boarder for every boarder you send over quickly. However, if you can get a foothold on the enemy ship and disable rooms instantly this strategy has a huge payoff. A successful teleport rush will often win without taking any hull damage.

Teleport Rush with Cloak – This is very similar to the Teleport Rush, but uses the cloak to stage boarders. It is less likely to get interrupted and is a little easier to set up in terms of crew positioning. The cost for this is having to include the cloak room on your ship and armor it.

ION Multi-rush

What’s common between the ION, EMP, and PD? All of them fire a volley of shots. If you tried to do multiple rushes back-to-back, any rushes that occurred while the weapon was firing would be wasted. All of the examples of rush AI below will ensure that you rush the room super quickly, which is not helpful for rooms with a volley. The only way to rush rooms with volleys is with the staggered multi-rush described on this page. The trick is stationing the crew exactly far enough away so that the time it takes for them to run to the room is the length of the gun’s volley. The second rusher should run into the room just after the gun stops firing and rush it again.

If you have two 100% rushers and are trying to figure out what gun to put them on at the start of the battle – the ION is clearly the winner for straight damage. Even against a shield, it will do 3.3 damage per volley and the EMP will only do 2.1. Of course, the hangar and teleport both are very good when rushed, but serve different purposes than the straight damage of ION.

Hangar Multi-rush

Rushing out multiple craft from the hangar gives you a big boost in DPS early. The AI for doing so is incredibly short, but complicated in how it operates. It can be used on any room with no volley, but is primarily used for the hangar. Here’s what you’ll need to get set up:

-Multiple rushers, 100% is preferable. Let’s say they are A, B, C and D – with A being the oldest (most seniority) and D the newest

-Empty spaces equal to the number of rushers, in empty rooms. Let’s call the destination Room Y. By empty, I mean no crew can start in room Y or target it, at least when the battle starts. For example, if you have four rushers, you’ll need at least four places in stand in empty rooms.

-All rushers should begin the battle in the hangar.

1) Target room has no friendly – Use special power

2) Target room has no friendly – Target hangar

3) None – Target Room Y

You’re probably thinking there’s no way it’s that simple. But it is! The AI uses conflicting commands that cause the crew to target one room in one frame, and a different room in the next frame. This creates a “twitching” or “dancing” effect where the crew stays in place but oscillates back and forth very quickly. Each crew cycles through being the only crew targeting the hangar, and only executes their rush if they are the only crew targeting the hangar. No two rushes occur in the same frame. Skip down to “Frame by Frame Analysis” to see exactly what happens.

Remember that a room doesn’t have to be at full power to rush, so you should set the hangar to 1 power during the rush and then you can decrease it to 0 afterwards.

How to improve the rush crew

Even after the abilities are used, the crew will continue to “twitch” because in the three simple commands above, there’s never anything telling them that they can stop. Ideally we want these rush crew to be useful after they complete the rush. This is tricky to execute because the commands needed for the rush must have precedence at the start of the battle. If you just want the rusher to stand in a room to boost it and do no repairs, you can use the AI below. However, the main problem with this is that if the home room does not have another crew in it, your crew will go to the hangar because of command 2.

1) Target room has no friendly – Use special power

2) Target room has no friendly – Target hangar

3) Enemy ship has full HP – Target Room Y

4) None – Target home room (whatever room you want to boost)

Repair AI with these rush crew is actually possible, mainly because the rush itself is done within a second of the battle starting. None of your rooms will be damaged then, so you can have your crew’s repair command be above the rush commands and they won’t interfere with the multi-rush. Command 2 ensures they go to the right home room once the enemy ship is damaged at all.

1) Repair AI

2) Enemy ship HP < 100% – Target home room (whatever room you want to boost)

3) Target room has no friendly – Use special power

4) Target room has no friendly – Target hangar

5) None – Target Room Y

Teleport Multi-rush

Overview

Multi-rushing the teleport is the way to make sure your boarders get onto the enemy ship in the first few seconds of the battle. Unlike the hangar rush, you can’t have your rushers all start in the teleport since there isn’t room. Also, you’ll need your boarders to get to the middle point of the teleport room to be ready to go when the teleport is charged. The way to do this is to have a line of boarders entering the teleport from one side, while a line of rushers enters from the other side. Each rusher will fully charge the teleport as each boarder enters.

The teleport room is three blocks wide, so like all other rooms of that width it has three places for crew to stand (left, middle, and right). In addition, the teleport has a fourth place to stand, in the middle of the room. I’ll call it the “pad”, and it’s the location that crew go when they are told to board the enemy ship. The pad is different from the other three places to stand because an infinite number of crew can stand there. Think of the pad as a waiting zone, very similar to the waiting location next to a lift when crew wait for the elevator to come. In the case of the teleport, the hyperspace elevator comes and retrieves one crew from the pad whenever the teleport is charged.

Important note – to ensure the sequencing of rushers and boarders is even, all your rushers and boarders must have enough stamina to reach the teleport running at their fast speed. If this is not the case, start the rushers farther away to make sure the boarders are ready on the pad by the time their rusher arrives. You may need to rearrange your rooms to ensure that you have enough spaces to the left and right of your teleport that the boarders and rushers can both be in position.

Boarder Placement and AI

Boarding AI with multi-rush is straightforward, because the main goal is to get the boarders to the pad as fast as possible. If you already use the teleport, you can probably re-use whatever boarding AI you already have. The key is to stage the boarders correctly: one boarder should start in the teleport, and the rest should start in rooms to one side of the teleport. As soon as the battle starts, they’ll all enter the teleport and head to the pad. Start with very simple boarder AI until you get the multi-rush to work, and then add more complicated boarder AI.

1) None – Use special power

2) Enemy room HP > 0% – Target condition room

The most common error with boarder AI is not targeting enough rooms. For example, if the only targeting command for your boarders is “Enemy ship has full shield – target enemy missile room”, and the enemy has only one missile, then only three boarders will attempt to board. The missile only has three spaces so the three most senior crew will target them. If you have boarders sitting on your ship doing nothing, make sure you are targeting enough enemy rooms!

Rusher Placement and AI

All rushers should be staged in rooms on one side of the teleport, opposite the boarders. This way the boarders and rushers can enter the teleport at the same time and each rusher will fire their ability on one boarder. No rushers will start in the teleport, because the first rusher can fire his ability as soon as he moves into the teleport. The first boarder, who starts in the room, needs time to reach the teleport pad before the first rush fires.

The teleport rush AI is more complicated than the hangar rush AI, because teleport rushers still need to take turns targeting the teleport but there are many more rushers than can fit in the teleport. You’ll need to set up the rushers so that they run through the teleport without stopping in it, to allow the crew behind them to enter. Also, you’ll need to ensure that each rusher takes turns targeting the teleport so that rushers don’t use their abilities in the same frame and waste their rush. Counter-intuitively, the secret to doing this is to artificially limit the number of spaces available in the teleport room.

Imagine that the teleport was one grid space wide, like a security door. It would only have one place for crew to stand, plus the pad for boarders. In this case, only one rush crew could ever target the teleport in each frame. A Xin crew could only target the teleport in a frame if no higher seniority crew are already targeting it, and once that Xin crew targets it, no lower seniority crew can target it in that frame. With twitch AI, the Xin crew would stop targeting the teleport in the next frame, and the next lowest seniority crew would have a chance to target it. (See “Frame by Frame Analysis” below for this cascading effect). The easy way to ensure that the teleport has one open place is to put two defending crew in the teleport at the start of the battle. These two crew cannot move from the teleport until the rush is complete.

The last piece of the puzzle is to ensure that even with the twitch AI, the rush crew move toward and through the teleport. One of the rooms in the AI is the teleport, and the other room (Room Y) must be on the other side of the teleport from the rushers, so that the shortest path to Room Y runs through the teleport. This way, the rushers will run straight towards the teleport once the battle starts. In their head, they’ll constantly be changing targets, but since the route to both targets is through the teleport, they’ll run that way at full speed. The same constraints apply as the hangar multi-rush; Room Y that the rushers are targeting must have no crew in it.

1) None – Use special power

2) Target room has no friendly – Target teleport

3) None – Target Room Y

Once you implement this, you’ll notice that the rushers do run through the teleport, rush, and then run all the way to Room Y. At this point they’ll stop twitching because command 2 will be false as all the rushers will have arrived. Why do the rushers keep running to Room Y if they are alternating targeting the teleport and room Y? The short answer is that they spend most of their time targeting Room Y, so they’ll walk all the way there. Each rusher is targeting the teleport for only one frame, and then when they stop targeting the teleport the next lowest seniority crew targets it. The original crew will only target it again once all other rushers have done so. This means they will only spend 1/(# of rushers) frames targeting the teleport, and most of their time targeting Room Y. Don’t worry that the rusher might run all the way through the teleport without targeting it – even if you had 10 rushers, they wouldn’t be able to all cross over the teleport before 10/40th’s of a second had elapsed. Each one will have a frame where they are targeting the teleport and are also in the teleport to do their rush.

Teleport Multi-rush with Cloak

The multi-rush with cloak is the most offensive strategy in pixel starships. You can cloak your ship in the first frame of the battle, and then when you come out of cloak, your stacked boarders will all fly onto the enemy ship. With this strategy it’s possible to disable all your opponent’s reactors within seconds, if you have enough boarders and rushers.

You’ll need everything that’s required in the teleport multi-rush, plus the cloak room on your ship and another 100% rusher to rush it at the start of the battle (you can also use multiple rushers that add up to 100%). However, you’ll need one less rusher than boarder, because the teleport will charge once for you during the cloak.

Boarder Placement and AI

The boarder AI is identical to the teleport multi-rush, but the placement is easier. You don’t need the boarders to run into the room in a careful sequence, you just need them all to get to the teleport pad by the time the cloak expires. For a max level cloak, this is 6.5 seconds, which is quite a bit of time. One major benefit of running cloak multi-rush is that you have more flexibility when designing your ship, because you don’t need as much unobstructed staging room on either side of the teleport.

Rusher Placement and AI

The rusher AI is a bit more complicated with the cloak, but very doable. The key is that we want all our rushers to be in the teleport when the cloak ends, but we also want only one at a time to be able to target the teleport. In the non-cloak variant using the twitch AI, the rushers move all the way through the teleport because they only spend a small fraction of the time targeting the teleport. How do we get them to stay there until the cloak ends? The rushers can utilize the pad during the cloak, since an infinite number of crew can be standing on it. You can make your rushers go to the pad by telling them to board the enemy ship while your ship has cloak. Then when your cloak ends, the rushers will leave the pad and head to Room Y – but not before briefly targeting the teleport and using their rush. Like the non-cloak variant, make sure that two of the spots in the teleport and taken up with stationary defending crew, so that only one of the rushers can target the teleport at a time.

1) None – Use special power

2) Your ship has cloak – Target enemy random room

3) Target room has no friendly – Target teleport

4) None – Target Room Y

If your rushers have higher seniority (are older) than your boarders, you may find that the rushers take spots in the room you want the boarders to go to, if the random room they target happens to be the room type the boarders are trying to board. You can fix this by having the rushers and boarders target different rooms on the enemy ship. Just make sure that both rushers and boarders have enough spots to target on the enemy ship. If any crew are standing still while the rest are behaving properly, you are probably not targeting enough rooms.

Frame by Frame Analysis

You asked for it. Here is exactly what happens in the mind of your crew when you tell them to dance about. This specifically is the hangar multi-rush, but the principles apply to any dancing/twitching where crew fight for a spot in a room.

Our four rushers are A, B, C, and D, with A being the oldest. Each crew will execute all of their commands in every frame (40 frames per second), with oldest crew going first. When a crew executes commands, movement commands will happen first, then special ability commands.

1) Target room has no friendly – Use special power

2) Target room has no friendly – Target hangar

3) None – Target Room Y

Frame One

A executes commands first. He is targeting the hangar to start, which has B, C, and D in it already. This makes command 2 false; command 3 is the first true movement command, so A will execute that and start walking towards room Y. Command 1 is not performed, because A is not targeting the hangar, AND there are friendly crew in the hangar anyways.

B executes commands next. He is also targeting the hangar to start, which now has only C and D in it. Like A, he will start walking towards room Y, without using his special ability.

C executes commands next. He is also targeting the hangar to start, which now has only D in it. Like A, he will start walking towards room Y, without using his special ability.

D executes commands next. He is targeting the hangar to start, and everyone else has left! Command 2 is true so he will keep targeting the hangar, and command 1 is true so he’ll execute his rush! Crew do not need to be “in position” in a room to execute their rush. If you were paying attention closely, you would realize that crew D would target the leftmost position in the hangar (where the oldest crew in a room stands) because he is the only/oldest crew in the room now. Since he started as the newest crew on the right side of the hangar, he’ll stand walking to the left. Thankfully this doesn’t matter and the rush can be triggered from anywhere in the room.

Frame Two

A is currently targeting room Y, which has no one in it. This makes command 2 true, so he’ll target the hangar. He won’t use his rush though, because D is standing in the hangar.

The same is true for B and C.

D is targeting the hangar, which has A,B, and C in it. Command 3 is true, so he’ll start going to room Y.

Frame Three

A is targeting the hangar, which has B and C in it as well. This makes command 3 the first true command, and A will start going to room Y.

B is targeting the hangar, which has C in it. This makes command 3 the first true command, and B will start going to room Y.

C is targeting the hangar and is the only crew doing so. He will keep targeting the hangar due to command 2, and use his ability due to command 1. Our second craft is launched!

D is targeting room Y which has no one in it, so he’ll target the hangar.

Frame Four

A is currently targeting room Y, which has no one in it. This makes command 2 true, so he’ll target the hangar. He won’t use his rush though, because C is standing in the hangar.

The same is true for B.

C was targeting the hangar, but now A, B, and D are so he’ll target room Y.

D is targeting the hangar, which has A and B in it. Command 3 is true, so he’ll start going to room Y.

Frame Five

A is targeting the hangar, which has B in it, so now he’ll target room Y.

B is the only crew targeting the hangar, so he’ll keep targeting it and use his rush. The third craft is launched!

The AI continues in a similar manner until all the craft are launched, putting out one every 2 frames, or 2/40’ths of a second.