Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: KeldorKatarn on July 06, 2009, 02:20:55 pm

Title: Jump distances
Post by: KeldorKatarn on July 06, 2009, 02:20:55 pm
Is there any way to calculate the jump-in and jump-out distances of ships? How does the engine calculate those?
Would be really nice if there was an easy way to do this instead of trial and error.
Title: Re: Jump distances
Post by: Wanderer on July 06, 2009, 02:47:13 pm
Well... you can always use scripting to determine the jump in and jump out distances
Title: Re: Jump distances
Post by: KeldorKatarn on July 06, 2009, 03:10:47 pm
Looking at the code at least for HUGE ships it seems easy to calculate...

Warpout distance = length * 0.5 - bbminz

length = length of the bounding box z dimension
bbminz = min z value of bounding box (negative, so it actually adds to the distance)
Title: Re: Jump distances
Post by: chief1983 on July 06, 2009, 04:06:48 pm
Does the engine actually check for a collision based on that data or does it check on a static short distance?  I worry because the current FotG warpout code actually warps the ship halfway across the playing field.  If it doesn't check through the necessary field of play we could try to warp through a Star Destroyer.
Title: Re: Jump distances
Post by: KeldorKatarn on July 06, 2009, 04:41:22 pm
I haven't checked for that. It checks for something special when a ship is docked.. but I don't know if it does colission detection.

The warp code is quite messy and hard to understand at all.
Title: Re: Jump distances
Post by: Nuke on July 06, 2009, 05:02:08 pm
how hard would it be to add a little indicator in fred which, if activated, would show where the jump hole would be when the ship warps out. this could save fredders alot of trial and error work.
Title: Re: Jump distances
Post by: dANGER boy on July 06, 2009, 07:15:12 pm
Amen to that.  I've had the same idea but have just reverted to trial-and-error while Fredding.
Title: Re: Jump distances
Post by: KeldorKatarn on July 06, 2009, 08:27:38 pm
well as I wrote, with large capships you can calculate it with abolve formula.
Title: Re: Jump distances
Post by: Cobra on July 06, 2009, 08:47:37 pm
I don't think there's a lot of collision detection going on when a ship warps in. I remember trying to fire bombs at a Deimos or Orion that was still in the process of jumping in and the bombs simply went through it.
Title: Re: Jump distances
Post by: colecampbell666 on July 06, 2009, 09:12:20 pm
Affirmative. Shots don't damage them until they're nearly through.
Title: Re: Jump distances
Post by: Aardwolf on July 07, 2009, 09:57:56 am
How does the collision warning - unable to jump thing work?

That is, when you're in a fighter, and you press alt+j, and it says "screw you" because there's a ship or asteroid in your way -- how does it determine that?
Title: Re: Jump distances
Post by: Trivial Psychic on July 07, 2009, 11:33:41 pm
Affirmative. Shots don't damage them until they're nearly through.
Back during "Playing Judas" in FS1, I've had the Eva run me over as it warped in, and it never even touched me.  It made lining up for scanning it quite easy.