Sunday, August 28, 2011

Updated Lighting + Fixes

Light from a post now gradually fades.
So I spent the evening fixing some bugs and adjusting the gameplay.  As you can see from the screenshot, light from posts now extends a lot further out and gradually fades out instead of the black/white we had before.  As I was playing and testing bug fixes, I also realized that it's a pain having to constantly find a fuel depot.  I increased the range of the depots by about 3x and I found it to make the game a lot more fun to play.

The bug that I think I've fixed is the one where the map flickers.  I thought this was due to a rounding error but I actually fixed it by simplifying my code.  Beforehand, I had two variables in my world.  There was a Vector3 called mapPosition and a Vector2 called drawOffset.  mapPosition was a Vector3 because I thought I could have multiple layers of map and store them on the Z axis.  drawOffset was pretty much a Vector2 copy of mapPosition that was used for drawing objects.  As time went on, I found myself rarely using mapPosition and I wondered if I could just pull it out.  After backing up all my code (to make it easier to revert incase I didn't like it), I started the process of removal.

After getting all the references out, I played around for a little bit and made sure I didn't introduce any bugs.  Much to my satisfaction, I realized that I hadn't seen the map flicker bug at all since removing the Vector3.  I've been testing for a couple of hours ever since and haven't noticed it at all.

I also added some basic AI.  I'm not sure how I feel about it though.  I want the player to feel very alone in this game.  You are inside this machine and have been left on this roid to survive/make your way back home (haven't completely figured out the story yet).  Either way, I want to find a balance where you can feel that there's a threat through some kind of enemy but also feel very alone in this asteroid belt.

I'm going to keep working on gameplay elements this week.  I'm also hoping to finalize a story before the end of the week.

No comments: