Spellcaster Studios

Make it happen…

New collision detection

Until now, the collision detection of the player character and the game world was point based, i.e. I would detect if the player could move to a position if the differential of heights of the new position was smaller than the “step size”.

This would lead to this:

screen107

Half the character is penetrating the scene, since the point I was checking was the middle of his feet. Although this worked fine, it had some shortcomings (specially when the camera was close to the character because of obstructions), and it looked ugly…

I’ve changed that piece of code so that it uses a cylinder for the collision detection, leading to a much nicer effect (and more robust in some cases):

screen108

It’s not perfect yet, some fringe cases might cause the character to intersect the world geometry, but those are the exception rather than the rule…

I’m thinking on doing a small “voxel editor” just to create world geometry (instead of building everything from code); it will come in handy for story-related set pieces… Building specific geometry in code is hard!

This shouldn’t take too long… Merging that content with the terrain will probably be harder, I think… the editor itself is something I have done for a 48-hour competition (http://shadowcovenant.com/blog/2012/04/22/throwing-the-towel/).

Link of the Day: If you’re interest in bump mapping effects, take a look at Morten S. Mikkelsen’s blog at http://mmikkelsen3d.blogspot.pt/, it has really interesting stuff (that I really have to try out one of these days!)

Comment