enigma-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Enigma-devel] Maemo Port for Nokia Internet Tablets - Performance


From: Ronald Lamprecht
Subject: Re: [Enigma-devel] Maemo Port for Nokia Internet Tablets - Performance
Date: Sat, 23 Feb 2008 18:40:14 +0100
User-agent: Thunderbird 2.0.0.9 (Windows/20071031)

Hi,

Pipeline wrote:
Andreas : disabling sounds does not seem to improve performance.

Ronald (and all) :
I believe this to be an animation slowdown with the many laser stones. I looked into source but could not find animation logic for lasers. Is this in C++ or lua? Previously i had disabled sparkles to improve performance (although i cant confirm how much that helped)... how can i test disabling of laser animations, and if that helps is there some way we can either disable or reduce animations if the fps fall below 10 or so? Laser animations are really nice to have in most levels but this may be too much.

Patch r1046 has just been a preliminary experiment to check the influence. I mailed yesterday the draft concept of a complete laser light reengineering. It mainly addresses the large number of inconsistencies in the current gaming logic concerning the laser light (see bug reports #11112, #9475,...). But of course it addresses the inefficiency of the laser beam drawing, too. You are right in your assumption that the current implementation redraws all grids with a laser beam on it on every frame with single change of laser light anywhere. I plan to redraw just those grids where the light did change. This should speed up the redraw on "Magic Triangle" by another factor of 3 - 4.

Also, can anyone confirm if the calculations you are doing should benefit from floating point hardware? I am seeing no difference in performance when compiling for that, however im not sure the software architecture supports this.

Clarence : as mentioned above, while the n800/810 do have fpu i do not believe it is being utilized. I am interested in performance of gp2x on similar levels. The gp2x looks like interesting hardware, and i imagine there is healthy community and history behind that port. Since the nokia are less known for their gaming controls, i imagine future gp2x or pandora devices will be interesting ARM-based gaming environments.

With the given framerates I do think the fpu is used.

Till:
What about the double/float issue? Would it perhaps make sense to replace any occurence of doubles within the game with something typedef'd so we can easily change this to float if helpful. Or would you like us to test if floats actually give us a performance benefit before doing something like that?

The gaming engine is *very* sensible to the precision of the calculations. All ports that like to be compatible and that may result in a future networking capable Enigma version have to stick to double precision.

Actually even most current fpu's are not precise enough in their implementation. Internal rounding "errors" (surely within the specifications) do sum up within a few seconds of physics simulation. Please try out Enigma 1.01 with level Enigma IV#30 - do nothing, just wait for about 10 seconds. On most cpu 2,3 or even all 4 marbles will move due to missing fpu precision. Try out the attached collision test levels with 1.01 - they should be stable, there is no bad algorithm in Enigma 1.01 - it is just the fpu. You can even detect different behaviour with different cpu's!

Now check these levels with the trunk 1.10! I did some algorithmic "magic" to get these common symmetries stable independent of the used fpu. We do need this stability in future to play a networking game with two different hardware architectures plugged together!

The approach you should take with remaining performance problems is the creation of "cross"-levelpacks (see refman chapter 2) that provide your users those levels that are playable on your devices.

Thanks to Raoul for these nice test levels :-)

Greets,

Ronald
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<el:level xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://enigma-game.org/schema/level/1 level.xsd" 
xmlns:el="http://enigma-game.org/schema/level/1";>
  <el:protected>
    <el:info el:type="level">
      <el:identity el:title="Collision physics 4" el:subtitle="" el:id="c4"/>
      <el:version el:score="1" el:release="1" el:revision="0" 
el:status="stable"/>
      <el:author el:name="Raoul Bourquin" el:email="" el:homepage=""/>
      <el:copyright>Copyright © 2007 Raoul Bourquin</el:copyright>
      <el:license el:type="GPL v2.0 or above" el:open="true"/>
      <el:compatibility el:enigma="0.92">
      </el:compatibility>
      <el:modes el:easy="false" el:single="true" el:network="false"/>
      <el:score el:easy="-" el:difficult="-"/>
    </el:info>
    <el:luamain><![CDATA[
-- GENERAL --
levelh = 13
levelw = 20

create_world(levelw, levelh)

forcex = 5
forcey = 5

spacefriction = 0

function renderLine( line, pattern)
    for i=1, strlen(pattern) do
        local c = strsub( pattern, i, i)
        if c=="#" then
            set_stone("st-glass",i-1,line)
            set_floor("fl-sahara",i-1,line)
        elseif c==" " then
            set_floor("fl-sahara",i-1,line)
        elseif c=="-" then
            set_floor("fl-space",i-1,line,{friction=spacefriction})

        elseif c==">" then
            set_floor("fl-space",i-1,line, {force_x = forcex, force_y = 0, 
friction=spacefriction})
            set_actor("ac-whiteball-small", i-1+0.5, line+0.5, {controllers=0})
        elseif c=="<" then
            set_floor("fl-space",i-1,line, {force_x = -forcex, force_y = 0, 
friction=spacefriction})
            set_actor("ac-whiteball-small", i-1+0.5, line+0.5, {controllers=0})
        elseif c=="v" then
            set_floor("fl-space",i-1,line, {force_x = 0, force_y = forcey, 
friction=spacefriction})
            set_actor("ac-whiteball-small", i-1+0.5, line+0.5, {controllers=0})
        elseif c=="^" then
            set_floor("fl-space",i-1,line, {force_x = 0, force_y = -forcey, 
friction=spacefriction})
            set_actor("ac-whiteball-small", i-1+0.5, line+0.5, {controllers=0})

        elseif c=="1" then
            set_floor("fl-space",i-1,line, {force_x = forcex, force_y = forcey, 
friction=spacefriction})
            set_actor("ac-whiteball-small", i-1+0.5, line+0.5, {controllers=0})
        elseif c=="2" then
            set_floor("fl-space",i-1,line, {force_x = -forcex, force_y = 
forcey, friction=spacefriction})
            set_actor("ac-whiteball-small", i-1+0.5, line+0.5, {controllers=0})
        elseif c=="3" then
            set_floor("fl-space",i-1,line, {force_x = -forcex, force_y = 
-forcey, friction=spacefriction})
            set_actor("ac-whiteball-small", i-1+0.5, line+0.5, {controllers=0})
        elseif c=="4" then
            set_floor("fl-space",i-1,line, {force_x = forcex, force_y = 
-forcey, friction=spacefriction})
            set_actor("ac-whiteball-small", i-1+0.5, line+0.5, {controllers=0})

        end
    end    
end

renderLine(00 , "####################")
renderLine(01 , "#                  #")
renderLine(02 , "#    1---v---2     #")
renderLine(03 , "#    -1--v--2-     #")
renderLine(04 , "#    --1-v-2--     #")
renderLine(05 , "#    ---1v2---     #")
renderLine(06 , "#    >>>>#<<<<     #")
renderLine(07 , "#    ---4^3---     #")
renderLine(08 , "#    --4-^-3--     #")
renderLine(09 , "#    -4--^--3-     #")
renderLine(10 , "#    4---^---3     #")
renderLine(11 , "#                  #")
renderLine(12 , "####################")

oxyd_shuffle()

-- Special
set_actor("ac-blackball", 2.5,7.5, {player=0})                    
    ]]></el:luamain>
    <el:i18n>
      <el:string el:key="title">
        <el:english el:translate="false"/>
      </el:string>
    </el:i18n>
  </el:protected>
</el:level>
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<el:level xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://enigma-game.org/schema/level/1 level.xsd" 
xmlns:el="http://enigma-game.org/schema/level/1";>
  <el:protected>
    <el:info el:type="level">
      <el:identity el:title="Collision physics 5" el:subtitle="" el:id="c5"/>
      <el:version el:score="1" el:release="1" el:revision="0" 
el:status="stable"/>
      <el:author el:name="Raoul Bourquin" el:email="" el:homepage=""/>
      <el:copyright>Copyright © 2007 Raoul Bourquin</el:copyright>
      <el:license el:type="GPL v2.0 or above" el:open="true"/>
      <el:compatibility el:enigma="0.92">
      </el:compatibility>
      <el:modes el:easy="false" el:single="true" el:network="false"/>
      <el:score el:easy="-" el:difficult="-"/>
    </el:info>
    <el:luamain><![CDATA[
-- GENERAL --
levelh = 13
levelw = 20

create_world(levelw, levelh)

forcex = -2
forcey = -2

spacefriction = 0

function renderLine( line, pattern)
    for i=1, strlen(pattern) do
        local c = strsub( pattern, i, i)
        if c=="#" then
            set_stone("st-glass",i-1,line)
            set_floor("fl-sahara",i-1,line)
        elseif c==" " then
            set_floor("fl-sahara",i-1,line)
        elseif c=="-" then
            set_floor("fl-space",i-1,line,{friction=spacefriction})

        elseif c==">" then
            set_floor("fl-space",i-1,line, {force_x = forcex, force_y = 0, 
friction=spacefriction})
            set_actor("ac-whiteball-small", i-1+0.5, line+0.5, {controllers=0})
        elseif c=="<" then
            set_floor("fl-space",i-1,line, {force_x = -forcex, force_y = 0, 
friction=spacefriction})
            set_actor("ac-whiteball-small", i-1+0.5, line+0.5, {controllers=0})
        elseif c=="v" then
            set_floor("fl-space",i-1,line, {force_x = 0, force_y = forcey, 
friction=spacefriction})
            set_actor("ac-whiteball-small", i-1+0.5, line+0.5, {controllers=0})
        elseif c=="^" then
            set_floor("fl-space",i-1,line, {force_x = 0, force_y = -forcey, 
friction=spacefriction})
            set_actor("ac-whiteball-small", i-1+0.5, line+0.5, {controllers=0})

        elseif c=="1" then
            set_floor("fl-space",i-1,line, {force_x = forcex, force_y = forcey, 
friction=spacefriction})
            set_actor("ac-whiteball-small", i-1+0.5, line+0.5, {controllers=0})
        elseif c=="2" then
            set_floor("fl-space",i-1,line, {force_x = -forcex, force_y = 
forcey, friction=spacefriction})
            set_actor("ac-whiteball-small", i-1+0.5, line+0.5, {controllers=0})
        elseif c=="3" then
            set_floor("fl-space",i-1,line, {force_x = -forcex, force_y = 
-forcey, friction=spacefriction})
            set_actor("ac-whiteball-small", i-1+0.5, line+0.5, {controllers=0})
        elseif c=="4" then
            set_floor("fl-space",i-1,line, {force_x = forcex, force_y = 
-forcey, friction=spacefriction})
            set_actor("ac-whiteball-small", i-1+0.5, line+0.5, {controllers=0})

        end
    end    
end

renderLine(00 , "####################")
renderLine(01 , "#11111#      #22222#")
renderLine(02 , "#11111#      #22222#")
renderLine(03 , "#11111#      #22222#")
renderLine(04 , "#11111#      #22222#")
renderLine(05 , "#11111#      #22222#")
renderLine(06 , "####################")
renderLine(07 , "#44444#      #33333#")
renderLine(08 , "#44444#      #33333#")
renderLine(09 , "#44444#      #33333#")
renderLine(10 , "#44444#      #33333#")
renderLine(11 , "#44444#      #33333#")
renderLine(12 , "####################")

oxyd_shuffle()

-- Special
set_actor("ac-blackball", 10.5,3.5, {player=0})                    
    ]]></el:luamain>
    <el:i18n>
      <el:string el:key="title">
        <el:english el:translate="false"/>
      </el:string>
    </el:i18n>
  </el:protected>
</el:level>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]