måndag 31 augusti 2009

Bug Busters

Up until now our project has been spared from any major bugs. At least that I know of. So when I encountered a bug in the script system the night before yesterday I was a bit surprised. Somehow, after a random period of time, a Listener object was corrupted which caused the app to crash. I battled that f*kn bug for almost two days when I stumbled over the solution to the problem. Not the explanation though. I'm still a bit crossed but I'll live. However, I am going to have to find out what caused the crash and if it was an error from my part in the script or in the C++ code. The script bugs are a lot harder to track down but often more obvious. I'll have to create some script bug tracking system. Anyway, that's all for now. The action/event system still works great by the way. Haven't changed it yet.

As for the gaming experience, the opponent is now chasing the ball. In a primitive way, sure, but chasing it still, and returning it. It's quite fun to play actually=)

fredag 28 augusti 2009

I can't believe I am writing about Actions again

...but here goes.
I have spend some time rebuilding the action system for the gazilionth time but now I have ended up with something I can live with for a couple of months. I think. Anyway, it basically works like any UI system you have come across - you have a bunch of actions and you bind keys to it. What I added this time is the ability to bind hotkeys, like CTRL+S. For now I store the modifiers (CTRL, ALT, etc) and their states in an 8-bit int along with the keycode (total of 16 bits). This limits the number of modifiers to 8 and is really meant to be used only with the standard keyboard modifiers. I know I may have to change it in the future to allow other input devices like game pads to have modifiers. For now the modifiers are all hardcoded keyboard ones and that's pretty much unacceptable. For example I know many of you (and I) use Mouse Click + Scroll in some applications. So why build this in the first place? Well, I needed the basic functionality and it's still very easy to expand and/or change.

The major change for this update is really that I have added to types of events, DigitalInputEvent and AnalogInputEvent to remove any bias towards keyboards or mice. Basically to add a new device type (say a wii-mote) you inherit the InputDevice class and specify what goes into the events. The digital ones are meant for buttons and keys. The analog is basically anything else, mostly related to movement I guess.
All for now.