Scrap Mechanic

Scrap Mechanic

WASD Converter
KitsuSenpai 2020 年 5 月 28 日 上午 1:35
Massiv latency buildup when in multiplayer (Survival)
Hi

i converted this and your Camera Converter mod to Survival. We found out, if you connect the WASD Converter with a seat and sit on it, over a short period of time it builds up a massive amount of latency for the clients in multiplayer, regardless if your driving or not. The latency can go up over 10 seconds in under 5 minutes. When you destroy the converter, the game for the clients catches up and the latency returns to normal. I currently not tested it with the Camera Converter, but i suspect the same problem there. Also the Yaw/Pitch/Roll Outputs of the Camera Converter have no motor functionality with the new upgradeable motors from survival. It only outputs positive signals. The old creative motors work as intended. Would be nice, if you would look into this. You don't have to upload an update to steam right away, but a link to a fixed version would be nice, if you have the time for it.

Love your mods, keep up the good work ;)

PS: tested game version 4.4

Edit: Disconnecting the Converter from the seat is enough to fix the latency
Edit: Only a seat and the converter are enough to start the buildup, no motor required
最后由 KitsuSenpai 编辑于; 2020 年 5 月 28 日 上午 2:22
< >
正在显示第 1 - 5 条,共 5 条留言
TechnologicNick  [开发者] 2020 年 5 月 28 日 下午 1:09 
Thanks for the report.

I haven't tested it in multiplayer at all since survival mode came out. I noticed vanilla logic gates have the exact same problem you're describing when changing their state repeatedly.

I'll do some more investigating when I have the time for it.
KitsuSenpai 2020 年 5 月 29 日 上午 6:36 
Nice, thx in advance, i really appreciate that. Hope you find something useful.

And yeah we noticed that too, 0 tick logic clocks are pushing the latency really fast.
Faupi 🐾 2020 年 6 月 4 日 上午 5:13 
Hey, I took just a quick look at the code and I have a feeling it might be the fact that you're sending updates through the server on every single update, not just when it's needed; when the state has changed etc. I could be wrong and I don't currently have a way to test it out, but it could be something worth looking into.

For a quick fix I'd just change the last else to elseif and compare the current value to the previous as the previous if statements already do that, or just simply wrap it all up in a check if it's changed at all

EDIT: That's under XYZ_Converter.server_onFixedUpdate()
最后由 Faupi 🐾 编辑于; 2020 年 6 月 4 日 上午 5:14
KitsuSenpai 2020 年 6 月 4 日 下午 1:44 
Thanks for the info, i'll look into that and make some tests. It could reduce the latency a fair bit, but we also noticed latency buildup with the vanilla logic gates. But for a first fix this should do.

EDIT:

I wrapped a change statement around each update, as mentioned by @Faupi, so it only triggers once, if you press/release the button. That will fix most, if not all lag that would build up. But I didn't tested this yet.

I also found out, that the A and D Converter where broken in survival, because the getPoseWeight() function is out of bounds with the new seats. You have to use getSteeringAngle() to get them work in survival. They output integer between -1 and 1 just like getPower() and work with the old seats, too.

The setPower() function doesn't work with the new survival engines anymore. They require isActive() to receive power with setPower(). You could redefine some function, but changing the WASD Converters back to Logic Output only again and adding Steer and Power Converters for Power Outputs would be the easier approach.
最后由 KitsuSenpai 编辑于; 2020 年 6 月 4 日 下午 7:00
TechnologicNick  [开发者] 2020 年 6 月 6 日 下午 6:04 
Yeah I haven't looked into this at all since I posted the message. The A and D converters seemed to work fine in creative. I assume the creative seat isn't scripted.
< >
正在显示第 1 - 5 条,共 5 条留言
每页显示数: 1530 50