[Scummvm-devel] ATTN Engine authors: Advanced engine features

Max Horn max at quendi.de
Wed Oct 27 23:12:41 CEST 2010


Hi Vladimir, all!

Am 27.10.2010 um 20:50 schrieb Vladimir Menshakov:

> 27.10.2010, 17:57, "Max Horn" <max at quendi.de>:
>> Am 26.10.2010 um 00:47 schrieb Max Horn:
>> 
[...]

>>> less of whether you implement something or not, please update the page with details about your engine, i.e. which feature it supports and which not. This is currently missing for (at least) the following engines:
>>>  * draci
>>>  * hugo
>>>  * lastexpress
>>>  * teenagent
> Oh, really? I thought I was one of the first who updates the page. 
> http://wiki.scummvm.org/index.php?title=Advanced_Engine_Features&diff=15288&oldid=15121

Totally sorry, I somehow missed your update! yes, you were the first :). And Filippos just added SCI, so now only draci and sword25 are missing. Thanks to everybody who added info about their engine so quickly :).

> I'm planning to implement missing features as soon as possible, changed job recently, don't have much time to spend, sorry.
> Oh maybe I missed something?

No worries. I did not mean to push you or other engine devs into implementing these features (though of course it'll make your engine yet more user friendly ;). Rather, I wanted to make sure every dev is at least *aware* of them, as several of the more engines implement only very few if any features. Of course this may also simply be due to a lack of time, etc..


Am 27.10.2010 um 21:28 schrieb Vladimir Menshakov:

> I reviewed all features unsupported by teenagent and have some questions. 
> Does engine need custom pauseEngineIntern/syncSoundSettings code, if it did not use anything beyond standard mixer code/flags (playStream(kMusic/kSFX) , and did not strictly rely on timer? 

In that case you don't have to do anything. (Just to make sure nobody gets confused, use of MIDI is of course not standard mixer use.) If your engine is in that category, it should be safe to not implement those -- and it would make sense to add a "Support not necessary:" row for the "Improved pause support" AEF entry on the Wiki. If your engine is one of these, please feel free to do just that!

> Should we add default implementation for the kSavesSupportCreationDate feature kSavesSupportPlayTime feature flags somehow, as it has been done for thumbnails?


I am not sure whether I correctly understand what you have in mind ... ? For both, the critical part is to gather and store that data in the engine; writing/reading it to/from a savestate is just a single line... For thumbnails, we provide some utility functions, but not a default implementation for kSavesSupportThumbnail.

Maybe you meant something like the following, though: We could enhance the default pauseEngineIntern to keep track of the time since the engine was instantiated (subtracting the paused time). And add Engine::getTotalPlaytime() and Engine::resetTotalPlaytime(int msecs = 0) methods. (The param would be used when loading a savestate). That would make it pretty simple for engines to implement that feature.

Adding kSavesSupportCreationDate support to an engine is already pretty much trivial: When a new game is started in your engine, record the current time using OSystem::getTimeAndDate. But *when* this should be done is highly engine specific. We could add a "TimeDate _startOfCurrentGame;" member to Engine, and a method to init that; and then we could add two functions (not member of Engine, I'd say) which can read/write a TimeDate struct to a stream; plus a syncTimeDate method to Common::Serializer. An engine then just has to call the init method at the right moment, and would have to read/load the "_startOfCurrentGame" value when syncing a savegame.

If you want to implement any of these, fine by me :).


Cheers,
Max



More information about the Scummvm-devel mailing list