New MP scenario not working in 1.3.6

Having trouble with the game? Report issues and get help here. Read this first!

Moderators: Forum Moderators, Developers

Forum rules
Before reporting issues in this section, you must read the following topic:
Soliton
Site Administrator
Posts: 1618
Joined: April 5th, 2005, 3:25 pm
Location: #wesnoth-mp

Post by Soliton »

Bob_The_Mighty wrote:The size of my saved game file (autosave, turn 1) is 1,814kb.

There is a ton of variables initialised in a start event, I presume that accounts for much of the data.

What's a plausible size, i.e. what can the game handle at the moment or in the future? Is this ever gonna work?
As pointed out before it works fine for some and thus it is very difficult to answer those questions (by any developer, since none of them seems to experience those problems). You need to test for yourself what works and what doesn't.
As Sapient mentioned the MP server is being rewritten and the basic functionality is already there so I believe we could already test whether you have the same issues with the new server. You could join IRC and ask me about a test there or I'll see if I can find you on the server some time.
"If gameplay requires it, they can be made to live on Venus." -- scott

hjwn
Posts: 42
Joined: May 22nd, 2007, 6:36 am
Location: Europe

Post by hjwn »

Sapient wrote:To get idea of the real size of your WML, you should start a local game and then save it (probably in binary mode). The size of this savefile is what the server is trying to host for you.
Somehow all my saves with 1.3.6 seem to be text, even if I select binary mode. Don't know if this has anything to do with the way games are uploaded to the server, just wanted to mention it.
just blame it on the rng when you lose

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

Post by Rhuvaen »

Just tested this locally. For a comparison, here's how BoL fits in with first turn save file (not autosave) line count & save game size:

Code: Select all

 23000 - Dark Forecast (660 kb text)
 35000 - Unnatural Winter (910 kb text)
 61000 - Brotherhood of Light (1,8 MB text)
103000 - Random Invasion - early version (2,9 MB text)
The last was known to cause problem with disconnections, too. As you can see though, it's almost double the size of BoL. I played Random Invasion once over the server, although the other player apparently "immediately quit". I never tried it again, though.

I don't think at this size that it needs to be unplayable. It might depend on the specs of the client computers - they need to parse the WML, too, not only receive it. I don't have a particularly high-end machine, either, though, and never had that problem.

Does WML "nesting depth" cause any problems? That's one thing that strikes me about your scenario, that some of the options are nested pretty deeply inside lots of if's & while's. I could see you save a bit of WML by putting all the sides' spell effect events into one, but I don't think it would be much gain for the hassle.

I'll probably try this sometime over the server when I can, it looks interesting. :)

User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Post by Sapient »

Rhuvaen wrote:Does WML "nesting depth" cause any problems? That's one thing that strikes me about your scenario, that some of the options are nested pretty deeply inside lots of if's & while's. I could see you save a bit of WML by putting all the sides' spell effect events into one, but I don't think it would be much gain for the hassle.
I can't say with a great degree of certainty, but I suspect that nesting depth has no significant effect (if you can handle four sides with one block of code, that's probably a good thing).

The main thing you want to reduce is (expanded) line count. As an example, Roze was setting and reading a lot of variables for terrain manipulation in his 7p Survival, but he was able to eliminate all of these calls using terrain masks instead.

I think the most promising solution is Soliton's suggestion, though (server improvements).
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 »

I just played it on the MP server - all of the players (just three of us) experienced no problems starting the game, and we had a few observers.

We didn't know the story, of course, so it was a bit hard trying to guess what we were supposed to. It wasn't clear whether we were supposed to work together, so we decided to explore individually in the beginning.

There were a few bugs, a critical one was that one of the players couldn't recover from the poison of a lily. He tried standing next to the Mage of Light, healing on a village, and casting the antidote spell repeatedly. That cured him temporarily, but he became poisoned the next turn again for some reason.

Also, at some point the Revive spell stopped working for me. Nothing happened when I tried to cast it.

There was some output to the console when we played the game, namely:
error engine: failed to auto-store $unit at (90,19)
I attached some replays (all from the same game, taken at various intervals), they're plain text so you can peruse them.
Attachments
BoL_Replays.zip
BoL replays (in text format) at some intervals
(968.39 KiB) Downloaded 97 times

User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Post by Sapient »

Rhuvaen wrote: There was some output to the console when we played the game, namely:
error engine: failed to auto-store $unit at (90,19)
That is an unusual error, but it can occur if you use WML to move a unit from 90,19 before you refer to it as "unit" or "$unit" in any variable operations or substitutions (the automatic storage variables for units $unit and $second_unit are based on the principle of lazy-evaluation and the location of the units when the event starts).

If you were not intending to use the automatically stored unit variable, then you should probably use a different variable name to avoid conflicts.
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."

User avatar
Bob_The_Mighty
Posts: 822
Joined: July 13th, 2006, 1:15 pm

Post by Bob_The_Mighty »

Thanks for the feedback people.
error engine: failed to auto-store $unit at (90,19)
Could this occur by trying to teleport a unit in its own die event? The same die event also stores the unit and adds some hitpoints, but that happens after the teleport tag. I will change it round to see.
Also, at some point the Revive spell stopped working for me. Nothing happened when I tried to cast it.
Did you get the white 'Revive' word floating above your unit, or did it simply not let you select the spell? You might have just run out of mana...
There were a few bugs, a critical one was that one of the players couldn't recover from the poison of a lily. He tried standing next to the Mage of Light, healing on a village, and casting the antidote spell repeatedly. That cured him temporarily, but he became poisoned the next turn again for some reason.
This is odd. The lilly adds poison like this: {VARIABLE unit.status.poisoned on}

The antitode spell checks if 'unit.status.poisoned boolean_equals on'

Then removes it like this: {VARIABLE unit.status.poisoned off}

So I don't see where the problem is.
My current projects:
MP pirate campaign: The Altaz Mariners
RPG sequel: Return to Trent
MP stealth campaign: Den of Thieves

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

Post by Rhuvaen »

Bob_The_Mighty wrote:
error engine: failed to auto-store $unit at (90,19)
Could this occur by trying to teleport a unit in its own die event? The same die event also stores the unit and adds some hitpoints, but that happens after the teleport tag. I will change it round to see.
Really hard to say, without looking at the specific WML... :)
Did you get the white 'Revive' word floating above your unit, or did it simply not let you select the spell?
It let me select the spell, but ignored the action (I just went back to the top of the Healing menu). I had plenty of mana. The spell wasn't cast, and the word "Revive" didn't appear.
Bob_The_Mighty wrote:The antitode spell checks if 'unit.status.poisoned boolean_equals on'

Then removes it like this: {VARIABLE unit.status.poisoned off}

So I don't see where the problem is.
Perhaps the reference to unit is not the same in both events? How did you store unit? If it's just the reference that's available inside an event, I don't think you can manipulate the original unit by setting variables to it...

I'd avoid the variable name unit when storing units, simply because an event reference might override it and it just isn't clear whether you're using an event reference or stored variable.

User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Post by zookeeper »

Rhuvaen wrote:
Bob_The_Mighty wrote:The antitode spell checks if 'unit.status.poisoned boolean_equals on'

Then removes it like this: {VARIABLE unit.status.poisoned off}

So I don't see where the problem is.
Perhaps the reference to unit is not the same in both events? How did you store unit? If it's just the reference that's available inside an event, I don't think you can manipulate the original unit by setting variables to it...

I'd avoid the variable name unit when storing units, simply because an event reference might override it and it just isn't clear whether you're using an event reference or stored variable.
You can use the autostored $unit for modifying it. Just modify some variable of it and unstore it. Very convenient sometimes!

User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Post by Sapient »

I find that I am able to host these huge savegames with no problem here. I am attaching a copy of 1.3.6+svn from my local build. Also a copy of SDL_net.dll version 1.2.5. Also, a fixed version of a savefile from Brotherhood of Light. I had to fix the savefile in a text editor due to incorrect variable usage; lots of scalar variables were stored to explicit indeces of arrays, which are container variables only and thus caused an error on loading. If you open the savefile and scroll down to all the lines that start with # then you will see the problem (this is around the mid-3000's as far as line number).

To test the game, you will need to save the exe and dll to your Wesnoth directory (this will overwrite your old SDL_net.dll), and save Brotherhood_of_Light_Turn48 to userdata\saves. Then run wesnoth_r19715.exe and join the official server. Now choose Create Game. Instead of picking a map, double click where it says "Load Game". Now select the Brotherhood_of_Light_Turn48 and try to host it.
Attachments
bug9215_test.zip
This file requires the 7-Zip extraction utility (WinZip will NOT work)
(940.67 KiB) Downloaded 96 times
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."

User avatar
Bob_The_Mighty
Posts: 822
Joined: July 13th, 2006, 1:15 pm

Post by Bob_The_Mighty »

Thanks a lot for all this help. It still doesn't work for me, but I have finished a working version of this scenario and decided to put it on the server to see if anyone else can suss the problems.

I fixed the store_unit and poison issue, added an intro, briefly balanced all the prices and finally got round to finishing the final encounter.

I set up a thread for it here: http://www.wesnoth.org/forum/viewtopic. ... highlight=
My current projects:
MP pirate campaign: The Altaz Mariners
RPG sequel: Return to Trent
MP stealth campaign: Den of Thieves

Post Reply