by Pi-C

Car equipment for train avoidance, logistic network integration, circuit network connectivity, fuel refill, ammo reload, radio control, enemy targeting, and gate control.

10 days ago
0.17 - 1.1
2 years ago
Latest Version:
1.1.2 (10 days ago)
Factorio version:
0.17 - 1.1
8112 times

As of version 0.1.22/0.2.2, a grid mod isn't strictly required anymore! This mod now adds a minimal grid to any vehicle based on the "car" prototype that doesn't have a grid yet. However, this grid has just enough slots that you can equip all of the Autodrive sensors. Also, you can't place anything but the Autodrive sensors in it. So an external grid mod like Vehicle Grid still is required if you want to place any other equipment in your vehicle! If you use an external grid mod, you will be able to place the Autodrive sensors in them.

I use the Armor Plating mod in my own game. It provides small grids (usually just a dozen slots or less) that allow you to place some armor plates in it, but the grids aren't big enough per default to fit all Autodrive sensors and an appropriate number of armor plates. Therefore, Autodrive will now extend the grids from Armor Plating so that you can use all sensors in addition to the intended number of armor plates.

*If you know of any other mods that provide very small grids, please let me know so I can add the slots necessary to install the Autodrive sensors to them as well! Also, at the bottom of this page, there's some information for mod authors who want to add their grids to the list themselves.


Autodrive started as a mash-up of ideas for making cars smarter using grid equipment sensors, mix-and-match style:

  • Train sensor: Car will sense a nearby moving train and brake automatically, or accelerate hard if already crossing rails. Does nothing useful if you're driving along rails!
  • Enemy sensor: Car will sense and target nearby enemies within range of its guns. Does nothing if vehicle is unarmed.
  • Fuel sensor: Car will refuel from its inventory.
  • Ammo sensor: Car will reload ammunition from its inventory.
  • Gate sensor: Car will open gates without a driver. Enables path finding through gates (see below).
  • Logistic network sensor: Car will interact with the logistic network when parked. Filtered trunk slots are refilled like a requester chest, and unfiltered slots are exported like an active provider chest. Grew out of my old Logiquipment mod.
  • Circuit network sensor: Car will interact with the circuit network via a Shortwave channel. Use the radio control to select a car and a radio to associate the two. Send X and Y signals to the shortwave channel to direct the car.

All work when driving a vehicle manually, when a vehicle is parked, and when it's under remote control.


The train sensor is your friend... but it's not perfect. For high-traffic train areas, block off the rails with walls to force cars to path to gates. When RC driving all the way across the map, quickly scan the dashed yellow path and ensure there are no long segments where a car will be driving along rails.

The train sensor will accelerate a car very hard to get it off the rails in time to avoid a fast train, so don't stand in front of your car because it might kill you to save itself! :-)

Logistic Network

  1. Put a logistic network sensor into a car grid.
  2. Set some trunk filtered slots (middle mouse btn). These will be treated like logistic request slots.
  3. Park the car inside a logistics zone with robots -- mod won't activate if a car is moving.
  4. Robots should arrive...

Note that:

  • Sensor only ticks every few seconds, so be patient! :)
  • Filtered trunk slots are used to set the request slots of a hidden requester chest.
  • Unfiltered trunk slots are considered trash and put into a hidden active provider chest.
  • If the current fuel is requested in a slot, fuel tank will be filled up first.
  • Entering and starting the car is fine -- items still in hidden chests will be reclaimed.

Remote Control

Autodrive includes a remote-control automatic pathing tool. The RC is similar to the one in AAI Programmable Vehicles. Fine to run both mods in a game, but the sensors only work when AAI vehicle AI is turned off and the Autodrive remote-control is used. Sensors will not work for programmed vehicles because the tick handlers will fight for control.

Vehicle Roboports

One long-time problem with AAI and vehicle grids is losing robots and some types of grid equipment inventory contents. Autodrive is designed to solve those bugs, so for example, it's fine to kit out a Hauler with a personal roboport and a burner grid generator, and send it off to build remote mining outposts.


Cars request paths with clearance max(width, height) x 1.6 which avoids crashes and getting stuck on other entities. Mostly. The Factorio path-finding API exposed in 0.17 sometimes returns strange paths.

Bounce Crashing

Cars bounce backward a bit after a crash which usually leaves enough clearance to re-path. You might have seen this behaviour in other RTS games. They also auto-heal themselves and the other entity a bit. :-)


A car driving with the RC will try to path between trees, bounce-crashing and removing any tree it actually hits. The Hauler can bulldoze its way, albeit very slowly, through any forest.

Circuit Network

The circuit network can be used to emulate the remote control:

  1. Build and place a circuit sensor in a car grid.
  2. Build a shortwave radio and set the channel (instructions in that mod) to something, say Car(17).
  3. Use the remote control tool to drag-select both the car and the radio at the same time. Car will bind to the chosen channel and display it as a yellow caption while selected, eg car:17.
  4. Send X and Y signals to the radio I/O port to direct the car to a drive to a map location.
  5. Car will check for a signal change once per second.

There's a Markers mod to help choose and track map coordinates. I guess these become something like waypoints, except they're just informational; you still have to explicitly send X,Y signals.

Cars report back on the same channel once per second:

  • V: current X co-ordinate
  • W: current Y co-ordinate
  • A: duration since arrival at current map location in ticks
  • B: duration since arrival at current map location in seconds (floor(A/60))
  • D: duration since departure in ticks
  • E: duration since departure in seconds (floor(B/60))

A and D are mutually exclusive.

Note that X=0, Y=0 doesn't work, due to Factorio's convention of treating 0 as no-signal.


The biggest UPS hits are:

  • Cars actively driving because it's Lua and on-tick. Having lots of vehicles is fine, just not all pathing and driving at once...
  • Cars with a logistic sensor left parked in a logistic network zone for no reason. Remove the sensor or park cars outside the yellow zone once they've finished logistics requests.

AAI Programmable Vehicles compatibility

Yes, except the RC and AI notes above. AAI stand-alone vehicles like the Hauler, Warden and Chaingunner work with both mods.

Logistic Carts compatibility

Yes, both mods can run together, but sensors don't work on carts.

Gizmos Car Keys (improved) compatibility

As contributor to Autodrive and author of GCKI, I recommend using this mod because GCKI and Autodrive complement each other: Claim a vehicle using the keys from GCKI to make it your own. If you summon it to a location near you later on, it will be there immediately. Hop in and use the Remote Control from Autodrive to drive wherever you want to.

Autodrive has no optional dependency on this mod because GCKI must depend on Autodrive (patches fixing Autodrive bugs have been disabled in GCKI as they are now implemented in Autodrive), and adding dependencies to both mods would result in a circular dependency error.

Krastorio 2 compatibility

Should be compatible. On request, I've added that equipment installed in a vehicle's grid will also be automatically refueled if it has a fuel sensor. This has been tested with Krastorio specifically, but should also work with equipment from other mods.

VehicleSnap compatibility

Autodrive and VehicleSnap don't seem to interfere with each other, so you can use both mods together. Autodrive does it's own pathfinding, but VehicleSnap may still be useful for the times you want to drive manually.

Vehicle Wagon 2 compatibility

If a vehicle controlled by Autodrive is loaded onto a vehicle wagon, it will be removed from the GUI, to be restored again on unloading. Thanks to robot256 for cooperating on this!

Compatibility with mods that provide grids

If you are the author of a mod that adds small grids to vehicles, and you think that you can't spare the number of slots necessary to accomodate all Autodrive sensors (currently 8, all are 1x1 items), you can easily add the name of your grids to those that Autodrive will extend. You just have to add this to data-updates.lua of your mod:

if mods["autodrive"] then
    table.insert(autodrive_global.extend_grid_name_patterns, STRING)

STRING may be a regular expression that matches one or several grid names, e.g.

table.insert(autodrive_global.extend_grid_name_patterns, "^my%-.+%-grid$")

It may also be a full grid name, e.g.

table.insert(autodrive_global.extend_grid_name_patterns, "my-car-grid")

If you're uncomfortable with regular expressions, you can use several line like these, one for each grid you want to add:

table.insert(autodrive_global.extend_grid_name_patterns, "my-car-grid")
table.insert(autodrive_global.extend_grid_name_patterns, "my-tank-grid")