Wargus / stratagus

The Stratagus strategy game engine
GNU General Public License v2.0
627 stars 120 forks source link

Always "network out of sync" in multiplayer mode #12

Closed timfel closed 8 years ago

timfel commented 8 years ago

This game is so great to play with friends, but it has very unstable multiplayer. For example, I've tried to play with my friend several times, and while we were playing, we were always getting message "Network out of sync". In spite of it, the game looked good, but it gives only approx. 5 minutes, then says "Player send bad command". I use 2.2.5.5 version of both Stratagus and Wargus. 32-bit Windows. Also, in previous versions I've used previous versions of this game at Linux, and there was another problem: I was able to play with only 1 friend, but it was okay. When second friend tried to connect, it seemed that all connections were broken, but there was no any error reports, so I was able to start the game and play alone. Not sure about now, but I can try to test this with some of my friends, if you need.

I will repeat it again: the game is great, so I hope you'll fix this as soon as possible.


Imported from Launchpad using lp2gh.

timfel commented 8 years ago

(by joris-dauphin) All players should have the same version of stratagus/wargus.

If it is not that the problem, can you give some info to reproduce the error ?

timfel commented 8 years ago

(by mrbomfunk) All players were using the same version 2.2.5.5.

Some info to reproduce the error, hmm... That's what I did: Hosted a game with 3-player map. A friend connected and I started the game, so we were against one computer player. And from the first minute of playing both of us were seeing the "Network out of sync" error, then, after some minutes playing, game freezed with the "Player send bad command" error.

Also I tried to launch 3 copies of the game on one computer and connected all of them to one game. All of them were getting "Network out of sync" error, so it's not a network issue, I suppose.

timfel commented 8 years ago

(by erstmap) Stratagus has always had this problem. I remember back when I was at school we were forced to play Freecraft instead as Wargus 2.4 would go out of sync with more then three players.

I wonder if BOS Wars has fixed this issue? Back porting might be the answer.

timfel commented 8 years ago

(by pali) Bos Wars did not fix it too :-(

timfel commented 8 years ago

(by pali) Now I tested 2 instances of Wargus 2.2.6 on Ubuntu Oneiric in multiplayer game, both on localhost. And there was no out of sync problem.

Can somebody test network multiplayer game on localhost too? And also on LAN?

timfel commented 8 years ago

(by iddqd-mail) Yes, i've just tested localhost on Stratagus 2.2.6 Windows XP SP3 with Doom Wars and everything was OK. Replays are also played well.

timfel commented 8 years ago

(by iddqd-mail) Checked on real LAN too with 2 players and 2 computers. Everything was OK, no desyncing

timfel commented 8 years ago

(by pali) Bomfunk, can you test if you have still problems with version 2.2.6?

timfel commented 8 years ago

(by mrbomfunk) Hmmm, I just can't launch it on my Windows 7... It just says nothing and doesn't appear. I can try it on Debian Linux though, but I want it to work on Windows. Maybe I'm doing something wrong...

timfel commented 8 years ago

(by pali) Yes, there is problem with wargus.exe binary on Windows, see bug 909532

timfel commented 8 years ago

(by mrbomfunk) It seems to work good with 2 launched instanses of Wargus, but I can't test it with friends now.

timfel commented 8 years ago

(by pali) Seems that bug is fixed on localhost (confirmed by me, cybermind and bomfunk) and on real lan too (confirmed by cybermind). So I closing this bug as fixed, reopen if not. No idea which commit fixed this problem.

timfel commented 8 years ago

(by mrbomfunk) No, don't close it. I tried to play with my friend, but he only can join to my lobby, but when game starts, he is left in lobby, or game is out of sync immediately. On LAN it works ok, but on the Internet...

timfel commented 8 years ago

(by janitor) [Expired for Stratagus because there has been no activity for 60 days.]

timfel commented 8 years ago

(by iddqd-mail) Check, if bug is still present in game

timfel commented 8 years ago

(by artofwar) After many years, this bug continues to affect us. Currently on stratagus rev 8922, building in OS X 10.10 (Yosemite)

All computers running same version of OS and stratagus, all computers connected to same router.

Starts with "network out of sync" messages and finally ends with "player sent bad command."

Problem seems to worsen as army get bigger on both sides until game eventually stalls.

I build my own binaries for OS X and would not mind building a special version with debugging/logging params to trace this problem down. Thanks for any help.

timfel commented 8 years ago

(by iddqd-mail) I need information about game used (Wargus, Doom Wars, Wyrmsun ...), game's version (rev. number for Wargus), map used in game. And please send replay files from all computers. You may also run stratagus with "-i" key to get a more detailed information about game (stratagus will generate a big log file in game's directory (where stratagus.exe is located)). It would be good if you will send those log files from all computers (don't forget to compress them first)

timfel commented 8 years ago

(by mimoohowy) Just about any multiplayer wargus game gets 'network out of sync' within 20 minutes or so. I tried stratagus 2.2.7 linux to linux, linux to windows, and also windows to windows. Windows to windows was the least affected. I would imagine it can be easily reproduced since it happens so regularly to me on different machines, but I can provide the logs if stratagus developers never experience these problems.

When it comes to network play, I can also mention that I have problems joining the game unless I start 'startagus -P 6667' - such a server (6667) can be easily connected to.

timfel commented 8 years ago

(by mimoohowy) Yes, I can confirm. Freshly built stratagus 2.2.7 + wargus 2.2.7. Compiled on my machine amd64. On this machine I start two instances of wargus in this manner: ./stratagus -W -v 1024x768 & ./stratagus -W -v 1024x768 &

and I play a mutiplayer game between two windows on 192.168.1.2 interface. I start getting 'network out of sync' within 15 minutes on a map that I created in the editor. (BTW, the editor doesn't save many values to the files, like the race, the AI-style, the values of the starting resources (wood, gold, oil) so I edited the map file with a text editor).

The option -i suggested by cybermind is not working: wszafie:wargus$ ./stratagus -i ./stratagus: invalid option -- 'i'

timfel commented 8 years ago

(by iddqd-mail) Please use the recent version from trunk instead of 2.2.7

timfel commented 8 years ago

(by artofwar) Just built the latest version 8961 with wargus 1823 scripts. Network out of sync happens for us immediately upon game start. ran stratagus with "-i" key and attached resulting log files.

Note: I'm now building stratagus in OS X 10.10.2

I'm available for further testing/debugging when needed.

Thanks for your continued development on this great game.

timfel commented 8 years ago

(by iddqd-mail) Please update your Stratagus to rev. 8964 and Wargus to rev.1827 and report if this continues to happen. It would be good if you will describe your network (# of computers, pings, network speed etc)

timfel commented 8 years ago

(by artofwar) Updated to Stratagus rev. 8968 / Wargus rev. 1832- "Network out of sync" problem persists.

Local Network: Gigabit network...4 computers in same room, on same hub, all wired.

Only two computers playing on this test, here's the ping statistics between the two computers:

10 packets transmitted, 10 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 0.487/0.546/0.594/0.030 ms

We continued playing through the "Network out of sync" until we got to the point where someone "sent bad command." (We suspect this happens when one of the players selects a large army, 40+ troops, but it may be coincidence)

When someone get's the dreaded "player sent bad command" message, it's all downhill from there.

This time around, only the client player saved a log file (attached.) The computer who hosted the game did not leave a log (not sure why because game did not crash, could be operator error I guess.)

In any case, wanted to get this info to you as soon as possible.

timfel commented 8 years ago

(by mimoohowy) Fresh Stratagus 2.3.0 + Wargus 2.3.0 @ ubuntu. Still network out of sync :(

I am trying to understand how it works, so that I can help to resolve this bug:

So there are cycles in the game. Within each cycle the state of each single unit (each critter even) is passed thru the network. Each record is plain text, but also contains some hex tag and this tag is checked against network syncing (what is the "nature" of this hex tag BTW?). At some point I spotted the "network out of sync" in the console. As I understand I need to collect both the -p output in the console (network problems are reported here) and -i output (the state of the units).

Then the first bad cycle should be compared against the previous one and this is basicaly how I should report it, right?

Please change -P port Network port to use into -P port Network port to use for the client

my tests show this is the meaning of -P option (server fixed to 6660), unless I am wrong.

Regards, Karol

timfel commented 8 years ago

(by micronizer) Me and my group have been affected by this bug since the first version we tried (2.1), and we always try again with each new release with no result. In fact, each new version seems to get out of sync slightly faster. It always surprises me how multiplayer issues don't seem to get noticed; I suppose few people play wargus multiplayer.

arkadyeye commented 6 years ago

it's almost end of 2018. wargus 2.4.2 - the issue is still here

ZackKnopp commented 2 years ago

2021 and the issue is still here. Happens with local multiplayer, same router, different pc's.

Happening with us on war1gus as well.

Happens more often when not everyone is hardlinked, and more often with more players.

Happens almost always on the online, different household, public mode.

Any update on any potential fixes for this? We also crash as soon as we get booted from the multiplayer game with the following error message:

image

We're all running version 3.2.0 portable.

We bought a GOG copy of Warcraft 1 and used that copy to install the data files.

Are there any workarounds or fixes for this issue in either war1gus or wargus?

timfel commented 2 years ago

@ZackKnopp to sanity check, can you confirm you did not change any settings at all and everything as at default? There are still some bugs remaining with some game-changing settings not being synced correctly and causing desyncs.

ZackKnopp commented 2 years ago

Thanks for the quick reply, I'll try that out sometime this week without changing any settings on fresh installs.

Is there a list of settings somewhere that are okay to change for multiplayer or a list of the ones we're not supposed to touch?

ZackKnopp commented 2 years ago

Tried it out in 3 ways

image

And this stderr.txt

Can't find icon Can't find icon Stratagus crashed! A mini dump file "crash.dmp" has been created in the Stratagus folder. Please send it to our bug tracker: https://github.com/Wargus/stratagus/issues and tell us what caused this bug to occur.

We're all running version 3.2.0 portable.

No settings were ever changed (fresh installs)

We bought a GOG copy of Warcraft 1 and used that copy to install the data files from setup.exe on all 3 computers

Hunteil commented 1 year ago

Same here... same error dialog box shows up when it crashes. Game said: "network out of sync" with 20 minutes. Here is all my logs stderr.txt log_of_stratagus_3_1684677190.log log_of_stratagus_4_1684677364.log log_of_stratagus_4_1684679201.log log_of_stratagus_4_1684679233.log log_of_stratagus_4_1684679277.log unit_log_of_stratagus_4_1684678650.log

stdout.txt