Looking to solve the recall list duplication bug

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

Moderator: Forum Moderators

Forum rules
Before reporting issues in this section, you must read the following topic:
Yogibear
Retired Developer
Posts: 1086
Joined: September 16th, 2005, 5:44 am
Location: Hamburg, Germany

Post by Yogibear »

santi wrote:Yogi, guess you were the lucky one( -you are jhinrichs, right?)
Yep :wink:
Smart persons learn out of their mistakes, wise persons learn out of others mistakes!
SkeletonCrew
Inactive Developer
Posts: 787
Joined: March 31st, 2006, 6:55 am

Post by SkeletonCrew »

Somebody tricked me into looking into the problem and I found the cause.
Here's a piece of code copied from Kaleh's abilities.

Code: Select all

  [store_unit]
    variable=player_unit
    kill=no
    [filter]
      side=1
    [/filter]
  [/store_unit]
  {FOREACH player_unit i}
    {VARIABLE player_unit[$i].upkeep "full"}
    [unstore_unit]
      variable=player_unit[$i]
    [/unstore_unit]
  {NEXT i}
A [store_unit] without an x and y in the filter stores all units on the map and the recall list, which match the filter. In this case all units on side 1 are stored and not killed. The unstore unstores the units, the ones on the map aren't duplicated but the ones on the recall list have no location and thus are duplicated.

The most simple workaround for now might be add a line x, y=1-1000, 1-1000 to the filter. Not yet sure what the best real fix is, I'll post a followup in WML workshop to get feedback of more WML users.

PS it was much easier to find with a reproducible case ;)
User avatar
santi
Lord of Wesmere
Posts: 1320
Joined: April 6th, 2004, 12:32 pm

Post by santi »

Good news, I guess. It would help though if you could specify where to put the extra line, e.g.
[filter]
side=1
[x, y = 1-1000,1-1000]
[/filter]

?

Second, I have been fiddling around with the savegame I sent.
Instead of finishing the last scenario before the store (Elves last stand),
I went into an enemy keep to see what is on my recall list.
Fair enough, there was no duplication. I then finished the scenario, played the council scenario where the storing takes place and in the next scenario ....
there were no duplicate units. Although it seems clear that I should not complain about this, I do not know how to explain it? Should I send in that savegame too, or would I be spoiling the party?
Mr. Wednesday
Posts: 14
Joined: June 3rd, 2007, 11:04 pm
Location: South Bend, IN

Post by Mr. Wednesday »

If it would help, I have saves where the recall list is normal on turn 1 and frobbed on turn 2.
SkeletonCrew
Inactive Developer
Posts: 787
Joined: March 31st, 2006, 6:55 am

Post by SkeletonCrew »

I looked at your savegame but it already had a duplication Sarang was on the recall list and was already in the game... I reproduced the bug with UtbS, Shadow_Master gave a way to reproduce it there and it happened on every move event.

I committed a code fix which should be in 1.3.11 which will probably be released early next week, since 1.3.10 also has other nasty bugs.

To avoid the bug the x, y should be applied like this (modification on my earlier code example). In 1.3.11 this workaround should no longer be needed.

Code: Select all

    [filter]
      side=1
      x=1-1000
      y=1-1000
    [/filter]
Btw your campaign gives a lot of warnings about deprecated WML.

Please let me know whether 1.3.11 fixes the problem for you.
User avatar
santi
Lord of Wesmere
Posts: 1320
Joined: April 6th, 2004, 12:32 pm

Post by santi »

The fix does not seem to work for me:(see attached cfg)


[store_unit]
variable=l3_selector_store
kill=yes
[filter]
type=Elvish Marshal,Elvish Champion,Elvish Avenger,Elvish Sharpshooter
x,y = 1-1000, 1-1000 #maybe this is worng, I'll try again with your #solution
[not]
description=Kalenz
[/not]
[not]
description=Arkildur
[/not]
[not]
description=Landar
[/not]
[not]
description=Tameril-Isimeril
[/not]
[not]
description=Laril
[/not]
[/filter]


I presume the reason may be wrong WML in the place of
x=1-1000
y=1-1000
as you suggest. Anyway, I'll try again


Interestingly enough(and just to make sure we understand what is happening), I am attaching a savegame from a previous round
The game is won practically, but I think the last leader is not yet killed.
So what I did is : go with my leader(Kalenz) to the nearest orcish keep to check my recall list, just to make sure the duplication issue happens later on. I then played through the council and in the next playable scenario(Bounty Hunters) there was no duplication....

Also note that although in the Elves'_last_stand scenario the dwavish leader(Olurf) has a name, there is no name in the counci scenario and the name is ok again in the next scenario.

Finally, I know about the deprecated WML. This pertains to special "invisible" units and the reason I have not changed this yet is
that with the new frame syntax I need 3-4 animations for the new units and I do not remember how to do that with gimp.
But note that deprecated WML messages also appear for normal elvish units and there I have NO CLUE as to why that is, as these units are supposedly taken from core..... If I had such units in the domain, it might explain it, but I don't think there are any...

Last, I wonder if in future versions inheritance mechanisms could be
implemented to facilitate the use of derived units. For instance I would like to say the invisible elvish archer inherits all properties from the elvish archer, except for the graphics, the name and the hit probability.
How much of a problem would that be?
Attachments
Elves'_Last_Stand_Turn_17new.gz
(143.96 KiB) Downloaded 137 times
Council_of_hard_choices.zip
(2.47 KiB) Downloaded 113 times
User avatar
santi
Lord of Wesmere
Posts: 1320
Joined: April 6th, 2004, 12:32 pm

Post by santi »

One more question: Sarang was already on the game and the recall list on turn 18?? It is not on the recall list on turn 17, as you can see..
SkeletonCrew
Inactive Developer
Posts: 787
Joined: March 31st, 2006, 6:55 am

Post by SkeletonCrew »

The turn 18 savegame had the duplication and playing with the turn 17 savegame I didn't manage to reproduce the problem... can you test once 1.3.11 is out?
santi wrote:But note that deprecated WML messages also appear for normal elvish units and there I have NO CLUE as to why that is, as these units are supposedly taken from core..... If I had such units in the domain, it might explain it, but I don't think there are any...
Some core WML has been changed so it might be your content isn't updated with the latest changes/
santi wrote:Last, I wonder if in future versions inheritance mechanisms could beimplemented to facilitate the use of derived units. For instance I would like to say the invisible elvish archer inherits all properties from the elvish archer, except for the graphics, the name and the hit probability.
How much of a problem would that be?
Zookeeper confirmed; it's a CABD :)
Look at base_unit [1] which can do it. If you have problems with getting it to work better post a new thread in the WML workshop, since I've no idea how to use it ;)

[1] http://www.wesnoth.org/wiki/UnitWML
User avatar
santi
Lord of Wesmere
Posts: 1320
Joined: April 6th, 2004, 12:32 pm

Post by santi »

SkeletonCrew wrote:
The turn 18 savegame had the duplication and playing with the turn 17 savegame I didn't manage to reproduce the problem... can you test once 1.3.11 is out?
Right, I cannot reproduce the duplication with the turn 17 savegame either. But what could be wrong with my code? I will test with 1.3.11(probably should replay the whole scenario, right?)
SkeletonCrew wrote:
Some core WML has been changed so it might be your content isn't updated with the latest changes/
So if I understand right, the savegame keeps unit stats from the time it was played and if
the version has changed, then we have a problem?

BTW, what is a CABD????
Yogibear
Retired Developer
Posts: 1086
Joined: September 16th, 2005, 5:44 am
Location: Hamburg, Germany

Post by Yogibear »

santi wrote: So if I understand right, the savegame keeps unit stats from the time it was played and if
the version has changed, then we have a problem?
correct
santi wrote: BTW, what is a CABD????
"(it) can already be done (with WML)" :wink:
Smart persons learn out of their mistakes, wise persons learn out of others mistakes!
PsionicSliver
Posts: 14
Joined: April 27th, 2007, 5:38 pm

Post by PsionicSliver »

Hi,

I've accidentally stumbled on a different version of this bug using 1.3.10+svn (updated 11/17/07).

Playing "The Rise of Wesnoth" I saved the game after winning the first scenario, but before clicking "End Scenario". When I went to load that save, I noticed that I had a duplicated list of recalls.

I was able to replicate this situation. An interesting fact is that when I continued after saving, I didn't get a duplicated recall list; but, when I re-loaded the save, the recall list was duplicated.

I have the auto-save of the last turn, which doesn't seem to have the bug, and the save after winning, with the bug. I can upload them if someone feels they'd be helpful in solving this bug.

~PsionicSliver

Edit: This bugs also occurs upon finishing scenario 2 of "The Rise of Wesnoth"
mikecindi
Posts: 36
Joined: August 9th, 2006, 9:31 am

Post by mikecindi »

I have also come across a similar problem but it is more than duplication.

I'm using BfW 1.3.10 in both WinXP and Vector Linux 5.8 SOHO (kernel 2.6.22.1) and get the same problem on the second scenario (Across the Harsh Sands) of Under the Burning Suns.

After moving the heros out of the keep I then try to recall units. If I have not moved anyone out of the keep then I have just one of each recallable unit. For each of the three heros that I move out of the keep the number of individual, recallable units doubles. Thus when I move one hero I then have doubles of all recallable units; when I move the second hero I have four of each recallable unit (the original and three clones); and when I move the third hero then I have eight (original and seven clones) of each individual, recallable unit.

I tried deleting the duplicates but they just reappear. Then by the time I've engaged with an enemy (about three turns into the scenario) I takes several minutes to complete each unit's move thus making it unplayable.

I did not have this problem with 1.3.9 under Vector and never tried with WinXP.
The plans of the diligent...Pro. 21:5
Mr. Wednesday
Posts: 14
Joined: June 3rd, 2007, 11:04 pm
Location: South Bend, IN

Post by Mr. Wednesday »

mikecindi wrote:I have also come across a similar problem but it is more than duplication.
It's not a similar problem, it's the same problem. At least, it's the same problem I reported previously.
Mr. Wednesday
Posts: 14
Joined: June 3rd, 2007, 11:04 pm
Location: South Bend, IN

Post by Mr. Wednesday »

SkeletonCrew wrote:I committed a code fix which should be in 1.3.11 which will probably be released early next week, since 1.3.10 also has other nasty bugs.
The Windows "daily" r21754 is still suffering from the UtBS duplication bug. If I'm reading the SVN web interface right, your fix went in for r21732. I've attached a savegame (earlier version, appears to load cleanly) for the first turn, with a normal recall list. Each unit move duplicates the recall list.
Attachments
Across_the_Harsh_Sands-Auto-Save1.zip
(71.61 KiB) Downloaded 144 times
SkeletonCrew
Inactive Developer
Posts: 787
Joined: March 31st, 2006, 6:55 am

Post by SkeletonCrew »

@mikecindi the duplication in UtbS happens on every move of a unit, so the list of duplicates grows very fast.

@Mr. Wednesday r21732 indeed contains the fix, I just loaded your savegame and can't get duplicate units when I move around.

Other in the news there's another recall duplication bug [1] still left, the second seems to happen as soon as you load a savegame in linger mode... found it due to some other linger mode problems while implementing a new feature[2].

[1] https://gna.org/bugs/index.php?10354
[2] https://gna.org/bugs/index.php?10144
Post Reply