irrflight_chung free flight simulator in freebasic

User projects written in or related to FreeBASIC.
Frank Dodd
Posts: 444
Joined: Mar 10, 2006 19:22

Post by Frank Dodd »

Hi here are three small programs that can be saved into the irrflight_chung directory to test some simple graphical effects. it would be interesting to see how they work for you. but I am suspecting that it is the sound that is at fault.

Code: Select all

#include "my_irr_wrapper.bi"

IrrStart( IRR_EDT_OPENGL, 400, 200, IRR_BITS_PER_PIXEL_32,_
          IRR_WINDOWED, IRR_NO_SHADOWS, IRR_IGNORE_EVENTS,_
          IRR_VERTICAL_SYNC_ON )

IrrSetWindowCaption( "Example 01: Hello World" )

IrrAddStaticText( "Hello World", 4,0,200,16, IRR_GUI_NO_BORDER, IRR_GUI_NO_WRAP )

WHILE IrrRunning
    IrrBeginScene( 255,255,255 )
    IrrDrawGUI
    IrrEndScene
WEND

IrrStop

Code: Select all

#include "my_irr_wrapper.bi"

IrrStart( IRR_EDT_OPENGL, 200, 400, IRR_BITS_PER_PIXEL_32, _
        IRR_WINDOWED, IRR_SHADOWS, IRR_IGNORE_EVENTS )

DIM as irr_mesh MD2Mesh = IrrGetMesh( "./objects/axe.obj" )
DIM as irr_texture MeshTexture = IrrGetTexture( "./objects/axe.jpg" )

DIM as irr_node SceneNode = IrrAddMeshToScene( MD2Mesh )

IrrSetNodeMaterialTexture( SceneNode, MeshTexture, 0 )
IrrSetNodeMaterialFlag( SceneNode, IRR_EMF_LIGHTING, IRR_OFF )

IrrAddCamera( 50,0,0, 0,20,0 )

WHILE IrrRunning
    IrrBeginScene( 240, 255, 255 )
    IrrDrawScene
    IrrEndScene
WEND

IrrStop

Code: Select all

#include "my_irr_wrapper.bi"

IrrStart( IRR_EDT_OPENGL, 800, 600, IRR_BITS_PER_PIXEL_32, _
        IRR_WINDOWED, IRR_NO_SHADOWS, IRR_IGNORE_EVENTS )

DIM as irr_terrain Terrain = IrrAddTerrain( "./map0/media/terrain-heightmap2.jpg" )
DIM as irr_node TerrainNode = Terrain
IrrSetNodeScale( TerrainNode, 40.0, 4.4, 40.0 )

DIM as irr_texture TerrainTexture0 = IrrGetTexture( "./map0/media/terrain-heightmap2.jpg" )

IrrSetNodeMaterialTexture( TerrainNode, TerrainTexture0, 0 )

IrrSetNodeMaterialFlag( TerrainNode, IRR_EMF_LIGHTING, IRR_OFF )

DIM as irr_camera Camera = IrrAddFPSCamera( IRR_NO_OBJECT, 100.0f, 0.1f )

IrrHideMouse

WHILE IrrRunning
    IrrBeginScene( 240, 255, 255 )
    IrrDrawScene
    IrrEndScene
WEND

IrrStop
chung
Posts: 648
Joined: Jan 16, 2010 20:52
Location: France
Contact:

Post by chung »

(30/05/2010) kfps type reset to float
Important !!! i mistakenly changed kfps type from float to integer, which resulted in irregular fluidity of the game.I have reset it to float.
My apologize !
chung
Posts: 648
Joined: Jan 16, 2010 20:52
Location: France
Contact:

Post by chung »

(05/06/2010) exit by window close bug fixed .I have restored a program change which could cause task remain with the sound...if you exit by closing the window with the mouse instead of the escape key. It should work again now.
chung
Posts: 648
Joined: Jan 16, 2010 20:52
Location: France
Contact:

Post by chung »

(22/06/2010) shooting changed
(23/06/2010) change airships number added (3..10) (ctrl+S keys)
chung
Posts: 648
Joined: Jan 16, 2010 20:52
Location: France
Contact:

Post by chung »

(25/06/2010) dammaged airships smoke added
chung
Posts: 648
Joined: Jan 16, 2010 20:52
Location: France
Contact:

Post by chung »

(13/07/2010) change keyboard added (ctrl+K) AZERTYQW <-> QWERTYAZ ...
chung
Posts: 648
Joined: Jan 16, 2010 20:52
Location: France
Contact:

Post by chung »

(27/08/2010) tank mode with combat added.

now you can combat other tanks in your tank.

=> http://chungswebsite.blogspot.com/searc ... ight_chung

Image
chung
Posts: 648
Joined: Jan 16, 2010 20:52
Location: France
Contact:

Post by chung »

(10/11/2010) enhanced sunshine

Image
chung
Posts: 648
Joined: Jan 16, 2010 20:52
Location: France
Contact:

Post by chung »

(01/08/2011) cockpit display compatibility bug corrected
Mihail_B
Posts: 273
Joined: Jan 29, 2008 11:20
Location: Romania
Contact:

Post by Mihail_B »

chung wrote: ...
... i was working on my network support for pacman2 and suddenly i was
just thinking :
- what if we/you add network support to ChungFlightSim ?

We just have to agree on some [DATA structure] which my already finnished net module can update .

you will need to create only some variables in which I'll store input data from other users.
the server will :
1)apply inputs from all clients;
2)send to all other clients ONLY the postions of the changed objects

the client will :
1)send user keyboard inputs to SERVER
2)paint the screen
3)receive OBJECTS postions
4)NOT COMPUTE anything else BUT ONLY RENDER and SEND user keyboard inputs

this shuld be fast ...

What do you think about this ?
I'll be very happy, if you agree !

best regards
P.S.: no problem if you are busy with something else or whatever !
chung
Posts: 648
Joined: Jan 16, 2010 20:52
Location: France
Contact:

Post by chung »

i have programmed a multiplayer feature on a dedicated hosted website server for my game "fly_earth_chung" but didnt test it with other computers.
(it works if i run multiple instances of the program on my single computer but it is not significative and low fps on my netbook).

you can test it here => http://chungswebsite.blogspot.com/searc ... arth_chung

up to 8 players should appear if in radar range, or max 100 in globe map mode, but not tested.

i use ajax to communicate with the server and send both positions,timestamps and speed to interpolate.the server is written in python (constraint by appspot, the google apps host)


how does your multiplayer mode work ? : by connecting to players IP's and sending sockets or by a dedicated website server ?

how many max players do you expect ?
Mihail_B
Posts: 273
Joined: Jan 29, 2008 11:20
Location: Romania
Contact:

Post by Mihail_B »

removed by Mihail_B aka Zdupy
Post Reply