Saturday, January 11, 2014

Game Dev 6: Collision detection and basic physics (+ Player Controller character!)

I've completed another large update. I've used the voxel terrain and character modeling and AI I've developed previously and developed collision detection and basic physics. Another big change is that there is now a player-controlled character! The player's character is viewed in 3rd person.

For collision detection, basic AABB is used for now, with the thought that this can be improved later. The NPCs jump when they collide with the voxel terrain (using the AI system), and Physics is implemented such that each unit has velocities and accelerations in xyz directions. Rather than having the inputs (e.g. Keyboard) directly affect position, "forces" are set by modifying these velocities and accelerations. Similarly gravity is modeled using an acceleration.

Note that in the video below, I used a 2010 laptop with integrated graphics. Thus the game engine runs slow (31 FPS).