Update log
Full Gunboat God update
The complete published notes, normalized for clean reading and source attribution.
Extracted changes
- Workshop
- Gameplay
Ah yes, collisions. Every game developer’s favourite topic (that was a joke).
I will never forget the pure agony of the Plesioth hip check in Monster Hunter Freedom Unite. That was my first encounter with an evil hit box in games, and it was seared into my memory for all time.
Thankfully for Gunboat God, I have a few different tools at my disposal to ensure accurate and CPU-efficient collisions.
Enemies
Setting up enemy hit boxes is done on a case by case basis. The larger the enemy, the more accurate the collision method must be.
Small enemies like a beetle or bat only require a rectangle. This is manually adjusted for each of the enemy’s animations. Job done.
Different shapes and sizes
Round enemies can be conveniently given an elliptical collision shape, which can also be adjusted to suit the size of the enemy’s animations. Another job done.
Precise collision masks
Let’s say I have a gigantic tentacle enemy (which I absolutely do, thank you for asking) a rectangle or ellipse collision shape would be far too inaccurate for fair gameplay. This would also be true for other very large enemies and bosses, the largest of all. Precise collision masks are used for these animations, which don’t require any adjustment because the collision detection is simply based on the pixels in the animation frames, hence the “precision”.
In the above image, you can see that "precise per frame" is the chosen collision method. It looks like the rectangle is being used as the collision method, but it's not. In this case, the rectangle is being used as the area in which precise collisions will be detected. Two collision methods are being used to get the best result. (More on this below).
Extra refinements
There is a problem that can arise from precise collision masks, however. What if pixel-collision is “too precise” for some enemy animations? Take this boss animation for example.
The spikes on this boss can collide with the player, which feels way too unfair in playtesting when trying to duck and weave around the boss as it chases the player. As mentioned, the rectangle shape can be applied over the animation to determine the area in which precise collision can occur. This isn’t perfect at all, but it greatly helps crop out the spikes and wings from the collision mask. Another job done, again.
Bullets!
So we have all of the enemy collision shapes setup, but what are they colliding with? Bullets! The same system applies to player bullets, beams and bombs.
In hard-mode, the player will have an augment become available to them, called “Spear”. This allows bullets to pass through multiple enemies, so the bullets need to keep track of how many enemies they collide with before expiring. The laser beam weapon is a little more complicated. It needs to detect all enemy collisions, sort them by distance, then collide with the enemies one by one and in order. All of that happens once per frame.
More stuff!
That’s all for now!
Don’t forget to wishlist Gunboat God, it helps a lot and is much appreciated :D
I also post small development updates on Twitter and Bluesky. https://x.com/jansonRAD
https://bsky.app/profile/jansonrad.bsky.social
All the best, Tom
Source
