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

The Cardinal Crusade Demo Release! Friday 31 March

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

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…

Hi all!

A huge thanks to everyone who has played and left feedback for Eldritchvania so far!

This first update is all bug fixes and you can see exactly whats been fixed in the article below.

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

The Control update!

We've update the controls in Eldritchvania to make it more enjoyable.

Check the article for details!

Woah!

Thanks all!

Don't forget to Wishlist Eldritchvania!

https://store.steampowered.com/app/2423710/Eldritchvania/

Development Streams!