Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(+1)

Project update #1

The rendering engine as been reworked almost from scratch, it now supports multiple layers, animated tiles and tire marks on the ground! Another major change is going away from "room to room" scrolling to a smooth scrolling. Honestly this is less charming (in a retro way), but it is much better for gameplay and player comfort. On the gameplay side key/door has been added for making puzzles. Finally the car collision has been improved which is a subject I will go into details during this project update. But before that, let's have a mandatory downscaled-to-3MB-to-fit-the-limit GIF to show the current state of the game:



Collision detection

Usually collision in MonoPunk is handled using axis aligned bounding boxes (AABBs). This is generally perfectly fine for platformers, top-down RPG/shooters, shmup and so on. But Dungeon Racer is a bit different story. The level layout is and will remain square (this is the dungeon part!). But the collision between the car and the edges of tile/entity quickly became a frustrating nightmare. This is what happened when the car was driving too close from an edge:

The problem is that the hitbox cannot be too small otherwise frontal collision looks strange. But then when arriving at a 45 angle near an edge, the car collides. Here is a quick rundown of the options I listed:

  1. Use unaligned boxes so that the hitbox rotates when the car rotates. The best way to do that would be to use a 2D physic engine such as Box2D, set all bodies to trigger and use the engine for collision detection only. This seems a viable approach but I was not found of using and physic library and all  its side effects.
  2. Use a circular hitbox. This seems like a good solution. Circle to AABB hit check math is easy, the hitbox doesn't rotate. But still I though it would be better to have etched corner on the tiles.
  3. The last solution is to use pixel mask which means using a bitmap to store collision information of an object. This is quite easy to implement, should be fast given the low resolution, and allows for ANY shape.

Although all options are viable, I choose to go with 3. Not only this seemed a nice addition to MonoPunk, but also it solves all my issues. MonoPunk has been improved in a way that it supports most types of collision pair. So that you are not force to use pixel masks everywhere as this could be costly. So for example it is possible to collide an AABB against a pixel mask. This is also very convenient for map collision as most tiles doesn't need a pixel mask. Here is how collision now looks like:

What's next?

There is still work left on the car physic, this will conclude the core engine of the game. After that focus will be put on user interface and level design to have a first working 'race' in order to validate the core mechanics of the game.