MP Campaigns and current bugs [fixed 1 of 3]

Discussion of all aspects of multiplayer development: unit balancing, map development, server development, and so forth.

Moderator: Forum Moderators

Rhuvaen
Inactive Developer
Posts: 1272
Joined: August 27th, 2004, 8:05 am
Location: Berlin, Germany

MP Campaigns and current bugs [fixed 1 of 3]

Post by Rhuvaen »

Some now-lost post prompted me to do an assessment of the state of MP Campaigns in the current dev version. I did a test with three simultaneous clients acting as a host, network player and observer with the attached dummy MP_Campaign for 1.3.3, here are the results:

Host: never experiences any problems - gets asked to save a replay first and then a savegame for the next scenario.

Observer: gets the "Game over" message when the first scenario ends, and exits to lobby (instead of following on towards the next scenario). No other problems.

Network Player: gets asked to save a replay. He never gets asked to save the next scenario and his application freezes up. He's still connected though, the host gets a "player disconnected" message only when the client is closed.

Here's the backtrace for the network player client:

Code: Select all

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1080831200 (LWP 10128)]
0x0852f4c8 in config::empty () at stl_map.h:119
119         /// @if maint  The actual tree structure.  @endif
(gdb) bt
#0  0x0852f4c8 in config::empty () at stl_map.h:119
#1  0x0819b8fb in game_state (this=0xbfffd030, data=@0xbffff61c,
    cfg=@0xbfffd3b0) at gamestatus.cpp:458
#2  0x082e1072 in play_game () at iostream:76
#3  0x0824ed39 in enter_wait_mode () at iostream:76
#4  0x082510a7 in enter_lobby_mode () at iostream:76
#5  0x08251c87 in mp::start_client () at iostream:76
#6  0x08157a01 in (anonymous namespace)::game_controller::play_multiplayer (
    this=0xbffff5b0) at game.cpp:1284
#7  0x0815d284 in play_game (argc=1, argv=0xbffff904) at game.cpp:1893
#8  0x0815d6b8 in main (argc=1, argv=0xbffff904) at game.cpp:1951
I hope this helps - and no, MP campaigns are not working with 1.3.3, unless you just want to play solo with (re-joining) observers.

Submitted as Bug#9242. (The observer thing is probably a separate but minor issue)
Last edited by Rhuvaen on June 30th, 2007, 10:35 am, edited 1 time in total.
Rhuvaen
Inactive Developer
Posts: 1272
Joined: August 27th, 2004, 8:05 am
Location: Berlin, Germany

Post by Rhuvaen »

*bump*

I see that this bug hasn't even been "assigned" yet. Is there no developer brave enough to face this nasty monster of a bug, and make MP campaigns possible? :P

I guess bugs get assigned when a developer picks that bug from the list, am I correct? I mean, developers assign bugs to themselves, since this is an entirely voluntary affair? :)

*prepares to bake some e-cookies for potential volunteers...*
User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Post by Sapient »

I think Yogi Bear expressed some interest in fixing this, but he has been busy lately. I don't really want to work on this code because my computer runs out of virtual memory (and shortly thereafter becomes unstable) when I run more than one instance of Wesnoth. Another developer with some experience in this area would be Dirus, although he hasn't been very active lately you can often find him idling in the #wesnoth-dev channel.
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
Rhuvaen
Inactive Developer
Posts: 1272
Joined: August 27th, 2004, 8:05 am
Location: Berlin, Germany

Post by Rhuvaen »

Thanks, Sapient. I remember Dirus implemented the next_scenario in multiplayer. He might be a good candidate.

I'm just digging in the source a little myself, and the segfault occurs at this line:

Code: Select all

			if (!snapshot->empty() && (version < "1.2.2") )
Seems like there is no snapshot for the non-host player. I'm not sure how the networking works, but I would have guessed that there is a snapshot for each client - they're always included in the savegames.

Perhaps the snapshot is discarded too early for non-host players? :)

EDIT: besides, is there really a need for backwards compatibility to 1.2.2 and earlier for version 1.3.3/1.3.4? I mean, is it possible to play via lan on a mixed stable/dev version game? :shock:

EDIT2: I just deleted the whole backwards-compatibility code - AND NOW IT WORKS!!!

Hehe, I can submit this patch myself :P (if the backwards compatibility to 1.2.2 isn't needed, that is....)
CIB
Code Contributor
Posts: 625
Joined: November 24th, 2006, 11:26 pm

Post by CIB »

Whee, nice =) I don't really know how that whole developer version stuff works, but post here please, when that patch is available for download =o
tsr
Posts: 790
Joined: May 24th, 2006, 1:05 pm

Post by tsr »

YAY!

Finally, good work Rhuvaen :D

/tsr
Boucman
Inactive Developer
Posts: 2119
Joined: March 31st, 2004, 1:04 pm

Post by Boucman »

yes, please post a patch...
Fight key loggers: write some perl using vim
Rhuvaen
Inactive Developer
Posts: 1272
Joined: August 27th, 2004, 8:05 am
Location: Berlin, Germany

Post by Rhuvaen »

Here's a patch for version 1.3.4... should I make one for SVN trunk also or can you "infer" what the changes are? (I'm just checking out trunk in any case)

Boucman, before applying this patch - are we sure we don't need backward compatibility to version 1.2.2? :wink:

Two more bugs to go (although these are not of blocking importance):

1. story tags and contents are unavailable to network clients - Bug#7397
2. allow_new_game doesn't work and introduces an off-by-one bug in the map/scenario list (can't find the bug submission right now...)

EDIT: thanks to jb for teasing me yesterday for not looking into this myself. :D
Attachments
mp_campaigns_v1.3.4.tar.gz
patch against version 1.3.4
(1.24 KiB) Downloaded 152 times
Last edited by Rhuvaen on June 30th, 2007, 10:24 am, edited 1 time in total.
CIB
Code Contributor
Posts: 625
Joined: November 24th, 2006, 11:26 pm

Post by CIB »

Rhuvaen wrote: 1. story tags and contents are unavailable to network clients
Are you sure? The story tag is for displaying that black screen with pictures and text, right? I think I've seen that in network mode.
Rhuvaen
Inactive Developer
Posts: 1272
Joined: August 27th, 2004, 8:05 am
Location: Berlin, Germany

Post by Rhuvaen »

CIB wrote:Are you sure? The story tag is for displaying that black screen with pictures and text, right? I think I've seen that in network mode.
Yes, as host you see them. :wink:

It's the other players who don't - and usually they don't know that they're missing anything.

Have a look at the bug - it's still open and unassigned.
Rhuvaen
Inactive Developer
Posts: 1272
Joined: August 27th, 2004, 8:05 am
Location: Berlin, Germany

Post by Rhuvaen »

I'm not sure just deleting the backwards compatibility is the best fix. For MP, I can see no reasons to keep that code, but perhaps it's useful in SP? To continue playing a campaign that you started in 1.2.2? I'm simply not sure.

There might be alternative solutions - including a check if snapshot != NULL or providing the network client with a snapshot...

Just trying to point this out.
tsr
Posts: 790
Joined: May 24th, 2006, 1:05 pm

Post by tsr »

Ok, seems to work. Odd behaviour on the test-campaigns second scenario (could be wml-bug).

- Loosing both leaders renders a loss
- Loosing one leader and killing the enemy, renders nothing
- Killing enemy leader, renders nothing

Hoping that this is just a wml-bug and really looking forward to An Unnatural Winter as a campaign :)

Edit: this was tested as a local game

/tsr
tsr
Posts: 790
Joined: May 24th, 2006, 1:05 pm

Post by tsr »

Rhuvaen wrote:To continue playing a campaign that you started in 1.2.2? I'm simply not sure.
Well, I think too much has changed for that to be even remotely possible: new terrain system, arcane-damage type and the whole rebalancing for that for once (and those are the changes I know of as a non-coder, I can't even start too imagine all the small wml-changes that may mess up a 1.2-campaign if you tried to play it on 1.3).

Besides isn't one of the premises for this project that saves are not to compatible over branches. Including on the dev-version saves are allowed to be incompatible in between releases.

/tsr
Rhuvaen
Inactive Developer
Posts: 1272
Joined: August 27th, 2004, 8:05 am
Location: Berlin, Germany

Post by Rhuvaen »

tsr wrote: - Loosing both leaders renders a loss
- Loosing one leader and killing the enemy, renders nothing
- Killing enemy leader, renders nothing

Hoping that this is just a wml-bug and really looking forward to An Unnatural Winter as a campaign :)
Perhaps victory_when_enemies_defeated=no finally works? :)

I'm sure it's just the WML here, I mean I didn't add die events or anything to those simple test scenarios. (or were you talking about The Road South / UW :o ?)
CIB
Code Contributor
Posts: 625
Joined: November 24th, 2006, 11:26 pm

Post by CIB »

Rhuvaen wrote: Yes, as host you see them. :wink:

It's the other players who don't - and usually they don't know that they're missing anything.
Well, in 1.2.4 I definately get the story tags in Labyrinth of Champions without being host.
Post Reply