Autodrive

by Pi-C

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

Content
2 months ago
0.17 - 1.1
2.98K
Transportation Combat Logistic network Circuit network

g a few small issues

1 year, 6 months ago

Hi,
I was looking for mod which lets car transport me around automatically till I build enough railroad connections. This mod is good for it.

Is it possible to optionally turn off bouncing when not pathfinding?
Car usually bounces a little without Autodrive, but with the mod it looses speed control completely after hitting a tree making full speed reverse - full speed ahead with abnormal max speed https://youtu.be/2IFGuDVTYEg . It happens when RC is in hand. A contrast: while autodriving speed limit is about halved (car doesn't accelerate enough even for long direct parts of the way).

And sometimes a path is built between trees when car definitely can't pass with its bounding box - is there a way to turn it off and make longer paths around forests? If car movement is controlled every tick maybe path can be corrected/reset when next part of the path is built incorrectly?

1 year, 6 months ago

Hi!

I was looking for mod which lets car transport me around automatically till I build enough railroad connections. This mod is good for it.

Glad you like it, and thanks for your input!

Is it possible to optionally turn off bouncing when not pathfinding?
Car usually bounces a little without Autodrive,

Really? As far as I could see, it would come to a complete stop upon impact if Autodrive was not installed. (Or did you mean cars will bounce a little if the mod was active but the car wasn't on Autodrive's GUI? In this case, Autodrive will take control of the car while it's bouncing.)

but with the mod it looses speed control completely after hitting a tree making full speed reverse - full speed ahead with abnormal max speed https://youtu.be/2IFGuDVTYEg . It happens when RC is in hand. A contrast: while autodriving speed limit is about halved (car doesn't accelerate enough even for long direct parts of the way).

Yes, I've noticed that multiple crashes in a row may result in insane bouncing speeds. For the new version, I've already capped bouncing speed to the maximum speed a given vehicle can go (depending on its weight and friction, the tile beneath it, and speed modifiers from fuel).

And sometimes a path is built between trees when car definitely can't pass with its bounding box - is there a way to turn it off and make longer paths around forests? If car movement is controlled every tick maybe path can be corrected/reset when next part of the path is built incorrectly?

It's not quite that easy. Pathing uses the same algorithm that is used by the game for pathfinding of biters etc. We can allow/forbid vehicles to destroy entities of their own force -- but this usually doesn't apply to trees as they usually belong to force "neutral" ('usually' because mods may change that). Using this algorithm makes it possible to find a path leading from A to B (unless it's impossible to get there because it's been cut off by water, cliffs etc.) even over long distances. Trying to micromanage the path by going around forests may result in the vehicle ending up at a position from where it can't find a path to B.

There is a global setting "Heal vehicle on collision with trees". If that is active (the default), vehicles crashing into a tree will only bounce if they don't destroy the tree. If they kill the tree immediately, they will be put in "steamroll" mode, where they will accelerate for the next 30 ticks (half a second), thus gaining momentum and increasing their chance to kill the next tree as well. If the setting is on, even the vanilla car should be able to get through a forest -- although it may take some time.

If you have disabled this setting, try to enable it. Also, as the impact damage is a function of vehicle speed and weight, it may be worthwhile to send heavier vehicles (e.g. the vanilla tank or vehicles from other mods) through forests.

1 year, 6 months ago

The problem is I don't want to remove trees only just because my automatic path was built nearby. I need trees to consume pollution - I play with halved tile absorption and doubled tech costs, so keeping trees around base is essential till the end of midgame for me.

The tree destruction problem occurs only when autodrive makes a path through "forest" region. Instead of going around (+30% or even +50% to path length) and accelerate freely as a human normally does it tries to make path shorter and wastes more time on hitting trees, bouncing.
For now I have to divide path into 2-3 parts manually by selecting some intermediate points on mini-map.

1 year, 6 months ago
(updated 1 year, 5 months ago)

I need trees to consume pollution - I play with halved tile absorption and doubled tech costs, so keeping trees around base is essential till the end of midgame for me.

I understand your problem, but I don't know how to work around it with the currently available means. Basically, I if there is a collision with a tree, I could draw an imaginary line from the vehicle in the direction it's moving, and if there are more trees behind the first one, stop the vehicle and issue a new path request. However, if nothing has changed since the time the vehicle got its first path (e.g. part of the path has been walled off), I'd expect that this would return just the same path again, through the forest.

Instead of going around (+30% or even +50% to path length) and accelerate freely as a human normally does it tries to make path shorter and wastes more time on hitting trees, bouncing.

I've been disappointed myself with some of the pathing decisions made by the game, e.g. why does a vehicle decide to go through rough terrain if there is a nice concrete road just a few tiles to the side of its path? So far, I don't see how I could automate pathfinding in a satisfying way.

However, one of the things on my to-do-list is to allow players to somehow record a path. I'm not sure yet about the details. Perhaps you could manually drive a vehicle and hit a key when you want to set a waypoint, or a waypoint will be set whenever the vehicle is turned at an angle of more than X degrees. But prerecorded paths have serious implications: In the most simple case, you wouldn't want to record the same path all over again, but reuse it until you decide to delete it altogether -- this way it may be possible to go around forests or along roads. Take this a step further, you may want to combine several paths like these to set up a route from A to B (via several turning points) to C (ditto) or D (ditto). Then it may be a good idea to make special waypoints, e.g. if a vehicle with logistics sensor arrives at X, request THIS and provide THAT, when it has arrived at Y, provide THIS and request THAT. But all of this would require reworks of the GUI and judging from my experiences with the current GUI, that won't be either and will take time (not just a couple of weeks).

So, in conclusion: I definitely want to tackle this at some point, but there are some more serious things I've got to sort out first (e.g. train sensors and logistic sensors being quite useless right now) and it may take me a long time until I've got some presentable results on prerecorded paths. I hope you'll stay on nevertheless until that happens. :-)

New response