Simplified Flight Model

Thanks. I have been trying to create modules that programmers can use to create their own flight simulations - with things like the anti-aircraft simulation where you can now specify a target object and a target altitude for the shells to explode.

Yes, NPC combat is what I need to work on next.

I started that same thing about the same time last year on my FM2 simulation. I tried to make it realistic - by having the NPC get on your tail. That got pretty complicated.

This year, I will try it on my Camel simulation and I will start with a much simpler objective of having the NPC fly towards you. Because the NPC turn rate will be limited, that should evolve into the kind of turning fights I have been hoping to simulate. And, as I learn more, I should be able to improve the quality of the battles.

This is a big update! After months of trying, I have finally been able to implement rudimentary air combat in the Sopwith Camel flight demo!

The combat will begin when you have climbed to above 800 feet (they want to give you a sporting chance), The AA will stop (because your people don’t want to hit you) and one of the NPC airplanes will engage you.

To engage the NPC, I recommend the following:

  1. Take off and start a climbing turn to the right (East), away from the NPCs.
  2. Extend a bit to the East for spacing.
  3. Continue the turn until you are following the NPCs (West).
  4. Continue to climb. When you reach 800 feet, the fun will begin!

At present, the NPC is overpowered (for many reasons), so you probably won’t be able to get on his tail, but he can get on yours. I will be working on changes to make his performance more realistic, which should help level the playing field. Other changes will involve allowing him to fire his guns and allowing you to shoot him down. Long term plans involve NPC to NPC combat.

Unfortunately, the fixes that I have made in creating this scenario have somehow made things worse for the NPCs in the FM2 demo. I will fix that when I add air combat to that demo.

UPDATE (May 26)
I have limited the NPC bank angle to 60 degrees, which will give you a sporting chance to beat him. Next, we need to activate the “shoot down” graphics.

UPDATE (May 30)
The “shoot down” graphics now work. Each of the 3 fighter aircraft will now attack in order. All 3 are now easy to shoot down (10 hits, big hit box, max bank = 60). Later, I will make each airplane harder to shoot down. You can’t shoot down the bomber yet. Next we need to allow the airplanes to shoot at you, including the bomber.

UPDATE (June 2)
Each enemy aircraft will be more difficult and they will shoot at you if you are ahead of them.

UPDATE (June 8)
This is a fun update.

By pressing the “N” key you can now cycle through external views of all the airplanes, including the NPCs. Because of the greater distances and speeds involved In the FM2 simulation, I will be using this to help adjust the behavior of the NPC airplanes. I have now modified the NPC airplanes so that they can now chase other NPC airplanes. I now have the Zero NPC actually chasing the FM2 NPC.

In the FM2 demo, I have also updated the output information to indicate the horizontal direction and distance of the target. For your airplane, that gives information for the Zero NPC. For the Zero NPC, that gives information for the FM2 NPC.

The only bug so far is that the demo will stop if you have switched to an enemy NPC which is shot down. I will soon be changing the final sequence for destroyed NPC airplanes to eliminate that problem.

1 Like

This is a combination of updates, all with the same theme and slightly different mechanics.

[1 Jul 2026]
Since we are approaching the 4th of July, it seems especially appropriate that the theme of the month has been explosions. Here is a CodePen example which includes three components: an exploding orange sphere, smoke trails and a particle emitter. These will be designed so that you can re-use them forever, which will help limit use of GPU resources. The smoke trails component can also be adapted to create long stationary trails of smoke in the sky - which are useful showing damage, contrails, and colored smoke displays.

[6 Jul 2026]
The explosions have begun - check out the starting sequence for the Sopwith Camel demo.

[13 Jul 2026]
The Sopwith Camel now has a pale smoke trail. The airplane is not damaged, but the rotary engine on the plane is notorious for burning large amounts of oil, which left a smoke trail behind the airplane.

In the future, we can use all of the above to create more explosions and smoke trails behind damaged airplanes. For various reasons, I won’t be able to make these changes as fast as I would like. But I wanted to provide some simple of examples of what is to come.

[1 Aug 2026]
The Sopwith Camel demo now has a simplified “shoot-down” sequence. After 10 hits, the enemy aircraft will start smoking. After 25 hits, the enemy aircraft will catch fire and crash into the ground.

In the FM2 demo, we are still trying to make the enemy aircraft more visible. Even though WWII aircraft are larger, they are harder to spot given the greater speeds, distances and altitudes involved. Once we have done that, we can implement the shoot-down sequence and add more attackers.

1 Like

The special effects (aircraft shoot-downs, AA explosions, and bomb explosions) are now working, including sound effects for the explosions. You can see all of these on the Sopwith Camel flight demo. The FM2 is being updated to include all of these effects and to make enemy aircraft easier to spot.

Both the FM2 and Sopwith Camel demos are working. I have upgraded the AA guns by adding gunfire graphics and sound.

Intercepting the enemy in the FM2 demo is still a bit challenging. Two NPC aircraft are orbiting counterclockwise above volcano island at 5000 feet - a friendly and an enemy on his tail. The AA guns are firing at them and they are both trailing smoke. So climb towards the AA flak explosions. After awhile, these explosions should give you should get a sense of where the NPCs are in their orbits. You want to intercept them from behind. As you reach altitude, decrease your throttle to 80% and start looking for the smoke trails. The enemy NPC is ahead of the outer smoke trail. You can shoot him down.

The display shows the TgtDir (direction to the target) and TgtDst (distance to the target). But I have found that chasing these numbers is less effective that using visual references. One bit of information that might be more useful is the off-angle - the heading of the enemy relative to your heading. Ideally you will end up behind the enemy with a small off-angle to the right. A 180 degree off-angle means the enemy is flying towards you, so you want to start turning so that you can intercept the flight path.

This illustrates one of the big challenges with air combat simulations and real life. In real life, spotting a specific enemy aircraft is almost impossible. Most kills occur when a pilot sneaks up on an aircraft, he has just happened to spot. Very few were the result of an extended combat engagement.

Combat simulations are able to overcome this problem by labeling the aircraft or including a “radar” map or both. But that, of course, is unrealistic.

I have not added these aids. Instead, to intercept the enemy NPC, you must engage in a mental exercise similar to what a pilot does when trying to enter and remain in a holding pattern. But, in this case, the enemy is already flying in a “holding pattern” and you must figure out how to intercept him.

I will later add a couple of attackers, who won’t be as hard to find because they will be attacking you. After you have done that, I am working on a bit of a surprise ending which I’m sure you will enjoy.

MORE (Aug 31)
I have added airplane shadows to the Camel flight demo. So if you are having a hard time locating the enemy airplane, you can look for the shadow. This is a trick we use in real life aviation because other airplanes are not easy to spot.

MORE (Sep 1)
The flight demo is designed so that your “pilot persona” is a skilled pilot who can handle a lot of the basic tasks automatically (like keeping the airplane centered). Like many of the best pilots, your pilot persona now has the skill of spotting enemies from a good distance away. You can activate this skill by pressing the “m” key while in external view and the camera will point in the direction of the enemy. This is the first iteration so there are sometimes “funny” results, like where the camera is upside down. But it should provide a useful assist in locating those “hard to spot” enemies.

UPDATE (Sep 4)
The target tracking has been fixed. As before, it can only be invoked while in external view. But, target tracking is now part of what I call “tactical view”. The horizon is level and you are now viewing your aircraft and the enemy aircraft from the perspective of a 3rd party observer.

2 Likes

In response to a request, I have added a tutorial to the Camel flight demo. Press the > key to select a section (including off) and press the < key to go back within a section. Since one of the tutorials is on Air Combat, the enemy no longer attacks you automatically when you reach 800 feet. Instead, you have to press the K key to start the combat.

Let me know if this works and if the tutorial requires further clarification. In addition to telling the user what to do, I have tried to explain a little of what is going on (e.g. the role of Lift).

MODIFICATIONS TO TUTORIAL (11 Sep)
After some trial and error, I have modified the working of the tutorial a bit.
You can turn the tutorial on/off by pressing the t (tutorial) key. The default is off.
In the tutorial, there are several sections (e.g., Basics, Takeoff, Climbing, etc.)
Within each section, the messages will advance automatically after a few seconds.
The > key takes you to the next section.
The < key takes you back to the previous message in the section (in case you want to reread it).
When you turn off and then turn on the tutorial, you should be on the same page as when you left.

If the tutorial is off, the enemy will attack you when you climb above 800 feet. If the tutorial is on, you can only trigger attacks by pressing the k (kombat) key.