Tuesday, January 03, 2006

A four armed lover.

I've been cleaning the code and killing off bugs this morning.
It's painfully slow work but I feel like my pace has improved.

The first bug meant sometimes people could be rendered twice all over the place. I hadn't even noticed this potential problem until I started routing through the code. I was looking to solve a problem where changing maps caused the image to flicker. This was a real basic problem that should never have been.

All games with intelligent actors should generally have two loops per game frame.

1. Process All the Actors (movement, death ..)
2. Render

For some reason that I don't understand, I had at some point decided these where best together

1. Process+Render

So I had two maps.
The first I processed and rendered.
Then I processed the second map - here a character moved a went into the first map.
Result - character wasn't rendered for a frame.

Very simple very stupid.

So that's fix. The second problem I'm working on now is the camera that messes up after crossing too many map boundaries. Once this use to work. I've love to trap it down with unit tests but currently the codes too muddled and requires too many extra classes - it's something I'll work on uncoupling.

| |
Post a Comment