[BUG] STC warping animation partially ignored

(Herbyguitar) #21

Stargazer set up the warp in, warp out parameters using the techniques outlined above[quote=“radar3301, post:18, topic:1551500”]
(mostly because I didn’t want to mess with SobGroup splitting, game rules, and other such stuff)
[/quote]I think this is why it was borked in the new game. SG is not around much anymore…

(ajlsunrise) #22

I’m not sure I understand what you mean. SobGroups are still very much alive…

(Siber) #23

I think in this case SG is Stargazer, who set up that logic originally

(ajlsunrise) #24

Doh. Thanks @EatThePath

Well, I’m a huge fan of custom code now. Turns out they are global/can be shared between ships.

(Siber) #25

I think a lot of cool things can probably be done with the custom code system, or old things that could be done better, but I can never find time to really sink my teeth into it.

(Snake_B5) #26

Oooohh my gwwaaaadd yes it could ! \o/

@radar3301, you’re a legend ! <3

(ajlsunrise) #27

Been doing a bunch of experiments with the Star Trek style warp…

Good things:

  • Animations work as intended.
  • Ships don’t immediately disappear on warp out.

Bad things:

  • Ships don’t immediately disappear on warp out because you have to have a hyperspace effect defined in the race properties files, which leads to:
  • For a 1 second hyperspace effect (as defined in the race properties), animations have to be 100% done by the time the hyperspace effect moves to the halfway point, 0.5 seconds, because the hyperspace effect controls the clipping of the mesh (aka. whether the ship is drawn or not). But this means that for 0.5 seconds of both hyperspace in and hyperspace out, nothing is actually happening (I guess this is okay).
  • This also means that every ship for that race has to have the exact same hyperspace time.
  • Currently, the timing on effects is still off.

(ajlsunrise) #28


Pretty sure the ship disappears before it reaches the flash because of the exponential speed graph at which it enters. I’m not sure the engine is precise enough to catch the last bit of the animation.

(Nathanius) #29

Merry Christmas indeed! :santa:t4::smile:

I was thinking that we might have reason to migrate script to the custom code, here’s our impetus!

The timing of it all was something that Stargazer had figured out, I should be able to reuse that?

How are you making those mad files? Via HODOR?

(ajlsunrise) #30

I guess? I don’t know… I don’t see why not, except now the timing is going to be off…

No. I’m using the MAD Editor I created. Still needs some some slight work.

(Nathanius) #31

I asked Stargazer about the anim and how it clipped for you.

Part of the mad animation has always been cut. 1/10 of the animation was always missing in HW2.

Because of the 1/10s missing, the warp flash position is offset by 3280m, while the ship’s end position is 6561m in the mad animation.

The positions in the anim are (0s, 6561m), (0.125s,2187m), (…), …, if you do the math you get close to 3280m for 0.1s.

But I guess it hasn’t. Why should they change the duration of game ‘ticks’. These cause the delay between updates of different parts of the game engine (changes don’t happen instant).

That his ship does not reach to warp flash, is the 1/10s clipping, I think. And when it leaves hyperspaces it’s clipped because of the hyperspace window FX, I suppose. But that’s not interesting, because both mad animations are played. That’s what we’re after.

We don’t have a hyperspace fx animation listed in the race files like default HWRM, so the clipping you get from the square window isn’t triggered for us.

Essentially, to summarise the above, we’ve padded the animation so the ship reaches the flash point before the engine cuts off the end of the anim.

(ajlsunrise) #32

Having no hyperspace effect listed leads to ships simply disappearing when the hyperspace command is issued. The only way to have the ship not disappear instantly is to have the effect listed. I worked around the clipping issue by setting the offsets of the hyperspace window to {0, <0, 0, 100>}, {0.4999, <0, 0, 100>}, {0.5001, <0, 0, -100>}, {1, <0, 0, -100>} (hyperspace effects are scaled by the engine to resize to the bounding box of the ship hyperspacing). This is what I was referencing by the 2nd bullet point under my “Bad Things” list, above.

Well, at the very least, I feel like I’ve accomplished what I set out to do. You guys are free to modify the files however you wish. Just keep in mind the following requirements:

  • You have to have a hyperspace effect defined in the race properties.
  • Your animation has to finish in, or start after, half the time of the value of the cfg_hyperspace_effect_time variable in the race properties.

If the STC team doesn’t mind (specifically regarding the warp check script I cannibalized), I am okay with any part of this being used for other mods. You’ll also have to ask them about the fed_warpflash.tga texture in the fx sub-folders.

(Taiidan Republic Mod) #33

I also feel this, but I haven’t begun to scratch the surface of how to harness that power. Who feels able to write a tutorial…?

(ajlsunrise) #34

I can write one up if one doesn’t already exist.

(Herbyguitar) #35

Go for it. We’re all here to share and help, right :slight_smile:

(Nathanius) #37

So it’s taken me a month but I’ve finally gotten across our existing, full feature, warp script into the Custom Code. I even did it in such a way as to be able to continue moving the old scripts over from needing the sob splitter :slight_smile:

I got a headache trying to bring it over bit by bit into what you had written up @radar3301 and after I was finished I got exactly the same results as I did before (I had to set the repeat interval in the ship file to 0.01 for it to work as it did before though).

Unfortunately the first pass at getting your test warp ships to play warp in and out failed, I’ll try bringing your whole test framework in and then retrying once my headache has gone away >_<

(Nathanius) #38

@radar3301 your test files (unmodified) are all sorts of broken when laid over the top of STC :thinking:

Ships start out positioned ahead of where they should be and their warp out animation doesn’t play (their warp in animation does play though, opposite to the STC ships). More digging required… I’m going to disable stuff until I can get your results, hopefully it’s some script causing this and I can just fix it with a one liner!

So commenting out all of our scripts fixed the position of the ships at the onset, but the animation itself was still borked so… I don’t know. I’m going to revisit this later. There’s still lots to do that I can understand so I’ll work on that now :confused:

(Eville Jedi) #39

Radar, I got the example you posted to work, but I think I need to see how the animations are setup originally to get the timing to make sense, Even a screenshot of the HOLD_ANIM definition would be super helpful

(Nathanius) #40

How did you do it?! :open_mouth:

I have created a Max file with a base warp and shield anim that DAEnerys plays well, and the game seems to like, that I merge into HODs now in the hope that whatever is causing only half of an animation pair to play is identified to me. Did you want a copy?

(ajlsunrise) #41

Well that’s encouraging!

Sorry I didn’t respond sooner. I’ll put a full step-by-step together for you, if you still haven’t figured it out.