Author Topic: Multiple Dockees per Ship  (Read 5619 times)

0 Members and 1 Guest are viewing this topic.

Offline mikhael

  • Back to skool
  • 211
  • Fnord!
    • http://www.google.com/search?q=404error.com
Use the Iwar2 method for determining movement: compare ship mass.

This is by no means complete, but if you implement your dock chain as a list structure, you can traverse the list and total masses on the way until you hit an end point. If a ship tries to move, it has to  overcome the combined mass of objects to which it is docked. Traverse the list, total the masses, compare the total to the output of the attempted movement vector and you know if something gets to move or not.

Don't try to get fancy and calculate cumulative affects of multiple ships trying to overbear a larger ship (that way lies madness). If you force docking points to be oriented in the same direction on all ships (ie, ships always dock parallel with noses pointed in the same direction) you don't need to worry about tug of war situations. Either ship in a docked pair can break the dock any time (seperating the list into a pair of lists). Of course, to simplify further, player ships only need to have 1 ship-to-ship dock point (not much of an issue in Freespace, since no one is tugging cargo pods).

In other words, cheat.
[I am not really here. This post is entirely a figment of your imagination.]

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
EDIT: This post is in response to ZylonBane--

That makes it sound very complicated; I don't think it needs to be.  Every docked ship acts as one mass, so all we need to do is take every ship's velocity component and apply it toward the one mass.

Maybe do it this way: Divide each ship's velocity by its mass, then add all of the vector results together.  Apply the final vector sum to the whole thing.

It's all physics; it shouldn't have anything to do with privilege.


EDIT: I think mikhael and I have approximately the same idea. :)
« Last Edit: December 29, 2002, 08:15:47 pm by 561 »

 

Offline Sesquipedalian

  • Atankharz'ythi
  • 211
What happens now when two ships are docked and try to move in different directions?  The engine has to deal with it somehow.  Either the two ships already have a system in place for fighting it out, or one already is being given preference.  I'm not sure which scenario is true, but whichever it is, why should it suddenly no longer work?  In other words, I am questioning the assumption that we even have to come up with a system for this:  one is already there and works, and there seems no reason, according to either scenario, to think it would stop if we added another ship in.
« Last Edit: December 30, 2002, 12:44:07 am by 448 »
Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

The Scroll of Atankharzim | FS2 syntax highlighting

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
just have one parent ship that is the only thing that has the ability to move, if anyone else trys it does nothing
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Anaz

  • 210
sesq has it right IMO. We have the docker and the dockee. Throw physics out the window, the dockee has control over the whole thing.
Arrr. I'm a pirate.

AotD, DatDB, TVWP, LM. Ph34r.

You WILL go to warpstorm...

 

Offline ZylonBane

  • The Infamous
  • 29
Well, no. Once you allow unlimited arbitrary docking, the whole concept of docker/dockee goes right out the window. If A is docked to B, but B is then docked to C, then B is both a docker AND a dockee.

Hmmm.... I suppose you could determine the "owner" of a docking group by recursively walking the docked ships tree and finding the one ship that's not a docker. Assuming that dockers are one-to-one, and dockees are one-to-many, I think it's impossible to dock multiple ships in such a way that more than one is a dockee but not a docker. To save CPU time, this could be calculated only every time a docking/undocking occurs, and stored as part of each docked ship's local data.

Under this scheme, each docker would effectively be docked to two ships-- the ship it's logically attached to, and the ship it gives up its physics to. Hopefully the code that makes docked ships appear physically attached (eg, translates their parent's movement & rotation) can be extended to multiple ships in this fashion without too much pain.

Hmmm...
« Last Edit: December 30, 2002, 02:30:52 am by 264 »
ZylonBane's opinions do not represent those of the management.

 

Offline Rampage

  • Son Of Rampage
  • 211
  • Urogynaecologist
Yes, the problems with physics...

So how about it, a release for fs_open3.5? :nod:

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Mebbe. :)

I'll look into it.  Later. ;)

 

Offline Rampage

  • Son Of Rampage
  • 211
  • Urogynaecologist
Okay...  We should revive this.  All we want is simple:

1. For a freighter with multiple points dock with multiple cargo.
2. For a ship with multiple points dock with multiple vessels when NOT MOVING!!!!  (Forget the centripetal forces and related physics problems that deal with moving targets.)

Rampage

 

Offline Galemp

  • Actual father of Samus
  • 212
  • Ask me about GORT!
    • Steam
    • User page on the FreeSpace Wiki
OK, I've got an idea. We have singledock ships, and multidock ships. Multidock ships are not allowed to dock with other multidock ships. This way no ship can be both a docker and dockee.

Multidocks include capital ships (cruiser and above,) installations and freighters. We can have the code read a 'multidock' tag or something in the table. Everything else is single docking like it is now.

This would prevent chain docking, and you're not going to have a Fenris and an Arcadia actually dock with each other, so that's OK. Is this feasable?
"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 StratComm

  • The POFressor
  • 212
  • Cameron Crazy
    • http://www.geocities.com/cek_83/index.html
How about, rather than prevent a capital ship and installation from docking with each other, not allow other ships to dock to either if one is docked to the other.  I have a particular drydock mod that relies on Capital ship docking, and I'd like the source to allow that if possible.
who needs a signature? ;)
It's not much of an excuse for a website, but my stuff can be found here

"Holding the last thread on a page comes with an inherent danger, especially when you are edit-happy with your posts.  For you can easily continue editing in points without ever noticing that someone else could have refuted them." ~Me, on my posting behavior

Last edited by StratComm on 08-23-2027 at 08:34 PM

 

Offline Stryke 9

  • Village Person
    Reset count: 4
  • 211
How 'bout you just tell people not to do anything fantastically stupid, and you won't have any problems?

I don't see a situation in which you'd have, say, a freighter docked to a cargo pod docked to a fighter docked to another freighter docked to a capship and the Volition Bravos, anyway. Capships dock to fighters and other capships, but you wouldn't have huge branching chains of capships, anyway, you'd have only one on one (and maybe on one on one on one on one), because you'd have to go out of your way from modeling the ship on up to make it able to dock to two or three capships at once, and since it'd look as silly as it'd really be, nobody would do that anyway. And capships don't need more than a couple dock points anyway. Freighters only dock to their cargo.

Honestly, the only reason someone would try to make a long, awkward, branching chain of docked vessels, and then try to move them, is if they were looking for trouble in the first place. You can make the SCP idiot-proof, but you can't account for the creativity of idiots, or the extent they'll go to to **** themselves over, and I don't recommend you try. I can guarantee that if the sort who stick paperclips in wall sockets got their hands on a copy of the current SCP, they'd find a way to make it crash.



You're overcomplicating this. If you want, you can include a stern warning in the readme to make branched docking chains at one's own risk, but seeing as it's an extremely unlikely use to ever come up, and at worst the program will just crash, not leap off their hard drive, kill their dog, and schtup their mother, I think it's fair to say it's okay if someone tries once and learns their lesson.



And that's my contribution for the year.:D

  

Offline Sesquipedalian

  • Atankharz'ythi
  • 211
Well said.
Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

The Scroll of Atankharzim | FS2 syntax highlighting