What’s the most basic repair AI possible?
1) Friendly room HP less than 100% – target condition room
It’s a good start! At least your crew will go to any damaged room and repair it. Highest seniority crew, who have been on your ship the longest, will go first. It might be a long distance for them if there are closer crew, but they will get there eventually. Crew with this one command will sit in the room once it’s repaired, and keep taking damage if the opponent keeps shooting the same room.
What if we improved this AI so that crew went back to a home room once all rooms are at full health? This will keep them from getting shot as much, since a room that was just damaged is likely to get damaged again.
1) Friendly room hp less than 100% – target condition room
2) None – target laser room
Now, our crew will repair, but once the room is repaired, they’ll go to the closest laser room that has an open spot for them. If the damaged room was a laser room, they’ll just sit there and keep getting shot. For this reason, it’s a good idea to set up your crew with different home rooms. Also, the home room is the one that they will be boosting most of the time, so it should be a room that matches their highest stat. Have your high weapon stat crew with home rooms of lasers, missiles, or cannon; have high science stat crew in your shield and teleport; etc.
OK, so above AI is working great until you upgrade and get to this ship.
It’s big and it seems like your crew always run really far to get to the damaged room. This is because the highest seniority crew will go to the damaged room first. Imagine your captain (the oldest crew) is sitting in the hangar as his home room, and then the bottom right reactor is damaged. He’s got to run clear across the ship and wait for two elevators to get over there. Your reactor is destroyed and you’ve taken lots of hull damage by the time he reaches the room.
How can you fix this? Assign crew to repair rooms NEAR their home room. Imagine the hangar crew had this AI:
1) Ability command
2) Your Hangar HP less than 100% – target condition room
3) Your laser HP less than 100% – target condition room
4) Your missile HP less than 100% – target condition room
5) None – target hangar
Now your crew will repair only rooms on the left half of the ship! It will be a short trip. (Except the PP over by the shield.)
Similarly, you can set up your shield crew to handle the right half:
1) Ability command
2) Your Shield HP less than 100% – target condition room
3) Your AA HP less than 100% – target condition room
4) Your android room HP less than 100% – target condition room
5) Your reactor HP less than 100% – target condition room
6) None – target your shield room
Repair in stages
Now you’re cooking! Crew is stepping into rooms to repair quickly, then stepping out again to preserve their health. Now what if you used multiple sets of crew, so that a second set would help repair if everyone who was originally told to repair the room died? Imagine a shield crew that you want to remain speeding up the shield for the early part of the battle, then go repair the left side of the ship if you’re taking damage there.
1) Ability command
2) Your shield room hp less than 100% – target condition room
3) Your ship HP greater than 50% – target your shield room
4) Your Hangar HP less than 100% – target condition room
5) Your laser HP less than 100% – target condition room
6) Your missile HP less than 100% – target condition room
7) None, target your shield room
Keep crew alive
Crew HP doesn’t affect their ability or room boosting stats, so a crew with one health will do just as good a job speeding up your weapon as a crew with full health. For this reason, it’s good to add a command to have the crew “retreat” to a safer room when they are at 25% health. This safe room should be different from their home room, but still a room type that benefits from their highest stat. This command should be right under the ability command. The only downside is that it can increase traffic into and out of the focus fired room. If your crew is coming into the focused room to repair and is damaged below 25% before they even get one repair action off, they will turn around and leave. This may jam up an elevator for the next crew trying to enter and repair. Still, it’s a good tactic that can keep your ship running fully boosted.
Python 3 improvements
With python 3 and the continue current job command, you can have crew operate in stages, without specifically limiting yourself to stages when the ship HP changes. You just have to provide conditions based on different percentages of room health, so that crew with 100% will repair the room first, then crew with 50%. Take a look at the example below; this crew is primary repair for rooms on the right side of the ship, but will also go repair rooms on the left if they drop below 50%. If any hangar/left side crew are still alive, they’ll have preference to repair your lasers first because they are set to repair them at 100%. The key command is command 3 – it will make sure your crew will repair a room to full health. If you had command 5 without command 3, your crew would repair the hangar up to 50%, but then leave to go back to their home room.
1) Ability command
2) Your HP less than 25%, target your laser (crew will run to pp since it’s the closest laser, and is science boosted)
3) Target room HP less than 100%, continue current job
4) Your shield room hp less than 100%, target condition room
5) Your android room hp less than 100%, target condition room
6) Your Hangar HP less than 50%, target condition room
7) Your laser HP less than 50%, target condition room
8) None, target your shield room
Adjust your repair AI as you go. Rooms that get shot more will need more crew set up to repair them. For rooms that get shot all the time, make sure that crew from an adjacent room are stationed to repair them quickly. Don’t have an elevator in the primary path. Finally, not every crew has to repair. It’s an important role and many of your crew should repair at some point, but sometimes the role that crew is doing is too important to leave their dedicated room.