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 4 forks source link

Step modifier column in steps grid #248

Closed theis999 closed 1 year ago

theis999 commented 1 year ago

We currently use the comment field for some special modifying behaviors which is a rather obscure way to handle such things.

Current

We currently uses the comment field for a fairly wide array of step modifying behavior:

then we also

and

Step modifications

This is in response to having Set recipe that blocks until the assembler is not crafting. However a few other uses also comes to mind:

  1. No order - execute task in no particular order, for instance if you want to take items from a bunch of furnaces and just want it done as fast possible.
  2. Wait for crafting - When you have queued up intermediate items for crafting the next item, then it could be useful to block&warn before adding a new item to the crafting queue.
  3. Walk to - specifically for walking to a far away item to execute some task (mining it or take items from a wreck). Then we could cancel the walk.
MortenTobiasNielsen commented 1 year ago

Modifier suggestions:

theis999 commented 1 year ago

I don't disagree that those could be useful. They do however sound much more like they are modifying the TAS state than a specific step.

MortenTobiasNielsen commented 1 year ago

Agreed. I think we can do both step and state modifiers in the same column.

  1. No order: Would the LUA code keep on going to the next step and check if that can be executed until it finds one or it gets to X forward step and then stops?
  2. Wait for crafting: Sounds pretty useful. It is pretty annoying to try to align that so it is tick perfect.
  3. Walk to: I don't really understand this one. Why would you want to cancel a walk step - couldn't you just make the walk step to where you want to go?
theis999 commented 1 year ago

I was thinking the lua could be allowed to "rearange" steps that had no order, to whichever could be completed first. So you would have to have a block of steps that could be done in any order. So if you had task A through E. A and E are both order steps, but B,C,D are un-order. So the TAS can execute them as C->D->B giving the full order as A->C->D->B->E.

theis999 commented 1 year ago

Walk to, would allow a new walk command to override the destination. Which is useful if you don't care about reaching a certain destination, and only care about performing a task in that general direction.

MortenTobiasNielsen commented 1 year ago

I still don't really understand in what situation I would do that instead of just walking to the destination I actually want to go. :)

theis999 commented 1 year ago

Well it is similar to mining ALL where you don't care about how long it takes but want to switch tasks as soon as it is completed. It is meant as something that makes it easier to use the generator, by giving you good precision without too much hassle.

image For instance in this case. I want to run right until i can take the iron from the ship and then i want to change direction. In this case i can slowly search for the correct x / y, which takes some time as generator does calculate the distance to wreck parts correctly. Or i would use this modifier, to say go towards x,y until the plates can be taken from the wreckage.

MortenTobiasNielsen commented 1 year ago

So you would set the x to sometime much lower (or larger) than you expect and just let the character run until it is within distance - that would be pretty useful.

theis999 commented 1 year ago

Exactly