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.

Inga kommentarer: