The collision stair case

https://amano-media.nyc3.digitaloceanspaces.com/devlog/the-collision-stair-case/01-statircase.gif

It all started with this little boy right here. A bug that had been annoying us for a couple of days, and this week was the time to fix it!

As stated on the previous post, updating all the pieces all the time was a bad idea. We needed to figure out a way to update only the ones that needed to be updated after another block got destroyed. The quick and dirty solution was to check all the pieces inside a bounding box on top of the piece that got destroyed.

https://amano-media.nyc3.digitaloceanspaces.com/devlog/the-collision-stair-case/04-statircase.gif

We found an issue with the solution because If you have a structure like the one below, you could affect pieces in a column far away to the destroyed block and the algorithm would miss them.

https://amano-media.nyc3.digitaloceanspaces.com/devlog/the-collision-stair-case/06-statircase.gif

The easiest solution was to check all the blocks above the one destroyed. We tried it, but came across a couple of issues. We updated way more pieces than the ones that were needed, not only that, but we some pieces kept freezing in the air.

https://amano-media.nyc3.digitaloceanspaces.com/devlog/the-collision-stair-case/03-statircase.gif

At this point I realized that the basic idea was flawed. The pieces need to get updated not only if the block below them gets destroyed, but also when one piece below them starts moving.

So the new solution is: after we grab one piece, we search for all pieces that are in contact with it. Then we search for pieces in contact with those pieces, and then again and again. This is fast because we save the dry pieces inside a grid, so we only search nearby cells.

https://amano-media.nyc3.digitaloceanspaces.com/devlog/the-collision-stair-case/05-statircase.gif

And it works!, we only update the pieces that need to be updated, and the code is way simpler to maintain.

A couple of tools helped us chase down this bug. We use LDTK to generate the game screen, it's very helpful, as we can generate any specific layout in seconds and start testing from there. Making the parser took us a couple of hours and has saved us a huge amount of time already.

https://amano-media.nyc3.digitaloceanspaces.com/devlog/the-collision-stair-case/07-statircase.png

We also added a grid overlay to the game through the Playdate men, to position things or figure out their coordinates.

https://amano-media.nyc3.digitaloceanspaces.com/devlog/the-collision-stair-case/02-statircase.gif

Comments

Other Posts

You can subscribe via RSS or follow us @amanogames_

Let’s finish this

Let’s finish this

We are back working on Pullfrog! What happened?

Let's talk about Don Salmon

Let's talk about Don Salmon

Don salmon, a new platforming game made in Godot and a small update on Pullfrog

Spooky eyes and level editors

Spooky eyes and level editors

Last year we made the decision to take a break and focus on a spooky game around the spooky season.

This kills the frog

This kills the frog

After rewriting the physics system for the third time, it was time to start working on more fun stuff. The frog death system™.

On starting a game

On starting a game

A couple of things I would recommend when starting your first game on the Playdate.

How to correct a corner

How to correct a corner

There are many techniques that you can apply so that a platformer game feels good. One of those is corner correction.

On "Bouncy" Animation

On "Bouncy" Animation

Another Equally important decision, is choosing which poses you want to emphasize in order to get that reactive feeling when a character interacts with the world.

About Amano & the collision conundrum

About Amano & the collision conundrum

So, a couple of months back, Mario and I were happily working away on The game, finding out the workflow and working out the kinks of developing for the PlayDate. We laid down the main mechanic, blocks were falling and colliding correctly the character was moving alright but we were doing everything on the simulator, NOT testing on the actual device. so when we decided to take it for a spin…  it crashed.

Pullfrog postmortem, Long Live Pullfrog 2-Bits

Pullfrog postmortem, Long Live Pullfrog 2-Bits

So towards the end of the year, Mario managed to get his hands on a Development console for the handheld "Playdate" and we decided to attempt do make a second version of Pullfrog, this time featuring a playful little crank and seemingly less restrictions except for the apparent ones like the black and white color of the screen. Oh the naivety.