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.

lördag 6 september 2008

Script Support

Hi there,
I'm slow on the update side but a bit faster working...
The last week I have implemented script support via LuaBind so now you can control objects and components via lua-scripts. The engine is still not fully binded and probably won't be, i.e. it will have script support for different parts so you don't have to register luabind functions for everything if you don't want to.

this is the first test script I wrote (for an 3d-aim controlled by the mouse). It works well btw :)

function handleMouseEvent(this, mouseState)
obj = this:getOwner()
cpos = obj:getCPosition()
pos = cpos:getPosition()
relX = mouseState.X.rel
relY = mouseState.Y.rel
x = -relX/50
y = -relY/40
xPos = pos.x
yPos = pos.z

if ((xPos + x) > 7.5) then
x = 7.5 - xPos
end
if ((xPos + x) < -7.5) then
x = -7.5 - xPos
end
if ((yPos + y) > 7.5) then
y = 7.5 - yPos
end
if ((yPos + y) < 0.5) then
y = 0.5 - yPos
end

cpos:translate(x, 0, y)
return
end

fredag 22 augusti 2008

Well..

Hi again. I guess it has been a while since last time. I have been working on a website project so not much has happened. Although, we are currently working on a Demo Game using the engine. This is a concept-teaser-render of the game: