Page 2 of 5 FirstFirst 1234 ... LastLast
Results 11 to 20 of 48

Thread: AirDogs 1942, a TBDI sample game

  1. #11
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: AirDogs 1942, a TBDI sample game

    Mike,

    I had some time today to test AirDogs 1942 game.
    I tested on my laptop that has no any DI devices so consider it a non ideal situation. Here my observations:
    • if I change
      dim xRes as long = 640
      dim yRes as long = 480
      to
      dim xRes as long = 1024
      dim yRes as long = 768
      initial menu is not centered (or redimensioned). The same happen if TBGL window is redimensioned at runtime by manual operation.

    • if TBGL window is redimensione at runtime while paying game (let say you start from 640x480 and than make TBGL bigger) the new game playground is not considered by planes that continue to see previous logical size.

    • Using up/down arrows while in initial menu takes more than 2 second to to move current active menu. Maybe it can me related to the fact I've no DI devices. While inside RenderMenu function I get only 1 FPS.



    I will test more maybe this evening when home. I will have joystick.

    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  2. #12

    Re: AirDogs 1942, a TBDI sample game

    1) The game is not ment to be played at bigger resolutions.
    2) Because of the lag, could it be that you have vertical sync off?

  3. #13
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: AirDogs 1942, a TBDI sample game

    All other TBGL scripts run as expected at big FPS.

    Also AirDogs 1942 works as expected once inside the game. It is just the menu that has this problem. As soon as I'm inside the game, it is perfect!
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  4. #14
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: AirDogs 1942, a TBDI sample game

    I limited the problematic part. If I comment the following commented part in RenderMenu function all run at high speed.

    [code=thinbasic]
    ...
    tbgl_PushMatrix
    tbgl_Translate 320, 100, 0
    for j = 1 to 5
    if j = actmenu then
    tbgl_Color 255,255,255
    else
    tbgl_color 200,200,200
    end if
    ' tbgl_BindTexture %mnplate+j ' Sets texture #1 as actual
    ' tbgl_BeginPoly %GL_QUADS
    ' tbgl_TexCoord2D 0, 0
    ' tbgl_Vertex -64, -20+j*46, 0

    ' tbgl_TexCoord2D 1, 0
    ' tbgl_Vertex 64, -20+j*46, 0
    '
    ' tbgl_TexCoord2D 1, 1
    ' tbgl_Vertex 64, 20+j*46, 0
    '
    ' tbgl_TexCoord2D 0, 1
    ' tbgl_Vertex -64, 20+j*46, 0
    ' tbgl_EndPoly
    next
    tbgl_PopMatrix
    TBGL_ResetMatrix
    tbgl_drawframe
    ...
    [/code]

    But of course menu items are not on screen.

    Going home now. I will test more later.

    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  5. #15
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: AirDogs 1942, a TBDI sample game

    Eros,

    1 FPS is a bit scary.
    Such a low FPS you should not get even in case OpenGL falls to software mode on your dual core monster.
    Try to comment out TBDI commands, maybe some device lags it ? ( but this is highly unprobable ).

    Here is slightly more optimized ( still not to maxx ) RenderMenu procedure:
    [code=thinBASIC]
    '*-------------------------------------------------------*
    '* drawMenu *
    '*-------------------------------------------------------*
    sub RenderMenu()
    local pressed as long
    local jx as long

    pressed = %FALSE

    tbgl_GetAsyncKeyState(-1) ' Resets keys status before checking

    tbgl_UseAlphaTest 1
    tbgl_AlphaFunc %tbGL_GREATER, 0.5
    tbgl_UseDepth 0 ' No depth - it's useless for smokes, it will look better without it
    tbgl_Uselighting 0 ' No light
    tbgl_usetexture 1 ' Texturing on

    while IsWindow(hWnd)

    'FPSCount = TBGL_GetFramerate 'help_CalcFramerate

    ' *******************************
    ' * RENDERING THE SCENE *
    ' *******************************
    tbgl_RenderMatrix2D
    tbgl_ClearFrame

    tbgl_BindTexture %mnPlate ' Sets texture #1 as actual

    tbgl_PushMatrix
    tbgl_backColor 0, 67,171
    tbgl_Color 255,255,255
    tbgl_Translate 320, 240, 0

    ' We will map player texture to square polygon

    tbgl_BeginPoly %GL_QUADS
    tbgl_TexCoord2D 0, 0
    tbgl_Vertex -128, -128, 0

    tbgl_TexCoord2D 1, 0
    tbgl_Vertex 128, -128, 0

    tbgl_TexCoord2D 1, 1
    tbgl_Vertex 128, 128, 0

    tbgl_TexCoord2D 0, 1
    tbgl_Vertex -128, 128, 0
    tbgl_EndPoly

    tbgl_PopMatrix

    tbgl_PushMatrix
    tbgl_Translate 320, 100, 0
    for j = 1 to 5
    if j = actmenu then
    tbgl_Color 255,255,255
    else
    tbgl_color 200,200,200
    end if
    tbgl_BindTexture %mnplate+j ' Sets texture #1 as actual
    tbgl_BeginPoly %GL_QUADS
    tbgl_TexCoord2D 0, 0
    tbgl_Vertex -64, -20+j*46

    tbgl_TexCoord2D 1, 0
    tbgl_Vertex 64, -20+j*46

    tbgl_TexCoord2D 1, 1
    tbgl_Vertex 64, 20+j*46

    tbgl_TexCoord2D 0, 1
    tbgl_Vertex -64, 20+j*46
    tbgl_EndPoly
    next
    tbgl_PopMatrix

    tbgl_drawframe

    if tbgl_getwindowkeyonce(hWnd,%VK_DOWN) THEN actmenu = actmenu - 1
    if tbgl_getwindowkeyonce(hWnd,%VK_UP) THEN actmenu = actmenu + 1

    jx = tbdi_joyY(0)
    if Pressed = %TRUE and jx > -10 and jx < 10 then
    pressed = %FALSE
    end if
    if Pressed = %FALSE and jx < -10 then
    pressed = %TRUE
    actmenu = actmenu + 1
    end if
    if Pressed = %FALSE and jx > 10 then
    pressed = %TRUE
    actmenu = actmenu - 1
    end if

    If actmenu = 6 then actmenu = 1
    If actmenu = 0 then actmenu = 5
    if TBDI_JoyButton(0,2) <> 0 then exit while
    if GetAsyncKeyState(%VK_RETURN) THEN exit while
    wend

    end sub
    [/code]

    This code runs 400 FPS on my PC with onboard GeForce 6150, your Radeon is much faster !


    Bye,
    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  6. #16

    Re: AirDogs 1942, a TBDI sample game

    Where did you enhance it?

  7. #17
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: AirDogs 1942, a TBDI sample game

    Eros,

    I found the problem !

    Menu items textures are not sized in power of two - 128x40! Me and Mike have 3D card with correct OpenGL 2.0 implementation - non power of two textures cause no trouble.
    It seems your release of ATi drivers does not do non-power of two textures on hardware.

    My excuse ;D : TBGL manual says only power of two textures are allowed.

    So just copy attached modified textures ( 128x64 ) to your AirDogs \ Textures.
    You should get no hurt in quality ( as I stretched them vertically, program will map them on smaller height ) and I am almost 100% sure you won't get 1 FPS anymore.


    Bye,
    Petr
    Attached Files Attached Files
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  8. #18
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: AirDogs 1942, a TBDI sample game

    Mike,

    just little change - state controlling variables are moved before loop, there is no need to request alpha testing ( for example ) in every iteration. Once you set the state, it is set on until you switch it off.
    In fact my change was just cosmetic, on todays hardware it makes not so big difference.

    But this was not cause of the problem, that were NPOT textures.


    Bye,
    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  9. #19

    Re: AirDogs 1942, a TBDI sample game

    Ok, I thought the power of two counts only for the X axxis.

  10. #20
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: AirDogs 1942, a TBDI sample game

    Sadly not,

    I will accent it more in TBGL helpfile.

    Fastest are square shaped textures ( 512x512, ... ), rectangular textures with power of two sides ( 512x256, ... ) are similar in speed too.

    Non power of two are part of OpenGL natively ( not just via extension ) from OpenGL 2.0.
    They are more comfortable then the previous mentioned, but they generally *should* be slowest.

    This does not apply on my PC as it seems to perform well all 3 cases, but power of two textures are slightly easier to filter when you think of it.


    Bye,
    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

Page 2 of 5 FirstFirst 1234 ... LastLast

Similar Threads

  1. GPF with AirDogs and TB 1.6.0.4
    By Michael Hartlef in forum thinBasic General
    Replies: 23
    Last Post: 21-04-2008, 21:48

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •