Author Topic: Mods and gravity  (Read 5968 times)

0 Members and 1 Guest are viewing this topic.

Offline ShadowWolf_IH

  • A Real POF Guy
  • 211
    • CoW
I know of about 5 mods out there right now....not including mine, who are going to be using ground attack missions, and are also making grounded missions.....missions where you are on the ground driving a ground vehicle into combat.  Some help here would be great.

This is of course an oversimplification of my thought.  All of the ships in FS2 have mass, and that is what throws us around when we bump, right?  Or what allows one capship to push another.  Well our planet would also have mass.  I am not a coder and have no idea how complex this is, but it seems to me that there are three variables to worry about, mass of object A, mass of Object b, and distance between the objects.  Obviously the more mass of object A, the greater pull it will have at greater distances.  Then again you already knew that.  

The two things that make think about this are the push factor of bumping ships, and special eplosions which "push" you, more importantly, the lessening effect of that push at greater distances.

Is this even feasible? or am i thinking absolutely on the wrong lines?
You can't take the sky from me.  Can't take that from me.

Casualties of War

  

Offline Galemp

  • Actual father of Samus
  • 212
  • Ask me about GORT!
    • Steam
    • User page on the FreeSpace Wiki
Mass doesn't create gravity in the FS engine. Sorry.
"Anyone can do any amount of work, provided it isn't the work he's supposed to be doing at that moment." -- Robert Benchley

Members I've personally met: RedStreblo, Goober5000, Sandwich, Splinter, Su-tehp, Hippo, CP5670, Terran Emperor, Karajorma, Dekker, McCall, Admiral Wolf, mxlm, RedSniper, Stealth, Black Wolf...

 

Offline Stryke 9

  • Village Person
    Reset count: 4
  • 211
Ya'd need to install Newtonian physics.

Well, maybe not, but if you were gonna do this you might as well. It'd be by far the simplest route, and it'd still pretty ****ing hard. Telling the game which way is "down", setting the gravity level and having a function to turn it on and off for different missions, having it dependent on ship size... it'd get very ugly very fast.

 

Offline ShadowWolf_IH

  • A Real POF Guy
  • 211
    • CoW
actually, i was thinking more along the lines of reversing the push effect that you get.  as far as down goes, it is based on the center of the object you are giving gravity to.  As far as gravity level goes, have it based on mass.  That way it would read right off the table...and beneath a certain mass, the object cannot create gravity
« Last Edit: February 12, 2003, 10:42:26 pm by 820 »
You can't take the sky from me.  Can't take that from me.

Casualties of War

 

Offline Stryke 9

  • Village Person
    Reset count: 4
  • 211
Quote
Originally posted by GalacticEmperor
Mass doesn't create gravity in the FS engine. Sorry.



That, and last I recall, except for Nephilim everything has a mass of "1".

I don't know what you're talking about "reverse the push effect", seeing as there is no "push effect" constantly in place in the game, or even temporarily, unless you crash into something or get hit by a specific weapon, and neither of those two really create great opportunities for generating a unidirectional, constant force.

 

Offline ShadowWolf_IH

  • A Real POF Guy
  • 211
    • CoW
ok so you don't know what i am talking about.  The subject matter at hand is.......gravity.  If you are saying that my line of thought is wrong, how woudl you do it?
You can't take the sky from me.  Can't take that from me.

Casualties of War

 

Offline Fury

  • The Curmudgeon
  • 213
ShadowWolf_IH, good luck with your mod. But I can say that mods like that will not see daylight. FS2 is an arcade space simulator, not First Person Shooter mixup... It is just impossible to make FS2 to be everything.

...Unless I missed something obvious...

 

Offline LtNarol

  • Biased Banshee
  • 211
    • http://www.3dap.com/hlp/hosted/the158th
would it be possible to add 2 tbl flags for something like this? "gravity" and "grav-obj-no-collide"?

 

Offline ShadowWolf_IH

  • A Real POF Guy
  • 211
    • CoW
ok so now everyone has told us the ways it can't be done, can anyone tells us the way it can be done?  And actually i like Narol's thinking with the flags.  so, can it be done?
You can't take the sky from me.  Can't take that from me.

Casualties of War

 

Offline aldo_14

  • Gunnery Control
  • 213
i heard - though I'm not 100% sure - that weapons with a high negative blast can have a gravity effect.

Maybe.... if an object has mass (pof) over a certain limit, it applies a 'pull' effect on objects within a certain radius (defined by mass*somefactor).  This pull effect *could* be a simple modification of the physical location of each object every 1/n seconds (i.e. simply subtracting from the co-ordinate location).  Possibly with n decreasing with proximity to the object (exponential / increasing gravity).  The trick would be - I guess - optimising the maths operations so not to overload the system.. maybe reducing the multiplications required (less ALU ops), or 'fuzzing' co-ordinate values by rounding them.  

One problem could be in actually moving ships without giving the impression of 'jerking' them... maybe a subtle manipulation of the inertia of the ship (using M.O.I. settings I presume)?  If someone could get a working tractor beam coded up, this could provide part of the basis for this...?

 

Offline Stryke 9

  • Village Person
    Reset count: 4
  • 211
That'd take a lot of fiddling around, and wouldn't be smooth, anyway- a beam, I think, can't just do a gentle pull, just like you can't have it do only 1HP of damage every other second. They're just not set up that way. It'd be worth a shot, but I wouldn't lay money on it, and at any rate you'd have a hell of a hard time keeping the beam directly under the fighter pointing straight up. And doing that for every vessel in the game.

Shadowwolf: the point is, you can't do gravity gracefully in the FS engine. It's not built for it in every way. I'm sure someone could jury-rig some programming monstrosity onto the physics engine to give everything a gradual pull down, but it'd be iffy whether you could ever turn it off without reinstalling the game, it'd be a beastly piece of programming work for very little return, and frankly you won't find anybody crazy or stupid enough to do it. Maybe, if at some point someone wants to stick in Newtonian physics, they could include the gravity option on their way, but that'd be essentially taking out the current engine in its entirety and replacing it- an even more massive project, and while significantly more worthwhile than just adding gravity, it won't be happening any time soon.

It's not as simple as just adding a table flag- that flag would have to be backed up by part of the physics engine that calculated gravity and would move all objects in one direction when activated. The current FreeSpace physics engine has no provisions for such a thing, which means you'd have to retool half of the engine just to get it to fit in, not to mention actually coding it, which I have no idea personally how you'd do. At the moment, it's just plain not a feasible idea.

 

Offline LtNarol

  • Biased Banshee
  • 211
    • http://www.3dap.com/hlp/hosted/the158th
Well, the idea of the flags was to minimize the amount of actual physics calculations involved.  The "gravity" flag would tell the engine that the "ship" with that flag should be treated as a gravity source and that all objects accelerate toward it at whatever velocity by is in the flag's first parameter - which would also be the amount of thrust required in a direction away from the center of the object in order to overcome the effects of the object's 'gravity'.  This part is essentially simple addition and subtraction on a given vector.  The flag can have 3 parameters, one for the default pull a second for the amount by which other objects are slowed (I.E. ship_new_max_velocity=ship_tbl_max_velocity - value).  A final flag could be the radius for which other objects are affected.

With ships and fighters, you can have a "gravitate" flag dealy that tells the engine not to ignore the first "gravity" parameter, so the fighter or ship doesn't accelerate toward a planet automatically.  Ships without this parameter ignore the actual gravity, but are still slowed.  Ships with it will use the first "gravity" parameter of whatever object and accelerate towards that object if within range.

A "no-grav-obj-collide" flag would be needed to keep ground units from constantly colliding into the planet, probably with 1 parameter specifying the minimum distance between the center of the ship and the surface of the planet.  Basically, replacing the collision stuff with hovering stuff.

Having no experience with the code of the FS2 engine, I can't go any further in detail but given what I do know about the engine, this shouldn't be impossible.  Difficult perhaps, but worth the effort in my honest opinion; especially if you know what I have in store for you guys if ground units work.

 

Offline Ace

  • Truth of Babel
  • 212
    • http://www.lordofrigel.com
Two things that would currently work in FS:
The negative mass value "tractor beam" weapon effecting a ship, pulling it to the ground.

The ground object moves upward to a waypoint in the extreme distance, this can be done at a speed and distances so that the vertical limits of a mission boundary do not seem to be lost.
Ace
Self-plagiarism is style.
-Alfred Hitchcock

 

Offline Stryke 9

  • Village Person
    Reset count: 4
  • 211
Ah, I get it. That'd actually be a lot more graceful a way to do it, provided you didn't mind having a point gravity source rather than a planar one. I'm sure you could set up something with the weapons bit of the engine so that the point would pull every vessel a minute amount every fraction of a second- you'd still be shaking, but not a whole lot, just enough to make it really irritating if you went over about ten to fifteen minutes...

 

Offline Nico

  • Venom
    Parlez-vous Model Magician?
  • 212
pb is, if you flight horizontally , you'll either go down or up when you're supposed to have a constant altitude...
SCREW CANON!

 

Offline aldo_14

  • Gunnery Control
  • 213
Quote
Originally posted by Stryke 9
That'd take a lot of fiddling around, and wouldn't be smooth, anyway- a beam, I think, can't just do a gentle pull, just like you can't have it do only 1HP of damage every other second. They're just not set up that way. It'd be worth a shot, but I wouldn't lay money on it, and at any rate you'd have a hell of a hard time keeping the beam directly under the fighter pointing straight up. And doing that for every vessel in the game.


I'm talking about implementing a specialised tracotr-type beam as a simple physics test for applying a subtle MOI change to a specific model.  I.e. you see if the beam can be used to pull a ship towards a specific area (the beam source in this case), and build on top of that.

 

Offline ShadowWolf_IH

  • A Real POF Guy
  • 211
    • CoW
right pulling to a point instead of a plane......that would work
You can't take the sky from me.  Can't take that from me.

Casualties of War

 

Offline Nico

  • Venom
    Parlez-vous Model Magician?
  • 212
Quote
Originally posted by Venom
pb is, if you flight horizontally , you'll either go down or up when you're supposed to have a constant altitude...


that pb will remain true.
SCREW CANON!

 

Offline LtNarol

  • Biased Banshee
  • 211
    • http://www.3dap.com/hlp/hosted/the158th
Well, if programmers are willing, they could probably create a new flag for objects which are affected by gravity, such that objects without the flag are unaffected.  Thus, a fighter would fly around as normal whereas a tank or hovertank will hug the ground.

 

Offline LtNarol

  • Biased Banshee
  • 211
    • http://www.3dap.com/hlp/hosted/the158th


still no takers?