It is really funny how things get done on a project like this.
I wanted to drop in a very simple flight model to help with debugging the radar code, so I needed to add an engine to my aircraft.
So I wrote an EngineComponent and linked it to a definition file so I could hook up the physics code that actually does all the engine calculations.
That was fine, but then I realised I needed a way of specifying which keys would map to which commands without having to edit game code.
So I added InputEventComponents and attached them to the EngineComponent. So I now have keys which can be remapped to external devices, but have default keyboard values which you define in the game object editor.
But I needed to check my engine code was working before I moved on. I was very annoyed to realise the MFD's don't have a page for engine management.
So I decided I could easily add sound effects so I could hear the engine start up.
So I added a sound effect manager, but that meant I had to have a way for you to change the sound effects attached to an engine without coding. Don't want an F16 sounding like a Fokker tri-plane.
So I added a sound effect pack system and linked that in as a parameter on an EngineComponent. So for an engine you create a standard set of wav files, put them in a directory and specify the directory in the game object editor on the EngineComponent.
Great. All works. You can now mod the engine on an aircraft without writing a single line of code.
So I tested it.
I found that the engine cranked forever. Debugged it and found that my fuel tanks were empty. So I filled them with fuel.
Debugged it again and found it cranked for about 1 second then started to spin up. When N2 got to the required level the engine ignited just as I expected.
The sound effect for EngineStart finished and the engine never transitioned to the running state.
The first thing I did was add code to allow a sound effect to partially loop. So you specify a loop start and end position and it will play that section of the sound effect again and again.
Then I debugged why it was never going to the run state.
I hadn't advanced the throttle from 0 to idle as I was supposed to
So now I have fully modable engines with sound effects and keyboard inputs.
At the moment I have just used one key for power management, and one key for the starter motor, but I can add more very simply.
Now since I have this in my mind, I'm going to add code to detect you flooding the combustion chamber with fuel before the engine starts up properly.
I suppose that one day I will put in the simple flight model, but at the moment I see engine fires and warning tones in my future.
Funny old world.