Author Topic: Limited inertial motion possible?  (Read 2300 times)

0 Members and 1 Guest are viewing this topic.

Limited inertial motion possible?
Quote
Originally posted by TMC
On the subject of newtonian physics... I tried the IFH game and it's okay but the speeds involved make it bad. The vipers in BSG TSR can fly in a straight line at maximium speed and then suddenly flip around and hit the burners, going in the opposite direction at a positive speed in a matter of seconds. IFH takes too long and you wind up just going in a straight like for 30 seconds until your speed evens out.

For example, freelancer. You could cut your engines and drift along. Due to the speeds involved I was using BSG style tactics such as fly above the enemy and go into inertial mode and swing the nose down at them and open fire, and the typical "flip around and shoot the badguys" thing. What I'd do instead of turning the engines back on was to tap the afterburners... this helped me get the ship moving in the direction desired very easily.

I wonder if someone would be able to code a system which flew (like you said) in a descent style manner, but if you held down a button, the ship would continue to fly on that heading but you could spin the nose in any way you want?


I'd like to know SCP programmer thoughts on this matter.

 

Offline aldo_14

  • Gunnery Control
  • 213
Limited inertial motion possible?
Can't you achieve that already by fannying about with rotdamp or something?

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Limited inertial motion possible?
Code-freeze.

Other than that, it's probably just a matter of removing some code to rotate the inertia when the ship rotates.

But I know I've been hit by a ship (Sathanas in Bearbaiting) and was thrown backwards for several kilometers despite trying to fire my engines and get back.
-C

 
Limited inertial motion possible?
So the inertial vector is always relative to the ships orientation!? That would explain the weirdness.

I've been getting some ODD results playing with damp and deceleration values of the TBL.
« Last Edit: August 22, 2005, 02:40:18 pm by 1582 »

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Limited inertial motion possible?
Quote
Originally posted by WMCoolmon
But I know I've been hit by a ship (Sathanas in Bearbaiting) and was thrown backwards for several kilometers despite trying to fire my engines and get back.


IF you look at the mission in FRED you'll notice that on the easier skill levels they actually make you invulnerable (or guardianed. Can't remember which). It probably wasn't a case of you getting smacked out of the way so much as pushed there by the Sath most likely :)
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 
Limited inertial motion possible?
I tried this a long time ago. I tried to make a GTF Perseus have Newtonian physics in such a way that you could literally push forward, turn the ship completely around and you'd be facing backwards, but moving in the direction originally thrustered in.

To try to accomplish this, I removed all maximum velocity constraints from the Perseus, removed all damping from it and gave it one heck of an afterburner system, but this only succeeded in creating a craft that could not slow down once sped up. In addition, trying to move the joystick in order to "turn around and counteract the speed" didn't work --- instead of rotating my ship while remaining on course, it changed the direction of my runaway ship!

The Perseus would change direction the second I moved the joystick no matter how fast I was going. It seems impossible to make the ship rotate without changing its direction of movement. This I think correlates the inertial vector being related to ship orientation.
« Last Edit: August 22, 2005, 04:36:03 pm by 1644 »

 

Offline Flaser

  • 210
  • man/fish warsie
Limited inertial motion possible?
AFAIK there is no such thing as inertial vector - for the ships have no real inertia.

Instead applying forces to a moving object, all player input directly changes the movement of the object.

Hence,
accelerate/decelerate = change movement speed function
turn = change movement direction

There is no conventional intertia in game.

What IS simulated is the SECONDARY INERTIA, that is the inertia used when calculating the ROTATION of an object.
Simply put you have to calculate how fast the object will start to spin along 3 perpendecular axises when spun with the same force. From that all other spuns can be calculated.

Beside that there is a mass factor that's used for collisions (and beams), however the flight model doesn't use this value AFAIK.

Is this right code gurus?
"I was going to become a speed dealer. If one stupid fairytale turns out to be total nonsense, what does the young man do? If you answered, “Wake up and face reality,” you don’t remember what it was like being a young man. You just go to the next entry in the catalogue of lies you can use to destroy your life." - John Dolan

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Limited inertial motion possible?
Uhm, I don't know physics all that well, but how FS2 does it is this...

It has the current velocity stored in a vector. ( vector = X,Y,Z values).

It then has a second vector, that determines the desired velocity. When you press '\\', you set this vector's z attribute to the max speed of your ship.

Finally, other values determine how fast you can change your current velocity to the desired velocity. So if your Max Decel Rate is 10, and you're going 50 m/s, and you press 'stop', FS2 will set the desired velocity vector z component to '0' and linearly subtract 10 from your current velocity every second.

Now, in a flash of memory, I remember I was poking around in the code once to try and get Newtonian physics to work, and discovered that what Freespace 2 seems to do is apply the velocity according to the rotation of the ship in world space. I think I got it half-working by removing the function to rotate the velocity by the ship's orientation, but had trouble applying thrust according to the current orientation of the ship (Because everything outside of physics assumed that the z component of the current velocity vector would be 'forward' for the ship; without the extra rotation calculation, it would actually be 'forward' in world space. So if you press '\\', your ship might immediately start moving up, sideways, diagonally, or whatever if you turned at all, or the mission designer turned the ship in FRED.)

So to get complete Newtonian physics, you'd probably want to go and add some special member functions to the 'ship' or 'object' class that would automatically compensate for Newtonian and non-Newtonian physics, then modify the rest of the code to use those functions. Fairly straightforward, but it'd probably take a medium amount of time.
-C

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Limited inertial motion possible?
For some reason I didn't mention this in my first two replies, but add this to mantis (there's a 'features' thing) for post-3.6.7 perusal.
-C

 

Offline Davros

  • 29
Limited inertial motion possible?
Quote
Originally posted by Flaser
all other spuns can be calculated.

 



spuns :D :D :D

 

Offline pflumm

  • 22
Limited inertial motion possible?
Quote
Originally posted by WMCoolmon
Uhm, I don't know physics all that well, but how FS2 does it is this...

It has the current velocity stored in a vector. ( vector = X,Y,Z values).

It then has a second vector, that determines the desired velocity. When you press '\\', you set this vector's z attribute to the max speed of your ship.

... and so on ...



If anybody ever wants to implement physically correct movements in SCP, I would be glad to help with the physics part (I studied physics and have been carrying out numerical calculations for around 6 years now...). Sadly, I can't code it myself (lack of time, I am actually working), though I would like to. Because newtonian motion can be cool. Look at Tachyon (a space trade/sim game) on how to do it in a nice way. In that game, you have a button which puts your ship into "slide" mode, which means that if you turn, no thrusters will be fired. If you are in "normal" (non-newtonian) mode and you turn, thrusters will be fired in oreder to change your flying direction of. Depending on the mass of your ship and strength of your thrusters, changing your direction can take a bit of time. A small, agile ship can turn in a second if the speeds are not too high, but a big one (or if velocity is high), might need much more than that.

 

Offline Trivial Psychic

  • 212
  • Snoop Junkie
Limited inertial motion possible?
Newtonian physics can be closely simulated already with changes to rotational dampenning and other figures in a fighter's performance.  The problem is the AI.  The AI is not written to know what newtonian physics is and thus won't behave properly.  The AI could be rewritten, but coders avoid touching the AI like the plague.
The Trivial Psychic Strikes Again!

 

Offline pflumm

  • 22
Limited inertial motion possible?
Quote
Originally posted by Trivial Psychic
Newtonian physics can be closely simulated already with changes to rotational dampenning and other figures in a fighter's performance.  The problem is the AI.  The AI is not written to know what newtonian physics is and thus won't behave properly.  The AI could be rewritten, but coders avoid touching the AI like the plague.


So flying in a direction, keep flying in that direction, turning around and shooting backwards is possible? I would love to try that with a starfury. I guess I would need a new table entry?

The AI certainly would have to be rewritten completely to take into account real newtonian physics, I can understand noone wants to do that. However, good AI would be great.

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Limited inertial motion possible?
IIRC, objects' local velocity is oriented by their orientation matrix and then applied as their world velocity, so no.
-C