Wednesday, March 7, 2018

And so my Space Career Begins...

Comms work now.
I was able to (hopefully) peg down that last null pointer, and was able to play the game. For some reason, my mouse would die when I went to either the navigation or tactical screens. These are the "busiest" screens that are using my very ugly color hacks. The game was running at a blazing 2 FPS. I'm actually impressed that it was going that fast. The mouse clicks, however, were being delayed by anywhere between 10 and 45 seconds. The strange thing was the keyboard queue was fine, so there was something up with my mouse queue.

Enemies are not rendered right.
After digging a but I discovered that my mouse event queue was storing hundreds of mouse movement events, and not just the mouse clicks. The means that the game grabbing a single unneeded mouse movement event every frame and throwing it away, only to grab another the next frame. If you didn't touch the mouse It would eventually "catch up" and grab that click. I updated my event handler to simply delete all accumulated mouse movement events in the queue until it comes across a click or until the queue is empty. The game is supposed to check for a click first and then asks the OS where the mouse pointer actually is on the screen. Mouse movement is handled by the OS. This also allows for a touch interface. When you tap the screen, your finger X and Y location is read after that.

The good news is that I was able to create a new fleet commander, assign him to a mission, and then run though the whole game and win. The game, for the first time, ran end-to-end! This doesn't mean the game isn't without bugs. I still have to set up my alpha channels for transparencies right, but that's cosmetic. I'm also getting closer to changing the game font to a TrueType font to speed up rendering.  My biggest hurdle right now is figuring out how to render the enemies in game. It's not using my render routines I made for the builders. Once I have that nailed down, it will be time to start adding some functionality such as the "options" button and sound effects. I hope to have an "Ugly Beta" by the end of the month. The Ugly beta is a beta version of the game with the legacy graphics and before an art pass.  I have yet to run the game "outside" of Visual Studio stand alone.  I just added that as a Trello goal.

Oh and I have to get the builder off the the artist :)


No comments:

Post a Comment