MortenTobiasNielsen / Factorio-TAS-Generator

This is an attempt to create a helper tool for Tool Assisted Speedruns in Factorio. A guide of how to use the tool can be found here: https://www.youtube.com/watch?v=V9tuNoDqc0E&t
MIT License
13 stars 2 forks source link

Implement using vehicles #42

Closed MortenTobiasNielsen closed 2 months ago

MortenTobiasNielsen commented 2 years ago

The tool won't really be complete without being able to get into and drive/shoot with cars and tanks.

theis999 commented 1 year ago

I'll try to compare walking and driving:

Walking uses absolute direction and a constant speed (velocity). Driving uses relative direction and acceleration.

The walking commands translate an absolute position into a direction. For a driving command we could keep using an absolute position:

We would then need to translate the position into a direction and a distance. Then we can use the distance to determine acceleration & deacceleration. (For a bit of added precision, we might need to accelerate less when the deviation in direction is great). There is an algorithm for deaccelerating before you reach a point, i can't recall what it is called.

To keep the driving fluid we would need to look ahead in the steplist, to check if a new drive command is coming. So we don't break at driving waypoints. I don't know what to do about percussive breaking or exiting the vehicle before stopping??

I am not sure if it is possible to use the walk command to drive, or we need a separate drive command. We certainly need a enter/exit command. We also need a completely new algorithm for moving in vehicles. The positional precision when driving is more imprecise, which also has to be dealt with. IF the driving distance is great enough (+50 tiles), then it might also be possible to use the built in lua pathfinder.

TLDR;

It seems like a lot of work, for rather marginal use. It does however seem possible to implement in our current setup.

MortenTobiasNielsen commented 1 year ago

I think this shouldn't be considered. I find this to be in line with using bots - I guess it could be cool to be able to do, but would you really wanna do it in a TAS?