Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: headdie on July 06, 2011, 03:02:17 am

Title: Warpin / Warpout speed
Post by: headdie on July 06, 2011, 03:02:17 am
I am working with high warpin/warpout speeds and having problems working out where to place the ships to avoid collisions, does anyone know the maths behind how the game handles deceleration from warp velocity?
Title: Re: Warpin / Warpout speed
Post by: PL_Harpoon on July 06, 2011, 03:24:16 am
I think the best thing you can do is to increase the $Forward Decel: value in ships.tbl. Otherwise your ships will slow down very slowly. If you don'twat this, you can also experimend with FRED (ex. create a mission in which ship warps in in the centre of the map along path of some small ships (like beacons) used as measure).
Title: Re: Warpin / Warpout speed
Post by: MetalDestroyer on July 06, 2011, 03:25:34 am
Why don't you use the warp type "Hyperspace " (http://www.hard-light.net/wiki/index.php/Ships.tbl#.24Warpin_Type:) ? The engine will automatically place the ship to the right coordinate. In FRED, you need only to place the ship like usual.
Title: Re: Warpin / Warpout speed
Post by: Vengence on July 06, 2011, 02:23:40 pm
Just hopping into this topic, last time I messed with such features it didn't work. I once tried a faster warpin speed using the normal FS2 warpin. The ship never warped in, the portal simply stayed open the whole time. Then when I set it to hyperspace recently the ship never warped in in the first place. Guess I am asking is that are there values I need to be aware of when using different warpin types and speeds? This is just personal experiences, I never saved the tables and this was likely a few years ago.
Title: Re: Warpin / Warpout speed
Post by: headdie on July 06, 2011, 02:52:23 pm
i was using

Code: [Select]
$Warpin Type: default
$Warpin Speed: 2000
$Warpout Type: default
$Warpout Speed: 2000

everything warped in ok but I couldn't figure out the distance to position the ship to stop it slamming into something or it flying strait through the battle area and off into the sun.  the ship was shedding speed but slowly so I was hoping someone could post me a workable formula or at least confirm which constants/variables are in play so i can research it properly.

Why don't you use the warp type "Hyperspace " (http://www.hard-light.net/wiki/index.php/Ships.tbl#.24Warpin_Type:) ? The engine will automatically place the ship to the right coordinate. In FRED, you need only to place the ship like usual.

It's not quite the effect I was after, I wanted the player to be able to watch the ship slow from high speeds as though ending a high velocity transit and slowing to combat speeds
Title: Re: Warpin / Warpout speed
Post by: PL_Harpoon on July 06, 2011, 03:06:26 pm
In that case, as I said $Forward Decel: is the key here. Just increase the value and the ship will slow down more quickly.
Title: Re: Warpin / Warpout speed
Post by: MetalDestroyer on July 06, 2011, 03:11:48 pm
i was using

Code: [Select]
$Warpin Type: default
$Warpin Speed: 2000
$Warpout Type: default
$Warpout Speed: 2000

everything warped in ok but I couldn't figure out the distance to position the ship to stop it slamming into something or it flying strait through the battle area and off into the sun.  the ship was shedding speed but slowly so I was hoping someone could post me a workable formula or at least confirm which constants/variables are in play so i can research it properly.

Why don't you use the warp type "Hyperspace " (http://www.hard-light.net/wiki/index.php/Ships.tbl#.24Warpin_Type:) ? The engine will automatically place the ship to the right coordinate. In FRED, you need only to place the ship like usual.

It's not quite the effect I was after, I wanted the player to be able to watch the ship slow from high speeds as though ending a high velocity transit and slowing to combat speeds

If you use hyperspace, just add Warpin speed/warpout speed (in seconds instead of meters/s).
Quote
$Warpin Speed:
FS2 Open 3.6.10:
Sets the speed at which the ship warps in for default warpin effect
Sets the time that the ships warp in (not the animation itself) takes for BTRL type warpin effects
Syntax: Float, meters per second or miiliseconds
Title: Re: Warpin / Warpout speed
Post by: headdie on July 06, 2011, 03:41:49 pm
In that case, as I said $Forward Decel: is the key here. Just increase the value and the ship will slow down more quickly.

I am currently using 10 (seconds) on a 150 meter long warship and have experimented with distances ranging from 10,000-20,000 meters, which leads me to believe that $Max Velocity: and/or MOI is involved.
Title: Re: Warpin / Warpout speed
Post by: Droid803 on July 06, 2011, 04:59:03 pm
Why don't you use the warp type "Hyperspace " (http://www.hard-light.net/wiki/index.php/Ships.tbl#.24Warpin_Type:) ? The engine will automatically place the ship to the right coordinate. In FRED, you need only to place the ship like usual.

If you use that be prepared eat facefuls of bugs including, but not limited to, spontaneous ship self-destruction, ships dissapearing off the map, and random collisions between capships which are kilometers apart.
Title: Re: Warpin / Warpout speed
Post by: MetalDestroyer on July 06, 2011, 05:39:30 pm
Why don't you use the warp type "Hyperspace " (http://www.hard-light.net/wiki/index.php/Ships.tbl#.24Warpin_Type:) ? The engine will automatically place the ship to the right coordinate. In FRED, you need only to place the ship like usual.

If you use that be prepared eat facefuls of bugs including, but not limited to, spontaneous ship self-destruction, ships dissapearing off the map, and random collisions between capships which are kilometers apart.

It's been a while I use this warp type. And I abuse it in each mission I fred. And I didn't really encounter any severe issue.
Title: Re: Warpin / Warpout speed
Post by: Droid803 on July 06, 2011, 05:54:33 pm
oh, trust me, I know what I'm talking about.

You put a ship along the vector of another ship warping in, you get the ship warping in hitting while warping in and dying. 100% reproduceable. Also ****s up sound for the rest of the mission. means that you can't use "near ship" as an arrival cure as you don't know if it will clip through something and totally **** your mission.

You put two ships warping in in formation and if they're within a km or two of each other, both will explode in the same way once they warp in. Bam.

Worse part about this? Doesn't happen on everyone's computer. And it never happens on debug. Ever.
I have stuff that explodes like this on mine, but not on my tester's and vice versa. Something to do with how processors handle floating point math or whatever.

I've experimented with it tons with different configurations and these are my findings.
My verdict is that Hyperspace is horribly bugged and only really works if you ensure all warping in ships have a clear vector, with a several kilometer berth.

I even have an image explaining exactly what happens. (http://img.photobucket.com/albums/v423/kc1991/hyperspaceBUUG.jpg) I still have the exact mission, and it happens every. single. time. Except on debug. Then it doesn't happen at all.

I have heard reports of the others happening which dissapeared when I spaced the ships out appropriately, thus, leading to the conclusion of what the culprit was. Simple deductive reasoning -> change one thing, problem goes away? That thing was causing the problem.
Title: Re: Warpin / Warpout speed
Post by: MetalDestroyer on July 06, 2011, 06:11:10 pm
oh, trust me, I know what I'm talking about.

You put a ship along the vector of another ship warping in, you get the ship warping in hitting while warping in and dying. 100% reproduceable. Also ****s up sound for the rest of the mission. means that you can't use "near ship" as an arrival cure as you don't know if it will clip through something and totally **** your mission.

Ah, this, I encounter some time in this mission (http://www.youtube.com/watch?v=_5sSvlY8MNI). For me, it's a normal behavior. It would be cool if the warp in ship is able to detect any object in his course and take necessary manoeuver like slowing down.

You put two ships warping in in formation and if they're within a km or two of each other, both will explode in the same way once they warp in. Bam.

I didn't reproduce this one perhaps because there are placed ouside a km or 2.

Worse part about this? Doesn't happen on everyone's computer. And it never happens on debug. Ever.
I have stuff that explodes like this on mine, but not on my tester's and vice versa. Something to do with how processors handle floating point math or whatever.

Which processor are you using ? AMD or Intel ? For my case, I'm using a Intel Core i7.

I've experimented with it tons with different configurations and these are my findings.
My verdict is that Hyperspace is horribly bugged and only really works if you ensure all warping in ships have a clear vector, with a several kilometer berth.

I even have an image explaining exactly what happens. (http://img.photobucket.com/albums/v423/kc1991/hyperspaceBUUG.jpg) I still have the exact mission, and it happens every. single. time. Except on debug. Then it doesn't happen at all.

I have heard reports of the others happening which dissapeared when I spaced the ships out appropriately, thus, leading to the conclusion of what the culprit was. Simple deductive reasoning -> change one thing, problem goes away? That thing was causing the problem.
Title: Re: Warpin / Warpout speed
Post by: Droid803 on July 06, 2011, 06:13:47 pm
I'm on an Intel Core i7 as well. I would have considered it normal behavior if the sound didn't start being totally choppy once it happened. But it does, so there's either something wrong with sound, or with Hyperspace, and definitely something wrong with how they're interacting.
Title: Re: Warpin / Warpout speed
Post by: Fury on July 06, 2011, 11:23:26 pm
everything warped in ok but I couldn't figure out the distance to position the ship to stop it slamming into something or it flying strait through the battle area and off into the sun.  the ship was shedding speed but slowly so I was hoping someone could post me a workable formula or at least confirm which constants/variables are in play so i can research it properly.
In ship editor, lower the ship's initial velocity. The lower the velocity, the less distance the ship travels during warp-in. IIRC ship's current velocity does not apply to distance traveled during warp-out however. Odd inconsistency but there you have it.
Title: Re: Warpin / Warpout speed
Post by: Vengence on July 06, 2011, 11:55:57 pm
I've been messing with the hyperspace option today and thus far it seems rather difficult to um... 'control'. I keep trying to modify the values but I don't seem to be able to freakin slow down how fast the hyperspace warpin is. Its as if the time it takes to go from distance to the final location is 5 frames. As in it doesn't look like it decelerates or anything... it just 'appears'. Same when it leaves. It doesn't accelerate. Is this what is to be expected with this warpin type? Or, again, am I missing some kind of tables?
Title: Re: Warpin / Warpout speed
Post by: Droid803 on July 07, 2011, 12:07:36 am
That appears to be how it works for me.
Title: Re: Warpin / Warpout speed
Post by: MetalDestroyer on July 07, 2011, 01:07:35 am
I've been messing with the hyperspace option today and thus far it seems rather difficult to um... 'control'. I keep trying to modify the values but I don't seem to be able to freakin slow down how fast the hyperspace warpin is. Its as if the time it takes to go from distance to the final location is 5 frames. As in it doesn't look like it decelerates or anything... it just 'appears'. Same when it leaves. It doesn't accelerate. Is this what is to be expected with this warpin type? Or, again, am I missing some kind of tables?

If you set a Warp in Speed, the value you put is in second. So, if you put 5, your ship need 5 sec to arrive to his final destination. The greater is the value, the ship will move slowly. But it appears it doesn't slow down as expected. I've just tried it yesterday just to confirm the behavior of this variable since I didn't really understand the description in the wiki.
IIRC, it was Chief who has implemented such feature, I think. :)
Title: Re: Warpin / Warpout speed
Post by: swashmebuckle on July 07, 2011, 01:16:47 am
Hyperspace does indeed have some issues.  When a ship is set to jump out using hyperspace, it needs to be going a certain speed before the warpout will occur, just like with a normal subspace jump.  Unfortunately, there doesn't seem to be any way of controlling what that speed is, so ships generally slow down to a crawl before suddenly leaping out at a bajillion m/s...
Title: Re: Warpin / Warpout speed
Post by: MetalDestroyer on July 07, 2011, 02:59:17 am
Hyperspace does indeed have some issues.  When a ship is set to jump out using hyperspace, it needs to be going a certain speed before the warpout will occur, just like with a normal subspace jump.  Unfortunately, there doesn't seem to be any way of controlling what that speed is, so ships generally slow down to a crawl before suddenly leaping out at a bajillion m/s...

Is there a way for the warp in, to detect in the ship course if there is a potential collision ?

X---------------/---------------------<ship_in_hyperspace>

X is the final destination, the slash is an object (ship, planet, or whatever). If an object is detected, the ship will stop his hyperspace jump instead to continue to his final destination.
Title: Re: Warpin / Warpout speed
Post by: PL_Harpoon on July 07, 2011, 03:44:48 am
In that case, as I said $Forward Decel: is the key here. Just increase the value and the ship will slow down more quickly.

I am currently using 10 (seconds) on a 150 meter long warship and have experimented with distances ranging from 10,000-20,000 meters, which leads me to believe that $Max Velocity: and/or MOI is involved.
What's your warp-in speed and max velocity?
Title: Re: Warpin / Warpout speed
Post by: headdie on July 07, 2011, 04:39:58 am
At present

Code: [Select]
$Damp: 5.0
$Rotdamp:                       5.5
$Max Velocity: 0.0, 0.0, 48.0
$Rotation time: 8.0, 8.0, 8
$Rear Velocity: 0.0
$Forward accel: 5.0
$Forward decel: 10.0
$Slide accel: 0.0
$Slide decel: 0.0
$Warpin Type: default
$Warpin Speed: 2000

I am aiming for a fast and fluid style of combat and movement in general so even large warships are quite fast and agile by FS standards
Title: Re: Warpin / Warpout speed
Post by: PL_Harpoon on July 07, 2011, 05:50:53 am
So, in that settings, if your ship decelerates from 48 to 0 in 10 seconds then it will need about 416,6 seconds to stop from your warp-in speed. By that time it can fly really far away. Try to decrease $Forward decel: value to something like 0.05 and see where that leads you.
Title: Re: Warpin / Warpout speed
Post by: swashmebuckle on July 07, 2011, 11:44:15 am
Hyperspace does indeed have some issues.  When a ship is set to jump out using hyperspace, it needs to be going a certain speed before the warpout will occur, just like with a normal subspace jump.  Unfortunately, there doesn't seem to be any way of controlling what that speed is, so ships generally slow down to a crawl before suddenly leaping out at a bajillion m/s...

Is there a way for the warp in, to detect in the ship course if there is a potential collision ?

X---------------/---------------------<ship_in_hyperspace>

X is the final destination, the slash is an object (ship, planet, or whatever). If an object is detected, the ship will stop his hyperspace jump instead to continue to his final destination.
I don't think that's possible without a code change (or maybe it could be done with scripting?).  The game does check the area ahead of your ship on warpout, but only for a short distance (which makes sense for the FS-style subspace jump).  That might be a good place to start working on a hyperspace overhaul, as hopefully it would just be a matter of extending the checked area out to the edge of the playing field.
Title: Re: Warpin / Warpout speed
Post by: Vengence on July 07, 2011, 12:17:28 pm
If you set a Warp in Speed, the value you put is in second. So, if you put 5, your ship need 5 sec to arrive to his final destination. The greater is the value, the ship will move slowly. But it appears it doesn't slow down as expected. I've just tried it yesterday just to confirm the behavior of this variable since I didn't really understand the description in the wiki.
IIRC, it was Chief who has implemented such feature, I think. :)

I've tried it with a time of 9000 even and no go ;). It just plops into existance.