[Scummvm-devel] MADE engine performance

John Doe john_doe at techie.com
Wed Sep 23 10:54:07 CEST 2009


The problem is that in MADE the mainloop is in the script and so the script interpreter runs all the time in contrast to other games where game scripts are called from the C++ code and run for only a short time.

There's a workaround in script.cpp ("We sleep a little after 500 opcodes to reduce the CPU load.") which I added which reduces the CPU load in x86/WinXP considerably. Maybe decreasing this number could help so it will sleep after e.g. 100 opcodes.

I didn't profile it but I guess the engine spends some time in the findObjectProperty in database.cpp since it seems to be called quite often. Theoretically the call result could be cached somewhere (using the call parameters as ID) and reused later on. (I'll try to try that later.)

Another thing is that currently the game doesn't use dirty rectangles or similar so the whole screen is updated on each call to sfShowPage.

> ----- Original Message -----
> From: neil at millstone.demon.co.uk
> To: scummvm-devel at lists.sourceforge.net
> Subject: [Scummvm-devel] MADE engine performance
> Date: Wed, 23 Sep 2009 08:19:30 +0000
> Hi,
> I had a go last night at getting Return to Zork running on the DS
> port of ScummVM, and after fixing a few fatal bugs in the engine
> (memory leaks and excessive stack usage, I'll submit fixes when I
> get back to my PC) the game runs fine. Unfortunately it runs at
> less than one frame per second, even when very little appears to be
> going on. For example, when the birds are circling when sitting on
> the first playable screen, everything moves really slowly. The
> video playback runs at normal speed (and looks great!)
> There doesn't seem to be an excessive amount of calls to the
> backend or graphics rendering going on, so it seems to me that the
> time is spent executing script functions. Can someone who knows
> this engine take a look at it and give me some clues as to where to
> start? Even if someone could just send me a profile of this game
> sitting idle at a gameplay screen it would help.
> Thanks for everyone's continuing help,
> - Neil
> -----------------------------------------
> Sent by emoze push mail
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry® Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9-12, 2009. Register now!
> http://p.sf.net/sfu/devconf
> _______________________________________________
> Scummvm-devel mailing list
> Scummvm-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/scummvm-devel


An Excellent Credit Score is 750 
See Yours in Just 2 Easy Steps!

More information about the Scummvm-devel mailing list