Game Engine DevelopmentAgile Game DevelopmentObject Oriented Programming
ChickBoy
ChickBoy is a 2D platformer game inspired by souls-like games. The game was developed using SDL for graphics and Visual Studio as the development environment. It features dynamic platforming elements, immersive combat, and diverse enemy AI, emphasizing tight controls and challenging yet rewarding gameplay. Additionally, the project served as an opportunity to expand my technical proficiency in C++ development, focusing on game programming patterns and real-time rendering.
Tools vscode
Tech C++, GLSL, SDL, SDL_mixer
Timeline 2024 July 10th - 2024 July 30th
Scroll to discover
Key Features
Souls-Like Combat: Engaging enemy AI, dodge mechanics, and a short range attack system make for challenging yet rewarding combat.
Platforming Mechanics:
Double-jump, wall-sliding, and dashing to navigate complex environments.Interactive World Elements:
Gates, switches, and environmental shift are dynamically linked with player progress.Art Style:
Sprite-based visual elements with dynamic visual and audio effects provide a vivid game world.Levels:
The game includes four distinct levels, including the starting page level, providing a structured progression of difficulty and complexity.Prototype and Design
Prototype Overview: The initial prototype of ChickBoy was focused on establishing the core movement and combat mechanics. The goal was to create a playable framework that allowed for rapid iteration on the game's core features. The prototype included basic platforming elements such as jumping, dashing, and collision detection, as well as basic combat interactions with enemy placeholders. This foundation enabled early testing of the feel of movement and combat, allowing adjustments to be made to create a fluid and responsive experience.Early Concepts and Ideas: The concept behind ChickBoy was to combine the challenging elements of souls-like combat with the precision of a platformer. Early iterations focused on creating engaging levels that encouraged exploration and rewarded skillful navigation. The levels were designed to include environmental shifts, enemy placements, and dynamic elements such as gates and switches, which were incorporated to make each level progressively more challenging.Target Audience: The game targets players who enjoy fast-paced, challenging platformers with a focus on combat. Fans of souls-like difficulty, precise platforming, and rich game environments will appreciate ChickBoy.Visual Concept:
Audio Design: The audio design of ChickBoy uses assets from Hollow Knight sound effects and NieR: Automata background music to evoke a sense of mystery and tension. Hollow Knight's sharp, organic sound effects add a tactile quality to interactions, while NieR: Automata's evocative music creates a sense of grandeur.
In game, actions trigger randomized or alternating sound effects, and different combination of interactions produce unique audio feedback. Background music dynamically fades in and out as the player approaches or moves away from level gates. There are total of 49 sound effects and 3 background music in the game.
In game, actions trigger randomized or alternating sound effects, and different combination of interactions produce unique audio feedback. Background music dynamically fades in and out as the player approaches or moves away from level gates. There are total of 49 sound effects and 3 background music in the game.
Level Design:
Gameplay Iterations: Throughout the prototyping phase, several iterations were made to refine the gameplay mechanics. Platforming abilities, such as double-jump and wall-sliding, were tuned for responsiveness and flow. Combat, especially attack collision and hit-back effects, was adjusted based on player feedback to ensure a fluid and intuitive experience. This iterative approach was essential in balancing the difficulty and ensuring that both platforming and combat felt rewarding without being overly punishing.
Prototyping Tools and Techniques: The prototyping process heavily relied on SDL for rapid testing of rendering and physics interactions. Visual Studio's debugging tools were used to identify and fix issues in collision detection and AI behavior. The use of GLSL allowed for quick implementation of visual effects like water reflections, which were tested during prototyping to add depth to the game world. Early level design drafts were created using simple JSON files to manage game objects and environment elements, allowing for easy adjustments during testing.Technical Architecture
High-Level Architecture: The technical architecture of ChickBoy follows a modular approach, allowing for clear separation of core gameplay, rendering, and user input. The architecture is organized into several key modules, each handling specific game functionalities, which improves maintainability and scalability.Key Logic Flows
Game Loop:
Level System:
Input Handling:
Rendering System:
UML Class Diagram
Technical Details
Programming Language: C++ was used as the primary programming language for ChickBoy. The decision to use C++ was based on its efficiency for performance-critical applications like games, as well as its suitability for low-level manipulation of game assets and memory management.Libraries and Frameworks:SDL (Simple DirectMedia Layer): Used for graphics rendering, input handling, and window management. SDL provided the necessary functionality for creating the 2D game world, handling key events, and drawing sprites efficiently.
SDL_mixer: Managed sound effects and background music. This library made it straightforward to load and control multiple audio tracks, contributing to an immersive experience.
GLSL (OpenGL Shading Language): Used to create shaders that implemented visual effects such as water reflections and lighting, providing an extra layer of visual polish.
nlohmann JSON: This library was used to manage level data, allowing level configurations, enemy placements, and object properties to be defined in external JSON files, which simplified iteration.
- Data Structure: Custom structs were used to represent hitboxes for characters and obstacles. These structs stored position, dimensions, and allowed for efficient collision detection during gameplay.
- Axis-Aligned Bounding Box (AABB): AABB collision detection was implemented to determine interactions between entities and the environment. This method was chosen for its simplicity and performance benefits, making it suitable for detecting collisions in a 2D platformer.
- Types of Collision: Separate collision logic were written to handle different scenarios, such as character-environment interactions use map collision, charatcer-object interactions use static collision, and enemy-player interactions use dynamic collision.
- Sprite Sheets: Character and enemy animations were managed using sprite sheets, which contained all frames of animation. The animation system was responsible for cycling through these frames based on character state (e.g., idle, running, attacking).
- Frame Timing: A timer-based system was used to control animation playback, ensuring that transitions between animation frames were smooth and matched the character's movement speed.
Chasing: Simple chasing algorithms were implemented for certain enemies to allow them to navigate towards the player.
Patrolling: Certain enemies appear in areas that require wall-jumping, patrolling in a fixed pattern to obstruct the player's path and increase the challenge by causing damage if touched.
Complex Pattern: The boss enemy exhibits a dynamic behavior pattern, adapting its actions based on the player's relative direction and distance, as well as its own current health.
- Object Pooling: Frequently instantiated objects, such as levels, were managed using an object pool to reduce the overhead of dynamic memory allocation and deallocation during gameplay, enabling seamless level transitions.
- Frame Rate Consistency: The game loop was optimized to ensure consistent frame rates by using delta time for movement and animation updates, ensuring a smooth gameplay experience across different hardware.
- Culling: Objects outside of the camera view were not rendered, improving performance by reducing the number of draw calls each frame.
- Visual Studio Debugger: Used extensively for stepping through code, monitoring variables, and diagnosing issues such as incorrect collision detection or animation bugs.
- Logging: A simple logging system was implemented to output debug information to the console, which helped identify issues related to game logic, such as incorrect enemy behaviors or failed level transitions.
- Hitbox Visual Debug Mode: A hitbox visual debug mode was introduced to aid in verifying the accuracy of collision detection in combat. This mode renders the hitbox areas in real-time, allowing for precise observation and adjustment of hittable zones.
Playtesting
Playtesting was conducted throughout the development cycle to ensure that ChickBoy provided a challenging yet enjoyable experience. The goal was to identify pain points, areas of confusion, and any unintended behaviors.
One example is that in the third level playtest, many players found it difficult to control the attack direction using movement inputs, particularly in tight combat scenarios. To address this, a dynamic targeting system was implemented, allowing the player's attack direction to automatically adjust toward the closest hittable enemy hitbox. This enhancement made combat feel more fluid and intuitive, ensuring a smoother and more satisfying player experience.
One example is that in the third level playtest, many players found it difficult to control the attack direction using movement inputs, particularly in tight combat scenarios. To address this, a dynamic targeting system was implemented, allowing the player's attack direction to automatically adjust toward the closest hittable enemy hitbox. This enhancement made combat feel more fluid and intuitive, ensuring a smoother and more satisfying player experience.
Results and Takeaways
Project OutcomeFuture ImprovementsExpanded ContentAdditional levels and more diverse enemy types could be developed to expand the game's content and keep players engaged for longer. Including more complex puzzles and introducing new abilities would enhance gameplay depth.
Refined AIEnemy AI could be improved to be more dynamic and reactive, enhancing the challenge and making enemy encounters more engaging. Introducing cooperative enemy behaviors could also provide a fresh layer of strategy for players.
Enhanced Collision DetectionUpgrading from AABB to SAT for collision detection offers greater hitbox precision, resulting in more accurate and satisfying combat interactions.
Credit: Art and Sound
Visual: Character, item, and map assets for ChickBoy were sourced from Penusbmic on itch.io. Their unique artistic style contributed significantly to the game's visual appeal and thematic consistency. You can explore their work through this link: https://penusbmic.itch.io/Sound Effects (SFX): The sound effects in ChickBoy use audio assets from Hollow Knight, providing sharp, organic, and immersive sound design for character interactions and combat feedback.Background Music (BGM): The background music in ChickBoy utilizes audio assets from NieR: Automata, enhancing the emotional depth and atmospheric immersion throughout the game.