Wednesday, June 27, 2012

Speed, Acceleration, Friction, Time

Today was a complete failure in terms of getting anything meaningful accomplished.

I went through some of my old code and found an XNA library with a few useful functions. I can use the input manager and fps tracker as-is, but the animation manager will need some heavy modification because of the way I did my sprites. The first thing I did was hook up the fps tracker. This allows me to track the frames per second put out by my PC to analyze any problems. For example, if I make a change to the way sprites are rendered and suddenly my FPS drops from 6000 to 4000, I'll know that it was not a very efficient change. It's much easier to debug memory issues and cycle hogs on the spot rather than further down the road when my codebase is 10x as large.

I ran into a big issue when I hooked up the fps tracker. Previously my game was running at a constant 60fps, but suddenly my PC was pushing out frames as fast as humanly (computerly?) possible. This caused my character's movement speed to increase 100 fold. To combat this I need to change my movement algorithm to incorporate elapsed game time. I must be tired or had a brain fart or something because I can't get it working properly. Out of frustration I deleted my current movement code and decided to deal with it tomorrow.

No video for today folks.

No comments:

Post a Comment