See site in english Voir le site en francais
Website skin:
home  download  forum  link  contact

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

Author Topic: Question for dan about implementing a live astronaut in another vessel  (Read 1851 times)

0 Members and 1 Guest are viewing this topic.

Offline toadtal

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
02 February 2006, 05:36:36
HI, currently I am a member of the NASSP project (hompage: nassp.sourceforge.net) and our goal is to recreate the
apollo program in as realistic a way as possible. I have long since been a fan of dan's DGIII as well as his
fspassengers addon.

CUT TO THE CHASE
My reason for this post is that i am hoping to add a feature that will simulate the apollo astronauts and therefore
require the orbitnaut to maintain cabin conditions. I am requesting any help what so ever that you can provide me.
Mainly i am curious as to how you coded the astronauts (c++ ??). Also, i was wondering if u could point me in the
right direction as to where i can find the files that simulate the astronaut in the dgII to use as a template.

Any other help or directions would also be appreciated

I WANT TO EMPHASIZE THAT I AM ASKING FOR THIS HELP ONLY IF YOU CONSENT TO GIVING ME YOUR HELP AND THAT
I UTILIZE YOUR HELP IN MAKING ANOTHER GREAT ADDON FOR ORBITER.


Offline DanSteph

  • Administrator
  • Legend
  • *****
  • Posts: 15407
  • Karma: 258
  • Hein, quoi !?
    • FsPassengers
Reply #1 - 02 February 2006, 13:32:17
Hello, yes all was coded in C++.

About live system it's easy, you set a "O2 reserve" of say 1000
(A float value that hold 1000) then each loop you deduct the crew
consumption multiplied by DT (delta time of the loop)

You must absolutely use DT provided in the main loop otherwise
a computer with 120 FPS will use much O2 than one with 40 FPS.

Something like that: (Pseudo C++ code)


Code: [Select]
At ini time:

fO2Tank = 1000.0; // float value O2 Tank
fO2InCabin=100.0; // the O2 present in the cabin
fOneCrewConsumption=0.12; // changing this you can tune the compsumption of one crew.
fNumberOfCrewAboard=3; // changing this you can simulate EVA in the cabin.
bButtonO2Open=1; // value to simulate the O2 circuit being open or not

At loop time:

// this will deduce the O2 consumption of the crew aboard only if the O2 circuit is open
if(bButtonO2Open==1)
{

     fO2Tank-=(fOneCrewConsumption*fNumberOfCrewAboard)*DT;
     // fill the cabin with O2
     if(fO2InCabin<100.0)
       fO2InCabin+=10.0*DT;
}
else // if the circuit is closed crew will use cabin O2, once cabin empty they die.
{
    fO2InCabin-=(fOneCrewConsumption*fNumberOfCrewAboard)*DT;
    // no more O2 in cabin ? crew die
    if(fO2InCabin<1)
       bCrewIsDead=1;
}


Of course value has to be tuned and refinment can be done but the principe is here.


Hope it help ?

Dan


Offline toadtal

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
Reply #2 - 05 February 2006, 15:21:36
This helps alot howver, i am more concerned with the code that says when a astronaut dies cut control of the
spacecraft
further more the o2 float value i that the amount of o2 in the cabin or the amount of o2 in the oxygen tanks

« Last Edit: 05 February 2006, 15:21:36 by toadtal »