beyond-all-reason / beyond-all-reason/RecoilEngine
[FR] CEG: add a way to tie animLength to TTL
- Dominant language
- C++
- Stars
- 679
- Forks
- 290
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 40
Description
Say I have a 5x5 spritesheet and the last sprite is empty, I want the animation to play out exactly once and then disappear, for example it's a flipbook explosion that just dissipates. I want it to dissipate at a somewhat random pace so that explosions don't all look the same. Say I want it to have a TTL between 50 and 75 frames.
```
particleLife = 50,
particleLifeSpread = 25,
animParams = "5, 5, ???", -- what anim length do I put?
```
If I put 50 (or -50), then the animation will loop or bounce back if TTL rolls high.
If I put 75, then the animation will disappear abruptly before the last sprite is reached if TTL rolls low.
If I put `50 r25` then the TTL roll and animLength roll are still independent and not aligned with each other, so the two cases above can still happen.
Ideally there would be some way to make animLength take on whatever value TTL (particle life) rolled. Using `0` looks like a natural choice but any other way to specify this would also be fine.
Contributor guide
Research direction
Start by locating the particleLife, particleLifeSpread, and animParams handling in the engine. Trace how TTL and animation length are currently rolled and applied, then determine how they could share the selected particle lifetime. Done means a 5x5 animation with a random TTL from 50 to 75 plays once and disappears without looping or skipping its final sprite.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- game-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100