[Scummvm-devel] To all engine maintainers. Detector failure behaviour.

Eugene Sandulenko sev at scummvm.org
Tue Apr 25 16:50:01 CEST 2006

Hi all engine maintainers,

with this bugreport I found that we do not process properly one
important situation in our engines:


This is about situation when no data was found in directory specified
for particular game. This may happen when user adds it manually or when
he (re)moved his game data after successful detection.

I fixed SCUMM engine which just silently exited in this situation by
adding proper warning() call.

Though I was unable to fix Kyra engine which falls back to default
English Floppy when no known game is found. This is good as a fallback,
but would really be nice to check if important game data files really
exist in specified directory.

However I'm still not satisfied with these results.

How I view it (all below is IMHO):

More user-friendly behaviour now exists in SAGA and Simon engines,
which basically are built on top of same detection code. I.e. when game
data is not found, they do following:

  - Display GUI message
  - Return to launcher

You may try this with adding to your ini something like this:

and run 'scummvm ite-bad'

Currently only sword1 engine will show message and no engine returns to

How this is achieved.

To display a GUI message, use this small piece of code:

    _system->initSize(320, 200, 2);
  GUI::MessageDialog dialog("No valid games were found in the specified directory.");

I.e. initialize graphics, as most probably it is unitialized at that
time and display the message.

To return to launcher you should return valid Engine object by
Engine_BLAH_create() function. Particularly for Scumm engine this can be
an empty object which will do nothing, just display that message. I will
implement it little later. Currently most engines return NULL in this
case plugin code which produces useless 'Cannot instantiate engine'
message which may mean anything.

So, what do you think? If you agree to this approach, please, implement
it in your engine.

Additionally above short piece of code may be moved to common/util.cpp
or similar place, and, of course, I'll describe this on our Backends
HOWTO once it is settled down.


PS. If no complains will follow, I'll assume that nobody objects. Though
if no commits will follow, I will try to implement it by myself, though
I can easily break your engines in evil fashion ;).

More information about the Scummvm-devel mailing list