Skip to main content

Happy new year! 0.3.4 is now released.

· 2 min read
Mia Gobble
Seam Creator

New year, new update! v0.3.4 introduces EventSequence, alongside some other changes and API doc improvements.

Before going deeper, this is the summary of changes made:

  • Added EventSequence
  • Completely rewrote the math for springs, fixing bugs relating to critical dampening
  • Backend changes
  • Removed From and DeclareComponent errors when trying to refer to them, and they now just return nil
  • Improved API documentation

The big highlight of this update is EventSequence, which is a way to, well, sequence stuff. It's great for complex animations with many changing values and moving parts.

Here is an example using it:

local TestValue = Value(5)

OnChanged(TestValue, function()
print(TestValue.Value)
end)

local TestSequence = EventSequence({
{
Time = 0.1,
ValueSource = TestValue,
NewValue = 10,
},

{
Time = 1,
ValueSource = TestValue,
NewValue = 15,
},

{
Time = 3,
ValueSource = TestValue,
NewValue = 25,
},

{
Time = 2.5,
ValueSource = TestValue,
NewValue = 20,
},

{
Time = 5,
Callback = function()
print("Reached 5 seconds")
end,
}
})

TestSequence:Play() -- Over the course of 5 seconds, it prints 10, 15, 20, 25, and "Reached 5 seconds"

Aside from that, let's talk about springs. When I first added Spring, it had a comment in the math function saying:

I copied this spring math from another module I did a long time ago, so let's hope it doesn't explode.

And well... it exploded. It turns out the math didn't do a good job with critically dampened springs that were updated often, usually causing crazy results. The new math should fix this.

On the backend, the big change I did was swap from Janitor to Trove for anything cleanup-related, since Janitor wasn't very reliable at times. That being said, in the future I plan to swap out Trove for Heap, a cleanup module of mine that was just birthed (https://github.com/MiaGobble/Heap).

Finally, From and DeclareComponent will no longer throw an error when referenced, and all references to them are now cut. If you still try to use them, you will get a nil value.

I want to point out that alongside this update is some improvements to the API documentation, which should hopefully better explain some key parts of Seam.

That's this update! Let me know how event sequences and springs work for you.