Background: I am intending to try to program a remake of Sim Copter. This will be my first project in the BGE (although I have spent a great much time learning Blender and using it for modeling and animation). If you ever played or saw the original SC, perhaps you understand why I don’t think this project would be setting the bar too terribly high. I face three basic challenges (I list them as I will probably be asking for help on the others later): setting up flight control and physics for my helicopters, generating a city from models and some kind of saved map file, and lastly coding some sort of rudimentary AI (The original SC’s AI was awful considering its fairly pivotal role in missions, but crazily it worked). Right now my first task is with my 'copter.
Question: (Helicopter physics, if you skipped the first paragraph) To simplify things, I am currently only thinking in 1 axis, namely Z. I have a skeletal script handling sensors and actuators which also contains a function called Lift() which is scripted to the local Z linV component of a servo motion actuator. What I need, of course, is to figure out what lift should be generated over time a) while the user applies steady (full) power to spin the rotor up during takeoff and b) while the user uses key controls to create appropriate variance in lift while the rotor is spinning at a constant RPM. I suppose there may be more situations to consider, but for now those will do, and I intend to focus on a) first. Since Blender has no actuators which control acceleration (wait, thought, would a self referencing servo do that??), it looks like I will need to create a function which will handle acceleration internally, outputting linV, as it already does. It seems to me that the easiest way to do this would be to use some form of curve with time on one axis (time from liftoff, time from application of lifting force) and lift of the other. The simplest solution I can think of is simply to write a (several) function(s) for my script containing a piecewise mathematical equation and, taking time as a parameter, returning lift. This, however, seems inconvenient. The Real Question: In the game engine, is there a convenient way to use curves such as IPO curves to translate between and input value and an output? Is there a hackish way to do it? Is there something I’m overlooking entirely? Does anybody have other thoughts on making a game like this or (gasp) in anybody interested in helping?