Selfdriving Logistic Cars

This is the place to request new mods or give ideas about what could be done.
User avatar
hitzu
Filter Inserter
Filter Inserter
Posts: 530
Joined: Tue Sep 09, 2014 5:55 pm
Contact:

Re: Selfdriving Logistic Cars

Post by hitzu »

This has gone too far. I'm sorry. I'm not aganst any mod and I didn't want to say anything bad about your idea besides that almost anything you want you can get right now out of existing parts with some minor tweaks. Yes, this is a compromise, but I think it is better to get fun right now, rather than wait indefinitely for something so complicated as new AI, pathfinding, scripting etc. If anyone will make this mod for you this would be great for all the community and the game.

voddan
Fast Inserter
Fast Inserter
Posts: 124
Joined: Sat Jun 03, 2017 9:22 pm
Contact:

Re: Selfdriving Logistic Cars

Post by voddan »

Wow, just found this thread after the Bots vs Belts FFF.
Actually this is pretty good!

Small self-driving cars could deliver goods instead of flying logistic robots.
The benefit is that ground space is limited, thus ground logistic bots would loose their efficiency with numbers, and would not be able to compete with belts.
Also it would look much more like something from a real factory.

The only 2 downsides I see are (a) it could be a terrible mess of robots in the factory and (b) actual path finding will be very hard on CPU.

User avatar
Skellitor301
Fast Inserter
Fast Inserter
Posts: 140
Joined: Mon Aug 04, 2014 10:04 pm
Contact:

Re: Selfdriving Logistic Cars

Post by Skellitor301 »

voddan wrote:Wow, just found this thread after the Bots vs Belts FFF.
Actually this is pretty good!

Small self-driving cars could deliver goods instead of flying logistic robots.
The benefit is that ground space is limited, thus ground logistic bots would loose their efficiency with numbers, and would not be able to compete with belts.
Also it would look much more like something from a real factory.

The only 2 downsides I see are (a) it could be a terrible mess of robots in the factory and (b) actual path finding will be very hard on CPU.
Yeah, the idea I had for that was you place markers for the vehicles to move between, and if the path was a bit complex then more markers can be used to ease the pathfinding workload. There is a mod like this I've found which uses biter ai for movement and pathfinding which is brilliant in my opinion.

voddan
Fast Inserter
Fast Inserter
Posts: 124
Joined: Sat Jun 03, 2017 9:22 pm
Contact:

Re: Selfdriving Logistic Cars

Post by voddan »

Skellitor301 wrote:There is a mod like this I've found which uses biter ai for movement and pathfinding
Cool! Could you share a link please?

Since I wrote my previous post I gave it a little thought and found a promising solution.
It is a path-finding algorithm which is (a) CPU efficient (b) easy for a player to understand (c) optimized for logistic throughput (d) can be manipulated in a natural way.

This path-finding algorithm is different from biters AI because the task is rather different.
IMO it resembles how ants navigate when searching for food, so I call it "the ant algorithm" :D

Here it is in a nutshell:
  • - bots travel between logistic chests (from A to B)
    - bots make 45 (90, 180) degree turns in place
    • - turning is slower than going straight
    - bots move faster on good pavement

    - bots prefer the optimal path from A to B
    • - to find an optimal path start with the strait [A, B] on a 45 degree grid (see above)
      - if the path encounters an obstacle
      • - move alongside the obstacle till you can continue the path to B
        - out of a left-hand and a right-hand path prefer the shortest
        - if possible move on the right side of a passage
      - if the path is one-tile-wide, then it is a "corridor" and it is specially marked
      • - each corridor has a direction which can change
        • - bots can travel in the direction of a corridor
          - bots can't enter a corridor against its direction
          - if a bot came to a corridor against its direction, it has to wait around the corridor entrance
        - if on one side of a corridor too many bots are waiting, the corridor direction will change in their favor
        - if waiting times are too long, the routes are recalculated not to use the corridor

    - when a bot starts from A, an optimal path is found and saved to cache
    • - all later bots traveling from A to B will use the saved path from cache
      - if a bot encounters a person or a biter on its path, it stops and politely waits till the path is clear
      - if a bot encounters a building on its path, the path must be recalculated
      • - a blocked path from A to B is recalculated
        - bots that have been traveling from A to B on the old path should return to A and start on the new path
        • - in many cases bots do not have to return all the way to A
          - if you trap a bot while building buildings so that it can't return to A, it should be somehow communicated (honking?)
      - if a bot encounters another logistic bot
      • - and their paths cross, then one of the bots allows the other to pass
        - and their paths are head-to-head
        • - if both can, both move their paths one tile to the right
          - if one can, it moves its path one tile to the right
          - if neither can move to the side, then it is a one-tile-wide passage ("corridor")
          • - a direction is chosen for the corridor, and the bot that is against the direction drives back out of the corridor
            - bots follow the tactics for the corridors described above
The paths the bots take should be easy to control by building wide straight walking paths with good pavement (a.k.a highway).
Algorithm will optimize turns and driving speed and prefer highways to random driving.
Also it stimulates players to build wide passages, which is already a good practice.

What do you think?

What do you think?

BHakluyt
Fast Inserter
Fast Inserter
Posts: 241
Joined: Sat Oct 08, 2016 12:43 pm
Contact:

Re: Selfdriving Logistic Cars

Post by BHakluyt »

Did you know, there is a mod that gives the cars the self driving ability. It works with hotkeys to switch on/off and you can even set speed limits. You need to build roads with any type of paving though. Its quite cool and works well when having good roads.

Then there is the AAI programmable vehicles mod which probably does ecaxtly what you want. I have never checked it out though. Maybe this will help...

voddan
Fast Inserter
Fast Inserter
Posts: 124
Joined: Sat Jun 03, 2017 9:22 pm
Contact:

Re: Selfdriving Logistic Cars

Post by voddan »

BHakluyt wrote:Did you know, there is a mod that gives the cars the self driving ability. It works with hotkeys to switch on/off and you can even set speed limits. You need to build roads with any type of paving though. Its quite cool and works well when having good roads.

Then there is the AAI programmable vehicles mod which probably does ecaxtly what you want. I have never checked it out though. Maybe this will help...
I want to connect those cars to requester and provider chests, so that they load-drive-unload automatically what I need where I need.
Also I would prefer them smaller (1x1) if possible.

It would be nice to model this with a mod, but I am not sure how to do it with existing ones.

BHakluyt
Fast Inserter
Fast Inserter
Posts: 241
Joined: Sat Oct 08, 2016 12:43 pm
Contact:

Re: Selfdriving Logistic Cars

Post by BHakluyt »

If someone can mod a 1x1 vehicle for you I guess it would be very easy to have the car stop at a spot to load unload into chests. I even refuel my trains on curves sometimes.

But for now I think give the AAI package a try. There is probably vehicles already included that can work. Not sure. I know there is a cool mod called just 'truck.' I think it would be compatible with aAI from what I've read. Also just make a funny contraption with belts going this way and that way to have a car position where you want it. With combinators you can switch belt movement on off too. Hoewever the last parts are probable useless. I think AAI vehicles haulers directly take the ores etc to where they must go or where you want/set them like some chests. Watch a few youtube vids, I see AAI can be daunting so build it with a videos help...

Edit - maybe you can copy car prototype from game or other mod and modify size and hitbox to fit ur 1x1. If you're good with blender you can make a nice little buggy or something. I know animated stuff like cars require lots of sprites for each direction etc. Company of Heroes, the Germans have this little mine buggy thing . I imagine something like that but just a but bigger/buffed. Like put a dumptruck bucket on that. Like a "garbage skip" placed on wheels

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

Re: Selfdriving Logistic Cars

Post by Earendel »

Here is the AAI Programmable Vehicles mod: viewtopic.php?f=93&t=38475

User avatar
Skellitor301
Fast Inserter
Fast Inserter
Posts: 140
Joined: Mon Aug 04, 2014 10:04 pm
Contact:

Re: Selfdriving Logistic Cars

Post by Skellitor301 »

Yes, the AAI mod is the mod like was thinking of that uses biter ai for pathfinding, which is pretty clever as you can set mining vehicles to a set area and the biter ai has idle movement implemented. It's not a bad idea to utilise and possibly improve upon this ai for this mod idea

User avatar
mrudat
Fast Inserter
Fast Inserter
Posts: 229
Joined: Fri Feb 16, 2018 5:21 am
Contact:

Re: Selfdriving Logistic Cars

Post by mrudat »

I would think the most appropriate cargo handling vehicle for Factorio would be a https://en.wikipedia.org/wiki/Forklift.

If we're modelling a forklift in-game, it would be a vehicle that's roughly 2x1 in shape, which can turn around its own centre (like the tank); the centre of the model being where the mast is.

It interacts with a chest by inserting its forks into the chest to set down or pick up cargo.

There could be multiple tiers of forklifts; a beginning forklift that moves at 1/2 player speed, but doesn't need specialised flooring, and a forklift that moves at player speed, but requires at least stone flooring.

If we're modelling modern forklifts, warehouse-specific forklifts rely upon hard, smooth, flat flooring (almost always concrete), but are cheaper and easier to maintain than forklifts that need to deal with less ideal terrain. The most modern forklifts for factory usage tend towards being battery powered (so as to not emit exhaust gasses in a (relatively) confined space). I believe that forklifts that get used out in the field tend to be gas-powered for a longer run-time between refuelling.

If there is containerised cargo, you could have a container forklift that is capable of moving a loaded container (or 20 stacks; given a real-life flatbed train car can hold two 20 foot containers and the in-game train car holds 40 stacks).

It can pick up and move an entire stack of stuff from one chest to another (or if used with a pallet mod, it can shift only pallets, but robots can't).

It might be easiest to require a specialised tile type for where forklifts can drive, a contiguous set of floor tiles would delineate the logistic area a set of forklifts can service, probably painted in hazard stripes on the outside edges.

For high-throughput, you would want passages that are at least 2 tiles wide, and to have any chests set back from the main thoroughfares so that a forklift stopped interacting with a chest doesn't block traffic.

Post Reply

Return to “Ideas and Requests For Mods”