flare-engine icon indicating copy to clipboard operation
flare-engine copied to clipboard

Animation Definition Files with non-8 direction rendering

Open pennomi opened this issue 6 years ago • 4 comments

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?

pennomi avatar Feb 18 '19 01:02 pennomi

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)

dorkster avatar Feb 18 '19 02:02 dorkster

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.

pennomi avatar Feb 18 '19 02:02 pennomi

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.

directions

pennomi avatar Feb 18 '19 02:02 pennomi

There is also 3 directions (up/right/down) with left being mirrored from right.

basxto avatar Dec 17 '19 15:12 basxto