Texture stages, slow motion, lost device

Posted by Eugene / 6th November 2009 in IGFEB09 - Team A, Production Diaries

MDS - GamesBlog - HarvestMenu

The light was not shining off the terrain because the texture stage was set to use the texture only. I set the first argument to the texture stage to be the diffuse colour and the second to the texture, I set the colour operation to modulate and the light shines off the terrain. I had to experiment with the colour operations to get the colours right and the material.

MDS - GamesBlog - HarvestInGame08

While people were beta testing the game, it would slow down on occasion and everything would appear to be in slow motion. This was because the clock was using the previous frame time if there was a big spike in the amount of time between frames. As a result, the clock would continue to use the last frame time until another big spike occurred so I updated it to only use the last frame time once.

Level selection screen

Level selection screen

Spent most of the day working out how to reset the Direct3D device when it enters a lost state. I released and reallocated all the resources that used the default Direct3D pool however, it was telling me that some stateblocks were not being freed. Both Steffan and John helped me out and in the end, it was because there is a function that needs to be called on all Direct3D font resources called OnLostDevice when the device is lost. Also, a pointer to the backbuffer was being stored in certain classes and needed to be released and reallocated. Once these problems were sorted a couple of lights needed to be set on the device again because it had been reset, now everything carries on as normal when the device is lost and the game even pauses.

MDS - GamesBlog - HarvestInGame09

Leave a Reply

Search

Newsletter

View Sub Categories

Recent Posts

Connect With Us