An easy day’s work

Despite a slightly late start this morning, I’m impressed with the way things are going at present.
Still researching on some of the ways to perform some of the functions required by Talking Timepiece, I instead decided to devote most of today’s time working on the virtual pet.
Having fished out the source code and taken a good look, I was appalled at various things, having written most of it midway through last year before I had really learned much about memory management and coding game engines.
First things first. The memory hogging little … well, anyway, I taught it to use 8.5MB rather than 30MB. I forgot that the virtual pet was one of the programs where I loaded in all the sounds at once - not a very memory effective way of managing things.
After that, I worked on the previous bug that had literally puzzled and frustrated me since the end of November last year. The file to which the pet’s status info was written wasn’t overwriting.
All the time I was searching through the code that handled the files to see whether it opened them is append mode rather than overwrite, and all the time the error was staring me straight in the face, if not touching me. It was all to do with the variable that the information was stored in when the data was read that hadn’t been reset and blanked out before reassembling each individual value.
I then concentrated on making sure the array that held all the parameters was synchronised correctly, since the last draft of the program dealt with different parameters for the pet’s emotions, actions and care status.
There were also a few program crashes along the way because I’d forgotten to free the memory used by the audio library, since this was another DirectX to Streamway conversion, so I sorted them out.
Alongside all that were various other minor issues, such as the program beeping when first loaded. All dialog boxes beep when a control is focused, so quite naturally it wants to beep when it loads. Therefore I set a counter that when set to 0 it would stay silent when the first control is reached, if not then continue as normal.
This will prove in useful for the base of a means of configuring the program. If you set it not to give audio feedback when navigating or when performing an action, well, I’ll probably use a boolean value for something like that, as is the programming standard.

One Response to “An easy day’s work”

  1. Согласен, эта весьма хорошая мысль придется как раз кстати…

    Помощник юриста, нотариуса Having fished out the source code and taken a […….

Leave a Reply