Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I worked on this problem for a bit. What's going on is the game relies on the OS-provided C runtime libraries ("msvcrt"-style things) to do its math. Wine's implementation of these libraries does not match Windows's perfectly. If all players are using the same implementation, then they will agree, and there are no problems, so people think it is working. But if a player on Wine tries to play against a player on Windows, they will fall out of sync because the math errors eventually add up.

That was as far as I was able to take it. Another much more skilled dev at CW dug in a lot deeper and wrote a blog post about it[1], but as far as I know the problem remains unsolved.

[1] https://www.codeweavers.com/blog/rbernon/2022/9/12/ucrtcring...



Oh interesting, I always wondered what the underlying issue was and why downloading some obscure looking dll solves it.

For a practical solution, just using the Windows dlls seems to work fine. Without AoE2:DE goes out of sync immediately, with I've played hour long games.


Oh wow, thanks for sharing. I knew it was an oos but didn't think a math lib specifically was the issue.


I remember it being interesting to work on. It's been years, but if I remember right, there is some way to convince the game to dump a log of unit positions during a multiplayer match, possibly as part of its desync handling. I enabled that on both Win & Linux hosts, ran a match between the machines until they desynced, and diff'd the game's own logs, then confirmed from the Wine logs that the faulty values were coming from CRT-related math functions. It's always fun when you get to use a game's own debug utils to track down a problem.

Anyway it'd be great if the game devs included their own math libraries instead of relying on the OS's. That would fix the problem quite nicely.


Do you know if the code from the blogpost you mentioned is publicly available? I don't think I could find it but I'd love to give it a try


I don't, he did that work after I left the job. You could email Rémi or hop into one of the Wine dev channels to start up a conversation.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: