Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+1)

Hey, I'm curious about how you handle collisions in your engine. If there's a devlog you've written on it I might have missed it?
Are characters AABBs? I don't know if this is 100% accurate but I'd heard that Quake used (discrete?) ray intersection tests against Minkowski summed geometry. Is this the same as what you're doing? 

(3 edits) (+1)

I think I wanted to write about it just forgot 

anyway from what I know Quake is using the BSP for all world collisions
and their trick is to extrude the walls and floors inwards
the advantage is this makes collision very elegant (simple and fast): point to plane collisions for all world collision (no worry about triangles)

and the disadvantage is they need to store multiple copy of the level (e.g. one for bullets-unextruded, one for humans, one for big stuff like shamblers )

and I think this what they mean by the Minkowski geo thing  (I'm not sure about this but I think it refers to adding the volume of one object to another and changing it to a point to object test - something like that)


I'm afraid Zortch is not this sophisticated or elegant: there is a large triangle soup and it's sorted onto a 2D grid  and it's mostly sphere to triangle and line to triangle test
(and characters do a cylinder to cylinder test against each other)
it's quite a complicated mess, I prepared some slides that might explain it better:

there are also many edge cases: a character might stand on another, a character might stand on another
that is travelling on a conveyor belt or mover ..  and so you can only stack crates the moving creatures
will drop you off


it's a complicated thing - there are seperate item classes for items affected by gravity,
ones that stay put and ones floating in air etc.


this made thin enemies very hard to hit - the female guards use slightly bigger OBB than needed
(also all heads use a bigger radius - where there is a head that is)
and of course some bones are marked to not to be hit at all
and I forgot to mention on the slide: the AABB of the character is fixed and not affected by the 3D models box
(usually smaller than the character)


another trick is that the sphere to triangle test needs to be done multiple times
because the new velocity might push the object into another triangle
(not to mention moving geometry also needs to be tested every time)

of course all this trouble is to climb stairs and small heights effortlessly
which sometimes works too well - you auto jump over any railing
there was also a problem with slopes - with sphere collison you get 'free' sliding
but here it had to be hacked in based on the triangle normal

gibs and grenades use a simplified  method where it's only sphere against triangle


(there were problems with this of course: walls would often push out grenades before it could collide with them
so there are extra checks to see if the mover actually changed place etc)

in summary the collision system is a collection of hacks held together with prayer and glue

(+2)

I'm sorry it took me so long to respond but I really am thankful that you've written such a detailed reply!! It's interesting to see how youve approached it

no worries, I'm happy to answer all questions 👍