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

Post demo update!

Development Streams!

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!

The Cardinal Crusade Demo release!

Joining the 10Y club

A look at a new enemy: The Core Guards Today we would like to show off one of the new enemies that you will encounter in world 3. These large, brutish soldiers are well armoured and will surely put up a fight! … Even if they have apples for heads.

Its finally time to announce a release date!

Eldritchvania will be available here on Game Jolt, Steam and Itch.io at 12am(AEDT) on the 10th of February!

\/ Read the article for more \/

We took @Benallen 's suggestion and improved the map view even more by changing the colour of rooms you've entered, further clarifying where you've been so far; and thus where you might want to go next.

#Eldritchvania

Devlog sunday 8