[MOD 0.14] AAI Programmable Vehicles

Topics and discussion about specific mods
User avatar
Earendel
Factorio Staff
Factorio Staff
Posts: 711
Joined: Sun Nov 23, 2014 11:57 am
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by Earendel »

I can't recreate the Unit Scanner blueprint problem. I've tried all sorts of configurations. Is the blueprint you are using from the blueprint string I posted or is it one you made? Do you still get the problem if you fix the resulting setup and make a new blueprint?

Version 0.1.11 is out now. It fixes the issue of vehicles using energy when their speed is above 0 but not fast enough to ever actually move a single pixel.

Also the structures and zones mods have been updated to return the zone tile index/id if a unit or tile scanner encounters a zone tile. Also if a unit scanner is scanning a player, it now also returns zones under the player.

Berkys32
Fast Inserter
Fast Inserter
Posts: 113
Joined: Mon Mar 07, 2016 9:17 am
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by Berkys32 »

Earendel wrote:I can't recreate the Unit Scanner blueprint problem. I've tried all sorts of configurations. Is the blueprint you are using from the blueprint string I posted or is it one you made? Do you still get the problem if you fix the resulting setup and make a new blueprint?
Now i have opposite problem - I cant get Unit scanner work, if I build it by hand. Look:
http://steamcommunity.com/sharedfiles/f ... =820033209
And I DO have car with that ID.
But building it via blueprint of already built scanners (which still work) is resulting into working setup...
EDIT: Ok, I got it. If I choose manually in Constant combinator vhicle type and ID, its broken. If I copy that setup from another combinator that works, its ok...
Earendel wrote:Version 0.1.11 is out now. It fixes the issue of vehicles using energy when their speed is above 0 but not fast enough to ever actually move a single pixel.
Great! Great!
But I have to ask, bcs I didnt look carefully before - its ok that laser tank burns 1MW every second if its moving (even very slowly)? - Just asking, realyy dont know what it was before...
Earendel wrote:Also the structures and zones mods have been updated to return the zone tile index/id if a unit or tile scanner encounters a zone tile. Also if a unit scanner is scanning a player, it now also returns zones under the player.
Great! I can now stop using those terrible setup, which compared Xs and Ys of zone and vehicle, now it will be much easier to setup convoy AI. (When I realize how to post it here Ill do it)

Thanks for your work!

Berkys32
Fast Inserter
Fast Inserter
Posts: 113
Joined: Mon Mar 07, 2016 9:17 am
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by Berkys32 »

Another ?bug? - signal "Time since moved" never resets if car is controlled by AI - even if it isnt movig (similiar to energy consumption bug)...

"Time since moved" seems to be reseted, but only when vehicle move at some faster speed. Speed, my miner isnt able to reach...

User avatar
Earendel
Factorio Staff
Factorio Staff
Posts: 711
Joined: Sun Nov 23, 2014 11:57 am
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by Earendel »

Berkys32 wrote:Now i have opposite problem - I cant get Unit scanner work, if I build it by hand. Look:
http://steamcommunity.com/sharedfiles/f ... =820033209
And I DO have car with that ID.
But building it via blueprint of already built scanners (which still work) is resulting into working setup...
EDIT: Ok, I got it. If I choose manually in Constant combinator vhicle type and ID, its broken. If I copy that setup from another combinator that works, its ok...
Did you double check that you are using the vehicle type id signal and not the vehicle item signal?

"Time since moved" should update when the vehicle actually changes XY tile. It should work for miners but it will get reset less frequently.

Berkys32
Fast Inserter
Fast Inserter
Posts: 113
Joined: Mon Mar 07, 2016 9:17 am
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by Berkys32 »

Did you double check that you are using the vehicle type id signal and not the vehicle item signal?
Ok, it works now... but im 100% i was using right "item" Laser tank ID. I didnt even know I can choose item itself...
"Time since moved" should update when the vehicle actually changes XY tile. It should work for miners but it will get reset less frequently.
I was looking at signals from bunch of my tanks following leading one (when testing my convoy AI) and sometimes it went over 2k even tank was still in move... Ill look further into it when ill be playing next time ;)

Introprospector
Burner Inserter
Burner Inserter
Posts: 10
Joined: Sat Oct 24, 2015 12:07 am
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by Introprospector »

Boats?

xlomkn
Burner Inserter
Burner Inserter
Posts: 18
Joined: Wed Dec 14, 2016 8:17 pm
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by xlomkn »

Zone scanner does not output vehicle id signals when a vehicle stands on a zone (a tile scanner on that spot outputs the zone and vehicle).

Tile scanner outputs the vehicle item instead of the vehicle id signal.

Bugs or intended behavior ?

User avatar
Earendel
Factorio Staff
Factorio Staff
Posts: 711
Joined: Sun Nov 23, 2014 11:57 am
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by Earendel »

Introprospector wrote:Boats?
It works with the Ships mod.
I'm thinking about making my own Hauler Ship, Chaingunner Ship, and Cannon Ship.
xlomkn wrote:Zone scanner does not output vehicle id signals when a vehicle stands on a zone (a tile scanner on that spot outputs the zone and vehicle).

Tile scanner outputs the vehicle item instead of the vehicle id signal.

Bugs or intended behavior ?
They are not bugs. Zone scanners are just to locate and count zone tiles, not scan the tile location. Tile scanners are designed just to find the physical contents of the tile, however, I can see that it would be useful to also get the unit type id and unit id so I will consider adding those as outputs.

xlomkn
Burner Inserter
Burner Inserter
Posts: 18
Joined: Wed Dec 14, 2016 8:17 pm
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by xlomkn »

I've asked an evolution to the maintainer of Satellite Uplink Station mod. He's been quite fast to do it!
Now, you have access to an Unit Remote Controller and a Zone Planner in the toolbar while uplinked.
Thanks to him ;)

xlomkn
Burner Inserter
Burner Inserter
Posts: 18
Joined: Wed Dec 14, 2016 8:17 pm
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by xlomkn »

They are not bugs. Zone scanners are just to locate and count zone tiles, not scan the tile location. Tile scanners are designed just to find the physical contents of the tile, however, I can see that it would be useful to also get the unit type id and unit id so I will consider adding those as outputs.
I'm trying to make an autonomous path with zones: I use a zone scanner to loop in zones and send the position to a tile scanner to find vehicles. I want to send that to an unit controller to send the vehicle to next zone. This would be like a conveyor for vehicles that could be used for any vehicles (and many at the same time).

But maybe I'm trying to do it the wrong way!

User avatar
Earendel
Factorio Staff
Factorio Staff
Posts: 711
Joined: Sun Nov 23, 2014 11:57 am
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by Earendel »

I don't think there is a wrong way as long as it works. One slightly awkward thing for using a single zone for a continous trail is that if you need to modify a middle bit it messes up the trail order.
Personally I've found it easier to scan the vehicles first to see if they are in a zone, mainly because there are less vehicles than zone tiles so the loop is faster. For paths I've had some good results in having zones for "head in this direction" such as north, south east, etc. Then just build a road and use the angle and speed control for vehicles on the road.

User avatar
Earendel
Factorio Staff
Factorio Staff
Posts: 711
Joined: Sun Nov 23, 2014 11:57 am
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by Earendel »

Version 0.1.12 has a graphical difference between a vehicle item signal and a vehicle type if signal for the core vehicle set. Using a Unit Scanner on a vehicle now returns the number of empty slots, so you can check if a hauler is getting full.

GeekBeam
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sat Nov 14, 2015 12:57 pm
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by GeekBeam »

so, I figured a method to compare if the distance between one object or another is above or below a compared number.

Image

essentially, what I want to do is subtract the lesser coordinate from the greater one (which always equals a positive number) so I can get the difference between the two, giving me two sides to the triangle that I want to get.

now I just do some math ( 0*0=0 for both the X and Y parts, then do the same thing for the distance).

I'm using the Pythagorean theorem ( A^2 + B^2 = C^2 ) to solve for the distance, but for a good long time, I wasn't able to figure out how to get the distance I wanted without using a square root function (which sadly doesn't exist in factorio :? )

eventually I just came up with the idea "well, if I can't square root the squared value, why not just square the distance I want to compare it to?" and now this little contraption exists!

I've got a blueprint which is compacted just a little bit from the showcased one. have fun.

compact:

Code: Select all

H4sIAAAAAAAA/+Va226jOhT9lYrHGRNhJ+SiDvNyzke0qkbIBTe1RExkTBVOlH8/5tI0hgA2JOl0Zp6iAZa3174tbzeM76I4wNGd7+1pELPE2+8pC8nOgyCh
a4Yjby+yLfEsKsjGAgxv5G/MqXjdEEEDO4g3z5RhEXPrcADVt6jj2/9iRuwkwEy+fwCECSooyZctH+c2CMzEKTDYxol8K2befufZc5B5NjqAkHISFP+LgPxK
8Djyn8krfqMx9/YvNBKE57iqKW+UixRHijUhTQJ7zQmRNkmolAm5+4qF3EiJzsqlJN6TBa1f3r54XaIXG8h8GnrokP8D1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act:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by Earendel »

Very nice. I like this, thanks for posting.

GeekBeam
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sat Nov 14, 2015 12:57 pm
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by GeekBeam »

Earendel wrote:Very nice. I like this, thanks for posting.
Many thanks ^u^ i am just loving this mod so far. My next contrapion is going to be figuring out a way to have an automated movement system, including split off junctions, independant caravans, and the ability to docl up the caravans of haulers you have.

As an aside, the hauler loader you have doesn't work, the hauler is unable to path through the 2-wide gap between the yellow belts.

xlomkn
Burner Inserter
Burner Inserter
Posts: 18
Joined: Wed Dec 14, 2016 8:17 pm
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by xlomkn »

I had a crash. I was using the Miner To Resource Zone blueprint to send a Flying Fortress (Aircraft mod) to a parking zone. When getting in the aircraft, going few tiles away and getting out (to test if the aircraft get back to the parking zone), I got the crash.

I also had issues with a Hauler parked just beside the parking zone, that started to do inventory transfer and stopped suddenly, the hauler still have supply and the aircraft still need some. This issue happened before the crash. When reloading the game, the inventory transfer is still blocked, and I can sometime reproduce the crash.

Don't know if the bug is with AAI or Aircraft mods, but something went wrong between them ;)
crash logs
(just in case you ask, pos mod is a little home made mod that display the player position in a button)

User avatar
Earendel
Factorio Staff
Factorio Staff
Posts: 711
Joined: Sun Nov 23, 2014 11:57 am
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by Earendel »

Code: Select all

1663.797 Error Car.cpp:348: receiveMovementImpulse of flying-fortress-_-ghost ended up with unreasonable position
Well this should be an interesting one.
Was the flying fortress near to the edge of the loaded map when it happened?
I can tell that the flying fortress was in biter AI navigation mode because "flying-fortress-_-ghost" is a duplicate vehicle without collision so that the navigator can do it's work.

It will be easier to recreate the problems if you could make your save file available. Can you upload it somewhere and PM me a link?

doktorstick
Fast Inserter
Fast Inserter
Posts: 152
Joined: Fri Aug 12, 2016 10:22 pm
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by doktorstick »

I have a suggestion for the hauler unloading.

Have a building similar to the Vehicle Deployer. When a hauler gets near it, you take over control and guide it into the building. At this point, it works like a large factory building meaning that inserters can pull from the building (think warehouse mod). When the hauler is empty or a signal to the building to "eject" the hauler, it moves out--again similar to the Vehicle Deployer.

This--IMO--would be more elegant than the walls with belts to try and guide the hauler so you can unload it.

User avatar
Kazaanh
Inserter
Inserter
Posts: 31
Joined: Tue Oct 27, 2015 2:57 pm
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by Kazaanh »

This mod idea is amazing, fanstastic for some PvP or very heavy biter settings.

The problem is, I don't know how to start with this mod. Some tutorial would be nice. Video tutorial would be best.

Cheers

User avatar
Earendel
Factorio Staff
Factorio Staff
Posts: 711
Joined: Sun Nov 23, 2014 11:57 am
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by Earendel »

doktorstick wrote:I have a suggestion for the hauler unloading.

Have a building similar to the Vehicle Deployer. When a hauler gets near it, you take over control and guide it into the building. At this point, it works like a large factory building meaning that inserters can pull from the building (think warehouse mod). When the hauler is empty or a signal to the building to "eject" the hauler, it moves out--again similar to the Vehicle Deployer.

This--IMO--would be more elegant than the walls with belts to try and guide the hauler so you can unload it.
I'm thinking about making a drop-depot / warehouse building that uses the hauler's inventory transfer system to just quickly dump or collect cargo. It might be a bit over powered but you can kinda do the same thing now by using a parked hauler like an inventory hub. Also, most of the code I'd need already exists so it seems like a good short term solution.
Kazaanh wrote:This mod idea is amazing, fanstastic for some PvP or very heavy biter settings.

The problem is, I don't know how to start with this mod. Some tutorial would be nice. Video tutorial would be best.

Cheers
Right now my priorities are bugfixing and important features that are currently missing. I might do a video, but it's less of a priority right now because I'd probably have to redo it after the changes I'm planning. Also it's out of my comfort zone so maybe I'm just avoiding it. Anyway there are loose plans for a video just not right now, however, if anyone else would like to make a tutorial video and it is at least somewhat useful I will link to it at the top of this thread and on the mod portal page :D
xlomkn wrote:I had a crash. I was using the Miner To Resource Zone blueprint to send a Flying Fortress (Aircraft mod) to a parking zone. When getting in the aircraft, going few tiles away and getting out (to test if the aircraft get back to the parking zone), I got the crash.

I also had issues with a Hauler parked just beside the parking zone, that started to do inventory transfer and stopped suddenly, the hauler still have supply and the aircraft still need some. This issue happened before the crash. When reloading the game, the inventory transfer is still blocked, and I can sometime reproduce the crash.

Don't know if the bug is with AAI or Aircraft mods, but something went wrong between them ;)
All fixed now.

If you're interested, the issues were nothing to do with the aircraft mod. The crash was caused by the vehicle being replaced with a composite version while it had a negative speed. You can now bail out of vehicles going backwards at high speeds without worry of a (game) crash.

The inventory filters were being reset because the vehicle was being swapped with a similar-looking one but with slightly different stats, but the filters weren't copied to the new entity. They are now.

The inventory transfer issue was not exactly a bug, you needed to have a unitdata setting on the hauler of the same item type in order for it to allow the item to be transferred. I realise that it's not very intuitive, so I have changed it so that haulers can always deliver inventory to nearby vehicles that request it even if they don't have a matching unitdata setting. I can't think of any unintended consequences of that change but we'll see. Anyway the inventory transfer system in your save file is working now.

Finally, when playing around with the aircraft I noticed they were using pathing when AI driven which is completely unnecessary. In 0.1.13 pathfinding is switched off for aircraft so that fly very smoothly over buildings and water when AI controlled.

Post Reply

Return to “Mods”