Author Topic: ScummVM support for translating/modifying games  (Read 2065 times)

0 Members and 1 Guest are viewing this topic.

Offline ZvikaZ

ScummVM support for translating/modifying games
« on: April 17, 2022, 09:18:06 AM »
This topic has been mentioned here in few threads, and some information is at https://bugs.scummvm.org/ticket/13414.
I have made now some modifications to ScummVm's code (which will be probably available tomorrow at their daily builds).

The situation with my fixes should be (if I'm not mistaken ;) ):
  • The game's GameID in WinAGI is determined by the .com file's name, or `AGI` if it's `sierra.com`
  • Once the game files are being changed, ScummVM fails to find the game in its detection table
  • ScummVM tries fallback detection, based on GameID's value in WinAGI
  • If it's a value that's known to ScummVM (ignoring case), it will be used
  • Otherwise, it will be `agi-fanmade`
  • ScummVM's `gameid` for each game can be seen in scummvm.ini, or at https://github.com/scummvm/scummvm/blob/046b6a6328075a4c876d8ee83c5755efff9da7d9/engines/agi/detection.cpp#L48
  • Note that Space Quest 1 (for example) might have 'sq.com' in some distributions, which will make its GameID in WinAGI to be 'SQ', while scummvm expects it to be 'sq1'. Just modify it in WinAGi

I assume that's enough for the translation work.
If something else is needed, or if I'm mistaken, please notify me.



Offline AGKorson

Re: ScummVM support for translating/modifying games
« Reply #1 on: April 18, 2022, 02:39:10 AM »
  • The game's GameID in WinAGI is determined by the .com file's name, or `AGI` if it's `sierra.com`
Not quite true. If a valid game loader (*.COM file) is detected when importing a game, the loader's file name is used as the default WinAGI GameID, which is usually 'KQ1', SQ1' or whatever the install batch file named the loader. If the loader is 'sierra.com, then the default WinAGI GameID will be 'SIERRA'. If no valid loader file is found, then the default WinAGI GameID will be 'AGI'.
Doomlazer pointed out correctly below that the default WinAGI GameID is 'agi' if the game loader is 'sierra.com'.

  • ScummVM tries fallback detection, based on GameID's value in WinAGI
To be clear, this will only be the case if your game includes the WinAGI game properties file (*.wag) in your game's directory. If you don't include the WAG file, then SCUMMVM will (obviously) use a different method to determine what game (and version) is running.

  • Note that Space Quest 1 (for example) might have 'sq.com' in some distributions, which will make its GameID in WinAGI to be 'SQ', while scummvm expects it to be 'sq1'. Just modify it in WinAGI
(emphasis added)
THIS! The WinAGI GameID property can easily be changed to whatever you want it to be. You don't have to accept whatever it gets set to when a game is imported.

The WinAGI GameID has no intrinsic value to an AGI game; it is there to help identify your game while you are editing. There is a built-in feature that let you easily use that property as an argument for the 'set'game.id' command, but that's it.

The SCUMM folks have decided to also use the WinAGI GameID  in their detection functions- while I am generally OK with that, I must say I'm mildly annoyed that their implementation seems to be a source of confusion regarding what's going on with WinAGI. I don't think it has to be this complicated. If it were me, I would have assumed any game that includes a WinAGI game file is either a fan-made game, if the WinAGI GameID is not a known Sierra gameid, or a variant of a Sierra game if it is known.

I don't normally use ScummVM when runnig/testing games. So did a small bit of testing (using v2.5.1). First, by running ScummVM directly, and then trying to Add and then Start a game.

If I modify SQ1, and leave 'sq1.wag' file in the game directory, with a WinAGI GameID value of 'sq1, and then Add the game to ScummVM, it shows a list of games to choose from, including
  • Space Quest I: The Sarien Encounter ("<description>" "<version>" "<datetime>"/DOS)
where <description>, <version> and <datetime> correspond to the Description, GameVersion and LastEdit fields from the sq1.wag file. And the game runs in ScummVM.

Changing the WinAGI GameID to any other 'Sierra' gameid ('kq1', pq1', etc) also shows a similar option, and the game will run.

If I modify the WinAGI GameID value to 'TEST' (or anything other than a Sierra gameid or 'AGI'), I get the option to add
  • ("<description>" "<version>" "<datetime>"/DOS)
but when trying to run the game, it fails, saying "Could not find any engine capable of running the selected game."

If I modify the WinAGI GameID value to 'AGI', then I get this option:
  • Sierra AGI game ("<description>" "<version>" "<datetime>"/DOS)
and the game runs. So, using a WinAGI GameID of 'AGI' or a Sierra gameid will allow a game with a .WAG file to run in ScummVM. Using any other WinAGI GameID won't.

Next, I tried to run ScummVM from within WinAGI, by selecting ScummVM as the game platform.

The first thing I noticed is that there's a bug in how WinAGI builds the command line to add to ScummVM. It uses a hard coded value of 'agi' for the [game] parameter. I'm pretty sure I tested that when I added this feature, and I recall thinking that 'agi' as a command line [game] parameter meant to run the game using the AGI engine. Either I'm mis-remembering, or something changed in ScummVM since I added that.

The effect of this is that if the WinAGI GameID is *not* 'agi', then the game won't run when you click the 'Run' button. You'll get a message from ScummVM saying the game data files can't be found.

That was easy enough to fix. (I'll try to get a new version out shortly.) But it exposes the same issue as noted above - if the WinAGI GameID is not 'agi' or a Sierra gameid, then the game will not run in ScummVM when you click on the 'Run' button.

That kinda sucks, and I hope the fix you submitted to ScummVM will fix that.

« Last Edit: April 18, 2022, 07:40:06 PM by AGKorson »

Offline ZvikaZ

Re: ScummVM support for translating/modifying games
« Reply #2 on: April 18, 2022, 03:31:28 AM »
Thanks for the detailed information.

1.
Regarding the automatic GameID setting - is it documented in WinAGI's help? (honestly, I haven't checked...) If not, maybe it'd be nice to add.

2.
Quote
If it were me, I would have assumed any game that includes a WinAGI game file is either a fan-made game, if the WinAGI GameID is not a known Sierra gameid, or a variant of a Sierra game if it is known.
ScummVM's folks agree with you, but they had a bug.

Quote
That kinda sucks, and I hope the fix you submitted to ScummVM will fix that.
It should fix exactly that.
Please check the daily build.
It should either create a known Sierra gameid, or 'agi-fanmade'.

3.
Fun fact - that bug is partly because of me :)
When I worked on PQ1 Hebrew translation, I discovered that ScummVM had support for .wag file reading, but it was outdated, and was based on .wag binary format. Which means that it didn't work for modern WinAGI versions. I added support to the modern textual .wag format. Because of that, all that .wag handling code that was ignored for long time started working, include the bug (that was there before I came) that you mentioned, of the unknown gameid.
« Last Edit: April 18, 2022, 04:37:18 AM by ZvikaZ »

Offline doomlazer

Re: ScummVM support for translating/modifying games
« Reply #3 on: April 18, 2022, 03:52:20 PM »
If the loader is 'sierra.com, then the default WinAGI GameID will be 'SIERRA'. If no valid loader file is found, then the default WinAGI GameID will be 'AGI'.

Not to nitpick, but if I change SQ.COM to sierra.com and import, the resulting default WinAGI GameID is AGI. At least that is what's happening with my v2.2 copy of SQ1. My copy of SQ2, which uses sierra.com also comes in as AGI.
« Last Edit: April 18, 2022, 04:00:19 PM by doomlazer »

Offline AGKorson

Re: ScummVM support for translating/modifying games
« Reply #4 on: April 18, 2022, 07:35:59 PM »
If the loader is 'sierra.com, then the default WinAGI GameID will be 'SIERRA'. If no valid loader file is found, then the default WinAGI GameID will be 'AGI'.

Not to nitpick, but if I change SQ.COM to sierra.com and import, the resulting default WinAGI GameID is AGI. At least that is what's happening with my v2.2 copy of SQ1. My copy of SQ2, which uses sierra.com also comes in as AGI.
No, go ahead and nitpick! You are absolutely right. There is a line of code in WinAGI that specifically changes the GameID to 'agi' if the file is named 'SIERRA.COM'. I got that wrong! In my (lame) defense, it's been a long time since i wrote that code, and I happened to have a few test games where I named the wag file 'SIERRA.wag'. It made me think that the GameID was also 'SIERRA'. Thx for the reminder to make sure I know what I'm talking about before I go correcting someone else's post!  :-[

I'll edit my post accordingly.


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.019 seconds with 23 queries.