Another screen shot showing off what we’ve been working on for the past week in the physics/engine department.
The first obvious change is the new level. This is a much smaller level that allows us to iterate changes much more quickly than the huge one we were previously using. It also has a bit of room to run around on flat ground to test the controls. Another big change in this level is the scale; we’re properly scaling 50px = 1m here.
Next would be the addition of Andy’s new character into the game. So far we have idle, blink and run animations.
The crazy outlines probably require some explanation; that’s my mess. This shows off my debug visualization of the physics engine we have integrated. They are color coded based on their physical state: red is a dynamic body that is active, blue is a dynamic body that is asleep and green represents a static body. You can see that the physics system is properly determining which bodies need to be active and which can be put to sleep to save CPU time.
The player is now enclosed in a capsule now, this allows us to smoothly slide up slopes/etc without getting stuck on corners. The addition of an extra body (the circle) also allows the engine to easily detect whether or not the player is on solid ground, which makes determining which state we’re currently in a lot easier. We’ve literally cut down the lines of code to determine this down an order of magnitude.
The screen shot doesn’t really show it well, but the player is currently determined to be in the "on ground" state, meaning we can jump/etc. This is working even though we’re standing on a completely dynamic box. Sounds simple, though Torque did not handle this case very well at all and required a complete extermination of any Torque physics, port to Box2D and rewrite of all the state code -- hence the major accomplishment of it working now.
No comments:
Post a Comment