Monday, January 24, 2011

The physics of it all

Last week I spent more time than I really wanted on fixing collisions. I spent the majority of my time redoing the physics bit from basically scratch. Turns out that my previously "infallible" implementation wasn't quite so infallible as I thought, what with moving through walls and jumping to the other end of the screen, but I think I've got it down now.

What I did was detach rendering from the progression of the game world. Now the game world takes 4 "steps" before rendering anything. This made me reduce every physics related variable to about a fourth but everything is now much more accurate and it feels a lot more slick. I'm quite pleased. I also managed to implement this really sweet tool that's going to make debugging later a breese. This debug mode allows me to pause the game and step through each physics "frame" to look for any inconsistencies. It also displays what the physics engine did at that frame so I know where to look if something goes wrong.

Now that I've laid the groundwork I can continue with adding cool stuff to my little "engine" to make it more complete and more like an actual game. Though I'll probably spend time moving stuff around so that I get a bit cleaner code. Below you'll find the revised changelog for the current game version (0.3). I'll also have you know that I have a roadmap up to V 0.5 so I'll have plenty to do for the coming weeks.

Until next time!



v 0.3 (unreleased)
- Tweaks to improve the player's appearance.
- Box collisions work now. You can collide with everything.
- Tile's now have 4 solid states: None, Platform, (Vertical) HalfBlock and Solid.
- Sepperated rendering cycles from physics cycles.
- Physics redone entirely. It is now virtually infallibe.
- Sepperated debug related functions from regular ones, thus introducing debug mode.
- Added the ability to step through all past (up to 4096) physics frames.
- Another tile drawn, it kind of looks like a treetrunk.
- Added a rudimentry Menu with placeholder graphics and intro animation.
- Began punctuating changelog changes.

No comments: