Table based warp parameters and new custom warp animations.#6500
Conversation
…eters configurable by table. New exp_to_line function to be more consistent and to fix a bug.
MjnMixael
left a comment
There was a problem hiding this comment.
Noticed a few things with parsing that's not immediately apparent since our parsing system can be a touch confusing.
…enum and default else statements will not override earlier entries.
|
I believe I've addressed the suggested changes with this latest commit. Let me know if you think of anything else. |
MjnMixael
left a comment
There was a problem hiding this comment.
Well done with the new changes. They revealed just a few more small cleanup things but otherwise the parsing is looking good to me.
|
Parsing looks good to me now. 👍 |
BMagnu
left a comment
There was a problem hiding this comment.
Some small changes.
Other than that, there's a bunch of math here.
For the new options, I'll just assume that it's sensible for the visual effect you're going for.
For the classic type, I can't easily validate that the defaults will result in the same visuals as they did before this PR. Is this the case? Or does this PR visually change things for the default tables?
Took a closer look, but I actually need to change the default flare size ratio to be All of these changes will change the size of the warp model for older media_vps. The scaling of the warp model was determined by a couple different factors including the radius of the model itself. I could make it to where the cinematic "defaults" that I chose would be required in a |
|
Hmm, that sounds interesting. |
I suppose I could pull that information from the model, but the radius is also arbitrarily divided by |
|
Yeah, pretty much. |
…le with older mediavps.
|
This latest commit should preserve older mediavps. I pulled out my new table and my new |
BMagnu
left a comment
There was a problem hiding this comment.
Alright, seems good.
I'll assume this is well tested both for existing MVPS / retail and your new use case based on your comment.
Small and subtle fix: move the CINEMATIC options inside the preceding if() block in the same way that the flare style options are inside their preceding if() block. This prevents the CINEMATIC options from being reset to their default values in subsequent modular table parsing. Followup to scp-fs2open#6500.
Overview
There are two reasons I want to add this feature. First, because the lens flare does not scale with model size and the warp model radius sizing was imprecise. In order to make the warp model radius bigger, the convention was to just make the model bigger in the
.pofitself. Additionally the previous code divided by 25 in order to compensate for the larger model radius. Thus scaling the model relative to the ship is a trial and error process. Also, I've made my current effect larger than the effect has been previously, and when I did that I discovered that the lens flare does not scale relative to the warp model. So I wanted to remove any arbitrary scaling factors and allow for a way to make the lens flare proportional.Secondly, I wanted to customize the animation to be more dynamic and resemble the intro cutscene of Freespace 1. In that cutscene there's variable "ripple speed' and an initial spin that make the subspace vortex opening a lot more dynamic and interesting.
So I've done several things in this PR.
shipfx_calculate_effect_radius()is 1.5. By changing the fireball table values$Warp size ratio:and$Flare size ratio:, it's possible to increase or decrease the ratios as necessary with any animation. These values are multiplied on top of the already existing 1.5 multiplier which allows us to maintain the retail default.$Cinematic: trueis defined, you then define the ratios as+Warp size ratio:and+Flare size ratio:underneath the cinematic option. This is because, with Cinematic turned on, there are different default values than with it off based on my own tweaking of the effect. The Cinematic warp defaults for+Warp size ratio:and+Flare size ratio:is1.6and5.3respectively.$Bobboau anim: truetable value. This will override the Cinematic option if$Cinematic: trueis on.$Cinematic: truealso comes with the extra options+Rotation anim:and+Frame anim:. These give direct access to the functions that define the rotation and frame rate of the Cinematic warp animation.+Rotation anim:first two slope values are multiplied against PI so we can define the rotation velocities in terms of radians.An example
-fbl.tbmentry (don't use these rotation values, they're ridiculous):exp_to_line()explanationThis function starts off as an exponential function and then decreases into a linear function. This allows you to define an initial velocity that then decays into a linear velocity. The parameters of this function are
start_slope,end_slope, andscale.start_slopeis the initial velocity.end_slopeis the linear velocity the function settles on.scaleis how long it takes to go from exponential to linear.Demo Video