Magic'Stick

Genre: Beat 'em up

Gameplay Programmer

Using the rather limited visual coding of Construct 3, I created a fully customizable wave manager and AI for the enemies.

The Wave Manager uses a 3-dimensional array stored in a JSON file to encode all information needed to create a wave (the position of each spawner, what to spawn and how much). This JSON is loaded from browser memory on launch and then read at the start of every wave to position everything and call the function that instantiates an enemy.

The Enemy AI uses the A* algorithm, where enemies move as self-avoiding groups. To achieve this, I needed to either:

  • Recalculate the A* map every frame, which would kill performance.
  • Overwrite the behavior, which would make enemies behave unpredictably.

So, clearly I needed a better solution. Ultimately, I landed on a mix of both:

  • Every 0.5 sec we recalculate the map around the enemies far from view, and every frame we do it for the enemies close to the player. Since the player focuses on close enemies, we sacrifice a bit of performance to make them highly responsive.
  • If an enemy overlaps another enemy, we overwrite the pathfinding with a biased random walk. While overlapping, the enemy does not recalculate the A* map to save on performance.
Magic'Stick Movement

Level Design

After coding it, I also designed every wave manually.

Not to go blind, I conducted a lot of playtests to know how different players react and tend to play our game.

Using this data, I positioned each wave’s spawner at specific points, creating encirclement or pinch situations for the player, but also creating safe pathways with the grappling hook.

This created an experience of a seemingly simple game that is in reality very demanding. We wanted to push the player to truly learn each little mechanic and "exploit" we put in the game, while making sure the game was actually achievable.

Magic'Stick Spawner