Flight to Freedom (drake campaign)

Discussion and development of scenarios and campaigns for the game.

Moderator: Forum Moderators

Post Reply
CyberJack
Posts: 161
Joined: November 25th, 2004, 2:50 pm
Location: UK

Post by CyberJack »

Hi,

I seem to have a problem with 'Landfall': most of my units have gone missing :-(

At the end of 'Southern Shore' I've got quite a few units; then, during 'The Open Ocean' they're not available (as intended). But I expected them to show up again in 'Landfall', and they don't. Instead, I've got just two units available for recall: an anonymous Pirate Galleon (from 'The Open Ocean') and a single Drake Glider named "Kran".

So, I had a peek at the savefiles and noticed that at the start of 'The Open Ocean' the units aren't listed in the usual way, but instead each one is specified in a [recall_list]..[/recall_list] clause. What's really suspicious is that the very first of these is "Kran". At the end of 'The Open Ocean', this array is still there; but at the start of 'Landfall', it's gone, leaving no trace at all of any of the other units :-(

Anyone else run into this? Maybe a problem with an [unstore_unit] somewhere?
mpolo
Posts: 113
Joined: June 15th, 2004, 8:18 pm

Post by mpolo »

I can confirm the same problem on an earlier edition of Flight for Freedom, but the latest version seems to work for me-- though I have a whole bunch of "Clerics" that just appeared in the list (they look like Mages of Light, which admittedly, will be quite handy...)
CyberJack
Posts: 161
Joined: November 25th, 2004, 2:50 pm
Location: UK

Post by CyberJack »

Aha! I think I've found the problem. At the end of Open_Ocean.cfg, there's a little bit of code which says

Code: Select all

#other part of #10569 fix
        [unstore_unit]
        variable=recall_list
        [/unstore_unit]
        {CLEAR_VARIABLE recall_list}
which shouldn't work, because according to the WML reference http://wesnoth.slack.it/?DirectActionsWML unstore_unit doesn't work on arrays. Hence it's only reinstantiating the first unit in the list, and destroying the rest. So, I tried wrapping the unstore in a FOREACH loop (and adding find_vacant, in case one of the stored units overlaps with a surviving ship), and it works -- the recall list is intact at the start of Landfall.

Code: Select all

        {FOREACH recall_list index}
                [unstore_unit]
                        variable=recall_list[$index]
                        find_vacant=yes
                [/unstore_unit]
        {NEXT index}
        {CLEAR_VARIABLE recall_list}
But, I've spotted another bug now -- the gold is wrong. At the end of Southern Shore, I had 400+ gold, and this is shows up in the Open Ocean savefile; but, the game shows only 100 at the start of this scenario.

Presumably this is something to do with switching leaders; the snippet from the savefile at the start of Open Ocean reads

Code: Select all

[player]
        can_recruit="Drake Burner,Drake Clasher,Drake Fighter,Drake Glider,Drake Hatchling,Drake Slave,Pirate Schooner"
        gold="406"
        save_id="Malakar"
[/player]
but there is no unit called "Malakar" at this point :-(
MadMax
Posts: 1792
Joined: June 6th, 2004, 3:29 pm
Location: Weldyn, Wesnoth

Post by MadMax »

That bug has already been fixed in the latest version. I had forgot the save_id tags.

Unfortunately, you'll have to restart from Blue River.
mpolo wrote:though I have a whole bunch of "Clerics" that just appeared in the list (they look like Mages of Light, which admittedly, will be quite handy...)
Is the unit type Cleric or the description? Please send the savefile.
"ILLEGITIMIS NON CARBORUNDUM"

Father of Flight to Freedom
http://www.wesnoth.org/wiki/FlightToFreedom
CyberJack
Posts: 161
Joined: November 25th, 2004, 2:50 pm
Location: UK

Post by CyberJack »

Just to follow up with a bit more info: I've spotted that the original savefile for the start of 'Landfall' has *two* [player] sections, one for Malakar (with the right amount of gold) and no units, and another for the Unforgiver, with 138 gold (from Open Ocean) and the truncated unit list mentioned (the Unforgiver itself, plus one Galleon and one Drake).

With my original fix (iterating over the recall_list array), the savefile still has two [player] entries, one for Malakar, with the gold, and just one unit (the Unforgiver?!?), and another for the Unforgiver, with 138 gold and a complete recall list, without Malakar (still stored in malakar_store) but with a [unit] entry for itself.

So I think what's confusing the game engine (and may be behind the original manifestation of bug #10569) is the way the [side] definition in the successive scenario config files swaps between Malakar and the Unforgiver; the game is assuming that these are two different sides, with separate recall lists and stocks of gold. Just having the same side number isn't enough to make them the same side; perhaps they need to have the same save_id too? And/or maybe the save_id needs to reference an existing unit?

To test this, I've tried restoring Malakar and the Unforgiver at the end of Southern Shore, so that the side is once again led by Malakar, and then changing Open Ocean so that it defines Malakar as the leader in the [side] definition, and then switches Malakar and the Unforgiver around in the prestart event. This seems to work, so the Unforgiver has the proper amount of gold and a null recall list at the start, and the unit list is reinstantiated after victory. Then the same bug (lost recall list, missing gold) occurs at the start of Landfall instead; changing the [side] definition (and using the same leader-swap trick) once again fixes this.

So, I don't know whether it's possible to alternate leaders of the same side in the manner that was originally intended; it may be that the game engine requires a team (leader) name to remain constant from one scenario to the next. But I think this means that the current workaround for #10569 could be removed, and some prestart code used to get the same result without the additional unwanted "side"-effects ;-)

Hope this helps!
CJ
CyberJack
Posts: 161
Joined: November 25th, 2004, 2:50 pm
Location: UK

Post by CyberJack »

Hey! You fixed it while I was writing up what else I'd found! Very impressive!! ;-)

I don't mind restarting from Blue River (I'll do it better this time ;-)
Or maybe I'll just fix up the savefiles ...

BTW, congrats on creating the campaign :-)
Nice to have another one to play!
CyberJack
Posts: 161
Joined: November 25th, 2004, 2:50 pm
Location: UK

Post by CyberJack »

Just played through to the end of 'Landfall' -- no problems now :-)

One other thing I spotted, there's what looks to be a now-redundant (but presumably harmless)

Code: Select all

        [unstore_unit]
        variable=unforgiver_store
        [/unstore_unit]
        {CLEAR_VARIABLE unforgiver_store}
still at line 60 of the new Open_Ocean.cfg; AFAICS, there's now nothing any earlier that would have created unforgiven_store.

I checked the savefile for the start of 'The Drake Escape', and that looks good too, except -- to be completely pedantic -- that unforgiver_store is carried over (from the point at which Malakar disembarked), as well as the actual Unforgiver unit. I say completely pedantic because I can see that the Drake Escape code will (re-)create this variable anyway, in the prestart code, so the only consequence is making the savefile a tad bigger.

So, it's all looking much prettier :-) (and presumably #10569 can be closed now)
Keep up the good work!

CJ
MadMax
Posts: 1792
Joined: June 6th, 2004, 3:29 pm
Location: Weldyn, Wesnoth

Post by MadMax »

CyberJack wrote:One other thing I spotted, there's what looks to be a now-redundant (but presumably harmless)

Code: Select all

        [unstore_unit]
        variable=unforgiver_store
        [/unstore_unit]
        {CLEAR_VARIABLE unforgiver_store}
still at line 60 of the new Open_Ocean.cfg; AFAICS, there's now nothing any earlier that would have created unforgiven_store.
Removed.
CyberJack wrote:I checked the savefile for the start of 'The Drake Escape', and that looks good too, except -- to be completely pedantic -- that unforgiver_store is carried over (from the point at which Malakar disembarked), as well as the actual Unforgiver unit. I say completely pedantic because I can see that the Drake Escape code will (re-)create this variable anyway, in the prestart code, so the only consequence is making the savefile a tad bigger.
Fixed.
CyberJack wrote:So, it's all looking much prettier :-) (and presumably #10569 can be closed now)
Keep up the good work!
#10570 too, because it was caused by the same bug.

Thanks!
"ILLEGITIMIS NON CARBORUNDUM"

Father of Flight to Freedom
http://www.wesnoth.org/wiki/FlightToFreedom
mpolo
Posts: 113
Joined: June 15th, 2004, 8:18 pm

Post by mpolo »

I didn't very much enjoy "River of Skulls", by the way. :lol: (I was handily winning until I went down towards the purple and white guys -- and the orange guy who is behind them. They took advantage of the bottlenecks to such an extent that it was impossible to fight through... So I cheated rather than replay a 100-turn game.) At about 30 turns, I had killed like 6 of the 9 enemies, and was still going to run out of time at the Battle of the Choke Tunnels. (This may all be intentional. I'm just reporting my experience.)
MadMax
Posts: 1792
Joined: June 6th, 2004, 3:29 pm
Location: Weldyn, Wesnoth

Post by MadMax »

mpolo wrote:I didn't very much enjoy "River of Skulls", by the way. :lol: (I was handily winning until I went down towards the purple and white guys -- and the orange guy who is behind them. They took advantage of the bottlenecks to such an extent that it was impossible to fight through... So I cheated rather than replay a 100-turn game.) At about 30 turns, I had killed like 6 of the 9 enemies, and was still going to run out of time at the Battle of the Choke Tunnels. (This may all be intentional. I'm just reporting my experience.)
You don't have to kill all enemies, just get Malakar into the cave.

With the clerics, I can find nothing in the savefile that would have done this. And to my knowledge, there is not even a unit called 'cleric' in ANY campaign, official or not.

And the savefile will not even load on my computer, implying that it is corrupt.
"ILLEGITIMIS NON CARBORUNDUM"

Father of Flight to Freedom
http://www.wesnoth.org/wiki/FlightToFreedom
mpolo
Posts: 113
Joined: June 15th, 2004, 8:18 pm

Post by mpolo »

The save loaded under 0.8.8, but not under 0.8.9. It somehow got these units with empty unit type... Weird.

I realize that it's not necessary to kill all the leaders, but with the several chokeholds (where one of your units has to fight two of theirs and then hope that the computer is stupid enough not to fill the gap, so that you can get through), I was delayed enormously -- And it's quite depressing to have literally one unit on the map that can act productively...
MadMax
Posts: 1792
Joined: June 6th, 2004, 3:29 pm
Location: Weldyn, Wesnoth

Post by MadMax »

You need to kill the elf leader FAST. Preferably within five turns, because on turn six, if you are not already running, the orcs and humans will catch up, and you will be killed. After the elves are gone, it is simply a mad dash for the cave mouth. And the boar shouldn't be a problem, as four burners should be able to take it down, with maybe one or two losses.

Are there any other complaints? I plan to release 2.6 within the next few days, unless you have any other problems. So post 'em now!
"ILLEGITIMIS NON CARBORUNDUM"

Father of Flight to Freedom
http://www.wesnoth.org/wiki/FlightToFreedom
mpolo
Posts: 113
Joined: June 15th, 2004, 8:18 pm

Post by mpolo »

Ah... we're talking about different scenarios. The one with the boar was no real problem. The orcs and humans never got close to me. (Well one Knight got within 3 or 4 hexes, but since it was woods, he had no chance.) I meant the one where you have 100 turns to explore a huge cave system. On the way down to purple and white (whom you have to pass to win), you have to go through two "chokeholds" one after the other, and they recruit so many that it takes ages to get through there. I literally was there for over 40 turns making no progress whatsoever. (Move up one drake. Try to kill one of the two dwarves he is forced to face alone. If I kill one, pray that his spot won't get filled by another one so that I can get a second drake through the doorway... Keep sending units back to heal... BORING!)
MadMax
Posts: 1792
Joined: June 6th, 2004, 3:29 pm
Location: Weldyn, Wesnoth

Post by MadMax »

mpolo wrote:Ah... we're talking about different scenarios. The one with the boar was no real problem. The orcs and humans never got close to me. (Well one Knight got within 3 or 4 hexes, but since it was woods, he had no chance.) I meant the one where you have 100 turns to explore a huge cave system. On the way down to purple and white (whom you have to pass to win), you have to go through two "chokeholds" one after the other, and they recruit so many that it takes ages to get through there. I literally was there for over 40 turns making no progress whatsoever. (Move up one drake. Try to kill one of the two dwarves he is forced to face alone. If I kill one, pray that his spot won't get filled by another one so that I can get a second drake through the doorway... Keep sending units back to heal... BORING!)
Oh.

This scenario is supposed to be hard and long. But if it is that hard, then there is obviously a problem. I am thinking of adding some more events to the scenario, but can't think of any ideas. Can you?
"ILLEGITIMIS NON CARBORUNDUM"

Father of Flight to Freedom
http://www.wesnoth.org/wiki/FlightToFreedom
MadMax
Posts: 1792
Joined: June 6th, 2004, 3:29 pm
Location: Weldyn, Wesnoth

Post by MadMax »

One more thing: can you discuss level gameplay (other than bugs) in Strategies & Tips? I'd like to use this thread for bugs, suggestions, and release announcements.
"ILLEGITIMIS NON CARBORUNDUM"

Father of Flight to Freedom
http://www.wesnoth.org/wiki/FlightToFreedom
Post Reply