Devlog 1.1: Item catch prototype


Introduction

Hello there! This is Alessandro, one of the devs go this project. In this devlog we're going to talk about one of the mechanics of Brawlstorm, item catching. As this is one of the first prototypes, we'll go over this both in Unity and Unreal.

What is item catching?

Item catching is Brawlstorm's mechanic that revolves around picking up items in the game arena. The way we imagined it, we won't need a pickup key for the player to grab an item as it will happen automatically on item collision. Since we can also throw weapons and items a problem arises: how do we know if on collision we should pickup the item or damage the player from the enemy throw?

We agreed on the deciding factor to be the relative velocity of the player compared to the item.  If the relative velocity exceeds a certain threshold, the collision will cause damage to the player. If it remains below the threshold, the player will instead pick up the item.

Given the previous rule, a new interesting mechanic is introduced: item catching. Since the relative velocity is influenced by both the item’s velocity and the player’s movement, the player can adjust their motion to reduce it, aiming to stay below the threshold and successfully grab the item instead of taking damage. This needs accurate tweaking, but it can become part of the skill expression of the game and influence future design decisions to try and accentuate the importance of it.

Unity prototype

The Unity engine makes this mechanic really easy to implement.

private void OnCollisionEnter( Collision collision ) { }

This overridable GameObject method gives us access to everything we need. First off we're going to check the tag of the collider to be sure we're colliding with an item.

private void OnCollisionEnter( Collision other )     
{         
    if ( other.gameObject.CompareTag( "Item" ) )         
    {  
        // check vrel here
    }
}

After that we just need to calculate the relative velocity but the Collision parameter "other" already provides us this information.

private void OnCollisionEnter( Collision other )     
{         
    if ( other.gameObject.CompareTag( "Item" ) )         
    {             
        if ( other.relativeVelocity.sqrMagnitude > maximumItemSpeed * maximumItemSpeed )
        {                              
            // TAKE DAMAGE            
        }             
        else if ( _held == null )             
        {
            // CATCH ITEM
        }  
    }   
}

Unreal prototype

Work In Progress

Files

Build.rar 345 MB
4 days ago

Get [Group26]Brawlstorm

Leave a comment

Log in with itch.io to leave a comment.