You are browsing as a guest. Sign up (or log in) to start making projects!

8h 34m 22s logged

Unnamed Platformer - Devlog 4

I hate AABB with a passion. I spent 8.5 hours over 2 days (hardest lock in yet 🔥) on 2 features and Im pretty sure there are still bugs in each.

What I did: On day 1 I added collision detection for pretty much all my objects, added some custom physics (e.g. water and zero g now have custom physics), and implemented AABB collision. Since I got it working yesterday(mostly), I deleted the initial ground class I had for testing SFML and most features, as well as any related functions like the check ground function in the player class.

On day 2 I spent 4 hours trying to get the block to push. It took me a while cuz I initially tried to just copy the groundcollide() function and tweak whatever I needed to. However that didn’t work, so after hitting up Stack Overflow + Claude I realized I had to change up a LOT of my pre existing code. I added a master entity class for anything that is affected by physics (all players + the block + more features in the future probably) then added more functions and commands in my checkCollisions function in order to get my block mechanic mostly working. I also ended up adding many more features to my block class(velocity, gravity, and a grounded check) since it has to react to physics and the environment. Overall the introduction of an entity class that everything else inherits from was a big help in getting the game to work properly.

Challenges: my game crashed when I attempted to put the check collision function in main.cpp; then, implementing water and zero-g was a lot of trial and error not only to find physics that felt fluid but also because there were a lot of bugs in the logic as well as bugs that stopped the game from running at all. Also, it took me a while to wrap my head around AABB collision; I literally had to draw it out on a piece of paper and ask Claude to grasp the concept 😭

During bug fixes, I ended up breaking a bunch of stuff/realizing a bunch of stuff was still broken and spending a bunch of time fixing it. For example, while trying to fix collision, I ended up discovering a bug in my water/zero-g physics, and then while trying to fix that I broke my spring logic too. And creating the logic for pushing the block is a whole other can of worms. It took me 4 hours of implementing different strategies and adding different functions only to have a half baked block-pushing function. 😭 It does kind of work, but you can only push one block: any other blocks act like normal ground tiles.

AI used, if any: I asked Claude for help on how to tackle block pushing logic, as well as helping me understand AABB collision.

Plans for next time: I’m going to try and hopefully get all the block-pushing logic done without any issues, then fix up any collision-based bugs and work on implementing the rest of my player shapes.

K bye guys

0
2

Comments 0

No comments yet. Be the first!