Introduction

Previously on Land Crisis Dev Log:

We fought against animators and other weird things.

Today on Land Crisis:

Nope.

Development progress

current week

After countless attempts of getting animations working, I finally broke on a completly different topic: Framerates.

Or rather, “Sprites per Seconds” - or, as the more commonly used term “Frames per Second” / FPS.

Very basically: The system COULD work - if all the characters use the same amount of sprites.
The issue this time, is, that we have different “animation lengths” / number or sprites per animation. It would be manageable if I have 5 events and 3 animations, just skip every 2nd. But what about 4 vs. 3 or 2 vs. 5? This makes animating things needlessly hard and error prone. So, the easiest solution for this was implemented: a custom animation controller.

CAC

Even with a nifty little editor script. Performance-wise this can still be optimized to use a global “counter” loop instead of one per instance, but for now, the impact was lower than with the LateUpdate() one, so it’s allowed to stay. It also leaves some space for optimizing later on.
What I did, however, optimize, is the loading of “colored” sprites.
To create sprites in player colors we basically have a predefined number of colors (magenta and a couple of other horrific colors nobody’s gonna use) and replace them during load time with defined player colors. To not having to re-color them on each frame, during JSON load we cache those in a List. The only issues is, that I’m starting to lose track (or control) of the sprites here sooner or later. For now, this is the most “optimized” solution I got. The Animation Controller gets the colored-unit-specific-animation-specific list set as animation list and gets the FPS/SPS set to the required value for the animation, and let loose.
This should also work across multiplayer instances, as this is one of the specific goals we have in mind.

Summary:

  • Replaced Unity Animator and Unity Animations with custom script
  • Extended JSON files with animations and animation speeds
  • Added EditorScript for testing out animations and behaviours
  • Added everything back to the main game scene from the “debug” scene / my test environment.

And with that, I have to delay some footage from the in-game for another week. Sorrrrrry!

Upcoming planned next steps

Not much changed here:

Status Date Topic Sub-Topic Description
Work 5/06/2020 LandCrisis Development Check abilities with new GameEntity system (attack, gather)
Work 5/06/2020 LandCrisis Development Added units, animations and other graphical upgrades
Plan   LandCrisis Development Import FoW implementation
Plan   LandCrisis Development Static playtest, initial build

Closing statement

Any questions? Suggestions? Changes? Critique? Hit us up on Discord, the link is here.

Stay safe, stay strong, keep your distance and I’ll keep you guys updated soon!

- KuhnChris