Short Description: Program and control autonomous vehicles using a remote control handset or circuit conditions and zones. Can be used for base enemy base assault, patrols, friendly base navigation, vehicle-based mining, vehicle-based resource transportation, and more advanced applications. Works with vanilla and modded vehicles.
Name: aai-programmable-vehicles
Factorio Version: 0.14
Mod State: Beta
Dependencies: Base, Data Raw Prototypes, Detached Gun Sounds, Off-Grid Effects, AAI Programmable Structures, AAI Signals, AAI Zones, AAI Vehicles: Miner, AAI Vehicles: Hauler
Optional Extras: Bullet Trails, AAI Vehicles: Chaingunner, AAI Vehicles: Flame Tumbler, AAI Vehicles: Laser Tank
Author: Earendel
Downloads: Mod Portal
Licence: See below
Long Description
The Advanced Autonomous Industries: Programmable Vehicles mod gives all car-type vehicles some basic AI and allows you to command, control, and automate vehicles.
Vehicle Turrets
Any vehicles with a weapon act like a turret when they are not be directly driven by a player and will shoot at enemy targets. If you hop out of your car to build something then your car will defend you.
RTS-style Command & Control
You start with a Unit Remote Controller, a remote control handset that lets you select groups of units and order them around. The movement commands use biter AI. It can be used to send miners to resource zones, order haulers around, or order vehicles towards enemy bases.
Paths and Waypoints
Press Y (twice) to get a Path Remote Controller. This lets you add waypoints to any number of paths.
Vehicles can be sent to a path start to follow a complicated path around your base. Waypoints can be attached to players other vehicles so you can have a vehicle loop between a mining vechile and a vehicle depot without needing to use any combinators.
Hauling Vehicles
Hauler-type vehicles have an automatic inventory transfer system based on their Unit Data (see below). Their default setting is to accept raw resources. Miner-type vehicles are by default configured to try and push resources to nearby haulers. All vehicles are by default configured to try and pull a bit of coal or wood from haulers so that they can keep running. Vehicle Unit Data settings can be set with a Vehicle Deployer or modified with the Unit Data Controller structure.
Unit Data
Vehicles can store signal data. The signal data can be read with a Unit Data Scanner, or set with a Vehicle Deployer (at deployment only) or a Unit Data Controller (at any time). Item Signals are used in the Automatic Inventory Transfer System (see below), but Item Signals and Virtual Signals (letters, numbers, zones) can also be used to store arbitrary information, such as unique identifiers, squad assignments, or signals to signify alternate behavior.
Automatic Inventory Transfer System
Hauler-type vehicles and other types of vehicle handle Unit Data a bit differently.
Most vehicles use any Item-type signals (Iron Ore, Piercing Rounds Magazine, etc) as a target amount of items to store in their inventory. If there is a Hauler-type vehicle nearby and the vehicle is below it’s target it will pull the missing items from the Hauler. If the vehicle is over it’s target amount then it will try to push the excess items to the Hauler IF the Hauler is set up to accept that item type. If a negative value is set it will always try to clear that type from its inventory. Most vehicles have default Unit Data of Coal 50, meaning they will try and take 1 stack of coal (for their fuel inventory). Miners are configured with Iron Ore -1, Copper Ore -1, Stone -1, Raw Wood 50, and Coal 100. This means they will try and get rid of Ore, and Stone but keep a bit of wood or coal for fuel and export the rest.
Hauler-type vehicles use any Item-type signals as acceptable limits for other vehicles to push items to them. Their default settings are to accept up to 12000 of raw resources. If two haulers meet and one is over it’s acceptable capacity for an item and the other hauler can accept that item then the other Hauler can take the excess up to their own acceptable limit. If you deploy a vehicle from a Vehicle Deployer it will be deployed with any signal data the deployer's build-in constant combinator (bottom right of the structure).
Other changes
The tech tree has been altered slightly to make it easier to get vehicles a bit earlier.
To help enforce a specialised vehicle roles a vehicle is only allowed 1 weapon type.
Enemy structures can prevent nearby construction.
Example Uses
Use tile scanning to flag resources with zones. Send miners to those zones. Send haulers to the miners and then back to a depot when they have collected items.
Deploy combat vehicles with signal data of a certain zone, then send then to their assigned zone for patrols or attacks.
If vehicle health drops too low send them back to the base for repairs.
Use the tile scanner to find enemy bases, mark those with attack zones, and send vehicles in to attack without your involvement.
Current issues
Vehicles use biter AI when commanded with Unit Remote Controller or sent to an XY-Tile with a Unit Controller. The biter AI can be a bit derpy.
Demo Factory Save File Tutorial Videos by Nilaus
1. Vehicles and Manual Commands https://youtu.be/paUEMY3lTyQ
2. Scanners and Controllers https://youtu.be/e93rbJmFTyU
3. Automatic Zone and Miner assignment https://youtu.be/z8zBhn4SBD0
4. Automatic Alien Search and Destroy https://youtu.be/e_S5FwEDxeY
5. Automatic Haulage from Miner to Depot https://youtu.be/QoVRsQ4e6RE
Tutorial Videos by Steejo
1. Structures and Vehicles https://www.youtube.com/watch?v=tduRKYp_-ng
Tutorial Videos by Seeeno (German / Deutsch)
1. Overview / Überblick: https://www.youtube.com/watch?v=FIv0P9bUG3M
2. Zoning / Zonen : https://www.youtube.com/watch?v=Mumq28aVCyM
3. Auto-Zoning / Auto.-Zone: https://www.youtube.com/watch?v=9ODmYLhamng
4. Military / Militär: https://www.youtube.com/watch?v=woSei_ziAmo
5. Logistics / Wirtschaft: https://www.youtube.com/watch?v=dKhWarfOcvg
Instructions
The Programmable Structures mod forum page has the details of structure inputs options and potential outputs. In the posts below are some basic but useful vehicle-specific setups to get you started but they can be improved. You are encouraged to try and make some clever configurations of your own and post them in this mods forums thread.
Vehicle Deployer If you deploy a vehicle by hand (place it down) then it will have some default Unit Data based on it's type (miners export ore, haulers accept ore, vehicles request fuel). A vehicle deployed from the Vehicle Deployer will NOT have these defaults so you can set your own using the attached combinator. It is useful to have a separate deployer for miners, haulers, and other vehicles categoriesd by the ammo type they use. If you're feeling clever, you could instead use 1 deployer but change the signals based on the type of vehicle currently in the chest.
Vehicle Depot You can use a Vehicle Depot to rapidly drop off cargo from vehicles, or resupply vehicles. There is a built-in combinator to the top right. Any signals set there or connected to it set the depot's exchange data, which functions like unit data. When interacting with most vehicles the depot acts like a hauler, but when interacting with haulers it acts like a normal vehicle. The effectively means that it acts as though it has a priority between the two.
The simple concept is that setting a high value means the depot is accepting that item, setting a negative value means it is trying to give that item away.
Here are some examples:
Depot signal is 20 Coal but has 0 Coal, Vehicle signal is -1 coal but has 200 coal: 20 Coal is given to the depot.
Depot signal is 200 Coal but has 50 Coal, Vehicle signal is -1 coal but has 200 coal: 150 Coal is given to the depot.
Depot signal is 200 Coal but has 50 Coal, Vehicle signal is 50 coal but has 200 coal: 0 Coal is given to the depot.
Depot signal is -50 Coal but has 50 Coal, Vehicle signal is 50 coal but has 200 coal: 0 Coal is given to the vehicle.
Depot signal is -50 Coal but has 50 Coal, Vehicle signal is 50 coal but has 0 coal: 50 Coal is given to the vehicle.
Depot signal is 20000 Coal but has 200 Coal, Hauler signal is 500 coal but has 5000 coal: 5000 Coal is given to the depot.
Depot signal is -1 Coal but has 700 Coal, Hauler signal is 500 coal but has 0 coal: 500 Coal is given to the hauler.
Unit Data / Exchange Data Example