Wargus / stratagus

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

bugs, bugs, bugs #150

Closed timfel closed 8 years ago

timfel commented 8 years ago

(reported as Bug #1518749 by Karol Krenski - https://bugs.launchpad.net/stratagus/+bug/1518749)

I find regular bugs in the game, that narrowing them seems pointless to me. Some of the bugs were already reported by me and by other people. I can produce these bugs in various linux conditions with ease. I play wargus under various ubuntu versions which I compile the fresh stratagus/wargus myself. I could attach logs (wargus -p -i), but since the bugs seem so easily reproducable and obvious, I think there's no point. I will just enumerate the topics:

Look, I really hope stratagus/wargus will work great someday. I love the features, the high resolution and that it's opensource. I could try the regular warcraft from Blizzard, but I still choose to stay with wargus, despite the bugs. My kids and my old friends for LAN parties - we all hope that someday we can play undisturbed network wargus games.

a-detiste commented 8 years ago

Hi,

Feel generally the same in general & about LAN games particularly ... I did spent a lot of my time to help supporting all these old commeciral games in general, but can't help for this one much.

Andrettin commented 8 years ago

a-detiste, these multiplayer bugs have been solved in Wyrmsun (a Stratagus engine game), so it would be a matter of backporting those changes. The difficulty would be identifying precisely which changes from Wyrmsun's fork of Stratagus have to be ported for that to work (since it has 1789 changes).

a-detiste commented 8 years ago

Well, I've been brain-damaged from doing 13 years of SAS/SQL reporting since I'm 19; now I've been getting enough of my mind back toghetter to work on this game-data-packager project in Python http://pkg-games.alioth.debian.org/game-data/ for one year, but my C/C++ is still seriously lacking. Let's say I would do that later.

Andrettin commented 8 years ago

Ah, I didn't mean to say for you to do it. I plan to do it myself at some point; now that Stratagus is on GitHub, I want to slowly add Wyrmgus' improvements to it.

a-detiste commented 8 years ago

Aah, ok that would be great.

mimooh commented 8 years ago

Andrettin, you really fixed these issues I reported? That would be lovely to have these fixes in stratagus! My friends and I, we have sentiment for warcraft so we prefer to stay with stratagus/wargus. But at least I watched some Wyrmsun youtube videos :)

Andrettin commented 8 years ago

mimooh, most of them, yes.

I'll go one by one:

"I don't remember the last time I finshed the wargus LAN game. Always network out of sync / player sent bad command. Do the developers never experience this bug that has been here for years? Do the developers ever play wargus multiplayer?"

There was an out-of-sync bug, which I managed to fix. It could be ported easily (IIRC) to Stratagus, but it would be better if someone more knowledgeable about multiplayer code could review it.

"In preparation room / multiplayer game: when all players are ready and I start the game it happens that some players get the screen blank and never make it into the game."

This could either be due to the out-of-sync issue above, or be due to playing a map in multiplayer which has only 1 player. I haven't seen this happen with Wyrmsun,

"In preparation room: human/orc race setup are never respected."

I had the same problem with Wyrmsun, but fixed it.

"In preparation room: start with one peasant only not respected, at least sometimes."

Same as above; I also experienced this issue with Wyrmsun, but fixed it.

"Lot's of maps are said to be for 2 or 3 people, but the numbers are very often misleading. If the maps are cumbersome it might be better to have only say 10, but quality maps, working as expected. Otherwise players need to check this large collection of maps and hope that they will find the one which works as expected. I could produce some maps which could be distributed with wargus if the maps are problematic."

This is an issue with Wargus, rather than Stratagus. Either each map should be changed to have its true player quantity shown, or the Lua code in Wargus should be changed to override the stated player number with the real one.

"Diplomacy: ally human-computer in multiplayer game doesn't work."

Is allying between human and computer players something introduced with Wargus 2.3.0? I began working on Wyrmsun when Wargus was in 2.2.7, so I haven't kept entirely up-to-date on how Wargus is.

"Stratagus MetaServer: what is this thing? Does it work or it's just a concept of something to come? Perhaps it's too early to have it in the menu?"

That feature is sadly incomplete, to my knowledge :(

mimooh commented 8 years ago

"There was an out-of-sync bug, which I managed to fix." Wow! This was here for years! Good job. Can't wait to have it in stratagus. Please let me know when you're done, I am subscribed to this issue. And please fix this one quickly :) The other issues are minor comparing to this one. The other, but less important issue is to be able to choose the races. The rest of the issues - I can live with them.

In Wargus 2.3.0 there's Diplomacy menu where you can check/uncheck your allies and enemies and also have shared vision among your allies. Works for human players, seems clickable for computer players, but doesn't work.

Thanks for your contribution to this great open source project! And thanks to the whole team of wargus/stratagus!

screen01

Andrettin commented 8 years ago

I've uploaded the fixes to the multiplayer race selection and the out-of-sync issues to Stratagus now :)

Do you build Stratagus yourself? If so, let me know if everything is working for you now!

About the diplomacy menu, the thing is that when you click that option you are allying yourself with the AI, but it doesn't mean that the AI is allying itself with you. Basically, with that option you set your stance towards a player.

a-detiste commented 8 years ago

My daughter is grounded, how will I be able to test ? :wink:

Nope, I'll just build this & run around the flat.

mimooh commented 8 years ago

Wow, that was quick! Just compiling, however:

s1:stratagus$ git show commit 7ca9428b8da3c8565654c0a955afc04d82100af9 Merge: 7d9e670 cbe17ce Author: Tim Felgentreff timfelgentreff@gmail.com Date: Mon Nov 23 14:08:06 2015 +0100

Merge branch 'master' of github.com:Wargus/stratagus

[ 95%] Building CXX object CMakeFiles/stratagus.dir/src/video/font.cpp.o /usr/bin/x86_64-linux-gnu-g++ -DDEBUG -DHAVE_GETOPT -DHAVE_STRCASESTR -DHAVE_STRNLEN -DPIXMAPS=\"/usr/share/pixmaps\" -DUSE_BZ2LIB -DUSE_FLUIDSYNTH -DUSE_LINUX -DUSE_MIKMOD -DUSE_MNG -DUSE_OPENGL -DUSE_THEORA -DUSE_VORBIS -DUSE_X11 -DUSE_ZLIB -fsigned-char -g -I/home/mimooh/stratagus/src/include -I/home/mimooh/stratagus/src/guichan/include -I/home/mimooh/stratagus/src/guichan/include/guichan -I/home/mimooh/stratagus/obj-x86_64-linux-gnu-dbg -I/usr/include/lua5.1 -I/usr/include/SDL -o CMakeFiles/stratagus.dir/src/video/font.cpp.o -c /home/mimooh/stratagus/src/video/font.cpp /home/mimooh/stratagus/src/video/font.cpp: In member function ‘CGraphic* CFont::GetFontColorGraphic(const CFontColor&) const’: /home/mimooh/stratagus/src/video/font.cpp:469:94: error: cannot pass objects of non-trivially-copyable type ‘const string {aka const class std::basic_string}’ through ‘...’ fprintf(stderr, "Could not load font color %s for font %s\n", fontColor.Ident, this->Ident); ^ /home/mimooh/stratagus/src/video/font.cpp:469:94: error: cannot pass objects of non-trivially-copyable type ‘const string {aka const class std::basicstring}’ through ‘...’ /home/mimooh/stratagus/src/video/font.cpp:469:94: warning: format ‘%s’ expects argument of type ‘char’, but argument 3 has type ‘const string {aka const std::basicstring}’ [-Wformat=] /home/mimooh/stratagus/src/video/font.cpp:469:94: warning: format ‘%s’ expects argument of type ‘char’, but argument 4 has type ‘const string {aka const std::basic_string}’ [-Wformat=]

Karol Kreński

I've uploaded the fixes to the multiplayer race selection and the out-of-sync issues to Stratagus now :)

Do you build Stratagus yourself? If so, let me know if everything is working for you now!

About the diplomacy menu, the thing is that when you click that option you are allying yourself with the AI, but it doesn't mean that the AI is allying itself with you. Basically, with that option you set your stance towards a player.


Reply to this email directly or view it on GitHub: https://github.com/Wargus/stratagus/issues/150#issuecomment-158913863

Andrettin commented 8 years ago

Thanks, there was an issue with a debug message in font.cpp; I've fixed it now: https://github.com/Wargus/stratagus/commit/4ffc265cc55afe217381ae91bffcc799078d0b41

a-detiste commented 8 years ago

stratagus{-dbg} is built correclty, but make metaserver fails

even if I hide SQLITE, the build fails somewhere else.

-if(SQLITE_FOUND)
+if(FALSE)

- libsdl1.2-dev (>> 1.2.2), libx11-dev, libsqlite3-dev,
+ libsdl1.2-dev (>> 1.2.2), libx11-dev,

So I guess best is first to bring this to debhelper 9 compatibility level ! Will send a P.R. when I got it building again.


libsqlite3-dev

[  0%] Linking CXX executable metaserver
/usr/bin/ld: cannot open output file metaserver: Is a directory
collect2: error: ld returned 1 exit status

or

make[3]: Leaving directory '/home/tchet/git/stratagus'
make -f CMakeFiles/metaserver.dir/build.make CMakeFiles/metaserver.dir/build
make[3]: Entering directory '/home/tchet/git/stratagus'
make[3]: *** No rule to make target 'CMakeFiles/metaserver.dir/build'. Arrêt.
make[3]: Leaving directory '/home/tchet/git/stratagus'
CMakeFiles/Makefile2:107: recipe for target 'CMakeFiles/metaserver.dir/all' failed
make[2]: *** [CMakeFiles/metaserver.dir/all] Error 2
make[2]: Leaving directory '/home/tchet/git/stratagus'
CMakeFiles/Makefile2:119: recipe for target 'CMakeFiles/metaserver.dir/rule' failed
make[1]: *** [CMakeFiles/metaserver.dir/rule] Error 2
make[1]: Leaving directory '/home/tchet/git/stratagus'
Makefile:178: recipe for target 'metaserver' failed

debuild -us -uc -b gives an other error

==================================
-- Configuring done
CMake Error at CMakeLists.txt:1149 (add_executable):
  Cannot find source file:

    metaserver/cmd.cpp

  Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
  .hxx .in .txx

CMake Error: CMake can not determine linker language for target: metaserver
CMake Error: Cannot determine link language for target "metaserver".
mimooh commented 8 years ago

Wargus is broken. Cannot build. I just reported it as wargus issue: https://github.com/Wargus/wargus/issues/133

Which means I have to wait with testing of the new network fix :(

Karol Kreński

Andrettin commented 8 years ago

a-detiste, the metaserver code is (to my knowledge) incomplete. cybermind knew more about it, but unfortunately he stopped working on Stratagus many months ago.

a-detiste commented 8 years ago

@Andrettin

Hey, Wyrmsum is awesome, not like these horrible fan-made graphics I saw 15 years ago in ALE Clone (or this maybe https://en.wikipedia.org/wiki/Stratagus#/media/File:BFM-screenshot01.png )

Will clean the debian/ dir a little bit & give a P.R.

Andrettin commented 8 years ago

@a-detiste Thank you! I commissioned the graphics for the game from pixel artists to give it a polished look, glad to know you enjoyed it :)

micronizerbattheend commented 8 years ago

Could it be that someone finally fixed the most important and long lived wargus/stratagus bug? I'm so excited about it! I cannot wait to test. Could someone provide a windows binary for it or basic directions to assemble a version with this fix included? I've compiled stratagus for windows before in attempts to fix this bug but now I don't want to risk it! Andrettin, if the fix works I promise I will buy 4 copies of your game right away! :)

timfel commented 8 years ago

@micronizerbattheend Binaries are under releases: https://github.com/Wargus/stratagus/releases. Also for Wargus: https://github.com/Wargus/wargus/releases

micronizerbattheend commented 8 years ago

Thanks!

micronizerbattheend commented 8 years ago

I'm currently having a bit of trouble with those binaries, as when I try to run them they ask for some DLLs that are not included in the "dependencies.zip" file. (VCRUNTIME140D.dll, MSVCP140D.dll). I tried installing microsoft visual studio 2015 just to get the dlls but since the install of vs requires a massive amount of hard disk space I wanted to know if there's some workaround. Thanks again.

Andrettin commented 8 years ago

@micronizerbattheend Thanks for your nice comments!

About the DLL issues you are having, that's strange. It is the sort of thing that would happen if the the executable being compiled were a debug one, but AFAIK a release executable is set to be compiled.

micronizerbattheend commented 8 years ago

I got the file at https://github.com/Wargus/wargus/releases/download/master-builds/Wargus-2.4.exe

The errors pop up either when trying to run wartool during install, or wargus.exe after installation

Meanwhile the stratagus download (not wargus) does not have the same problem. So for now I will just "mix and match" putting the stratagus executable on the wargus folder.

timfel commented 8 years ago

Ooops, Wargus was building debug binaries. I've just updated the CI script, once it runs through (https://ci.appveyor.com/project/timfel/wargus/build/1.0.31), you'll have a release binary for Wargus. Sorry for the inconvenience

mimooh commented 8 years ago

Timfel and Andrettin, thanks a lot for making stratagus/wargus better! I really, really appreciate your great work!

https://launchpad.net/~stratagus/+archive/ubuntu/ppa says: "This PPA provides daily builds of Stratagus and some Stratagus Games". So the new debs are built daily and I don't have to build myself anymore?! That is great news!

When it comes to the "network out of sync" bug I haven't had an occassion to fully test it yet. But I'll surely share my comments about how the fixed stratagus behaves now.

micronizerbattheend commented 8 years ago

I also thank Timfel and Andrettin and will test as soon as I get in contact with my group of players. I have high hopes! :)

mimooh commented 8 years ago

Unfortunatelly, network out of sync is still there :( Hard to say if the network performance improved at all. I can provide weekly logs, because we usually play it weekly. Today we played around 10 games. The very same linux, the very same fresh deb files, quick LAN, 2 players games and 4 players games - all finished with out of sync. Here is one log of 2 players game:

http://www.inf.sgsp.edu.pl/~mimooh/outOfSync_13.dec.zip

As I undestood the bug may be related to upgrades of units. We tried to narrow the conditions and played with basic units only. Only peasants and orcs, no towers, no townhall upgrades. The game resulted with network out of sync. (The log above comes from another game).

Andrettin commented 8 years ago

That's really unfortunate :( So it seems that my fix only solved one desync cause.

I'm able to play Wyrmsun without desyncs, though (and haven't gotten any reports of desyncs since I've fixed that issue). One thing that just sprung to my mind - are you all playing with Warcraft 2 data extracted from a CD-ROM of the same language, or of different languages? Also, are you using the Battle.net version, or the DOS one?

mimooh commented 8 years ago

There is a computer lab of identical machines that we use. Exactly the same data everywhere. We extracted the data from DOS warcraft. First there are "network out of sync" and then games freezes after "player sent bad command". Dropping some players allows for continuation of the game.

I once created a map with lots of units, say 200 against 200. Then I played a network game and made the units move all over the map. I got desync infos, but the game never broke which would indicate that it's not "too much traffic" that causes the problem (normal games are under 100 vs 100 units)

I got the feeling today, that I got no single desync info when I played against myself on two computers, which means I always played on one client while there were no clicks on the other. And then switch after ~10 seconds. I developed into TownHall level 3 and dragons and then two kids came to finish the game and quickly they got desyncs.

I don't think I can do any serious C programming, but perhaps I could be of some use in debuging this problem by tracing the conditions inside the game that lead to desync error. There are some things that interest me:

a) Can I run a network game against AI? :) It would allow for sending more network traffic than when I play against myself.

b) What is the purpose of 87654321 in log_of_stratagus_0.log? 0 unit-oil-patch 1 P15 Refs 1: 87654321 7,5 0,0

c) Can I somehow replay the game from log_of_stratagus_0.log? Or logs are just to compared as text?

mimooh commented 8 years ago

If these out of sync issues are hard to fix and there may be more network issues (performance, security) and since metaserver development is not finished, parhaps raknet could be a solution? It has great opinions on the internet. http://www.raknet.net/raknet/manual/systemoverview.html

Andrettin commented 8 years ago

Hey mimooh, thanks for the thorough description of how you got the desyncs, that does help quite a bit. Since you didn't get the issue when playing alone, but in the same game the two players later did, then it is possible that it is the messages causing the error. Did you send any messages when you were playing against yourself?

mimooh commented 8 years ago

None of us ever sent any messages. How about this: I create a custom map with quite a few units / buildings. Then I hopefully create a scenario for how to repeatedly and quickly crash the network starting from this developed map. Would that help?

a-detiste commented 8 years ago

http://us.blizzard.com/en-us/company/careers/posting.html?id=15000XZ

micronizerbattheend commented 8 years ago

From my part testing, I only managed to get two short multiplayer games going, with no desyncs yet. But it might just be because the games lasted under 10-15 minutes, so I will try to do longer.

However, I'll mention here (because it relates to the original post on top of this issue report), that race selection doesn't work, and neither does diplomacy (in our games players couldn't even share vision).

Andrettin commented 8 years ago

I tested diplomacy and settings races with Wyrmsun and both worked every time I tested. It seems quite possible that the issues you're experiencing are due to how Wargus is configured, rather than with Stratagus itself.

Regarding diplomacy - are you sure both of you are setting your stances to the same? Shared vision only works if both players have marked shared vision with each other.

mimooh commented 8 years ago

I tested diplomacy and settings races with Wyrmsun and both worked every time I tested. It seems quite possible that the issues you're experiencing are due to how Wargus is configured, rather than with Stratagus itself. Race selection in Wargus is not respected, I confirm. We all like orcs here so I just crated orcs only map and we all play orcs and this is not much issue to me. But these out of syncs make my heart cry...

Karol Kreński

micronizerbattheend commented 8 years ago

We all like orcs here so I just crated orcs only map and we all play orcs

I think it wouldn't be too hard to put a script into the map file that went like "if player1name = "mimooh" then switch all player1peasants with peons" as a temporary workaround for the race selection; I agree with you that the most important issue here are the desyncs.

Kintobor commented 8 years ago

Cyber and I did heaps of testing. I thought we eliminated these desyncs in 2.3. We played FtM on Windows machines with a ping of 400. Can someone confirm that FtM desyncs?

DinkyDyeAussie commented 8 years ago

I thought the de-syncs were sorted in 2.3 as well. Everything was working great. Had alot of the old school features almost fully implemented again and now it seems the wargus game has taken a few steps backward.

timfel commented 8 years ago

It is weird that race selection is not respected, the code is there to map units from one race to another (in lua) and it is working in my tests. What map are you using, what version of wargus and stratagus (including git rev)?

timfel commented 8 years ago

@micronizerbattheend the race selection already is entirely implemented in wargus - see wc2.lua. It uses a mapping between human and orc units and overrides the CreateUnit function to replace units woth their equivalent depending on the race selection.

mimooh commented 8 years ago

Could it be that desyncs are linux related then? Hmm... I remember playing LAN games on 2 windows machines sometime early in 2015 (even before v2.3 I think). Even though we clicked the fastest we could, produced hundreds of units, we managed to finish most of the games. But whenever 2 kids play under linux the games break under 30 minutes I'd say. Kids play slow and produce few units and I think out of syncs happen more in quicker/larger games.

I created a massive map and then played on ubuntu. Two instances of wargus on localhost playing against each other. Within 5 minutes I've got planty out of syncs. After some time it resulted in "player sent bad command" and the player was dropped.

timfel, I will see about race selection withing an hour

mimooh commented 8 years ago

I confirm the bug with race selection. Four players map ./maps/skirmish/(4)central-park.smp.gz. 4 clients chose orcs. In game there were 2 orcs and 2 humans. All under ubuntu. I don't know precise github versions, but it's after the commits race related. It's fresh enough since -G option is there:

student@s13:~$ wargus --version Stratagus v2.4.0, Copyright (c) 1998-2015 by The Stratagus Project -G "options" Game options (passed to game scripts)

BTW, timfel, the -G option is the most awesome option of them all! :) All multiplayer fans should check it: it allows for setting all game parameters directly from command line, so you don't need to select anything in game praparation room.

timfel commented 8 years ago

@mimooh regarding testing out-of-sync bugs, I just pushed a 'dedicated' option that you can pass to the multiplayer server commandline. This way, the server will run player 0 as an AI player. If you launch a game with wargus -c multiplayer -G server,dedicated,map=islands.smp.gz,numplayers=1 and choose a map that has 8 person slots, then the server will run 7 AI players on it, and you can connect as a human player to test the network.

mimooh commented 8 years ago

@Tim, as always, I love your -G options :) In fact I once mentioned the need for having this AI bots for network tests to cheaply create traffic for me. But it turned out I could do without bots: a massive map would allow for quick out-of-syncing the game just playing myself in two windows.

But still this option is useful as it allows for handicapped games. When I play against my kid he can ally with the AI to beat daddy! :)

Karol Kreński

@mimooh regarding testing out-of-sync bugs, I just pushed a 'dedicated' option that you can pass to the multiplayer server commandline. This way, the server will run player 0 as an AI player. If you launch a game with wargus -c multiplayer -G server,dedicated,map=islands.smp.gz,numplayers=1 and choose a map that has 8 person slots, then the server will run 7 AI players on it, and you can connect as a human player to test the network.

--- Reply to this email directly or view it on GitHub: https://github.com/Wargus/stratagus/issues/150#issuecomment-166897915

timfel commented 8 years ago

Ok, there are at least three issues that I can see that prevent race selection from working that all happen to be only in multiplayer games. I fixed two of those locally, I have to go now, but might have a fix for the third (and hopefully last) issue later today

timfel commented 8 years ago

Ok, the race selection should work now. The first issue was that the order for the selection dropdown was reversed from the single player variant, but the lua code for swapping the units relies on those indices. The second issue was that the C++ code then subtracted 1 from this index, so rather than just getting the reverse races, you would get default when you select orc, and human when you select human. Finally, the reversal script needs to run on the clients, too, otherwise the different clients see inconsistent initial units, but the GameSettings were not being synchronized correctly, so some C++ code also needed fixing.

mizukami999 commented 8 years ago

timfel, thank you for 2.4, It's my only hope to get the game running in multiplayer. However, my Wargus crashes when Orc campaig mission VIII starts. The one about the Runestone. I wonder if anyone else has that issue. BTW can anybody confirm the "out of sync" error no longer crashes the multiplayer session?

mimooh commented 8 years ago

Unfortunatelly, "out of sync" is not fixed :(

Karol Kreński

timfel, thank you for 2.4, It's my only hope to get the game running in multiplayer. However, my Wargus crashes when Orc campaig mission VIII starts. The one about the Runestone. I wonder if anyone else has that issue. BTW can anybody confirm the "out of sync" error no longer crashes the multiplayer session?


Reply to this email directly or view it on GitHub: https://github.com/Wargus/stratagus/issues/150#issuecomment-179416519

mizukami999 commented 8 years ago

And the session crashes? )