Week 7 - A Big (Not) Bad Wolf


You can tell by the length of this post that MOJO is next Monday.

I'll start by the smaller stuff.

I made the logic for moving from one level to the next, a simple enough thing. The system was built to allow back and forth between the levels, but as we downsized the prototype, both in quantity and variety of elements that it demonstrates, there isn't much reason any more to return to a previous level.

Had to fix a lot of stuff in the character controller. It had some rough edges to begin with, that were mostly inconsequential at the time of conception, but that tech debt quickly caught up. My love for Unity's physics engine is ever shrinking.

Also made some managing stuff to keep the state of the world consistent through scenes. For example, if we opened a gate on level 1, then travelled to level 2 and back to 1 again, we would expect that gate to remain open.

There were a lot of small details everywhere that needed a bit of coding attention. Like giving attackable creatures a grace period at spawn in which they could not be attacked. The kind of stuff that is very very small, but would stand out like a sore thumb to players.

Another much needed addition was something to visually indicate that an enemy had received damage. I made a small particle effect to indicate this.

Finally, I designed and implemented a boss battle, the Big Not Bad Wolf (Working name).

Having a lot of levels made, a lot of unlockable abilities, narrative, boss battles, collectables, we realised that it was a bit too much for presenting at MOJO: no player would stick around for such a lengthy demo. So we downsized the prototype: No unlockable abilities, no side quests, a lot less levels. We kept a few levels, narrative (as it is the primary element of the game we focused on), and two boss battles. The reasoning was simple. Our large number of levels wasn't offering that much variety and excitement, while a single boss battle had more interest than all our still very crude levels combined.

So it fell to me to design and code a wolf boss battle. Here is a sketch I made of the wolf's abilities.


  • A is a simple dash forward, which can easily be jumped over
  • B is a lunging attack, forcing the player to either move away, or jump over, if they react quick enough. I am not yet sure if the dash will be available in this fight. It would be possible to dash under the wolf.
  • In C, the wolf disappears from the screen, hiding in one of the bushes (though its eyes shine through the foliage). After a brief delay, it jumps out, dealing damage in a large area.
  • D only happens twice, after the wolf loses a set number of hp points. The wolf moves to one side of the screen, and inhales as much airs as it can, and then exhales it, causing a gale that pushes the player and sends pigs flying that deal damage it they come into contact with the player.
  • E, which happens only when the wolf is almost without any hp, causes it to vanish from the screen. It then becomes night time, the wolf walks to the edge of a cliff in the background, and howls to the full moon. Darker and smaller copies of the wolf (named shades) start appear randomly, executing either A or B and then vanishing.

And here is how the wolf "thinks":

After each action (and after a small recovery period) it goes back to walking.

Implementing the battle was rough. Mostly due to unity's physics engine, which was not cooperating. I ended up giving up on it entirely, and so the wolf's movement is completely parametric. It did need some maths, particularly for the lunge, in which the equation for a parabola was needed to be found from the wolf and the player's positions, but it was better than the alternative. The main drawback is that collisions with walls wouldn't be that great, and would probably cause a bit of flickering, so my brilliant solution was to simply remove said walls. They are still there, invisible, for the player only, as we don't want them to wander off off camera, but the wolf can simply move outside. This was made mostly for the dash (A), but, unintentionally, worked quite well for the Full Moon Pack (E), as the wolf can simply return to the arena from its sides.

The animations are simple keyframes, and they do not use unity's animation system, rather being game objects that are toggled when needed. My animation skills are... something, so the singular keyframes worked better than anything more complex that would take more time. The wolf does look derpy rising and falling in the bush attack, which I love.

The bush attack has a simple animation with a ton of game objects that are randomly turned on and off - anything to avoid using unity's animation system. Makes one wonder why I even use this engine in the first place.

Finally I composed the scenario, and made the transition to nighttime, which is just the daytime sky having its alpha value gradually decreased, revealing the moon and dark sky behind it. I think it turned out quite nice.

This fight will most likely appear as an out of order battle in the MOJO prototype, so it lacks any level transition elements that would require some adjustment not to interfere with the fight, which is nice.



It is mostly finished, I just want to add a wind visual effect while the wolf is blowing, and it needs a few adjustments for the pigs and shades' spawning positions. A howling sound effect wouldn't go amiss either,

Get A Child's Tale

Leave a comment

Log in with itch.io to leave a comment.