Robots are brave; sometimes a little too brave. Most of the time, it is better to restrain a foolhardy attack than to have to egg on units, but some games require a little more common sense from your minions.
The map options bar (in the top left of the screen by default) has a Set Retreat Zone button with the picture of a wrench in a circle. Click on it and then click on the map where you wish retreating units to go. A circle will mark the area. Multiple retreat zones can be set throughout the map and units will retreat to the nearest one. Once at a retreat zone they will wait until they are fully repaired, then return to whatever they were doing before. Retreat will do nothing if no zones are set.
Setting a retreat zone within an existing one will remove it. Holding Shift while setting retreat zones will let you set/remove multiple zones without having to click on the button each time.
Units have a button that will set them to retreat from battle to a retreat zone at 30%, 65% or 99% health. Right-click on the button to cancel the retreat order. When damaged, retreating units will show a medic symbol.
- Set a retreat zone within range of several Caretakers. They can repair damaged units quickly.
- Swifts, if given a retreat state, will automatically use their boost ability (if available) to help them rapidly escape an engagement when they get too damaged. This can be very helpful, and even allow them to evade some missiles and other tracking weapons if they're lucky.
- Jump-capable units (i.e Pyro, Constable) will automatically jump towards the nearest Retreat beacon if set to a retreat state.
- Default retreat state can be set in the game menu (Game/Unit AI/Initial States), so that you don't have to always set it manually.
- To set hotkeys for changing retreat state or setting retreat zones, navigate into the game menu and find common commands under hotkeys.