Open main menu

Difference between revisions of "Auto detection"

1,344 bytes added ,  17:42, 3 March 2006
(Some ramblings on how to improve the SubstResFileNames system)
Line 81: Line 81:


Hence the idea is born to unify the knowledge / data found in <code>ScummEngine::openRoom</code> and <code>substResFileNameTable</code> into a single mechanism. This is why I wrote above that <code>detectGames</code> should return a SubstResFileNames (or equivalent recorde). We already pass that to the ScummEngine object. We simply extend this to allow to be used directly by <code>ScummEngine::openRoom</code> (and of course other methods) to generate suitable filenames from given data.
Hence the idea is born to unify the knowledge / data found in <code>ScummEngine::openRoom</code> and <code>substResFileNameTable</code> into a single mechanism. This is why I wrote above that <code>detectGames</code> should return a SubstResFileNames (or equivalent recorde). We already pass that to the ScummEngine object. We simply extend this to allow to be used directly by <code>ScummEngine::openRoom</code> (and of course other methods) to generate suitable filenames from given data.
How to achieve this? I am not yet fully sure how to do this best... We probably need (at least) the following three parts:
# A way to determine what file naming scheme to be used (for the detector; i.e. a way to loop over all possible detect names for a given game)
# A way to encode the naming scheme (i.e. <code>substResFileNameTable</code> or a successor)
# A function that generates filenames from the <code>substResFileNameTable</code>, given some data (like room & disk number)
The first part should be good enough to also allow the detector to extract useful extra information about the game. E.g. if the filename is 00.man, we know that it's Maniac Mansion Demo; if it's toffzeit.he0, then we are dealing with the German putttime, etc.
Parts 2 and 3 go hand in hand. Unfortunately, we can't just use a prinft format string, since in some cases, the file names may need to encode the room number, in others the disk number, and in some cases even letters instead of numbers are used (for HE 98+ games, "(a)" and "(b)" are used as file name extensions, at least)
This is still a bit fuzzy. To decide how to proceed, it might help to write down a list of all possible file names, or even a map between filenames <-> gameid, but since that's a lot of work and may just as well be *not* useful at all, I am not doing this for now... :-)


TODO: Finish this
TODO: Finish this
1,079

edits