[MOD 0.14] AAI Programmable Vehicles

Topics and discussion about specific mods
Ironhair
Long Handed Inserter
Long Handed Inserter
Posts: 53
Joined: Tue Apr 12, 2016 5:39 am
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by Ironhair »

So there is no property information tab that will tell me? Problems arise when you manually add a zone or of you want to send your miners to a specific ore field, but you have no idea what's the zone id...
I'm making do with making a different zone for manual orders, but it's not a nice workaround.
mrvn
Smart Inserter
Smart Inserter
Posts: 5925
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by mrvn »

Ironhair wrote:So there is no property information tab that will tell me? Problems arise when you manually add a zone or of you want to send your miners to a specific ore field, but you have no idea what's the zone id...
I'm making do with making a different zone for manual orders, but it's not a nice workaround.
Can't test right now but I don't think hovering over a zone marker with the mouse shows the id. Using a different zone for every miner is a good idea. Think of the zone ID is more like a job queue. Go there, then go there, and then there and so on.

Only thing where I use zones differently is for parking spots for idle haulers. There I make vehicle ID to zone ID. So hauler 3 idles at zone ID 3.
jinsediaoying
Burner Inserter
Burner Inserter
Posts: 16
Joined: Tue Feb 27, 2018 12:37 pm
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by jinsediaoying »

I think this mod should add a waypoint system to make ai programing easier.
I think there is 2 scenario are most commonly used.
1.a tank group patrol on a assigned path
2.hauler transport items between positions
If you can make those two very easy to use.
Then vehical transportion and defence system can become a daily use.

I write some ideas here: https://mods.factorio.com/mod/aai-progr ... 000ce4f3c7
I reorganized them below
Last edited by jinsediaoying on Wed Feb 28, 2018 8:40 am, edited 1 time in total.
jinsediaoying
Burner Inserter
Burner Inserter
Posts: 16
Joined: Tue Feb 27, 2018 12:37 pm
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by jinsediaoying »

Some suggestions
Step1: waypoint system
A waypoint is a special type of item that you can place on map.
It should have a unique waypoint id, this id should consistant even inside the inventory.
Its id and position and editable note should be shown on the mouse over ui.
When a waypoint id is input to a unit controller with a vehical id, that vehical will go to the position of that waypoint directly, no more x,y is needed.
Also when unit scanner scan a vehical, it should also return the nearest waypoint in range(maybe a 4x4 area?).

With this, the patrol behaviour can be set up much easier.
Tons of combinators and deciders will lost their job.
jinsediaoying
Burner Inserter
Burner Inserter
Posts: 16
Joined: Tue Feb 27, 2018 12:37 pm
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by jinsediaoying »

Step2: Useful Vehicle Interactors
2.1 Ground Interactor
A 4x4 floor that acts like a unit scanner, it only scans the vehicle right upon it, if there is more then one, then choose the one closest to its center.
Also act as a unit data controller, any signal input will send into the vehicle.

2.2 Waypoint Ground Interactor
a Ground Interactor that also is waypoint,

2.3 Pause Signal
When a vehicle have pause signal, it simply stops running the ai.

Technically, you can read vehicle id from a ground interactor to detect if it is occupied, and then send the signal back to the last waypoint interactor to ask it pause the vehicle. Then a waiting queue is created.
This can be done by a single decider.
By now, we are pretty much building an invisible rail network.

2.4 Fuel Inserter
Only insert items to the fuel slots.
Nice for a loading station
Last edited by jinsediaoying on Wed Feb 28, 2018 7:47 am, edited 3 times in total.
jinsediaoying
Burner Inserter
Burner Inserter
Posts: 16
Joined: Tue Feb 27, 2018 12:37 pm
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by jinsediaoying »

Step3: Path Plan System
3.1 Path Plan
Kind like a blueprint. It should have a unique path plan id.
It have an UI that you can design a path plan inside.
A path plan will contains a list of path nodes. Each node will contains a waypoint.
When vehicle achieved a waypoint, It will then go to the next.
There should be 3 modes: one-way, loop, and round trip.

The path plan id signal design will allow the possibility of change plan by circuit programs.

3.2 Path Plan Book
like a blueprint book, it stores path plan

3.3 Remote Path Control Center
A building that runs the path plan.
Input a path plan item or an path plan id signal, and a vehicle id, then the vehicle will follow that path.

3.4 Vehicle Computer
Can be an research or a vehicle equipment.
It will allow the vehicle run the path plan itself, without the need of a control center.
Set a path plan signal inside the vehicle's unit data to activate it.
When you have hundreds of haulers to manage in late game, this should much more convenient then the Control Center.
jinsediaoying
Burner Inserter
Burner Inserter
Posts: 16
Joined: Tue Feb 27, 2018 12:37 pm
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by jinsediaoying »

Step4: Improve pathfinding
With proper use of waypoint system. Long distance pathfinding can be avoid.
With path plan system, circuit network's coplexity is greatly reduced.
Those should benefit ups alot.
And players also can manually clear the path for the vehicles to further reduce the pathfinding requirment.

By the way, currently, I often see my hauler turning away suddenly, while the path is completely clear. I think this maybe is some kind of biter driver issue?
jinsediaoying
Burner Inserter
Burner Inserter
Posts: 16
Joined: Tue Feb 27, 2018 12:37 pm
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by jinsediaoying »

Step5: Disable the instant inventory transfer ability
It is overpowered, and the animation is weird.
Now let the inserters and robots do the job.
For the Warden, let it carry a robot port, and make all the vehicles part of the logistic net.
jinsediaoying
Burner Inserter
Burner Inserter
Posts: 16
Joined: Tue Feb 27, 2018 12:37 pm
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by jinsediaoying »

Finally, let's welcome the new era--Factorio On the Wheel
User avatar
Earendel
Factorio Staff
Factorio Staff
Posts: 716
Joined: Sun Nov 23, 2014 11:57 am
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by Earendel »

@jinsediaoying Thanks for the suggestions, you should be pleased to know that some of what you've asked for is planned. It's a little different in the details, so let me know what you think:

There will be GPS beacons (structures you can drive over) that return their XY position, but you can also give it id so that you can send vehicles to a specific beacon without needing its position (like the follow unit id). You'll be able to send units to individual Vehicle Depots in the same way, by their ID. (Eventually there will also be vehicle loadout stations where their equipment grids can be populated / edited, but that's a long way off.)

A waypoint system has been planed for a while, I've mentioned it previously here and there. It should be usable without the programmable structures mod. The original intention was that if you hold shift when giving an order it would add it to the current order queue, but sadly that's not possible. Instead you'll need to create a path before hand and then assign a vehicle to the path by ordering it to the path start location. (Or send it to the path id using a control tower).

Paths will be able to include dynamic destinations, like go from Miner 5 to Vehicle Depot 3, then loop. It would not matter if either of those targets moved.

There will be a Unit Control Tower command to deactivate a vehicle (set it to AI Off). It can't completely stop the ai processing but it's the same as if you do that manually. Sending an AI On command reactivates it (overrides the manual setting).

I won't be disabling the unit transfer mechanic by default, but I can add an option so that there's a limited transfer rate and an option to disable it.

There is a roboport vehicle planned.

Biter pathing ... sigh ... I've considered doing a lua pathfinder, but I have concerns over keeping the pathability model up to date and how slow it would be especially over long distances. It would probably be more effective for me to try and get source code access so I can try and expose the built in pathfinding as an API but I'm not ready to do that yet for time reasons.

That should cover a lot of what you've requested. The biggest gap is the vehicle interactors. There would have to be different ones for inventory and unit data, otherwise the items signals would get mixed. I guess there could be one type but there could be different connections for each... ? I'll have to think about that. Can you give me more information on how you'd use them?
User avatar
Asonael
Burner Inserter
Burner Inserter
Posts: 11
Joined: Thu Jun 22, 2017 8:37 pm
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by Asonael »

I seem to be having a problem. Chaingunners do not automatically attack biters, nor do biters seem to attack them. I've tried all 3 AI modes (Off, Auto and On) and they still refuse to auto-attack biters.

Mods include:
Everything AAI
Alien Biomes
Auto-fill (which neither fills chaingunner with coal or bullets)
Beautiful Bridge Railway
Bullet Trails
Enhanced Map Colors
Long Reach
Minimap Autohide
RSO
Text Plates
jinsediaoying
Burner Inserter
Burner Inserter
Posts: 16
Joined: Tue Feb 27, 2018 12:37 pm
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by jinsediaoying »

@Earendel
I'm very happy to hear that most of them are already in progress.
As long as the new design can let people build a hauler transport loop or a tank patrol loop without circuit programming, it is a good design.
Without the complexity of circuits, people can use it daily with belts, trains, and robots.

For the instant item transfer, seeing items flying on the map is just not factorio.
Thats the main reason why I don't like it.
If there is a proper unloading animation, then I can accept it between the hauler and depot, with rate limit.
jinsediaoying
Burner Inserter
Burner Inserter
Posts: 16
Joined: Tue Feb 27, 2018 12:37 pm
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by jinsediaoying »

For the interactor, It output signals as a unit scanner, and the input signals to it can turn on/off athe vehicle.
So how the signal inputs work is mainly depends on how your on/off signals work.
Since it will read out the vehicle id, you can always place a unit control tower or unit data control tower next to it to do the rest job.

here are some scenarios.
1.Loading/Unloading station
An interactor on the ground, with some inserters on the side.
The interactor itself works as a waypoint. (since a waypoint structure will take at least 1x1 space, and thus prevent other structures being build on that position, I think merge the functionality is necessary)
When a hauler steps on it, it will hold the hauler and let the inserts do their job until the pass condition is meet.
Conditions could be like "the ores in inventory is empty", "10s is passed", "the complex circuit next it said it is ok to pass", etc.
By the way, it would be convinent if there is a easy to use timer, either a conbinator or a buildin functionality.

2.Waiting Queue
When you have multiple vehicles sharing the same portion of a path, you need some organization. Like a unloading station or a gas station can be shared by many vehicles.
So you put like 10 interactors in a line, and connect them with deciders.
The desiders works like "if input position is occupied, told the output position hold the vehicle."
Its pretty much a vehicle version rail signal.
You can create a dedicate item to do the deciders job.

3.Railway Checkpoint
Ever worried of your vehicle and train crashed together?
Place a interactor (or make it a waiting queue) right infront of the rail.
Detectors send signals to let the interactor hold the vehicle when a train is coming close, and release it when the train id gone.
mrvn
Smart Inserter
Smart Inserter
Posts: 5925
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by mrvn »

jinsediaoying wrote:@Earendel
I'm very happy to hear that most of them are already in progress.
As long as the new design can let people build a hauler transport loop or a tank patrol loop without circuit programming, it is a good design.
Without the complexity of circuits, people can use it daily with belts, trains, and robots.

For the instant item transfer, seeing items flying on the map is just not factorio.
Thats the main reason why I don't like it.
If there is a proper unloading animation, then I can accept it between the hauler and depot, with rate limit.
If AAI vehicles could path find and reach a destination without bumping into things you could have inserters at the depot to unload. As is the inserters would quickly be destroyed because the hauler keep bumping into them. And what about miner -> hauler transfer? Or Warden -> chain gunner. You can't place an inserter between moving vehicles.

While one could make chain gunners return to base for refueling and rearming that seems impractical with miners. So one need to place a depo next to the ore patch and have miner deliver their ore there and then have haulers transport it back to base. Even with roboport vehicles that would complicate automatic mining quite a bit. Put it would be possible. Doesn't feel right though.

Apropos proper unloading animation: For hauler -> depot the hauler could be required to be on top of the depo and then tip over its cargo container and let gravity drop it into the depot. For miner -> hauler there could be some arm with a belt that swings out and then the ore runs over the belt into the hauler.

Not sure how you would tell the API about having extra animations. Would you have 2 sets of vehicles and then replace them mining-miner with unloading-miner and vice versa as needed?

Note: I would like to do this for train cars too with the bulk loader/unloader mod. So any tips how to do this are welcome.
jinsediaoying
Burner Inserter
Burner Inserter
Posts: 16
Joined: Tue Feb 27, 2018 12:37 pm
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by jinsediaoying »

The inserter crash issue is mainly a pathfinding issue. You can always put way point right infront of the loading point to adjust the drive in angle. The only requirement is that the hauler will stay stright on a clear path.

For the transfer between Warden and chain gunner, I think a vehicle robot port is the best solution. Both Warden and robots need red and green science, they are same level tech.

For miner->hauler and hauler to depot, with proper animation, Its actually pretty good. But for others, like items fly out the depot and fly into the hauler, it just not right.

Also, an alternative solution is to add a dedicate loading station, a garage that vehicles can drive in, it can have a one way out version and a two way out version. Vehicles can loading, unloading, refueling, fixing in a black box.

For the animation, I never touched factorio modding before, so I don't know neither.
But may the rocket silo can give you some clue? Its lunching animation.
Also the helicopter mod, it has a land state and a flying state.
mrvn
Smart Inserter
Smart Inserter
Posts: 5925
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by mrvn »

If the warden has a roboport then it can have logistic and construction bots. Chain gunners would then have a requester chest for fuel and ammo and the logistic bots would fly it over to them. I'm just afraid they will get shot down by the aliens in a fight. So please add something to enable/disable the bots.

The wardens repair magic could also become bot based. Same fear for the bots there too. But the magic repair beams are too powerful I think.

Note: as a side effect when a chain gunner enters a normal logistics zone it will get refueled and rearmed too.
jinsediaoying
Burner Inserter
Burner Inserter
Posts: 16
Joined: Tue Feb 27, 2018 12:37 pm
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by jinsediaoying »

Robots getting shoot down is not a thing that need avoid. It also happens when you do the laser tower crawl
Krivougolnik
Burner Inserter
Burner Inserter
Posts: 10
Joined: Fri Feb 23, 2018 6:56 am
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by Krivougolnik »

Why if a vehicle with ID x is passed through combiners coordinates to a vehicle with ID y so that y follows x, then y hangs when x stops?
User avatar
Earendel
Factorio Staff
Factorio Staff
Posts: 716
Joined: Sun Nov 23, 2014 11:57 am
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by Earendel »

Logistic bots are not capable of doing what you're asking for.
Krivougolnik wrote:Why if a vehicle with ID x is passed through combiners coordinates to a vehicle with ID y so that y follows x, then y hangs when x stops?
I don't understand what you mean.
Krivougolnik
Burner Inserter
Burner Inserter
Posts: 10
Joined: Fri Feb 23, 2018 6:56 am
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by Krivougolnik »

Earendel wrote:Logistic bots are not capable of doing what you're asking for.
Krivougolnik wrote:Why if a vehicle with ID x is passed through combiners coordinates to a vehicle with ID y so that y follows x, then y hangs when x stops?
I don't understand what you mean.
If you use coordinates, the vehicle that follows the ID coordinates starts hanging back and forth and consumes fuel when the sending ID is stopped, so I forced to use "follow the ID".
Post Reply

Return to “Mods”