Author Topic: Feature request: changes to $Warpout type: Hyperspace  (Read 3689 times)

0 Members and 1 Guest are viewing this topic.

Offline Droid803

  • Trusted poster of legit stuff
  • 213
  • /人 ◕ ‿‿ ◕ 人\ Do you want to be a Magical Girl?
    • Skype
    • Steam
Re: Feature request: changes to $Warpout type: Hyperspace
I have a few changes myself:

1. Make it so that the game treats the ship as "arriving" when it actually stops moving, not when it appears out at super far away. This will eliminate issues such as wings arriving from a ship's arrival being spawned at super long distances, and more importantly fix a crash that results when ships warping in have initial orders set to waypoints, waypoints-once, and ai-chase which occurs because there is an invalid pathfinding matrix as the ship's location is undefined/changing too fast. (I had a callstack identified as this by #scp, so yes it happens.)

2. Make ships not collide until they have "arrived" and stopped moving to prevent "hyperspace accidents", especially with the "near ship" and "in front of ship" triggers which can't really be used. I have had several people document ships failing to arrive/spontaneously exploding on arrival due to such collisions, which are not consistent and vary from processor to processor based on floating point math. This will also fix the bug where such a collision results in the game sounds cutting out.

I am making a mod that uses hyperspace as a warpin type, and these things occasionally end up semi-randomly breaking missions. The second one especially, since I can either have fixed arrival points (which can be abused), or the random factor of ships dying on arrival and game sounds cutting out.

In fact, I would classify these as bugs, but some people insist they don't exist, even though I've presented call stacks from FSO crashing with both, with handwaves telling me "oh, just don't set initial orders, assign them via sexp after they arrive" and "er, no, no hyperspace collisions"...

Please? D:
(´・ω・`)
=============================================================

 

Offline zookeeper

  • *knock knock* Who's there? Poe. Poe who?
  • 210
Re: Feature request: changes to $Warpout type: Hyperspace
Sure, I'll take a look at those sometime soon'ish.

 

Offline zookeeper

  • *knock knock* Who's there? Poe. Poe who?
  • 210
Re: Feature request: changes to $Warpout type: Hyperspace
This super-simple patch should pretty much fix those issues:

Code: [Select]
Index: shipfx.cpp
===================================================================
--- shipfx.cpp (revision 7929)
+++ shipfx.cpp (working copy)
@@ -4222,7 +4222,7 @@
 
  if(direction == WD_WARP_IN)
  {
- shipp->flags |= SF_ARRIVING_STAGE_2;
+ shipp->flags |= SF_ARRIVING_STAGE_1;
  objp->phys_info.flags |= PF_WARP_IN;
  objp->phys_info.vel.xyz.z = (scale_factor / sip->warpin_time)*1000.0f;
  objp->flags &= ~OF_PHYSICS;
@@ -4258,6 +4258,7 @@
  vm_vec_scale( &vel, initial_velocity );
  objp->phys_info.vel = vel;
  objp->phys_info.desired_vel = vel;
+ shipp->flags |= SF_ARRIVING_STAGE_2;
  }
  objp->flags |= OF_PHYSICS;
  this->warpEnd();
@@ -4287,4 +4288,4 @@
  vm_vec_scale_add(&objp->pos, &pos_final, &objp->orient.vec.fvec, scale);
  }
  return 1;
-}
+}
\ No newline at end of file

 

Offline Droid803

  • Trusted poster of legit stuff
  • 213
  • /人 ◕ ‿‿ ◕ 人\ Do you want to be a Magical Girl?
    • Skype
    • Steam
Re: Feature request: changes to $Warpout type: Hyperspace
Oooh that sounds cool.
...time to add another patch to my ever-growing-list of bug-fixes-not-in-trunk >.>
(´・ω・`)
=============================================================

  

Offline Goober5000

  • HLP Loremaster
  • Administrator
  • 214
    • Goober5000 Productions
Re: Feature request: changes to $Warpout type: Hyperspace
Not having any hyperspace-capable ships, I don't have the ability to test this, but it looks like it'll work.  Committed in 7936.