Speedrunner Movement
I crafted a speedrunner movement mechanic inspired by the game "Neon White." It encompasses a fundamental movement system enriched by various Abilities, enabling its versatile application across a broad spectrum of levels.
​
The development of this system took place within our team's custom engine, essential for our game projects. Notably, a significant aspect of the project involved implementing a physics engine to support its functionality.
Implementing PhysX and Basic Movement
The initial phase focused on implementing standard player movement, running and jumping. To do this a physics engine had to be used, in this case PhysX.
Setting up the fundamentals of PhysX wasn't overly challenging, but it did consume significant time due to my unfamiliarity with it. A crucial aspect emerged in establishing a robust filtering system and routing essential collision data to the appropriate components. To streamline this process, I devised a system allowing any game object to possess a PhysicsComponent. This component offered flexibility with various filters and enabled selective contact or triggering based on user preferences.
​
This enabled the implementation of basic movement mechanics, facilitating actions such as jumping when on surfaces with the ground filter, or taking damage upon contact with objects marked with the damage filter.
Adding Abilities
The subsequent phase involved initiating the creation of abilities, which were pivotal in defining the unique movement dynamics of Neon White. I categorized the abilities into two sections: initially, simpler ones with limited movement while active, followed by more complex ones requiring additional modifications to the physics implementation. To streamline the addition of future abilities, I devised a state system. Under this system, the player remained in a constant state that reverted to the normal state once an action was completed.
The simplest abilities encompassed two types of dashing, double jumping, and executing a ground slam.
Ground Slaming
Stomping served as the most straightforward ability, causing the player to descend at a consistent speed until collision with an object. However, merely executing this action lacked the satisfaction desired in an ability. To enhance the user experience, I implemented a brief buildup to convey a sense of weight, coupled with slight adjustments to the field of view (FOV) to create the perception of increased speed. This approach was consistently applied to all abilities to amplify the overall satisfaction of movement throughout the game.
Dashing
I developed two distinct dashing abilities:
The first was a straightforward dash, ideal for early introduction to players due to its simplicity and ease of use. Activating this ability resulted in movement along a flat, straight path, aligned with the direction the player was facing in the horizontal plane.
The second dash provided full directional control, offering greater versatility in its usage but requiring more skill to master. This ability was well-suited for introducing to players already accustomed to the game's basic mechanics.
An issue emerged when the abilities abruptly ended, resulting in sudden transitions back to standard movement and an instant halt for the player. To address this, I introduced an ambiguous falloff force that any ability could set. This force smoothed out movement at the end of abilities, creating a more seamless transition back to standard movement.
Double Jumping
Double Jumping was a bit diffrent from the previous abilities as it should not effect the rest of the movement of the player. Activating it was basicly just like jumping when standing on the ground. To make it work it just started the jump by impulse and then played the standard movement
Hurtboxes
In addition to movement, the player also required the means to inflict damage upon enemies and manipulate the environment. To achieve this, I implemented a hurtbox that each ability could activate and customize to match its movement. For instance, the dashes project a wide box in front of them, while the ground slam generates a sphere capable of destroying objects upon impact. In a full game scenario, these actions would be accompanied by visual effects (VFX) or particle effects, clearly signaling to the player the destructive effect and scale of their actions on enemies and the environment.
Shooting Bullets
The goal of the reference game is speedrunning and utilizing shortcuts, a feat made possible by shooting enemies, as every enemy must be defeated for the player to succeed.
Initially, shooting was implemented using kinetic bullets. However, a challenge arose as PhysX's continuous collision detection did not support this method.
The solution involved implementing a sweep mechanism. Given the deterministic nature of the speedrunning game, where enemies remain static, a sweep is conducted immediately upon the player clicking the button. If the bullet successfully hits its target, the enemy is scheduled to be eliminated after a specified duration determined by the bullet speed. This approach allows for the bullets to be entirely simulated, ensuring accurate gameplay mechanics.
Advanced Abilities
To maximise the number of possibilities when creating a level there are some more advanced abilities in the game 'Neon White'. To create something similar I had to add raycasting to my PhysX implementation, which was quite simple and made everything I needed possible.
​
To empower gameplay designers in refining each ability, I ensured nearly every aspect was customizable at runtime. This flexibility would allow a designers the opportunity to fine-tune gameplay to perfection, creating an addictive and engaging experience for players.
Grapple
Following the implementation of raycasting, the first ability I developed was a grappling hook. This ability functions by projecting a ray forward, and upon encountering an object within range, it pulls the player towards it, providing a boost. This feature opens up a multitude of creative possibilities, ideal for crafting a diverse range of levels within a game.
Teleporting
For long-distance travel, the teleportation ability is available, although it's restricted to teleporting to enemies. This ability was straightforward to implement, thanks to the existing functionality of raycasting. However, the challenge lay in making the teleportation feel satisfying, as simply transporting the player could be disorienting and lackluster.
To address this, I enhanced the experience by initially moving the player close to the enemy, then concluding with a dashing motion, providing a more dynamic and engaging transition.
Bomb
The most intricate ability in development was the Bomb ability. It was constructed by repurposing the bullet mechanics, with the crucial modification of triggering an explosion upon impact. Upon interacting with this explosion, the player is propelled upwards by a predetermined amount determined by current velocity. Additionally, the horizontal displacement is determined by the player's distance from the explosion's center.
Reflection
Developing this project was quite enjoyable, particularly due to the opportunity to craft something truly engaging for players. Throughout the process, I gleaned valuable insights from both successful implementations and areas for improvement. Specifically, I recognize the need for a clearer implementation of the physics engine, as post-collision events remain somewhat ambiguous, and there was a necessity for further filtering on the player side to streamline functionality. Reflecting on the structure of the abilities, I realize that enhancing clarity could facilitate easier future development for subsequent developers working on the codebase.