[MOD 0.14] AAI Programmable Vehicles

Topics and discussion about specific mods
robertpaulson
Long Handed Inserter
Long Handed Inserter
Posts: 92
Joined: Sun Jun 18, 2017 2:21 pm
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by robertpaulson »

Do I really have to install all other mods to have RTS control of my car? I don't want any other feature, just to have a RC car.

Before I start playing with the files, is it even viable to shave this mod down to just RC of vanilla vehicles?

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 »

Skeleton Man wrote:how feasable is it to allow vehicles with a color signal or something similar to take on that color on their exterior, similar to how when a player of a particular color is controlling them?

it would be nice to visually organize them
The only way to do it is put a dummy character entity in the vehicle, but that prevents any other player from getting in to take control so it's not a viable option.
robertpaulson wrote:Do I really have to install all other mods to have RTS control of my car? I don't want any other feature, just to have a RC car.

Before I start playing with the files, is it even viable to shave this mod down to just RC of vanilla vehicles?
No, the ones with ? are optional.

robertpaulson
Long Handed Inserter
Long Handed Inserter
Posts: 92
Joined: Sun Jun 18, 2017 2:21 pm
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by robertpaulson »

Earendel wrote:
No, the ones with ? are optional.
Yes, I know that. But you have 7 required mods:

Code: Select all

		"aai-programmable-structures >= 0.3.3",
		"aai-zones >= 0.2.1",
		"detached-gun-sounds >= 0.2.1",
		"off-grid-effects >= 0.2.1",
		"aai-signals >= 0.2.1",
		"aai-vehicles-miner >= 0.2.1",
		"aai-vehicles-hauler >= 0.2.1",
Considering I just want an RC function, hauler, miner, zones I assume could be dealt entirely without. I was asking if its even possible to shave off all these out for an RC functionality (I can do the leg work myself, and started it yesterday). I just don't want to spend few days working on it to realize that the RC or RTS-like control mechanics or tweaks are embedded in something thats not intuitively related.(not sure if I'm making myself clear here)

I really don't want all these items, features. I briefly browsed through some of it and I saw they change vehicle physics which will collide with some mods I already have. So I will be really happy if I can just select a single non-occupied car/tank and click it to go some place (that's how simple I want it). It doesn't have to account for collisions since it will be a single unit (that's where the vehicle physics changes came from I assume since they change collisions) it even doesn't have to engage with enemies, but it can I don't mind that part.

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 »

robertpaulson wrote:
Earendel wrote:
No, the ones with ? are optional.
Yes, I know that. But you have 7 required mods:

Code: Select all

		"aai-programmable-structures >= 0.3.3",
		"aai-zones >= 0.2.1",
		"detached-gun-sounds >= 0.2.1",
		"off-grid-effects >= 0.2.1",
		"aai-signals >= 0.2.1",
		"aai-vehicles-miner >= 0.2.1",
		"aai-vehicles-hauler >= 0.2.1",
Considering I just want an RC function, hauler, miner, zones I assume could be dealt entirely without. I was asking if its even possible to shave off all these out for an RC functionality (I can do the leg work myself, and started it yesterday). I just don't want to spend few days working on it to realize that the RC or RTS-like control mechanics or tweaks are embedded in something thats not intuitively related.(not sure if I'm making myself clear here)

I really don't want all these items, features. I briefly browsed through some of it and I saw they change vehicle physics which will collide with some mods I already have. So I will be really happy if I can just select a single non-occupied car/tank and click it to go some place (that's how simple I want it). It doesn't have to account for collisions since it will be a single unit (that's where the vehicle physics changes came from I assume since they change collisions) it even doesn't have to engage with enemies, but it can I don't mind that part.
I don't know what version you're using but the miner and hauler are optional now. In the future structures, zones, and signals can be made optional.
Data-raw-prototypes will not be required once a few things get properly implemented in the Factorio API, that's probably a few weeks away.
Off-grid-effects and detached-gun-sounds will always be required.

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 »

Everytime i try to remote control my tank leading my tank formation, i got CTD. Cant find any logs I could provide...
If i drive it personally, everything is ok

robertpaulson
Long Handed Inserter
Long Handed Inserter
Posts: 92
Joined: Sun Jun 18, 2017 2:21 pm
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by robertpaulson »

Earendel wrote: I don't know what version you're using but the miner and hauler are optional now. In the future structures, zones, and signals can be made optional.
Data-raw-prototypes will not be required once a few things get properly implemented in the Factorio API, that's probably a few weeks away.
Off-grid-effects and detached-gun-sounds will always be required.
That's good news. I managed to strip everything except Data-raw-prototypes and off-grid-effects. and few other things like allowing engines to be crafted manually. You changed a lot of things in there without specifying it that (to my knowledge) is not required but affects game balance quite significantly. anyhow:

now, as excepted, i have some trouble getting the mod (remote control item) to work. It selects a unit (a car) and a box appears with Type ID and Unit ID however there is no box below that gets populated, and the Manual Commands (Shift+LMB) do not work. Can you give me a hint where this is handled currently?

buggy123
Long Handed Inserter
Long Handed Inserter
Posts: 57
Joined: Sat May 13, 2017 11:53 pm
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by buggy123 »

whitecold wrote:
buggy123 wrote:Would it be possible to add a setting to toggle the 1-weapon-per-vehicle mechanic? It's possible to disable it by deleting a few bits in entity-update and entity-update-external but its kind of annoying doing it after every update.
Which bits exactly have to be deleted? I broke the mod trying to accomplish that.
Sorry for the late reply.

Okay, IIRC you need to edit "entity-update.lua" and "entity-update-externals.lua" in /prototypes/entity. For entity-update.lua, delete basically everything so that the only thing left in the file is this:

Code: Select all

function aai_split_vehicle(vehicle_name, gun_names)
end
I'd say just delete everything, but I suspect that would break things, since things would be trying to call a function that no longer exists. Instead we just delete everything in the function so that it does nothing when called.

Next, for entity-update-externals.lua, find and delete this bit of code near line 80

Code: Select all

    -- only 1 gun per vehicle
    if vehicle.guns and #vehicle.guns > 1 then
        -- assume last gun is best?
        vehicle.guns = {vehicle.guns[#vehicle.guns]}
    end
Unless I've forgotten anything, that should be it. AAI vehicles such as the laser tank will be unaffected, since they only have 1 gun anyway. Vehicles with multiple guns should behave normally, except that they'll only use one gun when AI-controlled (and it might not be a good gun), but that would happen anyway.

I really wish this was a configurable option.

Sabrewulf
Burner Inserter
Burner Inserter
Posts: 10
Joined: Mon Jul 11, 2016 12:11 am
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by Sabrewulf »

My vehicles hit anything at it way to reach the target when following.
Can you add a path-finding when following to avoid obstacles?

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 »

buggy123 wrote:
I really wish this was a configurable option.
I second this. And Im suggesting chabging weapons through vehicle data. Vehicles are able to use ammo from trunk, so...

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 »

Sabrewulf wrote:My vehicles hit anything at it way to reach the target when following.
Can you add a path-finding when following to avoid obstacles?
I think its because its actually going to sub X/Y (its telling vehicle only direction and speed).
Because of this im using following function only to hold formation. For longer distance moving Im using go to X/Y coords...

Skeleton Man
Inserter
Inserter
Posts: 23
Joined: Fri Jun 02, 2017 1:21 pm
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by Skeleton Man »

Sabrewulf wrote:My vehicles hit anything at it way to reach the target when following.
Can you add a path-finding when following to avoid obstacles?
the vehicles would use biter pathfinding anyways and would screw everything over
personally I dont tell them to follow anything until they're out in the open, trying to maintain a formation inside a factory is a loosing battle

alternatively have the vehicles follow one another using combinator logic in a specific tight formation like a column or something

Nightinggale
Fast Inserter
Fast Inserter
Posts: 120
Joined: Sun May 14, 2017 12:01 pm
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by Nightinggale »

I have had problems getting a hauler to return to the unload location. It was a strait line, but with water to one side and trees to the other, it often went in the wrong direction and started driving in circles. This made me come up with a system, which avoids using the pathfinder, which is useful for all vehicles passing tight locations.

The setup is as follows: (read everything before starting to copy)
  • Set up a constant combinator and a decider combinator
  • Connect constant to decider input with green wire
  • Set the decider combinator to output everything by value when X > 0. X is a zone, which loos like an arrow pointing up (color doesn't matter)
  • Set the constant combinator to output what you want a vehicle to do on that zone. That would be direction = 360 and whatever speed you want
  • Repeat that for the 7 other directions of the same color
  • Connect inputs of the 8 decider combinators with red wire
  • Connect outputs of the 8 decider combinators with red wire
  • Place a unit scanner and connect output to any decider combinator input using red wire
  • Set the unit scanner to trigger every single tick and make it output zone and ID
  • Place a unit controller and connect input to output of the decider combinators using red wire
  • Set the unit controller to trigger every tick
This will make vehicles follow the arrows on the ground. It's fast (combinators will finish in one tick) and it will use the ID from the scanner to the controller. This means you can set a constant combinator, loop or whatever you want as input to the scanner and it will figure out to send commands to the right vehicle. The pipeline structure allows setting a new vehicle every tick. Just remember that looping 50 vehicles means from the point of view from a specific vehicle, it gets updated every 50th tick, which is slow if it is moving at high speed and should have turned.

The only problem is that vehicles have a tendency to overshoot turns. This means if a west going vehicle turns to go north, it can end up west of the north line and this place will need arrows to north-east to correct this issue. Well that and being CPU heavy.

It's possible to add more constant+decider combinator pairs as long as it's certain that max one will trigger at once. This means you can add 8 more and have another color to tell that the vehicles should slow down before they turn. You can even have two steps of slowing down if you like, making a total of 24 decider combinators. Slowing down in advance for turns allows more vehicle in the loop as it can accept a delay of more ticks before going off the route.

Yes the pathfinder used when giving coordinates to go to could be better, but you can do lots of stuff with autonomous vehicles without ever using that pathfinder. You just need to figure out how to set up combinators to make it work the way you want it to work, like in this case get through a maze in your base without hitting all the assemblers ;)

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 »

Im using bobs vehicles and its equipment. And just realized vehicles are using battery energy instead of solid fuels (which I have tons of).
If it isnt bug, how to turn it off?

EDIT: It does even without bobs mods, just with vehicle grid...

EDIT 2: Its most probably caused by your mod - if i turn AAI off, vehicles cant use battery power to move anymore.

Skeleton Man
Inserter
Inserter
Posts: 23
Joined: Fri Jun 02, 2017 1:21 pm
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by Skeleton Man »

Berkys32 wrote:Im using bobs vehicles and its equipment. And just realized vehicles are using battery energy instead of solid fuels (which I have tons of).
If it isnt bug, how to turn it off?

EDIT: It does even without bobs mods, just with vehicle grid...

EDIT 2: Its most probably caused by your mod - if i turn AAI off, vehicles cant use battery power to move anymore.
i'd give your mod settings a check on the world, some of them might override other mods that try to intergrate battery power

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 »

Im not sure what do you mean..
my mods.settings.json?
mods.settings.json
here is my mod list:
my mod list
But as i told - when I turn off AAI, its ok. So I assume its bsc of it, as it is altering many things about vehicles...

Seldion
Inserter
Inserter
Posts: 43
Joined: Sat May 24, 2014 8:22 am
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by Seldion »

Not sure where to post this so if this is in the wrong place, pardon!

Either way, I have a request for you, I love your warden vehicle, all of them really but it came to me when I was using one as a repairer/gather that it would be awesome to have it's cannon as a turret, of'course be stronger and have a much father range would be great but it is just a thought, if it came true I'd glee with joy like a school girl xD

Also thank you for all your work on the mods that I so enjoy!

robertpaulson
Long Handed Inserter
Long Handed Inserter
Posts: 92
Joined: Sun Jun 18, 2017 2:21 pm
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by robertpaulson »

robertpaulson wrote:
Earendel wrote: I don't know what version you're using but the miner and hauler are optional now. In the future structures, zones, and signals can be made optional.
Data-raw-prototypes will not be required once a few things get properly implemented in the Factorio API, that's probably a few weeks away.
Off-grid-effects and detached-gun-sounds will always be required.
That's good news. I managed to strip everything except Data-raw-prototypes and off-grid-effects. and few other things like allowing engines to be crafted manually. You changed a lot of things in there without specifying it that (to my knowledge) is not required but affects game balance quite significantly. anyhow:

now, as excepted, i have some trouble getting the mod (remote control item) to work. It selects a unit (a car) and a box appears with Type ID and Unit ID however there is no box below that gets populated, and the Manual Commands (Shift+LMB) do not work. Can you give me a hint where this is handled currently?
I'm not sure if you are not happy about how i am editing your mod or simply you don't want to deal with me. But I guess I will have to take the long way around this and do it piece by piece.

User avatar
Sigma1
Fast Inserter
Fast Inserter
Posts: 232
Joined: Mon Nov 21, 2016 5:25 pm
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by Sigma1 »

I have a weird problem. I have configured a hauler to go between two depots, and the coordinates are set up correctly, but the hauler always goes to a specific spot and starts spinning in place.

EDIT: Seems that it was a combinator configured wrong.
she/they

robertpaulson
Long Handed Inserter
Long Handed Inserter
Posts: 92
Joined: Sun Jun 18, 2017 2:21 pm
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by robertpaulson »

Ok So I installed all required mods (all updated for .15 version), however I can't even get it to work:

Placing vehicles by hand throws error pointing to on_buit_entity, and the line 552

Code: Select all

table.insert(global.unit.unit_types[unit.unit_type], unit)
in control.lua (getting a nil instead of a table)

User avatar
cpy
Filter Inserter
Filter Inserter
Posts: 839
Joined: Thu Jul 31, 2014 5:34 am
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by cpy »

Is it me or this mod really eats update time like crazy?

Post Reply

Return to “Mods”