Basic programming language :: thinBasic Community
September 08, 2010, 05:52:48 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: RobotDuel - Game for 2 players: http://community.thinbasic.com/index.php?topic=305.0
 
  Home Help thinGaming Search Calendar Gallery Articles Donations Tags Media Center Login Register   *

thinBasic 1.8.0.0 is out !  :: See this post ( last update: 2010.03.07 ! )  :: Latest beta version: thinBasic beta 1.8.6.0 ( last update: 2010.08.02 ! )
Main menu
Members
Total Members: 526
Latest: jnash67
Stats
Total Posts: 26705
Total Topics: 3545
Online Today: 26
Online Ever: 121
(August 16, 2009, 07:08:32 am)
Users Online
Users: 1
Guests: 4
Total: 5
1 Spider, 4 Guests, 1 User
Bagamut
Google spider
Subject Statistics
Topic: AirDogs 1942, a TBDI sample game Replies: 47 posts
Read 13296 times 0 Members and 1 Guest are viewing this topic.
Pages: 1 2 3 4
  Add bookmark  |  Print  
Author Topic: AirDogs 1942, a TBDI sample game  (Read 13296 times)
0 Members and 1 Guest are viewing this topic.
Michael Hartlef
Creator of TBDI, TBAI and TBEM
Global Moderator
Hero Member
*****

Karma: 42
Offline

Gender: Male
Posts: 2955



« on: September 02, 2007, 10:57:17 am »

Hi folks,

after 3 weeks part time work, I proud to show off a little 2 player game.

I have to say thank you to Petr Schreiber for providing the TopDown3D
sources as they helped a lot during the development.

The game is called AirDogs 1942 and is a WW2 dogfighting game. It's not 100% finished
but allready fun to play. My son and I enjoy it very much.

The controls are simple:

JoyY to go faster or slower, or UP and Down
JoyX to turn
Button 1 to shot
Button 2 to select

If no joystick is connected, you ADWS and space    or LEFT,RIGHT,UP,DOWN,L

Once the bundle functionality is working again, I will create an exe for it.

Like allways, comments are welcome.

Take care
Michael

EDIT on June 7th, 2008: Updated the code with bug fixes and singler player code by Petr Schreiber. Also the menu buttons have a better size now so the FPS isn't dropping down anymore.
Attached files Thumbnail(s):


Other attached file(s):

* AirDogs1942_v11.zip (937.95 KB - downloaded 178 times.)
« Last Edit: June 07, 2008, 01:45:12 pm by Michael Hartlef » Logged
Petr Schreiber
Global Moderator
Hero Member
*****

Karma: 77
Offline

Posts: 5088


TBGL developer


WWW
« Reply #1 on: September 02, 2007, 12:03:10 pm »

Mike,

this is perfect !
Finally my joypad got some use Smile

Really good, nice and clean look ... fantastic !

I tried to use my PC steering wheel and joypad to control planes and it worked perfectly.


Good work!,
Petr



Logged

psch.thinbasic.com / forum
Information about ThinBASIC 3D programming and download of free TBGL tools.

WinXP Home SP3 - Sempron 3400+ @ 1.8GHz - 1Gb RAM @ 533 - NVIDIA GeForce 9500GT 512MB / NVIDIA GeForce 6200 TC
Michael Hartlef
Creator of TBDI, TBAI and TBEM
Global Moderator
Hero Member
*****

Karma: 42
Offline

Gender: Male
Posts: 2955



« Reply #2 on: September 02, 2007, 12:10:53 pm »

Steering wheel, not that is something. Thanks for the nice words.  Smile
Logged
Eros Olmi
Administrator
Hero Member
*****

Karma: 92
Offline

Gender: Male
Posts: 6314


thinBasic co-author


WWW
« Reply #3 on: September 02, 2007, 12:12:05 pm »

 Surprised FANTASTIC !
Thanks a lot to you for this astonishing example and for your new TBDI module. Tell me when you will be ready for official release.
Also a big thanks to your son, that I imagine he was your beta tester  ;D

I will play with my son too and will give you back impressions.

A big  :-*
Logged

www.thinbasic.com | community.thinbasic.compsch.thinbasic.com
Win7Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB
Michael Hartlef
Creator of TBDI, TBAI and TBEM
Global Moderator
Hero Member
*****

Karma: 42
Offline

Gender: Male
Posts: 2955



« Reply #4 on: September 02, 2007, 12:25:28 pm »

I can tell you, he had a blast.

The game isn't 100% finished because I was suffering from headaches and neckpains a lot this week. But the publisher made me releasing it.  ;D

I will work further on it, as I have some ideas.

Single player mode, different planes, options, maaaayyyyybe network playing.

It's a simple game but you can do a lot with it.
Logged
Eros Olmi
Administrator
Hero Member
*****

Karma: 92
Offline

Gender: Male
Posts: 6314


thinBasic co-author


WWW
« Reply #5 on: September 02, 2007, 12:31:55 pm »

It's a simple game but you can do a lot with it.

Well, not so simple. All is present: presentation, interface, multiple controllers plus keyboards, graphics, sprites, sounds. An impressive job, Mike.
Code is perfectly organized, clear. A joy to have a look for study purposes.
Logged

www.thinbasic.com | community.thinbasic.compsch.thinbasic.com
Win7Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB
Petr Schreiber
Global Moderator
Hero Member
*****

Karma: 77
Offline

Posts: 5088


TBGL developer


WWW
« Reply #6 on: September 02, 2007, 12:33:57 pm »

Mike,

I hope my work on new TBGL will go ok as till now,
when released, it will simplify even more whole source of AirDogs Wink

Just after playing Airdogs I finished attaching camera to entity which was making problems before,
so your game has brainhealing efffect too Smile


Bye,
Petr
Logged

psch.thinbasic.com / forum
Information about ThinBASIC 3D programming and download of free TBGL tools.

WinXP Home SP3 - Sempron 3400+ @ 1.8GHz - 1Gb RAM @ 533 - NVIDIA GeForce 9500GT 512MB / NVIDIA GeForce 6200 TC
Michael Hartlef
Creator of TBDI, TBAI and TBEM
Global Moderator
Hero Member
*****

Karma: 42
Offline

Gender: Male
Posts: 2955



« Reply #7 on: September 02, 2007, 12:37:22 pm »

Code is perfectly organized, clear. A joy to have a look for study purposes.

That was another goal I had. Writing a playable game in that short period and still having a codebase that is reusable and readable. Overall I put around 30-40 hours into it. It also helped me to figure out how fast and far I could come in a given timeframe.

Quote
has brainhealing efffect too

I'm glad I could help out here.  Smile I can't wait till you release it.
Logged
kent sarikaya
Hero Member
*****

Karma: 26
Offline

Gender: Male
Posts: 3228



WWW
« Reply #8 on: September 02, 2007, 09:59:32 pm »

Thanks Mike, as Eros said, you did a complete job, I really liked it from start to finish. A beautiful splashscreen, a nice menu, sound, sprites, action, and scenery, plus wide support of input. Excellent, thanks so much for the hard work and release!!!
Logged

Michael Hartlef
Creator of TBDI, TBAI and TBEM
Global Moderator
Hero Member
*****

Karma: 42
Offline

Gender: Male
Posts: 2955



« Reply #9 on: September 03, 2007, 05:40:04 am »

You're welcome.
Logged
Eros Olmi
Administrator
Hero Member
*****

Karma: 92
Offline

Gender: Male
Posts: 6314


thinBasic co-author


WWW
« Reply #10 on: September 04, 2007, 05:18:18 pm »

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
Logged

www.thinbasic.com | community.thinbasic.compsch.thinbasic.com
Win7Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB
Michael Hartlef
Creator of TBDI, TBAI and TBEM
Global Moderator
Hero Member
*****

Karma: 42
Offline

Gender: Male
Posts: 2955



« Reply #11 on: September 04, 2007, 06:37:34 pm »

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?
Logged
Eros Olmi
Administrator
Hero Member
*****

Karma: 92
Offline

Gender: Male
Posts: 6314


thinBasic co-author


WWW
« Reply #12 on: September 04, 2007, 06:48:10 pm »

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!
Logged

www.thinbasic.com | community.thinbasic.compsch.thinbasic.com
Win7Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB
Eros Olmi
Administrator
Hero Member
*****

Karma: 92
Offline

Gender: Male
Posts: 6314


thinBasic co-author


WWW
« Reply #13 on: September 04, 2007, 06:57:16 pm »

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

Code
...
     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
...
 


But of course menu items are not on screen.

Going home now. I will test more later.

Ciao
Eros
« Last Edit: September 04, 2007, 06:58:52 pm by ErosOlmi » Logged

www.thinbasic.com | community.thinbasic.compsch.thinbasic.com
Win7Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB
Petr Schreiber
Global Moderator
Hero Member
*****

Karma: 77
Offline

Posts: 5088


TBGL developer


WWW
« Reply #14 on: September 04, 2007, 07:03:06 pm »

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
  '*-------------------------------------------------------*
 '*                       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
 

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


Bye,
Petr
Logged

psch.thinbasic.com / forum
Information about ThinBASIC 3D programming and download of free TBGL tools.

WinXP Home SP3 - Sempron 3400+ @ 1.8GHz - 1Gb RAM @ 533 - NVIDIA GeForce 9500GT 512MB / NVIDIA GeForce 6200 TC
Tags: game tbdi TBGL 
Pages: 1 2 3 4
  Add bookmark  |  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC
TinyPortal v0.9.8 © Bloc
Valid XHTML 1.0! Valid CSS!


Google visited last this page August 15, 2010, 02:34:28 am