Flyer - a 2D flight simulation.

Hello,
I'd like to show You my new pet project - 2D flight simulation.
Features:
- somehow realistic flight model (if 2D flight model can be realistic 🙂 )
- damageable and partially breakable planes and other devices
- OpenGL rendering

See it here: http://pl.youtube.com/watch?v=b-adKB35Zjs&fmt=18
Code is here: http://code.google.com/p/flyer2d/
No binaries available at the moment.

It uses Boxc2D v. 2.0.1, Qt-4.3+/OpenGL for rendering. Developed exclusively on Linux, should "just work" on Windows, but I haven't tested it yet. If someone wants try it under Windows, best way to do it is to compile the code with MinGW

0.1 release will go out in few days (probably next weekend), there You can expect Windows (and Linux) binaries.

Planned features (in random order)
- many plane types (including helicopters),
- many weapons (bombs, rockets, etc)
- even more realistic damage management and instruments
- weather/daytime changes
- smart AI
- repairs and reloads ad airport
- ejection seat
- dynamic battlefield with ground vehicles
- huge world (at least 100km)
- smart AI
- networked game
- fun features, like: glider towing, in-air refueling
- nice dashboard with
- fun single-player missions

Probably I will manage to implement 10% of these 🙂.
this looks nice, i like the dogfighting. Is simulating fligh a difficult task or or is it just minor additions to what box2d offers?
zappBrannigan wrote:this looks nice, i like the dogfighting. Is simulating fligh a difficult task or or is it just minor additions to what box2d offers?


Actually, it's a minor addition. Box2D provides me with velocity vector and body position/orientation after each simulation step.
For aerodynamic-aware bodies I use these data to calculate airspeed, angle of attack, and to calculate resulting forces (lift and drag). Then these forces are put back to Box2D, which takes them into account during next step.

So all the hard stuff, like numerical solving, is done by Box2D. Not o mention collisions and contact forces used to calculate damage. I'm also using continuous physics for bullets: they are just tiny bodies moving with fast speed. This way damage from bullet hit is processed exactly the same way as damage from other collisions. Additionally - there are nice side-effects: bullets are less harmful when you run from shooter than when you ran toward shooter. Also: bullets are more harmful when hitting target's surface perpendicularly, otherwise then can slide, contributing less energy to the damage.
I'd really like to try this out. Was going to compile it myself (Ubuntu 8.04) but I've never handled a project using QT or .pro files before. Could you give a brief overview of your setup and perhaps some got-to-read-links?
TwoD wrote:I'd really like to try this out. Was going to compile it myself (Ubuntu 8.04) but I've never handled a project using QT or .pro files before. Could you give a brief overview of your setup and perhaps some got-to-read-links?

I was thinking of giving a windows compile a spin, but I noticed the QT dependency, so I stopped.

How 'embedded' is QT into your code? Would it be easy to replace with SDL? (www.libsdl.org)
TwoD wrote:I'd really like to try this out. Was going to compile it myself (Ubuntu 8.04) but I've never handled a project using QT or .pro files before. Could you give a brief overview of your setup and perhaps some got-to-read-links?


I'm using pretty standard setup (Kubuntu 8.04 64bit), nothing complicated. All you need is to install qt-4 development packages. All non-standard dependencies are included into source distribution (including Box12D itself). Also - at least until first release - you need Subversion client to get the source.

So:
1. get the source, in a way suggested by google's hosting page:

Code: Select all

svn checkout http://flyer2d.googlecode.com/svn/trunk/ flyer2d


2. Get into source directory, generate make file and build it:

Code: Select all

cd flyer2d
qmake-qt4 flyer.pro
make


3. If everything goes OK, you should have compiled binaries in fyler (and editor) sub directories.

Code: Select all

./flyer/flyer


You need to have hardware OpenGL implementation go get this working with decent speed.

If you encounter any problems, please, let me know.
Daid wrote:I was thinking of giving a windows compile a spin, but I noticed the QT dependency, so I stopped.

How 'embedded' is QT into your code? Would it be easy to replace with SDL? (http://www.libsdl.org)


You shouldn't have stopped 🙂
You can get easy-to-install Windows Qt package from this site: http://trolltech.com/developer/downloads/qt/windows , which also install MinGW (GNU compiler and tools for windows). So Qt really isn't a blocker.
Once you get Qt and MinGW installed, building instructions are identical like for Linux (see previous post). You only have to use 'MinGW/Qt console' available from Qt's start-menu directory, and probably simply use 'qmake' instead of 'qmake-qt4' for configuration.

QT is pretty much embedded into the code. I'm using it not only for GUI, but also for painting (using convenient QPainter interface to draw on OpneGL) and everything else. I'm using Qt's container classes and C++ extensions provided by it's meta-object system.

I was thinking about dumping Qt and using SDL instead, but I decided that such a project could be nice proof-of-concept for high-performance game build with Qt facilities. Also - I ad many experience and reusable code from my previous Box2D/Qtr project, the Construqtor ( http://code.google.com/p/construqtor/ )
macson_g wrote:
Daid wrote:I was thinking of giving a windows compile a spin, but I noticed the QT dependency, so I stopped.

How 'embedded' is QT into your code? Would it be easy to replace with SDL? (http://www.libsdl.org)

You shouldn't have stopped 🙂
You can get easy-to-install Windows Qt package from this site: http://trolltech.com/developer/downloads/qt/windows , which also install MinGW (GNU compiler and tools for windows). So Qt really isn't a blocker.
Once you get Qt and MinGW installed, building instructions are identical like for Linux (see previous post). You only have to use 'MinGW/Qt console' available from Qt's start-menu directory, and probably simply use 'qmake' instead of 'qmake-qt4' for configuration.
I stopped not because QT would give me troubles under windows. But because of QT. I don't like QT, not for the interface, not for the API. But for the build system. It's a library, it should behave as a library. I expect to use a library you need to include it's header files, and link in the library. Not be forced to use some other build system.

So much for my silly QT rant. Good luck with the project, looks like great fun.
Ah, figured I'd need to generate a Makefile, just didn't know how. Thanks for that info!

I stumbled upon a problem however. When running make, I get "No rule to create target '../lib/libflyercommon.a' which is needed for 'flyer'. Stopping."

I'll try fiddling with it a bit more later tho.

Btw, which IDE are you using? I've been trying to get Code::Blocks to use custom Makefiles without success (as many sources don't come with project files and I feel a bit more comfortable with a GUI). Well it does find and run the Makefile but the one I tested begins with checking for a file generated by configure before including it, which fails even tho it is there...

UPDATE: I managed to compile it now, not sure why it suddenly worked, I just compiled some sub-xxx and then tried the default again...
TwoD wrote:Btw, which IDE are you using? I've been trying to get Code::Blocks to use custom Makefiles without success (as many sources don't come with project files and I feel a bit more comfortable with a GUI). Well it does find and run the Makefile but the one I tested begins with checking for a file generated by configure before including it, which fails even tho it is there...
Code::Blocks custom makefiles should work, or rather, I've used it at least once. But you might need to set the make tool in the compiler. Also, use the SVN version, they are pretty stable and fix a few quite irritating build bugs.

Original thread: https://box2d.org/forum/viewtopic.php?t=1497