Skip to content

Allow curves to be tabled inline#6674

Merged
BMagnu merged 5 commits into
scp-fs2open:masterfrom
BMagnu:inline_curves
Jun 1, 2025
Merged

Allow curves to be tabled inline#6674
BMagnu merged 5 commits into
scp-fs2open:masterfrom
BMagnu:inline_curves

Conversation

@BMagnu

@BMagnu BMagnu commented Apr 9, 2025

Copy link
Copy Markdown
Member

This allows simple curves to be tabled inline wherever they are used, instead of forcing individual curve table entries.
Inline curves notably support only a much smaller subset of features, but that is perfectly sufficient for a large number of curves.
This can be used everywhere where curves are currently addressed by name in parsing.
An example table with inline curves would look as follows:

#Primary Weapons

$Name:                            @Subach HL-7
+nocreate
$Lifetime Curve:
+Input: Lifetime
+Output: Laser Radius Mult
+Curve Name: (0,0) -- (0.5,1000) -- (1,0)
$Lifetime Curve:
+Input: Lifetime
+Output: Laser Glow R Mult
+Curve Name: (0,0) -- (0.5,1000) -- (1,0)

#End

Note, that this will prevent curves from having a name that starts with an opening parenthesis.

For now, possible interpolations in inline mode are: --: Linear, -|: Constant, -/: Square with ease-in, /-: Square with ease-out.

@BMagnu BMagnu added enhancement A new feature or upgrade of an existing feature to add additional functionality. general modding A general feature or issue related to modding capabilities of FSO labels Apr 9, 2025
Comment thread code/math/curve.cpp
Comment thread code/math/curve.cpp
Comment thread code/particle/ParticleParse.cpp Outdated
Comment thread code/math/curve.cpp Outdated
Comment thread code/weapon/weapons.cpp Outdated
Comment thread code/weapon/weapons.cpp Outdated
Comment thread code/weapon/weapons.cpp Outdated
Comment thread code/weapon/weapons.cpp Outdated
Comment thread code/particle/ParticleParse.cpp Outdated
Comment thread code/utils/modular_curves.h Outdated
@BMagnu BMagnu merged commit e1810ed into scp-fs2open:master Jun 1, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement A new feature or upgrade of an existing feature to add additional functionality. general modding A general feature or issue related to modding capabilities of FSO

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants