Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Anyone got some pointers on how to impliment this please....

Author
Message
Obear
23
Years of Service
User Offline
Joined: 13th Oct 2002
Location:
Posted: 12th Apr 2003 22:35
Hi chaps.

OK bear with me here and ill try and explaine myself.

Im designeing a flight sim type of thing, now what i want to do is have various aircraft with varying abilitys based on its designe.

What im trying to do is create some aircrfat modles in parts, wings engine, tail, fusealarge etc.

To each of these parts i wish to give various variables, for example the main wings i wish to give varying LIFT variables, engines i wish to give various THRUST and WEIGHT variables, fusealarge i wish to give varying weight and airodinamic variables.

Then when these components are placed togeather in game to make up an aircraft the whole object will have the values assined to it giveing it a performace value

weight against lift, drag and airodinamics against thrust.

And so when in game these values will give each plane its own handerling abilitys.

Now when in game, say a wing gets shot off there will be no lift on that wing and so it will affect the whole aircraft.

Now the prolem i have is how to impliment the varibles for each modle or wing, tail etc into the game.

IM thinking of arrays to store the values of the componets (wing etc)but my mind is going blank when i try and think of how i take the varibles from the array and assign them to each modle item (wing, tail, etc) depending on which modle part is choosen for the aircraft, and setting up a PERFORMANCE chart/modle/array that can be instantly accessed in the main game loop to give the aircraft its handerlign ability.

OK i hope i made sence there. Im just after a direction in which to go to let me collect the various values for each PART and as the game is being played have them stored in some kind of PERFORMACE chart type thing that will be accessed every loop as the aircrfat flys.

Im just not sure how to go about this part, my mind is blank.

any suggestions would be of help, thanks
Hamish McHaggis
23
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 13th Apr 2003 02:36
You could have the arrays..

lift(x,y)
thrust(x,y)
drag(x,y)
etc...

'x' is the type of part (fuselage, wings, tail...) and 'y' is the number part that it is, eg - "wings 1", "wings 2", "wings 3"

Then you could assign values to them beforehand, outside of your main loop, with either a negative value (decreases the performance) or a positive value (increases performance)...

rem Wings 1
thrust(1,1)=-2
lift(1,1)=6
drag(1,1)=3

rem Wings 2
thrust(1,2)=4
lift(1,2)=2
drag(1,2)=-4

rem Fuselage 4
thrust(2,4)=5
lift(2,4)=2
drag(2,4)=-7

Then you could assign these values to some temporary variables (arrays) when they are chosen (chosen1 and chosen2 are the variables for the chosen part)...

temp_lift(1)=lift(1,chosen1) : rem Lift for the chosen wings
temp_thrust(1)=thrust(1,chosen1) : rem Thrust for the chosen wings
temp_lift(2)=lift(2,chosen2) : rem Lift for the chosen fuselage
temp_thrust(2)=thrust(2,chosen2) : rem Thrust for the chosen fuselage

You could then add the variables together to get the total amount of each attribute that is added/taken away...

rem Calculate total thrust
for l=1 to 5
total_thrust=total_thrust+temp_thrust(l)
next l

You would then have a value, either negative or positive, which you could add to a default value for that attribute, say 10...

actual_thrust=10+total_thrust

If you do that for all the attributes you would then end up with a final specification of your aircraft. It would be simple to access them from the in game screen then. So this is a summary of what you could do...

- Assign values for each aircraft piece
- Player chooses their aircraft pieces and values are assigned to variables
- Add all chosen aircraft attributes together
- Add the result to a default value

Hope I helped, ask any questions if you dont understand, I hope I understood your question correctly.

Why the hell'd you ask me for crying out loud!?!

Athelon XP 1400 Plus - Nvidia Geforce MX400 - 256mb RAM
Obear
23
Years of Service
User Offline
Joined: 13th Oct 2002
Location:
Posted: 14th Apr 2003 01:35
Hmmm some ideas there for sure, thanks alot

Hamish McHaggis
23
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 14th Apr 2003 01:54
Ha ha, yeah I did write quite alot in the end didn't I, did they help at all?

Why the hell'd you ask me for crying out loud!?!

Athelon XP 1400 Plus - Nvidia Geforce MX400 - 256mb RAM

Login to post a reply

Server time is: 2026-06-11 17:32:53
Your offset time is: 2026-06-11 17:32:53