Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.x.x] Fix For the Motherland game mode #415

Open
SenhorFlibble opened this issue Jan 5, 2022 · 23 comments
Open

[3.x.x] Fix For the Motherland game mode #415

SenhorFlibble opened this issue Jan 5, 2022 · 23 comments

Comments

@SenhorFlibble
Copy link

The removal of Aleona's Tales data from Wargus 3.x.x also resulted in breaking the For the Motherland game mode, because it relies on special units and commands defined in scripts from the scripts/caanoo folder which was removed alongside Aleona's Tales files.

Current releases of Wargus still allow to select the new game modes introduced by Kyran Jackson (For the Motherland and Front Lines) from the Standard Game menu, and include FtM maps and the relevant AI files. However, this mode will crash out of the box as explained above.

For the Motherland is not a game mode specific to Aleona's Tales, and can be played with the default Warcraft II art, so there seems to be no reason to abandon it and remove it from the project.

I was able to very easily fix the issue by restoring the caanoo folder and the scripts within, and re-enabling them. Only units.lua required minor edits to update some of the units (mostly towers) to the new stats used in v3.x.x.
caanoo.units.lua.txt
Other scripts can be left the same as in v2.4.x. Of course, loading these must be re-enabled (via scripts\buttons.lua ... upgrade.lua) for them to work.

With this fix, FtM maps can be run in Wargus 3.2.0, and everything works as intended, as far as I can tell. Here's a screenshot.

If you want, I can make a PR with the necessary changes.

Conversely, the other new game mode, Front Lines, does not work in both versions 2.4.x and 3.x.x. Unfortunately, Wargus crashes without any error messages in stderr.txt which would point to the cause of this problem.

@SenhorFlibble
Copy link
Author

SenhorFlibble commented Jan 7, 2022

I forgot to mention that the FtM map (2)forgotten-forest crashes Wargus, both in 2.4.x and 3.x.x. I've not been able to determine the cause. I have tested the FtM game mode with three maps, (2)less-than-three, (2)nicks-duel and (4)beethoven-day, which work fine. There might be other crashy maps as well.

@SimoneStarace
Copy link
Contributor

Other scripts can be left the same as in v2.4.x. Of course, loading these must be re-enabled (via scripts\buttons.lua ... upgrade.lua) for them to work.

I think one way to solve this is to add the code directly in the Game mode inside the scripts/lists/For the Motherland file, before the map is loaded.

If you want, I can make a PR with the necessary changes.

For me, you can make it.

@SenhorFlibble
Copy link
Author

I think one way to solve this is to add the code directly in the Game mode inside the scripts/lists/For the Motherland file, before the map is loaded.

I just tried that -- added the necessary Load("scripts/caanoo/...") lines to the beginning of For the Motherland list file, but it seems not to work -- Wargus crashes and the errors in stderr.txt suggest that the scripts had not been loaded.

I believe there should be no harm in restoring this the way it was originally done. These extra lines can be always commented out later.

@SimoneStarace
Copy link
Contributor

I just tried that -- added the necessary Load("scripts/caanoo/...") lines to the beginning of For the Motherland list file, but it seems not to work

Because if you just loaded the caanoo.units.lua there are only the definition of units. This mod seems to be made with a series of custom buttons, spells, units etc.

Wargus crashes and the errors in stderr.txt suggest that the scripts had not been loaded.

What OS are you using? Windows?

I believe there should be no harm in restoring this the way it was originally done. These extra lines can be always commented out later.

Personally, since this is applied only for a specific game mode, all declarations for this specific mode should be declared in the game file mode.

@SenhorFlibble
Copy link
Author

Because if you just loaded the caanoo.units.lua there are only the definition of units. This mod seems to be made with a series of custom buttons, spells, units etc.

No, I specified the loading of all relevant scripts, like this:

--      Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
--

Load("scripts/caanoo/buttons.lua")
Load("scripts/caanoo/spells.lua")
Load("scripts/caanoo/units.lua")
Load("scripts/caanoo/upgrade.lua")

Did I put it in the wrong place inside scripts\lists\maps\For the Motherland? I actually even tested the assumption that it couldn't load them because they're in a different branch of directories, and copied the above scripts right into the scripts\lists\maps directory ( and changed the file paths to simply Load("buttons.lua") etc., but this had no effect.

What OS are you using? Windows?

Yes.

@Kintobor
Copy link
Member

Kintobor commented Jan 12, 2022 via email

@Kintobor Kintobor mentioned this issue Jan 12, 2022
@timfel
Copy link
Member

timfel commented Jan 12, 2022

Yeah, we actually pulled everything out of Wargus quite some time ago. The old graphics are just not great, and no one felt like looking at that stuff at all. See #155

@SenhorFlibble
Copy link
Author

SenhorFlibble commented Jan 13, 2022

There is a fork which has all this enabled.

I've been able to run your version with standalone 3.2.0 Stratagus binaries, although I had to comment out the SetFogOfWarOpacity line in stratagus.lua. I was able to run skirmish games and For the Motherland. (4)beethoven-day and (2)less-than-three worked fine but (2)forgotten-forest still crashed.

I was further able to start the Frontier Force campaign by copying the interface folder from campaigns\human-tales to campaigns\human. However, it still crashed, with no indication of the cause in stderr.txt.

Do I need binaries compiled from your code instead?

The old graphics are just not great

Judging by the WIP version videos released by Kyran Jackson, he was slowly migrating to Wyrmsun graphics, before apparently switching altogether to a Wyrmsun fork/mod called Wyrmsun Thunder.

Aleona's Tales CVS actually has some improved sprites, like a big (but not 100pc complete) set of buildings by a certain Lital Natan (most can be seen here, alongside lower-quality work from other contributors).

@timfel
Copy link
Member

timfel commented Jan 13, 2022

As I said, I'm really happy to include lua code for a "mod" in a sensible way. But I'm not clear on the status and direction of tales. I don't have any interest in it, and the "newer" graphics in the forum also don't seem very nice to me :)

The thing is, since there is only very little maintenance happening on this project, I want to keep everything out that isn't maintained and used. I someone wants to add some code, I would like it to be either

a) small enough to be maintainable be me or someone else when the original author leaves

or

b) clearly separated, so we can just throw it out when it stops working and the original author has left and no one else is maintaining it.

@SenhorFlibble
Copy link
Author

The thing is, since there is only very little maintenance happening on this project, I want to keep everything out that isn't maintained and used.

I agree with you on this. The Tales should probably exist as a separate game/mod on its own. But my initial proposal here was that For the Motherland, as a game mode, already works in Wargus, both 2.4.x and 3.x.x. Those maps that don't work -- well, it's probably better to remove them. But those that do, I suppose there's no reason to cut this content.

I've been able to run your version with standalone 3.2.0 Stratagus binaries, although I had to comment out the SetFogOfWarOpacity line in stratagus.lua. I was able to run skirmish games and For the Motherland. (4)beethoven-day and (2)less-than-three worked fine but (2)forgotten-forest still crashed.

I was further able to start the Frontier Force campaign by copying the interface folder from campaigns\human-tales to campaigns\human. However, it still crashed, with no indication of the cause in stderr.txt.

I've had better luck pasting the data from Kintobor's fork over a portable installation of Wargus 3.1.2 with Warcraft II data installed. But it does not seem that so far this provides any advantage over the simple fix of adding back the extra caanoo entities required for the For the Motherland mode, because FtM maps which do not work here did not work for me in Kintobor's fork either.

@Kintobor
Copy link
Member

I had a look at the Forgotten Forest map. It uses FtM2012 instead of FtM2014 like the others. It also defines a new ai in the map definition.

The Caanoo folder name came from when the menus were adapted to work with 320x240 resolution (which was the native resolution of the Caanoo handheld). The scripts kept expanding till it did six different things. It mainly focused on giving map makers more options. Only override.lua was specific to Aleona's Tales.

I would like to reintroduce the Caanoo folder and use it to house mod scripts which can be loaded at will.

I'm thinking of the following structure:
/scripts/caanoo/ftm.lua < Scripts which are used only for the FtM game type.
/scripts/caanoo/expanded.lua < Additional units which can be used in custom maps.
/scripts/caanoo/frontline.lua < Scripts which are used only for the Frontline game type.
/scripts/caanoo/escape.lua < Scripts which are used only for the Escape game type.
/scripts/caanoo/stand.lua < Scripts which are used only for the Last Stand game type.

I'll like to create three new game types from maps from the Frontier Force campaign: Escape, Last Stand, and Scenario.

Escape - One team must get from one side of the map to the other. The other team has to stop them.
Last Stand - One side attacks with FtM mechanics. The other side defends as long as possible with standard mechanics.
Scenario - Standalone scenario missions.

I'll start by getting all the FtM maps working correctly.

@timfel
Copy link
Member

timfel commented Jan 14, 2022

@Kintobor that sounds like a good plan. why keep the caanoo folder name? if we're adding stuff back, maybe we can just put it in a mods folder right away?

@Kintobor
Copy link
Member

Kintobor commented Jan 14, 2022

That would be more logical but I like holding on to old things. :)

I view the Caanoo folder as having only script libraries which can be loaded at will for custom maps and game types. It wouldn't contain any subfolders. A mod folder on the other hand would be for game assets loaded via the game's Mods menu.

For example:
scripts/caanoo/
scripts/mods/Mod1/graphics
scripts/mods/Mod1/scripts
scripts/mods/Mod1/maps
scripts/mods/Mod2/graphics
scripts/mods/Mod2/scripts
scripts/mods/Mod2/maps

@timfel
Copy link
Member

timfel commented Jan 14, 2022

ah, ok, so caanoo would be like a library folder, and under scripts/lists/mods we put a file to load the additional files. this way we keep any caanoo strings out of existing files :)

@Kintobor
Copy link
Member

Kintobor commented Jan 20, 2022

(4)rockfort-arena.smp - Best AI. Used super towers which I'll remove to make the match quicker. Right now it is a big all stalemate.
(4)winter-bloodbath.smp - Crash on load.
(5)black-flood.smp - Froze when I tried to load it after (8)darius.smp. Works on a fresh start, but the game pauses when I alt-tab out. I have to fiddle with game speed to make it unpause. I lost. The AI needs to make peasants.
(8)darius.smp - AI isn't working correctly.

@Kintobor
Copy link
Member

Kintobor commented Jan 21, 2022

(2)forgotten-forest.smp - Crash on load.
(2)less-than-three.smp - Crash on victory.
(2)mushroom-panic.smp - Crash on load. 16612: attempt to index global 'ftm_index_start' (a nil value)
(2)nicks-duel.smp - Won without problem.
(2)one-way-through.smp - Won without problem.
(4)beethoven-day.smp - The armies are not being spawned. Evil Dragon and the two Ernies are though. https://www.youtube.com/watch?v=6qeazGmme1Y
(4)coastal-crusade - Was able to win without problems.
(4)river-crossing.smp - Crash on load.

@SimoneStarace
Copy link
Contributor

(2)forgotten-forest.smp - Crash on load.

This didn't happen to me. The only problem I have here is the Fog of War that isn't applied correctly in rectangular maps.

(2)less-than-three.smp - Crash on victory.

Same for me.

(2)mushroom-panic.smp - Crash on load. 16612: attempt to index global 'ftm_index_start' (a nil value)

Same issue for me.

(4)beethoven-day.smp - The armies are not being spawned. Evil Dragon and the two Ernies are though.

Strange. To me the armies are spawned. Yes the Evil Dragon is tough and annoying.

(4)river-crossing.smp - Crash on load.

I was able to play the map in debug mode, but it's in an unplayable state because the map is rectangular and the fog of war was going crazy.

(2)nicks-duel.smp - Won without problem.
(2)one-way-through.smp - Won without problem.
(4)coastal-crusade - Was able to win without problems.

No problems on those.

@Kintobor
Copy link
Member

Kintobor commented Jan 26, 2022

I think I've figured out why most of the maps crash for me. It is because they have non-square maps.

I was wrong about Beethoven Day, restarting the game fixed the issue. I've also managed to get Mushroom Panic to load, but it crashes after a little bit of time.

I'm keeping a journal on the forums. https://forums.stratagus.com/viewtopic.php?p=20477

@SimoneStarace
Copy link
Contributor

I think I've figured out why most of the maps crash for me. It is because they have non-square maps.

Can you be more specific? I have installed Wargus from the source and the problem of the fog of war isn't happening but the problem is surely something else.

@Kintobor
Copy link
Member

Maps would crash if they were 64x256 instead of 256x256. Changing 64x256 to 256x256 prevented some of the crashes.

I'm using the latest release. If you don't have the issue it might be different config settings.

@timfel
Copy link
Member

timfel commented Jan 27, 2022

I don't have enough time to test this properly, but if you agree among yourselves that one of the PRs that are open to fix this is the way to go, I will merge it :)

@timfel
Copy link
Member

timfel commented Jan 27, 2022

Maps would crash if they were 64x256 instead of 256x256. Changing 64x256 to 256x256 prevented some of the crashes.

This shouldn't happen anymore in the latest dev version. @ipochto fixed a bug with non-square maps just after the last release was finalized

@timfel
Copy link
Member

timfel commented Mar 22, 2022

I have merged @SimoneStarace's PR to fix some of these maps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants