Game
The Cardinal Crusade
7 years ago

Bug Bash: Down Stab Consistency


Welcome to Bug Bash!

Today’s bug is all about the Down Stab / Pogo-sword attack.

- Down Stab allows the player to attack downwards and bounce off damaging instances like a Pogo Stick

The issue/s:

  • Bounce height from a flat surface is inconsistent. This leads to level design issues in tight spaces where bounce height needs to be consistent.

    5d0a7cfd41f85.png
  • Sometimes the player falls too far into a damaging object and the player gets hurt when they should bounce safely.

    5d0a7d0071158.png

Initial thoughts:

The cause of both these issues is likely lag spikes. Less powerful machines sometimes see drops in frame rate and to compensate for this the game speeds up and slows down as frame rate fluctuates. This means movements become more extreme in some cases. Moving downwards to fast could cause the player to fall lower into a damaging object and take damage instead of safely bouncing. This could also cause the initial bounce location to vary in height making the total bounce height higher or lower in some cases.

Intended solution:

  1. Collision detection currently happens within damaging instances themselves. When a collision is detected with the players sword, they tell the player to bounce. Change this so that the player tests for collisions between the sword and damaging instances just before testing it’s own collisions.

  2. If a collision between the sword and enemy is found, pass on damaging instance to the player to process positional values in order to provide a precise and consistent bounce location.

  3. Within player’s collision detection, test to see if the player is currently executing a down stab by looking at speed and attack state.

  4. If doing a down stab, test current and previous position. If previous position is outside of the collision, revert position and move down into contact with damaging instance for precise and consistent bounce positioning.

Results:

After applying the intended solution the effects were as expected, but we only fixed one of the two bugs. The bounce position is much more accurate with an error margin of about one pixel. However when the game lags the player still bounces too high. It seems the issue might be related to gravity and jump power itself, rather than bounce location alone.

The new bounce method did fix the issue of the player falling too far into damaging instances though. So we’ve managed to successfully squash one of the two bugs.

In order to fix the bounce height issue we’ll need to look further into the jump physics to try and figure out why there is a height difference when the game is not running at a full 60 fps.

That’s it for this Bug Bash. Did you enjoy this post? Want to see more like it? Let us know by answering the poll options below!

Have you played The Cardinal Crusade Demo yet? It features the entire first world!

  12 votes Voting finished



5 comments

Loading...

Next up

Devlog: Behind the scene look at: The Brain Blaster enemy

Post demo update!

Hey all!

Just a friendly reminder for those who may have missed it.

Eldritchvania is out and free to play right now!

We're getting some awesome feedback and super stoked to see people enjoying our work.

Check it out: https://gamejolt.com/games/Eldritchvania/415163

Devlog sunday 8

The Cardinal Crusade Demo Release! Friday 31 March

The Cardinal Crusade Demo release!

A transformation Hello, in this devlog we’re showcasing an animation where the player character transforms into a smaller, flesh monster. Why is this in the game? What purpose does it serve? Perhaps more will be revealed soon…

We're back with another update to Eldritchvania!

The focus here was accessibility, namely the flashing effects included throughout the game.

We've added the option to turn off flashing effects!

Development Streams!