måndag 31 augusti 2009

Bug Busters

Hi,
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.

fredag 19 juni 2009

Actions and Events

More on events. I've integrated parts of the event system to work with states so that state changes are passed around as events. Works well. Also I have changed in the action handling a bit. (The part that binds keys to actions). And...as a final bonus I've added a small Lua console to ease testing.

As you can see I have typed "createObject("ball")" and sure enough, a blue ball (top right) comes zooming towards the corshair.

tisdag 16 juni 2009

Extended Script Support

Script support has been extended to enable creation of new component types using lua scripts. This opens for creating new types during run-time. The ScriptComponents are created using LuaBind's lua classes.

söndag 7 juni 2009

Events and Collision

Hi,
I guess I've been keeping it quiet for a while now but I have been programming quite a bit. Mainly stuff concerning collision handling and the events sent to objects and components. I think I have a good ground to stand on now and I created a quick example the other day where a box follows where I'm shooting and returns the ball over the net. Very fun but har to beat.

måndag 13 april 2009

Remodel

Hi, quick update.
I've been doing some modelling work over the break:

As you can see, the heads still need a bit of work (and they need to be attached), but I am quite happy with the bodies this far.

onsdag 17 september 2008

Script Support Extended

So, I have continued to add script support to the engine and by now I can test a lot of gameplay features real quick by scripting them in Lua files and indirectly adding the functions to event-handlers. I have been playing around with the aiming algorithms, e.g. which angle and speed a ball shot from a certain position should have to hit a certain target. For you who remember high school physics this may seem trivial but there are a few things that complicates the calculations.

For instance, if you have drag/wind resistance involved you need to use a numerical step method and even without that, if you want to calculate the initial angle of the velocity you get 4 different results which you have to evaluate to determine which are the correct ones. A bit painful but I guess it has to be done. I haven't made my mind up about drag yet, I have to test the accuracy and speed of some numerical step functions first to see whether the feature is worth having or not. Unfortunately none on my current dependencies have built-in functions for handling this type of differential equation solving so I have to write my own specialized one.

Apart from that, most of the implementations I have done since last time have gone smoothly.