Portfolio Project Blog post

pharium warima - Sep 20 - - Dev Community

Blog Post: Reflecting on My Maze Project Journey

Introduction: My Maze Project

For my final portfolio project, I build a 3D maze game using raycasting techniques. The project's goal was to create an immersive and interactive environment, allowing players to navigate a maze, complete with textured walls, enemies, and weapons. While the game was designed for anyone who enjoys solving puzzles and exploring virtual spaces, my personal focus was on implementing the core raycasting engine and camera movement functionality.

Why I Chose This Project

My decision to focus on this maze game stems from my fascination with the way early games like Wolfenstein 3D introduced players to immersive 3D environments. Growing up, I was captivated by how simple 2D techniques could create the illusion of 3D spaces. This project gave me the opportunity to revisit that excitement, but now as a developer. When I was younger, I would spend hours trying to figure out how these games worked. As soon as I had a chance to dive into raycasting in this project, it was like revisiting that childhood curiosity with the tools and skills I’ve acquired over time.

Project Accomplishments

The Maze Project was an ambitious endeavor, and by the end, I had achieved several key milestones. My game features:

  1. Real-time 3D Rendering using SDL2, where players can explore a dynamically generated maze.
  2. Camera Movement and Rotation allowing players to navigate using the w, a, s, d keys while rotating with the arrow keys.
  3. Collision Detection that prevents players from walking through walls, adding realism to the game environment.

My technology stack primarily consisted of C for performance, SDL2 for rendering and handling input, and a custom-built raycasting engine. We decided not to use any frameworks beyond SDL2 because we wanted a deeper understanding of how raycasting works under the hood.

Image description

Overcoming My Toughest Challenge

The most difficult technical challenge I faced during this project involved getting the camera movement and collision detection to work seamlessly. Initially, I struggled with creating a system where the camera could move smoothly without getting stuck in walls or passing through them. Here’s how I approached it:

Situation: Our maze needed a robust system for player movement, but early in development, our collision detection either stopped the player abruptly or allowed them to glitch through walls.

Task: My task was to refine the player’s movement and prevent collisions from ruining the gameplay experience. This meant figuring out how to balance smooth movement with solid collision detection.

Action: I researched different collision-handling methods and eventually decided to implement a sliding collision mechanic. When the player collided with a wall at an angle, the system would slide them along the wall rather than stop them entirely. This involved calculating the player's velocity vector relative to the wall's normal vector.

Result: After refining the calculations, the movement felt much smoother. The player could no longer walk through walls, but their movement wasn’t restricted in unnatural ways, adding to the game's immersive feel.

Lessons Learned

This project taught me a great deal, both technically and personally. On the technical side, I gained a deeper understanding of how raycasting works, as well as SDL2’s capabilities for game development. I also learned how to manage and optimize rendering performance when dealing with multiple textures and dynamic movement.

On a personal level, I realized the importance of persistence. There were times when the math behind raycasting and collision detection seemed overwhelming, but breaking the problem down step-by-step allowed me to eventually solve it. This project has also solidified my interest in game development, and I plan to explore more complex graphics techniques in the future.

If I were to approach this project again, I would focus on adding more game mechanics like lighting effects or advanced AI for the enemies. These features would enhance the gameplay and add another layer of complexity to the project.

About Me

I’m a passionate developer with a focus on game development and computer graphics. Having completed this project, I’m eager to continue learning and refining my skills in both software engineering and game mechanics. You can view the source code for this project on my https://github.com/warimap/Maze_project, and explore the game itself on the project, or connect with me on https://www.linkedin.com/in/pharium-warima-691028269/.

Thank you for reading about my journey with the Maze Project!


Feel free to adjust links and team member mentions based on your specific project details!

.
Terabox Video Player