flare-engine
flare-engine copied to clipboard
Animation Definition Files with non-8 direction rendering
It seems like the concept of 8-direction rendering is hardcoded into a couple places in the engine. I'm working on a concept that only needs one or maybe two visual directions for characters. Is there a way (other than to just repeat the animation lines) to make this happen?
Followup question: lots of missiles would look much better with 16-direction rendering. Is this currently possible?
Unfortunately, the 8 directions are indeed hard-coded. So 'no' to both questions.
Maybe we should support defining the total directions per-animation and automatically convert them to fit the engine's maximum direction count. This would be the same as repeating the animation lines, but it would happen automatically. The values for this new property would be a complete set:
- 1 direction
- 2 directions (left/right)
- 2 directions (up/down)
- 4 directions (up/down/left/right)
- 8 directions (default)
- 16 directions (if implemented)
That would be convenient for me, though it's also pretty easy to just generate the redundant lines at enemy design time.
You might get minor memory savings by calculating the necessary render direction at draw time based on the available directions instead of filling the animation table with a bunch of redundant data, but I'm sure that's negligible.
I forgot a thing that we ran into when making Polymorphable. The directional calculations were inaccurate when trying to force a lower number of frames into the current 8-directional system.
If a feature like this were to be implemented, I'd recommend trying to calculate the render direction based on the number of animation directions available at runtime.
There is also 3 directions (up/right/down) with left being mirrored from right.