Community

SCI Programming => SCI Development Tools => Topic started by: EricOakford on July 18, 2022, 01:35:41 PM

Title: Convert SCI0 vocab to SCI1 vocab?
Post by: EricOakford on July 18, 2022, 01:35:41 PM
My KQ4 upgrade patch is looking good. Now I've ported the game to interpreter S.old.010 (from the KQ1SCI demo).
With the system scripts updated, everything carries over with little issue, and there's MUCH more heap space available! Except... the main vocab is incompatible. Saving it as vocab.900 doesn't help.
Could SCI0 vocabs be converted to SCI1 vocabs? I know they were just compiled differently; the original source dictionary files are structured the same.

In the future, I plan to update the interpreter to 1.000.172 (from The Seasoned Professional). I know about this project (https://sciprogramming.com/community/index.php?topic=1911.msg13643#msg13643) which VGA-ifies the game. The only other obstacle here would be updating the Sound files to a format that's compatible with the newer interpreter. SCICompanion doesn't correctly support creation of sound resources that work with the earliest SCI1 interpreters.
Title: Re: Convert SCI0 vocab to SCI1 vocab?
Post by: troflip on July 18, 2022, 06:06:10 PM
I don't think there's an easy way to do it. You can see the difference between the 000 and 999 vocab resources here:

https://github.com/icefallgames/SCICompanion/blob/e2b5891052f884180b3705c273941b69b8a9878b/SCICompanionLib/Src/Resources/Vocab000.cpp

It's not a huge difference in format, but you'd probably need to write your own code to read in one format and spit out the other.

If I'd had access to the original dictionary file formats back when making SCICompanion, it probably would have been a good idea to support import/export of them.
Title: Re: Convert SCI0 vocab to SCI1 vocab?
Post by: Collector on July 18, 2022, 07:41:38 PM
The only other obstacle here would be updating the Sound files to a format that's compatible with the newer interpreter. SCICompanion doesn't correctly support creation of sound resources that work with the earliest SCI1 interpreters.

Export as MIDI and reimport?
Title: Re: Convert SCI0 vocab to SCI1 vocab?
Post by: ZvikaZ on July 19, 2022, 03:56:54 AM
I have faced similar problem when working on SQ3 Hebrew translation.
SQ3 uses the old, 7-bits, format. But for Hebrew I needed the new, 8-bit format.
Therefore, my scripts "export" the original vocab file to a .csv file (readable by Excel), the Hebrew translation was done in that file, and then another script "import"ed the .csv file to a vocab fie, in the new format.

You can see them at:
https://github.com/adventurebrew/re-quest/tree/master/tools/sci
 (https://github.com/adventurebrew/re-quest/tree/master/tools/sci)  (we have recently moved them to a new repo)

The scripts of interest for you are 'vocab_export.py' (to create the .csv file) and 'vocab_import.py' (to read the .csv file and create 2 vocab files (!) - both are in the new format, but they have different names and locations - you can safely ignore that unneeded file, just make sure it doesn't delete any important file for you...)

The scripts also have (a basic) '--help' support.

If this information is enough for you - great.
If not, I will have time tomorrow to run it myself, and write detailed instructions what should you run.
Title: Re: Convert SCI0 vocab to SCI1 vocab?
Post by: EricOakford on July 19, 2022, 12:37:55 PM
Here is the output (WARNING: Strong language found in vocab!), using the game's original vocab.000 and the newest version of Python 3.
Code: [Select]
Python 3.10.5 (tags/v3.10.5:f377153, Jun  6 2022, 16:14:13) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.

========== RESTART: C:\SCICompanion\re-quest\tools\sci\vocab_export.py =========
strings_import: get_room_number need to add support to define:  SORTCOPY
Warning: class mismatch:  {'words': ['ass', 'asshole', 'bastard'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['bit', 'bridle'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['ass', 'asshole', 'bastard', 'bitch', 'bullshit', 'clit', 'cock'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['ass', 'asshole', 'bastard', 'bitch', 'bullshit', 'clit', 'cock', 'cocksucker'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['ass', 'asshole', 'bastard', 'bitch', 'bullshit', 'clit', 'cock', 'cocksucker', 'crap', 'cunt'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['dark', 'dim'], 'class': ['ADJECTIVE', 'IMPERATIVE_VERB']}
Warning: class mismatch:  {'words': ['enter', 'go'], 'class': ['IMPERATIVE_VERB', 'INDICATIVE_VERB']}
Warning: class mismatch:  {'words': ['gold', 'golden'], 'class': ['ADJECTIVE', 'NOUN']}
Warning: class mismatch:  {'words': ['exit', 'leave'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['giant', 'ogre'], 'class': ['ADJECTIVE', 'NOUN']}
Warning: class mismatch:  {'words': ['place', 'put'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['bit', 'bridle', 'reins'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['boulder', 'boulders', 'rock'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['boulder', 'boulders', 'rock', 'rocks'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['place', 'put', 'set'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['ass', 'asshole', 'bastard', 'bitch', 'bullshit', 'clit', 'cock', 'cocksucker', 'crap', 'cunt', 'damn', 'fart', 'fuck', 'piss', 'shit', 'shithead'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['barn', 'stable'], 'class': ['ADJECTIVE', 'NOUN']}
Warning: class mismatch:  {'words': ['barn', 'stable', 'stall'], 'class': ['ADJECTIVE', 'NOUN']}
Warning: class mismatch:  {'words': ['boulder', 'boulders', 'rock', 'rocks', 'stone'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['boulder', 'boulders', 'rock', 'rocks', 'stone', 'stones'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['ass', 'asshole', 'bastard', 'bitch', 'bullshit', 'clit', 'cock', 'cocksucker', 'crap', 'cunt', 'damn', 'fart', 'fuck', 'piss', 'shit', 'shithead', 'turd'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['path', 'road', 'trail', 'walk'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['path', 'road', 'trail', 'walk', 'walkway'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['whale', "whale's"], 'class': ['ADJECTIVE', 'NOUN']}
Warning: class mismatch:  {'words': ['wood', 'wooden'], 'class': ['ADJECTIVE', 'NOUN']}
Traceback (most recent call last):
  File "C:\SCICompanion\re-quest\tools\sci\vocab_export.py", line 156, in <module>
    vocab_export(args.gamedir, args.csvdir)
  File "C:\SCICompanion\re-quest\tools\sci\vocab_export.py", line 139, in vocab_export
    write_csv(csvdir, sorted_vocab, config.vocab_csv_filename)
  File "C:\SCICompanion\re-quest\tools\sci\vocab_export.py", line 146, in write_csv
    dict_writer.writerows(vocab)
  File "C:\Users\eoakf\AppData\Local\Programs\Python\Python310\lib\csv.py", line 157, in writerows
    return self.writer.writerows(map(self._dict_to_list, rowdicts))
_csv.Error: need to escape, but no escapechar set

The last few words (ANYWORD, NOWORD) failed to be exported to the CSV file.

When importing the CSV file back into the vocab, SCICompanion seems to be able to read it right, but the interpreter doesn't recognize any words, probably because the vocab wasn't exported right.
Title: Re: Convert SCI0 vocab to SCI1 vocab?
Post by: ZvikaZ on July 19, 2022, 01:43:38 PM
Here is the output (WARNING: Strong language found in vocab!), using the game's original vocab.000 and the newest version of Python 3.
Code: [Select]
Python 3.10.5 (tags/v3.10.5:f377153, Jun  6 2022, 16:14:13) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.

========== RESTART: C:\SCICompanion\re-quest\tools\sci\vocab_export.py =========
strings_import: get_room_number need to add support to define:  SORTCOPY
Warning: class mismatch:  {'words': ['ass', 'asshole', 'bastard'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['bit', 'bridle'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['ass', 'asshole', 'bastard', 'bitch', 'bullshit', 'clit', 'cock'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['ass', 'asshole', 'bastard', 'bitch', 'bullshit', 'clit', 'cock', 'cocksucker'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['ass', 'asshole', 'bastard', 'bitch', 'bullshit', 'clit', 'cock', 'cocksucker', 'crap', 'cunt'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['dark', 'dim'], 'class': ['ADJECTIVE', 'IMPERATIVE_VERB']}
Warning: class mismatch:  {'words': ['enter', 'go'], 'class': ['IMPERATIVE_VERB', 'INDICATIVE_VERB']}
Warning: class mismatch:  {'words': ['gold', 'golden'], 'class': ['ADJECTIVE', 'NOUN']}
Warning: class mismatch:  {'words': ['exit', 'leave'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['giant', 'ogre'], 'class': ['ADJECTIVE', 'NOUN']}
Warning: class mismatch:  {'words': ['place', 'put'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['bit', 'bridle', 'reins'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['boulder', 'boulders', 'rock'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['boulder', 'boulders', 'rock', 'rocks'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['place', 'put', 'set'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['ass', 'asshole', 'bastard', 'bitch', 'bullshit', 'clit', 'cock', 'cocksucker', 'crap', 'cunt', 'damn', 'fart', 'fuck', 'piss', 'shit', 'shithead'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['barn', 'stable'], 'class': ['ADJECTIVE', 'NOUN']}
Warning: class mismatch:  {'words': ['barn', 'stable', 'stall'], 'class': ['ADJECTIVE', 'NOUN']}
Warning: class mismatch:  {'words': ['boulder', 'boulders', 'rock', 'rocks', 'stone'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['boulder', 'boulders', 'rock', 'rocks', 'stone', 'stones'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['ass', 'asshole', 'bastard', 'bitch', 'bullshit', 'clit', 'cock', 'cocksucker', 'crap', 'cunt', 'damn', 'fart', 'fuck', 'piss', 'shit', 'shithead', 'turd'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['path', 'road', 'trail', 'walk'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['path', 'road', 'trail', 'walk', 'walkway'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['whale', "whale's"], 'class': ['ADJECTIVE', 'NOUN']}
Warning: class mismatch:  {'words': ['wood', 'wooden'], 'class': ['ADJECTIVE', 'NOUN']}
Traceback (most recent call last):
  File "C:\SCICompanion\re-quest\tools\sci\vocab_export.py", line 156, in <module>
    vocab_export(args.gamedir, args.csvdir)
  File "C:\SCICompanion\re-quest\tools\sci\vocab_export.py", line 139, in vocab_export
    write_csv(csvdir, sorted_vocab, config.vocab_csv_filename)
  File "C:\SCICompanion\re-quest\tools\sci\vocab_export.py", line 146, in write_csv
    dict_writer.writerows(vocab)
  File "C:\Users\eoakf\AppData\Local\Programs\Python\Python310\lib\csv.py", line 157, in writerows
    return self.writer.writerows(map(self._dict_to_list, rowdicts))
_csv.Error: need to escape, but no escapechar set

The last few words (ANYWORD, NOWORD) failed to be exported to the CSV file.

When importing the CSV file back into the vocab, SCICompanion seems to be able to read it right, but the interpreter doesn't recognize any words, probably because the vocab wasn't exported right.

Can you send me the vocab file?
I will check what's gone wrong in exporting.

Regarding the interpreter not recognizing - can you please try with ScummVM?
Title: Re: Convert SCI0 vocab to SCI1 vocab?
Post by: EricOakford on July 20, 2022, 11:14:04 AM
I've got the vocab files here. The original vocab (from 1.006.004), the exported CSV, and the re-imported vocab.900.

I can't test in ScummVM, since it's an unknown game variant.
Title: Re: Convert SCI0 vocab to SCI1 vocab?
Post by: MusicallyInspired on July 21, 2022, 01:08:24 AM
The only other obstacle here would be updating the Sound files to a format that's compatible with the newer interpreter. SCICompanion doesn't correctly support creation of sound resources that work with the earliest SCI1 interpreters.

Export as MIDI and reimport?

Another problem is that currently there is no way to assign # of voices values to channels for SCI1+ sound resources (Adlib needs this). And you'd have to reimplement all the cue & loop points by hand.
Title: Re: Convert SCI0 vocab to SCI1 vocab?
Post by: ZvikaZ on July 21, 2022, 05:07:01 AM
Here is the output (WARNING: Strong language found in vocab!), using the game's original vocab.000 and the newest version of Python 3.
Code: [Select]
Python 3.10.5 (tags/v3.10.5:f377153, Jun  6 2022, 16:14:13) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.

========== RESTART: C:\SCICompanion\re-quest\tools\sci\vocab_export.py =========
strings_import: get_room_number need to add support to define:  SORTCOPY
Warning: class mismatch:  {'words': ['ass', 'asshole', 'bastard'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['bit', 'bridle'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['ass', 'asshole', 'bastard', 'bitch', 'bullshit', 'clit', 'cock'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['ass', 'asshole', 'bastard', 'bitch', 'bullshit', 'clit', 'cock', 'cocksucker'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['ass', 'asshole', 'bastard', 'bitch', 'bullshit', 'clit', 'cock', 'cocksucker', 'crap', 'cunt'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['dark', 'dim'], 'class': ['ADJECTIVE', 'IMPERATIVE_VERB']}
Warning: class mismatch:  {'words': ['enter', 'go'], 'class': ['IMPERATIVE_VERB', 'INDICATIVE_VERB']}
Warning: class mismatch:  {'words': ['gold', 'golden'], 'class': ['ADJECTIVE', 'NOUN']}
Warning: class mismatch:  {'words': ['exit', 'leave'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['giant', 'ogre'], 'class': ['ADJECTIVE', 'NOUN']}
Warning: class mismatch:  {'words': ['place', 'put'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['bit', 'bridle', 'reins'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['boulder', 'boulders', 'rock'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['boulder', 'boulders', 'rock', 'rocks'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['place', 'put', 'set'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['ass', 'asshole', 'bastard', 'bitch', 'bullshit', 'clit', 'cock', 'cocksucker', 'crap', 'cunt', 'damn', 'fart', 'fuck', 'piss', 'shit', 'shithead'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['barn', 'stable'], 'class': ['ADJECTIVE', 'NOUN']}
Warning: class mismatch:  {'words': ['barn', 'stable', 'stall'], 'class': ['ADJECTIVE', 'NOUN']}
Warning: class mismatch:  {'words': ['boulder', 'boulders', 'rock', 'rocks', 'stone'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['boulder', 'boulders', 'rock', 'rocks', 'stone', 'stones'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['ass', 'asshole', 'bastard', 'bitch', 'bullshit', 'clit', 'cock', 'cocksucker', 'crap', 'cunt', 'damn', 'fart', 'fuck', 'piss', 'shit', 'shithead', 'turd'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['path', 'road', 'trail', 'walk'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['path', 'road', 'trail', 'walk', 'walkway'], 'class': ['IMPERATIVE_VERB', 'NOUN']}
Warning: class mismatch:  {'words': ['whale', "whale's"], 'class': ['ADJECTIVE', 'NOUN']}
Warning: class mismatch:  {'words': ['wood', 'wooden'], 'class': ['ADJECTIVE', 'NOUN']}
Traceback (most recent call last):
  File "C:\SCICompanion\re-quest\tools\sci\vocab_export.py", line 156, in <module>
    vocab_export(args.gamedir, args.csvdir)
  File "C:\SCICompanion\re-quest\tools\sci\vocab_export.py", line 139, in vocab_export
    write_csv(csvdir, sorted_vocab, config.vocab_csv_filename)
  File "C:\SCICompanion\re-quest\tools\sci\vocab_export.py", line 146, in write_csv
    dict_writer.writerows(vocab)
  File "C:\Users\eoakf\AppData\Local\Programs\Python\Python310\lib\csv.py", line 157, in writerows
    return self.writer.writerows(map(self._dict_to_list, rowdicts))
_csv.Error: need to escape, but no escapechar set

The last few words (ANYWORD, NOWORD) failed to be exported to the CSV file.

When importing the CSV file back into the vocab, SCICompanion seems to be able to read it right, but the interpreter doesn't recognize any words, probably because the vocab wasn't exported right.

OK, we have 2 distinct problems here:
1. The original vocab has 2 strange bytes, after 'anynumber' entry, on the beginning of '!*' entry. The csv writer couldn't handle those. I fixed it locally. Anyway,  I don't understand why are they there - any input will be great.
2. That's not the reason it failed to work for you - but rather that I had only ScummVM in mind when writing those tools. The vocab file has pointers in the beginning, that are unused by ScummVM, so I didn't bother to handle them.

I suppose I can add support for those pointers - however, it'd be much easier if someone can refer me to an explanation how they are working. I'm aware of http://sci.sierrahelp.com/Documentation/SCISpecifications/27-TheParser.html#AEN5794 (http://sci.sierrahelp.com/Documentation/SCISpecifications/27-TheParser.html#AEN5794), but it describes only the old format (which uses 26 pointers, one for each letter) and not the new format (which uses 255 pointers).

EDIT
====
If I understand correctly SCICompanion's code, the 255 pointers are for ascii codes. Therefore, I can continue with this.
Title: Re: Convert SCI0 vocab to SCI1 vocab?
Post by: ZvikaZ on July 21, 2022, 09:36:17 AM
OK, I was wrong - those 2 'strange characters' were actually perfectly fine, it was a bug in my script.

Now everything is fixed, and should be working even with original Sierra interpreters (I hope...)
Please pull and check again.

Update how is it going.


Title: Re: Convert SCI0 vocab to SCI1 vocab?
Post by: EricOakford on July 21, 2022, 11:01:22 AM
It worked! Exported the original vocab, imported the CSV file back into vocab.900. Compiled all scripts, and the game recognizes commands now! I'll have to play through and check for any bugs.

The only other obstacle here would be updating the Sound files to a format that's compatible with the newer interpreter. SCICompanion doesn't correctly support creation of sound resources that work with the earliest SCI1 interpreters.

Export as MIDI and reimport?

Another problem is that currently there is no way to assign # of voices values to channels for SCI1+ sound resources (Adlib needs this). And you'd have to reimplement all the cue & loop points by hand.

I had similar issues with the QFG1VGA upgrade. I exported the Mac version's sound files' General MIDI tracks as MIDI files and re-imported them. I had to manually re-insert the loop points, and the PC Speaker driver doesn't play any of the music.

Maybe I'll give LSL2 the same treatment, since I've fully decompiled that one, too. It'll give both games better compatibility for fan translations.
Title: Re: Convert SCI0 vocab to SCI1 vocab?
Post by: ZvikaZ on July 21, 2022, 11:37:51 AM
I'm glad to hear that it worked!

Regarding the sound issue, I might give a hand here, to automate the manual work needed, but I don't really understand the problem definition.
I have done some work on ScummVM's sound code, but I never touched the sound format itself.

Can you refer me to specs, if any exists, of the old and new formats? Examples of game or two that uses each format?
And what happened to loop points in the new format?
And I didn't understand the comment regarding # of voices channels.

Title: Re: Convert SCI0 vocab to SCI1 vocab?
Post by: MusicallyInspired on July 22, 2022, 05:26:49 PM
I'm glad to hear that it worked!

Regarding the sound issue, I might give a hand here, to automate the manual work needed, but I don't really understand the problem definition.
I have done some work on ScummVM's sound code, but I never touched the sound format itself.

Can you refer me to specs, if any exists, of the old and new formats? Examples of game or two that uses each format?
And what happened to loop points in the new format?
And I didn't understand the comment regarding # of voices channels.

Here is the SCI Sound format specifications by Ravi Iyengar (https://wiki.scummvm.org/index.php/SCI/Specifications/Sound/SCI0_Resource_Format). It's more focused on SCI0 sounds and Amiga and Macintosh SCI1 sounds for some reason. There's no information about standard SCI1 sound resource specs that I could find. I do know the difference between SCI0 and SCI1+ sound resources aren't much but among them is that SCI1 sounds can have multiple tracks per channel which makes it easier to assign instruments to different music devices because you can assign multiple music device instruments using their own tracks to a single MIDI channel. The interpreter just ignores the other tracks for the music devices not being used. SCI0 sounds can only have one track per channel so you're limited to 15 tracks and have to share notation with other music devices (Adlib and MT-32 for instance).

As for the "# of voices" thing, part of the SCI sound resource specification is to assign an "initial voices" value to each channel. This is a value that SCI reads and tells the Adlib music device specifically how many voices can sound at the same time. Adlib is limited to 8-voice polyphony and no more (unless you use the SBPRO driver which is stereo OPL3 and you have 16-voice polyphony instead). So each Adlib dedicated track/channel must have an initial voices value set to properly control the polyphony. Ravi's "SoundBox" was a program he wrote to convert MIDI files to SCI0 sound resources and it allows the user to assign the "initial voices" value for each channel. This feature is not implemented in SCI Companion because it was designed mainly around GM MIDI import only and never really considered other music devices.

As for loop/cue points, I'm not sure exactly what has changed there. I would assume it was the same. However, Collector was suggesting that one extract the SCI sound resources to MIDI and then reconvert them to SCI1 sound resources. This process wipes the cue and loop information because they don't have a standard MIDI format equivalent. Hence they'd have to be re-implemented by hand. Having a proper converter to convert SCI0 sound resources to SCI1+'s format would negate this issue. I've looked into it but my code fu is weak.
Title: Re: Convert SCI0 vocab to SCI1 vocab?
Post by: ZvikaZ on July 25, 2022, 12:14:34 PM
Well, thanks to Phil's code I managed to get around SCI1+ format. The header is quite different. The payload is also slightly different.
I will open a different thread to discuss that.

Anyway, I have a (basic) tool ready:
https://github.com/adventurebrew/re-quest/blob/master/tools/sci/sounder.py (https://github.com/adventurebrew/re-quest/blob/master/tools/sci/sounder.py)

It currently can:

Missing features and limitations (will be hopefully addressed in the future):

It's supposed to handle cue and loop points, but I haven't thoroughly verified it.
Generally speaking, it's not verified well enough, and probably has some bugs ;)

As for number of voices, for adlib - there's no place to save it SCI1+ format (as far as I understand) - so, it's a problem...
It's interesting to check with ScummVM (I might do it...), or original interpreter (even better but I couldn't find it in OmerMor's files; maybe it's in the adlib driver itself) how is it handled.
Maybe the interpreter selects these values by itself?

As usual, run with '--help' to get detailed information, or ask here if something isn't clear.

And of course, I'll be happy to get bug reports or feature requests.

EDIT
====
For more details, see https://sciprogramming.com/community/index.php?topic=2075.0 (https://sciprogramming.com/community/index.php?topic=2075.0)

Title: Re: Convert SCI0 vocab to SCI1 vocab?
Post by: MusicallyInspired on July 28, 2022, 06:40:13 AM
Wow that's wonderful!
Title: Re: Convert SCI0 vocab to SCI1 vocab?
Post by: Andre999 on August 04, 2022, 07:42:29 PM
My KQ4 upgrade patch is looking good. Now I've ported the game to interpreter S.old.010 (from the KQ1SCI demo).
With the system scripts updated, everything carries over with little issue, and there's MUCH more heap space available! Except... the main vocab is incompatible. Saving it as vocab.900 doesn't help.
Could SCI0 vocabs be converted to SCI1 vocabs? I know they were just compiled differently; the original source dictionary files are structured the same.

In the future, I plan to update the interpreter to 1.000.172 (from The Seasoned Professional). I know about this project (https://sciprogramming.com/community/index.php?topic=1911.msg13643#msg13643) which VGA-ifies the game. The only other obstacle here would be updating the Sound files to a format that's compatible with the newer interpreter. SCICompanion doesn't correctly support creation of sound resources that work with the earliest SCI1 interpreters.

Nice. Having KQ4 converted to SCI01 would of course be of great help for VGA-ifing the game. Both sounds and vocab is a known issue for me. For Vocab I just used the file from the hacked Season Professional and added words manually to get the game to compile. That did not work to well. There is a lot of "bad said spec" messsages. For sounds I found one tool in this forum for converting, but it did not work out to well. I have attached the game, go to the fishermans pier, to hear a pretty bad version of his tune.

Your post definitly makes me want to pick up this project again. After the release of ScummVMX I did create a lot of new graphics (not included in attached game) and consider releasing them for use of this engine. But decieded against it for two reasons. First that SCUMMVM including X, does not allow for any patches, and I needed to make some. Second, I have decided that I want the characters to be larger as in later Sierra games. The 34 px high Rosella is to small for me :) Even if I find the 43ish px height of PQ2, Larry3, Iceman, and Qfg1 to be quite nice, for KQ4 using the indoor size of about 50px is the natural way to go.
 
Edit: If you want to run the attached game, you will need to enter path to dosbox in the game properties.
 
Title: Re: Convert SCI0 vocab to SCI1 vocab?
Post by: ZvikaZ on August 05, 2022, 02:59:33 AM
Nice. Having KQ4 converted to SCI01 would of course be of great help for VGA-ifing the game. Both sounds and vocab is a known issue for me. For Vocab I just used the file from the hacked Season Professional and added words manually to get the game to compile. That did not work to well. There is a lot of "bad said spec" messsages. For sounds I found one tool in this forum for converting, but it did not work out to well. I have attached the game, go to the fishermans pier, to hear a pretty bad version of his tune.

What is that tool you found in this forum? Is it 'Sounder'?
If so, I'd like to get (but probably on other thread, it's a little bit off topic here...) more details, in order to fix it.

EDIT
====
Also, please download an updated release: https://github.com/adventurebrew/re-quest/releases/latest/download/Sounder.Installer.exe (https://github.com/adventurebrew/re-quest/releases/latest/download/Sounder.Installer.exe)
Title: Re: Convert SCI0 vocab to SCI1 vocab?
Post by: Andre999 on August 05, 2022, 10:01:12 AM
This was a couple of years ago. Honestly I am 100% sure what I used, but I belive I used Snd2mid to convert to midi and then Sierra's SMF.exe or just imported the midi into SCI Companion. I am sure i tried both and one did not work at all (ie crashing the game or not playing), and the other gave the sounds in the attached game. Details in this thread: https://sciprogramming.com/community/index.php?topic=1849.

I have not tested your Sounder yet, but reading in this forum it looks promising.