Open main menu

Difference between revisions of "Auto detection"

1,616 bytes added ,  17:18, 3 March 2006
Added some more thoughts on how to implement the revised detection code
m (Changed section levels)
(Added some more thoughts on how to implement the revised detection code)
Line 54: Line 54:


In addition, of course the filename itself carries valuable information. One can narrow down the SCUMM version, and in the case of newer games, also may deduce the gameid from the filename. And sometimes even the platform and/or language. We currently do not take full advantage of this.
In addition, of course the filename itself carries valuable information. One can narrow down the SCUMM version, and in the case of newer games, also may deduce the gameid from the filename. And sometimes even the platform and/or language. We currently do not take full advantage of this.
=== Building blocks ===
The core for the revised create/detect scheme would be a function <code>detectGames</code> that takes a path, and optionally a set of hints (like gameid, platform, language. (Note: I am not yet sure whether those 'hints' will be actually useful, so maybe we can do w/o them).
It returns a set of potential games. The set entries will contain: A ScummGameSettings record, a SubstResFileNames record (or equivalent, as I plan to modify the file name subsitution scheme, see below), an MD5 (computed, may be misssing), and the name/path of the 'detecfile' (the file that was used to identify that game, and to which the MD5 checksum belongs).
This function can then both be used by the regular detector, as well as the 'create' function. The latter would in fact become quite simple:
# Call <code>detectGames</code> to obtain <code>gameList</code>
# Remove all entries from <code>gameList</code> which do not match the user specified gameid
# (Not sure if this step is good/bad/necessary) Remove entries for which the platform does not match (UNK would act like a joker here)
# (Not sure if this step is good/bad/necessary) Remove entries for which the language does not match (UNK would act like a joker here)
# If the size of <code>gameList</code> does not equal (i.e. no unique match was found), abort with an error
# Finally, create a suitable Engine instance
Note: I am not yet sure how to handle target_md5 here. Maybe we don't need it anymore, maybe it could be passed as a hint to <code> detectGames </code>.
=== File name handling (revising the SubstResFileNames system) ===
TODO


== Standardized descriptions ==
== Standardized descriptions ==
1,079

edits