I have been unable to find a way to successfully emulate player input on a tick by tick basis, I was hoping to make a more accurate version of tas tools but haven't found any way to do so. Is this a possibility to do or have I just been looking for something that isn't possible.
Both somewhat outdated and my fork definitely isn't feature complete. Good luck.
Did you ever test that in Multiplayer? I guess for speedruns that's not a relevant criteria?
Just wondering if walking_state actually is meaningfully usable outside of a 0-ms-ping context now.
Did you ever test that in Multiplayer? I guess for speedruns that's not a relevant criteria?
Just wondering if walking_state actually is meaningfully usable outside of a 0-ms-ping context now.
My fork works in multiplayer if the runner is the host. That means you could host the tas and have spectators. It doesn't work for joining players, because the latency/multiplayer logic can randomly delay actions a few ticks (usually when latency changes), most meaningful of those actions are crafting, mining and walking. Since the mod just does "x task at y tick", just a 1 tick delay in for example mining means that the mining isn't finished and everything goes wrong. A true multiplayer version would have to be more dynamic and work with events etc. However, there is another flaw to multiplayer: players joining messes with the rng, so the rng "manipulation" used for mining coal rocks doesn't work. For that reason, I never looked into making the mod dynamic.
Re: Emulation of a Player
Posted: Fri Jan 03, 2020 4:07 am
by eradicator
Bilka wrote: Thu Jan 02, 2020 4:03 pm
My fork works in multiplayer if the runner is the host. [...] It doesn't work for joining players
Ah yes, that would be exactly the experience i had :(. Thanks for confirming. Wish i could just issue a unit-style move command to the player.
Re: Emulation of a Player
Posted: Fri Jan 03, 2020 12:07 pm
by Klonan
eradicator wrote: Fri Jan 03, 2020 4:07 am Wish i could just issue a unit-style move command to the player.
eradicator wrote: Fri Jan 03, 2020 4:07 am Wish i could just issue a unit-style move command to the player.
I made this script a few months ago for an experiment I was working on, its probably still rough around the edges.
Can't currently test that. But if it's just an on_tick manipulation of walking_state wouldn't it still look shitty to the player who's "being walked" when lag-hiding does it's thing in a laggy mp game?
eradicator wrote: Fri Jan 03, 2020 4:07 am Wish i could just issue a unit-style move command to the player.
I made this script a few months ago for an experiment I was working on, its probably still rough around the edges.
Can't currently test that. But if it's just an on_tick manipulation of walking_state wouldn't it still look shitty to the player who's "being walked" when lag-hiding does it's thing in a laggy mp game?
I don't see why it would look shitty, the script will execute on_tick for the client, and latency hiding won't have any effect unless you start pressing the movement keys
Ping would only have an effect if some command was being sent from the server each tick, but this is all controlled inside the Lua script of the game, so MP or not won't make a difference
Re: Emulation of a Player
Posted: Fri Jan 03, 2020 2:40 pm
by eradicator
Klonan wrote: Fri Jan 03, 2020 1:41 pm
Ping would only have an effect if some command was being sent from the server each tick, but this is all controlled inside the Lua script of the game, so MP or not won't make a difference
That was also my expectation when i first tried this 2 years ago, but at the time (possibly to lacking experience) i found no way to make it work properly in mp. And it'll be a few weeks until i can test this.
Re: Emulation of a Player
Posted: Fri Jan 03, 2020 8:05 pm
by Bilka
Klonan wrote: Fri Jan 03, 2020 1:41 pm
I don't see why it would look shitty, the script will execute on_tick for the client, and latency hiding won't have any effect unless you start pressing the movement keys
Ping would only have an effect if some command was being sent from the server each tick, but this is all controlled inside the Lua script of the game, so MP or not won't make a difference
Did you read my post?
Bilka wrote:It doesn't work for joining players, because the latency/multiplayer logic can randomly delay actions a few ticks (usually when latency changes), most meaningful of those actions are crafting, mining and walking.
Klonan wrote: Fri Jan 03, 2020 1:41 pm
I don't see why it would look shitty, the script will execute on_tick for the client, and latency hiding won't have any effect unless you start pressing the movement keys
Ping would only have an effect if some command was being sent from the server each tick, but this is all controlled inside the Lua script of the game, so MP or not won't make a difference
Did you read my post?
Bilka wrote:It doesn't work for joining players, because the latency/multiplayer logic can randomly delay actions a few ticks (usually when latency changes), most meaningful of those actions are crafting, mining and walking.
Thats not how the Lua scripting works, the Lua script isn't ever delayed, it always executes on every tick for every client and server
EDIT: So I tested it out, the jumpiness comes from the latency hiding predicting where the player will be based on the current movement at the current tick (As opposed to player input as I thought it would use for its prediction). So if the script is going to turn the guy around in 1 tick, the latency character position will be incorrect
The solution is to disable the latency hiding, which I see from this old post you have mentioned before eradicator: viewtopic.php?t=63525
Re: Emulation of a Player
Posted: Sat Jan 04, 2020 7:53 am
by eradicator
Klonan wrote: Fri Jan 03, 2020 8:11 pm
The solution is to disable the latency hiding, which I see from this old post you have mentioned before eradicator: viewtopic.php?t=63525
By setting shooting state? Certainly never thought of using it like that. Albeit that has the drawback of applying the weapons movement penalty.
Re: Emulation of a Player
Posted: Sun Jan 05, 2020 11:39 am
by Bilka
Klonan wrote: Fri Jan 03, 2020 8:11 pm
Thats not how the Lua scripting works, the Lua script isn't ever delayed, it always executes on every tick for every client and server
That is how lua scripting works. Here is a demonstration. On the left is the host, on the right the joining player. The joining player is commanded to craft pipes by script, and the finishing ticks of the crafts are printed into chat. You can see that the crafting takes 2 ticks longer to complete than it should (see chat history) due to a latency change.
I used crafting as the example because it is extremely easy to demonstrate the issue with it, however mining and walking (and some other stuff) exhibit the same behaviour. Here is the command in case you want to try it yourself:
To sum up: Latency changes can and will delay actions such as walking, crafting and mining. This is done by the multiplayer logic and happens regardless of whether Lua triggers the actions or not.