Jakten På Pannkakstårta | PlayerController & Dialouge System
Table of Contents
Details
"Pannkakstårtan," a top-down adventure RPG, marked my fourth game project during my time at The Game Assembly. With a team of 5 programmers, 4 artists, and 2 designers, we collaborated over the span of 8 weeks. We used TGE school's own framework and Unity as our level editor.
Contributions
- PlayerController
- Movement
- Combat
- Dialouge System
- Romance System
- Display different emotion on characters
Intro
As part of my responsibilities, I led the development of the player controller. This included fine-tuning movement and rotation mechanics and setting up a smooth state machine to handle different player actions seamlessly.I also the added dynamic animations to make the character's movements feel more natural and responsive. In addition to these main tasks, I pitched in with other features to make sure the gameplay experience was immersive and complete.
PlayerController
Let's explore the core components of the player controller, Movement. state machine management and combat mechanics. Here's a look at how these elements came togeheter to shape the player's journey.
Movement Mechanics
In our project, we utilized an InputMapper to translate player inputs into actionable movements within the game environment. The RecieveEvent function is pivotal in this process, managing various input events to drive player motion.
Within RecieveEvent , we update the myInputDirection vector based on player input. For instance, pressing keys for moving up, down, left, or right adjusts the myInputDirection accordingly to reflect the desired movement direction.
Combat Mechanics
Entering Combat State: When the player enters combat, we trigger the onEnter function. Here, we initialize various parameters such as setting the attack timer, configuring animations, and activating the hitbox collider to enable attacks. Additionally, visual effects (VFX) and audio cues are triggered to enhance the combat experience.
StateMachine
In the player's movement state, the State Machine governs the flow between different player actions:
Dialogue State Transition: If the player is conversing and not rolling, the State Machine shifts to the dialogue state (
PlayerDialogueState
). This keeps dialogues uninterrupted.Take Damage State Transition: When the player takes damage, the State Machine switches to the take damage state (
PlayerTakeDamageState
). This handles damage reactions seamlessly.Combat State Transition: Initiating an attack prompts the State Machine to transition to the combat state (
PlayerCombatState
) once the attack timer elapses. This ensures fluid combat sequences.Roll State Transition: Rolling triggers a transition to the roll state (
PlayerRollState
) once the roll timer ends. This facilitates agile evasion during gameplay.
My Wish:
Considering time constraints, a pivotal enhancement would be pre-instantiating all possible states during initialization instead of creating new instances upon transition. This optimization minimizes memory overhead and enhances runtime efficiency by circumventing frequent object creation and destruction. Through this approach, resource management is improved, contributing to smoother gameplay without compromising development timelines.
Dialogue System
At the outset of our project, we initially planned to implement a dialogue and romance system only if we had a preliminary draft before the alpha stage concluded. I was particularly enthusiastic about this feature and felt compelled to swiftly create a first draft for the team to demonstrate its feasibility.
Working closely with Tove, we collaboratively developed a dialogue system that also incorporated various endings based on the player's choice of romantic interest.
Utilizing an unordered map, we efficiently mapped character emotions to dialogue lines, allowing for dynamic expression changes during conversations. Additionally, we introduced dialogue choices and responses, enabling players to shape interactions.