An integrated AI traffic system: Difference between revisions

Jump to navigation Jump to search
m
Robot: Cosmetic changes
m (Robot: Cosmetic changes)
Line 9: Line 9:


= Background =
= Background =
* 12/2001: "We need to be able to have multiple instances of various FDM's running concurrenty (and with your proposed changes, accessible through the property manager interface.) I'm thinking of things like random 'traffic' that would get created and deleted. For instance we have fdm[0], fdm[1], fdm[2], fdm[3] and then we delete fdm[1] because it flew out of range, but now another aircraft flies into view so we need to create fdm[4], etc."[http://www.mail-archive.com/flightgear-devel@flightgear.org/msg00881.html]
* 12/2001: "We need to be able to have multiple instances of various FDM's running concurrenty (and with your proposed changes, accessible through the property manager interface.) I'm thinking of things like random 'traffic' that would get created and deleted. For instance we have fdm[0], fdm[1], fdm[2], fdm[3] and then we delete fdm[1] because it flew out of range, but now another aircraft flies into view so we need to create fdm[4], etc."[http://www.mail-archive.com/flightgear-devel@flightgear.org/msg00881.html]


* 12/2001: "The cleanest solution is to have a separate property tree for each instance; globals could manage that, and make sure that the right one is always returned."[http://www.mail-archive.com/flightgear-devel@flightgear.org/msg00891.html]
* 12/2001: "The cleanest solution is to have a separate property tree for each instance; globals could manage that, and make sure that the right one is always returned."[http://www.mail-archive.com/flightgear-devel@flightgear.org/msg00891.html]
Line 17: Line 17:
* 11/2003: "I started working on a generalized and scriptable version of my tanker, but have been sidetracked by other stuff."[http://www.mail-archive.com/flightgear-devel@flightgear.org/msg18475.html]
* 11/2003: "I started working on a generalized and scriptable version of my tanker, but have been sidetracked by other stuff."[http://www.mail-archive.com/flightgear-devel@flightgear.org/msg18475.html]


* 11/2003: "What I'm driving at here is having a headless client that does multiple fdm/autopilot sims on behalf of a server which may itself be handling several planes in addition to the net connections -- no graphics at all -- though a side effect will be to have a user controled plane + one or more AI planes -- it may not get used that way -- but someone might"[http://www.mail-archive.com/flightgear-devel@flightgear.org/msg18439.html]
* 11/2003: "What I'm driving at here is having a headless client that does multiple fdm/autopilot sims on behalf of a server which may itself be handling several planes in addition to the net connections -- no graphics at all -- though a side effect will be to have a user controled plane + one or more AI planes -- it may not get used that way -- but someone might"[http://www.mail-archive.com/flightgear-devel@flightgear.org/msg18439.html]


* 11/2003: "what I'm asking is "everything looks like it works through globals rather than discrete instances of aircraft+fdm+autopilot -- am I looking at a serious architectural change to get multiple independent ac+fdm+ap simulated concurrently ??"[http://www.mail-archive.com/flightgear-devel@flightgear.org/msg18439.html]
* 11/2003: "what I'm asking is "everything looks like it works through globals rather than discrete instances of aircraft+fdm+autopilot -- am I looking at a serious architectural change to get multiple independent ac+fdm+ap simulated concurrently ??"[http://www.mail-archive.com/flightgear-devel@flightgear.org/msg18439.html]
Line 25: Line 25:
* 11/2003: "I was hoping to have multiple airplanes (each controlled by an individual program), each being updated once per video render instead of having independent execution frequency."[http://www.mail-archive.com/flightgear-devel@flightgear.org/msg18295.html]
* 11/2003: "I was hoping to have multiple airplanes (each controlled by an individual program), each being updated once per video render instead of having independent execution frequency."[http://www.mail-archive.com/flightgear-devel@flightgear.org/msg18295.html]


* 11/2003: "FlightGear is an old code base, and lots of the old assumptions (like a single aircraft) need to be teased out of the code before progress can be made on new features. This kind of work isn't glamorous, and often requires more effort than the new development does. But it's not brain surgery either."[http://www.mail-archive.com/flightgear-devel@flightgear.org/msg18446.html]
* 11/2003: "FlightGear is an old code base, and lots of the old assumptions (like a single aircraft) need to be teased out of the code before progress can be made on new features. This kind of work isn't glamorous, and often requires more effort than the new development does. But it's not brain surgery either."[http://www.mail-archive.com/flightgear-devel@flightgear.org/msg18446.html]


= Scripted AI Traffic =
= Scripted AI Traffic =
Line 47: Line 47:
= FDM driven AI Traffic =
= FDM driven AI Traffic =


* "The present AIAircraft fdm won't do it though. It only handles "normal" maneuvers, like normal climbs, descents and turns."[http://www.mail-archive.com/flightgear-devel@flightgear.org/msg19095.html]
* "The present AIAircraft fdm won't do it though. It only handles "normal" maneuvers, like normal climbs, descents and turns."[http://www.mail-archive.com/flightgear-devel@flightgear.org/msg19095.html]


* "need a full FDM to pull that off, with the AI manipulating the stick and pedals directly.. something I talked about as a possibility for my script engine to accomplish. I'm using David's AIAircraft (as I believe Eric is for the Nasal interface), but a full FDM could be interfaced if needed :)"[http://www.mail-archive.com/flightgear-devel@flightgear.org/msg19095.html]
* "need a full FDM to pull that off, with the AI manipulating the stick and pedals directly.. something I talked about as a possibility for my script engine to accomplish. I'm using David's AIAircraft (as I believe Eric is for the Nasal interface), but a full FDM could be interfaced if needed :)"[http://www.mail-archive.com/flightgear-devel@flightgear.org/msg19095.html]
Line 53: Line 53:
* "I personally think that fdm/autopilot is overkill given that they're dots in the sky unless you're illegally close."
* "I personally think that fdm/autopilot is overkill given that they're dots in the sky unless you're illegally close."


* "Not always -- for example, watching another plane land or take-off while holding short is the best way to tell what the wind is doing (is the plane in a major slip on short final? is it crabbed way to the right on climbout to hold runway heading? is it bouncing around like a mechanical bull from gusts and turbulence?). In a busy circuit, it's not uncommon to be following only 0.5mi behind another plane, and depending on screen resolution, you can probably tell again whether it's crabbed, what its pitch angle is, etc. I agree that you should not normally be close enough to see control surfaces move unless you're practicing formation flying."[http://www.mail-archive.com/flightgear-devel@flightgear.org/msg08574.html]
* "Not always -- for example, watching another plane land or take-off while holding short is the best way to tell what the wind is doing (is the plane in a major slip on short final? is it crabbed way to the right on climbout to hold runway heading? is it bouncing around like a mechanical bull from gusts and turbulence?). In a busy circuit, it's not uncommon to be following only 0.5mi behind another plane, and depending on screen resolution, you can probably tell again whether it's crabbed, what its pitch angle is, etc. I agree that you should not normally be close enough to see control surfaces move unless you're practicing formation flying."[http://www.mail-archive.com/flightgear-devel@flightgear.org/msg08574.html]


* "Temperature and air pressure are important because they affect density altitude -- the plane should climb very lethargically on a hot day at a mountain airport and quite vigorously on a cold day at sea level -- again, these are things you watch while holding short of the runway."[http://www.mail-archive.com/flightgear-devel@flightgear.org/msg08574.html]
* "Temperature and air pressure are important because they affect density altitude -- the plane should climb very lethargically on a hot day at a mountain airport and quite vigorously on a cold day at sea level -- again, these are things you watch while holding short of the runway."[http://www.mail-archive.com/flightgear-devel@flightgear.org/msg08574.html]
Line 59: Line 59:
* "Furthermore, above FL180 (and north of about 60deg latitude at all altitudes) altimeters are set to pressure altitude, so you'll have to take air pressure into account eventually."[http://www.mail-archive.com/flightgear-devel@flightgear.org/msg08574.html]
* "Furthermore, above FL180 (and north of about 60deg latitude at all altitudes) altimeters are set to pressure altitude, so you'll have to take air pressure into account eventually."[http://www.mail-archive.com/flightgear-devel@flightgear.org/msg08574.html]


* "Even in the circuit, circuit altitude is based on the altimeter reading, which (even when corrected for pressure) can be off a bit due to temperature and humidity. That's not a problem as long as everyone's altimeter is off the same amount."[http://www.mail-archive.com/flightgear-devel@flightgear.org/msg08574.html]
* "Even in the circuit, circuit altitude is based on the altimeter reading, which (even when corrected for pressure) can be off a bit due to temperature and humidity. That's not a problem as long as everyone's altimeter is off the same amount."[http://www.mail-archive.com/flightgear-devel@flightgear.org/msg08574.html]


* "You can go through and try to support all of this, but in the end, it will probably be easier just to create a new instance of an FDM and autopilot and let them fly the plane. Note that I'm not suggesting that you do this now -- what you've done already is quite impressive. However, be careful that you don't end up unintentionally creating your own new FDM in its stead."[http://www.mail-archive.com/flightgear-devel@flightgear.org/msg08574.html]
* "You can go through and try to support all of this, but in the end, it will probably be easier just to create a new instance of an FDM and autopilot and let them fly the plane. Note that I'm not suggesting that you do this now -- what you've done already is quite impressive. However, be careful that you don't end up unintentionally creating your own new FDM in its stead."[http://www.mail-archive.com/flightgear-devel@flightgear.org/msg08574.html]


* "I really think you should use FDM instances for the AI traffic: (1) So differenty types of aircraft will be handled correctly, (2) So slips, wind drift corrections and turbulence will happen right, (3) So we can use one autopilot interface and one FDM interface for both, (4) So the AI aircraft can merge nicely with multiplayer support"[http://www.mail-archive.com/flightgear-devel@flightgear.org/msg08627.html]
* "I really think you should use FDM instances for the AI traffic: (1) So differenty types of aircraft will be handled correctly, (2) So slips, wind drift corrections and turbulence will happen right, (3) So we can use one autopilot interface and one FDM interface for both, (4) So the AI aircraft can merge nicely with multiplayer support"[http://www.mail-archive.com/flightgear-devel@flightgear.org/msg08627.html]
Line 67: Line 67:
* "I do think you need to do a simplified thingy that just knows how to shuffle huge quantities of aircraft efficiently around the sky, so that they (eg)fly the pattern, or fly between airports, or wander around airways, or keep doing missed approaches at the same sequence of airports, or similar."[http://www.mail-archive.com/flightgear-devel@flightgear.org/msg08628.html]
* "I do think you need to do a simplified thingy that just knows how to shuffle huge quantities of aircraft efficiently around the sky, so that they (eg)fly the pattern, or fly between airports, or wander around airways, or keep doing missed approaches at the same sequence of airports, or similar."[http://www.mail-archive.com/flightgear-devel@flightgear.org/msg08628.html]


* "However, I think you should build it as an FDM (or extend an existing FDM, if you prefer) to provide the functionality. That way, 90% of the AI vehicles can be completely trivially simulated and will be trivially rendered as a tiny distant white blob (due to someone finally putting a ssgRangeSelector on the aircraft visual model infrastructure)."[http://www.mail-archive.com/flightgear-devel@flightgear.org/msg08628.html]
* "However, I think you should build it as an FDM (or extend an existing FDM, if you prefer) to provide the functionality. That way, 90% of the AI vehicles can be completely trivially simulated and will be trivially rendered as a tiny distant white blob (due to someone finally putting a ssgRangeSelector on the aircraft visual model infrastructure)."[http://www.mail-archive.com/flightgear-devel@flightgear.org/msg08628.html]


* "Taking that approach lets us easily have the remaining 10% that we will be flying close to be extremely realistic, even for formation flight (which is permitted by the FAA, by the mutual agreement of both pilots). The only time that you can be illegally close to another aircraft is if the other pilot doesn't expect you to be there (or if you busted another rule to get that close, of course)."[http://www.mail-archive.com/flightgear-devel@flightgear.org/msg08628.html]
* "Taking that approach lets us easily have the remaining 10% that we will be flying close to be extremely realistic, even for formation flight (which is permitted by the FAA, by the mutual agreement of both pilots). The only time that you can be illegally close to another aircraft is if the other pilot doesn't expect you to be there (or if you busted another rule to get that close, of course)."[http://www.mail-archive.com/flightgear-devel@flightgear.org/msg08628.html]


* "a lot of good reasons for using an fdm/autopilot combination for AI traffic from David Megginson and Alex Perry, I can see the point of wanting a proper simulation when within reasonably close visual distance of the target. My concern was that if there were a lot of traffic being simulated, a lot of it known to the pilot only through the radio communication, then using an fdm thats updating at 120Hz and simulating right down to the exhaust gas temperature is overkill, and that using a greately simplified model with basically a look-up table of typical speeds and climb/descent rates would allow the additional traffic to be updated in a queue with, say, only one plane updated per timestep if far enough away from the viewer. My concern was that updating a number of fdms per timestep could possibly introduce a noticable delay. I can accept the fact that when reasonably close the realistic behaviour of other aircraft provides useful piloting cues - I hadn't recognised the full significance of that. I personally think that a switch from a full autopilot/fdm combination to a greatly simplified where-to-fly/how-to-fly logic when beyond a certain distance/direction from the user is probably eventually justified (IMHO). "[http://www.mail-archive.com/flightgear-devel@flightgear.org/msg08690.html]
* "a lot of good reasons for using an fdm/autopilot combination for AI traffic from David Megginson and Alex Perry, I can see the point of wanting a proper simulation when within reasonably close visual distance of the target. My concern was that if there were a lot of traffic being simulated, a lot of it known to the pilot only through the radio communication, then using an fdm thats updating at 120Hz and simulating right down to the exhaust gas temperature is overkill, and that using a greately simplified model with basically a look-up table of typical speeds and climb/descent rates would allow the additional traffic to be updated in a queue with, say, only one plane updated per timestep if far enough away from the viewer. My concern was that updating a number of fdms per timestep could possibly introduce a noticable delay. I can accept the fact that when reasonably close the realistic behaviour of other aircraft provides useful piloting cues - I hadn't recognised the full significance of that. I personally think that a switch from a full autopilot/fdm combination to a greatly simplified where-to-fly/how-to-fly logic when beyond a certain distance/direction from the user is probably eventually justified (IMHO). "[http://www.mail-archive.com/flightgear-devel@flightgear.org/msg08690.html]


* "That's a good point. The other option would be to cut down the Hz for the AIs -- how low could we make it before the autopilot lost control -- 10Hz? 2Hz?"[http://www.mail-archive.com/flightgear-devel@flightgear.org/msg08693.html]
* "That's a good point. The other option would be to cut down the Hz for the AIs -- how low could we make it before the autopilot lost control -- 10Hz? 2Hz?"[http://www.mail-archive.com/flightgear-devel@flightgear.org/msg08693.html]

Navigation menu