Skip to main content

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

Physics in game is... different

Hey, did you two bodies can occupy the same space and time? In games, they can, and if you don't account for that you will get this:


So, what happened in there was that I mistakenly inverted the collision response normal vector, which pushed the camera into that box center, forcing the camera and the box to have the same position, once that happened the distance between both became zero, and in physics, dividing by distance is a common and frequent operation, so what happens when you divide by zero? So far in my engine that meant infinity, so yeah... in a split second the camera had a force of infinity applied to it, resulting in it getting tossed like a meteor outside of existence... quite a poetic bug :') 

Here is a zoom at the camera's position, observe how its Y position starts around 13, and then gets crazy really fast.


I changed the behaviour of my engine to take division by zero as nan (not a  number) so I can easily debug this scenario (it's more complicated that than, but that's the general idea).

So yeah, as you can guess I've been busy with the game's physics system:


The game won't explore physics system like the new Zelda or anything like that, its physics will be rather simple, that's why I'm just doing basic collision detection/response myself :)

The game is 12.5% complete and 26% ready for alpha release.