Game Programming and Development Tools

Hello! I – pabloaiz

pabloaiz

Member

Posts: 48
From: Tulsa, CA, US
Registered: 12-06-2003
Hey Dudes!


Wassup my dogs? Let me introduce myself, my name is Pablo, I'm 16, and I skate and live in front of my PC screen...(LOL, j/k about living in front of my PC screeen). Anyway, It's GREAT to find a Christian coding community!!

As a teen, I suppose the world is diff- I have about 20 buddies on my buddie list that work on games and such, (and I with them). It's pretty hard as I'm sure most of you know, (and I will recognize), how teens can be. Stubborn-they dont want no one to tell them what to do and it's so hard to tlak to them about Jesus. Talking with them all day, it's great to end the day at this forum where I can relax and let go of everything..so thanx again!!

Annyway I'm getting off topic, I have 2 questioons:

1 Can annone help me with programming aircraft physics, (using variables and such)??

2. Annyone know about/have BLITZ3D??

THANKS AGAIN!! please reply soon!

PS: Any teen-agers here? I hope so...sorry if I sounded a bit too 'street-style' for you older dudes out there.

------------------
"I want to know how God thinks- everything else is a detail..."-Albert Einstein

[This message has been edited by pabloaiz (edited December 06, 2003).]

CobraA1

Member

Posts: 926
From: MN
Registered: 02-19-2001
Welcome to CCN!

Hey there, wassup?

quote:

Annyway I'm getting off topic, I have 2 questioons:

Sure, love to help.

quote:

1 Can annone help me with programming aircraft physics, (using variables and such)??

Got a physics book? High School will do fine for a basic simulation. You're gonna want to know about vectors, and how to add them. Each vector stands for a force acting on the aircraft. The basic forces are: Lift, which makes the airplane go up - remember, lift is relative to the aircraft, not the ground. Gravity, which always pulls down relative to the ground. Drag, which always is opposite of the plane's actual direction, even if the airplane isn't pointing where it's going. Thrust, which is always straight forward relative to the aircraft. Those should be enough for a basic sim, but be aware that you're probably not going to be as accurate as Microsoft's Flight Simulator - complex flight sims do stuff like flight envelopes to make things more realistic, but stuff like that is harder to program.

quote:

2. Annyone know about/have BLITZ3D??

You've come to the right forum. If I remember correctly, Christian Coders has some good articles on Blitz Basic, take a look around.

quote:

PS: Any teen-agers here? I hope so...sorry if I sounded a bit too 'street-style' for you older dudes out there.

I don't mind.

------------------
There are only 10 types of people - those who understand binary, and those who don't.
Switch Mayhem now available! Get it here
Codename: Roler - Planning, writing GFX basecode.

ArchAngel

Member

Posts: 3450
From: SV, CA, USA
Registered: 01-29-2002
hey homie.

yeah, teen right here.

sry, not familiar with Blitz, but lotta people here are, i think...

I might be able to help with some physics, preferably on the math/calculus side. CobraA1 seems to be better at physics than me.

and if they're annoyed by "street-style," they're problem. tho I doubt they will. they're cool people. tho, I can't guarantee that they'll understand you...

------------------

AmazingJas

Member

Posts: 437
From: Sydney, NSW, AUSTRALIA
Registered: 04-03-2003
Cheers mate, not a teen, but am an Australian which is almost as bad

I do a bit of Blitz 3D and have been working on some helicopter physics. I made a little level which works a bit like the helicopters in the Desert Combat Mod for Battlefield 1942. I didn't use vectors though, (although I know that is the best way), I make my own bodgy physics and half the time they work out ok, the other half times I go cry to my PHD in Mathematics brother and he does the formulas for me

zookey

Member

Posts: 1902
From: Great Falls, Montana, USA
Registered: 04-28-2002
I Haven't been a teen for 3 months lol (just turned 20)----don't worry about the street style stuff-------T-Bone is cool and that is his style:-) Sorry, I am not a coder I am script writer and (a fancy word AthiestAdmirer taught me) conceptualist----------but either way welcome!

------------------
Ignorance is bad, if you have it you will not have a good time.

pabloaiz

Member

Posts: 48
From: Tulsa, CA, US
Registered: 12-06-2003
Well, cobra1-I already got those basic flight physics down-my simulator works ok- but I want something more realistic. Maybe this would be a lot of work? Maybe so...but I would love to try. About the lift thrust, ect. I know about that-(I'm a aircraft-crazy person), but I would like to know how I can include them into my programming. I will show you what I basically have for now in common words-not code, since not everyone here knows BLITZ:

var, (variable) speed# (# = floating point)
var weight_force_on_plane#
var throttle_percentage

if key a is pressed:
if throttle_percentage < 100
throttle_percentage = throttle_percentage + 5
EndIf
EndIf

if key q is pressed:
if throttle_percentage > 0
throttle_percentage = throttle_percentage - 5
EndIf
EndIf

If speed# < throttle_percentage
speed# = throttle_percentage
EndIf

speed# = speed# * .99 (friction)

weight_force_on_plane# = 5 - (speed# * .1) [It'll be able to have enough lift for flight at 50% throttle]

move the plane down at 'weight_force_on_plane#'
move the plane on it's own z axis at 'speed#'

It's not exacly like that, but close-but as you can see, works-but very primitively.... can annyone help? I dont mind starting from scratch.

------------------
"I want to know how God thinks- everything else is a detail..."-Albert Einstein

CobraA1

Member

Posts: 926
From: MN
Registered: 02-19-2001
Okaaaay, we're going to need to do some work here .

First of all, unless you like your aircraft flying in only one direction, all of your vectors need to be 3D. I hope you did that in your real code .

For a better look at flight theory and more of the physics involved, look here.

First of all, express everything as forces. That will make things easier and realistic.

The central equation is F=ma where F is the force, m is the mass of the airplane, and a is the acceleration.

Therefore, thrust is not directly related to speed, but rather to acceleration!

Friction should be directly related to velocity, and should exert a force, instead of taking .99 off speed.

Let's take a look at how to implement it, we'll assume one dimension for now:

Do thrust:
force1 = throttle

friction:
force2 = -(speed * friction_constant)

Add all of the forces:
force_final = force1 + force2

Calculate acceleration:
acceleration = force_final / aircraft_mass

Do the same for the other forces, and remember to do it all in 3D, and things should work better.

After that, you should also look into various limiting factors:

- Stall speed - Below a certain speed, the plane should "stall." The plane should, of course, be going faster than this before attempting to take off .

- you've already got the maximum speed limited by friction with my new equations.

- As altitude increases, the lift should decrease as the atmosphere gets too thin for the control surfaces and the wing.

------------------
There are only 10 types of people - those who understand binary, and those who don't.
Switch Mayhem now available! Get it here
Codename: Roler - Planning, writing GFX basecode.

[This message has been edited by CobraA1 (edited December 07, 2003).]

[This message has been edited by CobraA1 (edited December 07, 2003).]

AmazingJas

Member

Posts: 437
From: Sydney, NSW, AUSTRALIA
Registered: 04-03-2003
You could use force calculations on different parts of the plane to get more realistic effects like spiralling out of control and stuff. Maybe the wing tips, nose and rear.
pabloaiz

Member

Posts: 48
From: Tulsa, CA, US
Registered: 12-06-2003
Ok, this is great help. But I need a bit more of help in actually fitting all these calculations into my program...
So far, I think these are good enough :(?)
drag_mesurem# = (total aircraft drag to dynamic pressure- how do I do that?!)
wing_area# = 8(squared?)
air_density# = 1.1
gravity# = 9.806
lift_co# = 1.2

momentum# = mass# * velocity#
weight# = mass# * gravity#
lift# = lift_co# * ((air_density#* (velocity# * velocity#)) * 0.5) * wing_area
drag# = drag_mesurem# * ((air_density#* (velocity# * velocity#)) * 0.5) * wing_area

Well, that's what I gots for now... but I dont know if I did the calculations right? I need to find some way to work them through my code commands, (like EntityMove, EntityTranslate, ect).

So... help please?
LOL

PS: Thanks everyone for helping- the finishing of this flight sim is VERY important to me! Thanx again!


------------------
"I want to know how God thinks- everything else is a detail..."-Albert Einstein

[This message has been edited by pabloaiz (edited December 09, 2003).]

GUMP

Member

Posts: 1335
From: Melbourne, FL USA
Registered: 11-09-2002
http://opende.sourceforge.net/
pabloaiz

Member

Posts: 48
From: Tulsa, CA, US
Registered: 12-06-2003
wow..quick reply-but can I use tha with BLITZ? And even if I can.. I want to be able to understand what I'm coding-maybe to this by code isntead of using other sources/libraries/whatever it's called. LOL

So... can anyone help me?

------------------
"I want to know how God thinks- everything else is a detail..."-Albert Einstein

Wacko4X

Member

Posts: 92
From: Bellvue, WA, USA
Registered: 08-21-2002
quote:

If speed# < throttle_percentage
speed# = throttle_percentage
EndIf


I cant say I am an expert programmer or that I have programmed anything with physics but I do have one question about the above quote.

Shouldnt it be changed to:
If speed# != throttle_percentage
speed# = throttle_percentage
EndIf

You know, just incase later on you screw up some sort of speed calculation or if something is misplaced?
WaCkO

------------------
"Do or do not!, there is no try." ~ Yoda

[This message has been edited by Wacko4X (edited December 09, 2003).]

[This message has been edited by Wacko4X (edited December 09, 2003).]

pabloaiz

Member

Posts: 48
From: Tulsa, CA, US
Registered: 12-06-2003
Well, if you've played a flight simulation or know a bit about planes, on an airplane, you select a throttle position and the engine keeps on producing that output, once you lower the throttle, lowers the output too. Since it is producing less output, friction slows it down to that lowered setting. If the throttle is increased the engine output increases again, so basically:

if the throttle is increased, the engine increases thrust till it equals the increased setting if the throttle is lowered friction slows it till it equals the decreased setting...

So, no, that part of the code is correct.

Did I explain well? LOL Maybe not..

Anyway, help with physics?

------------------
"I want to know how God thinks- everything else is a detail..."-Albert Einstein