Board index FlightGear Development New features

AI & MP Dogfighting now working! Bombable ships, aircraft...

Discussion and requests for new features. Please note that FlightGear developers are volunteers and may or may not be able to consider these requests.

Re: AI & MP Dogfighting now working! Bombable ships, aircraft...

Postby jack » Thu May 20, 2010 7:52 am

That fixed it, thanks!!!! 8)
For Military Aircraft, Scenery, and more, visit http://alphashangar.co.nr/

'Retired' from FlightGear as of July 2011. You can contact me via my website if you'd like to pick up any old projects.
jack
Retired
 
Posts: 1432
Joined: Wed Mar 03, 2010 12:26 am
Location: KLVK
Callsign: Alpha-J, Rescue1
Version: GIT
OS: Mac OS X

Re: AI & MP Dogfighting now working! Bombable ships, aircraft...

Postby todaytomo » Fri May 21, 2010 1:58 am

Hi all, I have a somehow stupid question: I want the aricraft (A-10 for example) to be bombed in the air when just some parameters are changed through the HTTP interface. I have read the documents for bombable, and find that some related parameters, such as /bombable/fire-particles/fire-trigger, /environment/bombable/attributes/damage. I set these two parameters to 1, but the aircraft still be OK, not bombed...

I wonder is it possible to let A-10 bombed in the air by just changing some parameters on line?

Thanks very much!
todaytomo
 
Posts: 1
Joined: Fri May 21, 2010 1:49 am

UPDATE to 3.0i! AI & MP Dogfighting now working!

Postby flug » Thu Jun 03, 2010 7:22 am

Just made an update to Bombable ver. 3.0i.

It makes a small but important improvement--in multiplayer dogfighting, you can reset your damage level to 0% by going to file/reset.

This makes dogfighting much more attractive as you don't have to exit/re-start flightgear every time you reach 100% damage.

There are a few other minor updates/upgrades as well.

It has been tested and seems to work fine with FlightGear 2.0.

Download the update here: http://brenthugh.com/flightgear/bombable3i.zip
flug
 
Posts: 219
Joined: Wed Jun 17, 2009 2:06 am

Re: AI & MP Dogfighting now working! Bombable ships, aircraft...

Postby flug » Mon Jun 07, 2010 2:39 am

Been working on some fairly good improvements to the Bombable package over the past few days--more reliable communications over MP (for dogfighting), refinements and bugfixes, and getting another plane working for dogfighting (A6M2 Zero).

Here is a little preview:

Image

Image
Last edited by flug on Mon Jun 07, 2010 2:44 am, edited 1 time in total.
flug
 
Posts: 219
Joined: Wed Jun 17, 2009 2:06 am

Re: AI & MP Dogfighting now working! Bombable ships, aircraft...

Postby flug » Mon Jun 07, 2010 2:43 am

Couple more previews of Bombable 3.0j--coming soon:
Image

Image

Image

Image
flug
 
Posts: 219
Joined: Wed Jun 17, 2009 2:06 am

Re: AI & MP Dogfighting now working! Bombable ships, aircraft...

Postby flug » Mon Jun 07, 2010 2:45 am

And one final preview of Bombable 3.0j:

Image
flug
 
Posts: 219
Joined: Wed Jun 17, 2009 2:06 am

Re: AI & MP Dogfighting now working! Bombable ships, aircraft...

Postby flug » Mon Jun 07, 2010 2:52 am

todaytomo wrote:Hi all, I have a somehow stupid question: I want the aricraft (A-10 for example) to be bombed in the air when just some parameters are changed through the HTTP interface. I have read the documents for bombable, and find that some related parameters, such as /bombable/fire-particles/fire-trigger, /environment/bombable/attributes/damage. I set these two parameters to 1, but the aircraft still be OK, not bombed...


/environment/bombable/attributes/damage and /bombable/fire-particles/fire-trigger are the right places (or some of them, anyway, sort of) for the **main aircraft**.

To affect one of the other aircraft you see, you'll have to change parameters for the AI aircraft. They will be in something like /ai/models/multiplayer[3] or /ai/models/model[3]. When you go into those directories and poke around you'll start to see things.

However setting an object on fire isn't quite as easy as just setting a trigger.

Easiest way would be to open the nasal console (one of the menu options once you have started FlightGear) and then execute a statement something like:

bombable.startFire("/ai/models/multiplayer[3]");

Obviously, put in place of "/ai/models/multiplayer[3]", whatever model or object you want to set on fire.
flug
 
Posts: 219
Joined: Wed Jun 17, 2009 2:06 am

Re: AI & MP Dogfighting now working! Bombable ships, aircraft...

Postby flug » Mon Jun 07, 2010 3:09 am

jackmermod wrote:
happyflier wrote:How do I fire the guns on Fokker DR1? :?:


I have the same problem! I can't get the guns to fire in the fokker dr 1! :evil:


Look for a fix in 3.0j - the key will be 'e'.

(I always use the joystick, which doesn't have this problem . . . so sorry for not noticing. The dr 1 doesn't have any other keybindings, either, so if you don't have a joystick you might have other problems operating it.)
flug
 
Posts: 219
Joined: Wed Jun 17, 2009 2:06 am

Re: AI & MP Dogfighting now working! Bombable ships, aircraft...

Postby jack » Mon Jun 07, 2010 3:18 am

I finally set up the key bindings for my joystick, so now the guns work, thanks for answering though. Also, I've noticed a small problem. When I look at damaged aircraft from a certain angle, their damaged engine smoke sometimes turns white, then when I change my pitch or bank a little, it might turn black. Is this intentional?
For Military Aircraft, Scenery, and more, visit http://alphashangar.co.nr/

'Retired' from FlightGear as of July 2011. You can contact me via my website if you'd like to pick up any old projects.
jack
Retired
 
Posts: 1432
Joined: Wed Mar 03, 2010 12:26 am
Location: KLVK
Callsign: Alpha-J, Rescue1
Version: GIT
OS: Mac OS X

Re: AI & MP Dogfighting now working! Bombable ships, aircraft...

Postby flug » Mon Jun 07, 2010 3:41 am

jackmermod wrote:I've noticed a major defect in the realism of bombable effects. In an ai scenario, I can pepper a plane all I want(I sometimes put thousands of rounds into one plane), and it can take over 5 minutes to go down! I'll help fix this if anyone will join me. :D


Actually, you're being rather misled by the FlightGear's current impact model. It models any aircraft rather crudely as a large sphere and any projectile that hits **anywhere in that sphere** will show an impact point.

Also many of the aircraft on FlightGear currently use a 'bullet splash' graphic that approximates a large amount of dirt or soil being kicked up when the bullet hits the ground or something.

So what you are seeing (FG visual effect) is:

1. Bullet whizzes, say, 10 feet above the aircraft
2. FG detects this hitting its large invisible target sphere surround the aircraft
3. FG shows a nice impact point/explosion in the air fairly near the aircraft
4. You interpret that as "NICE HIT!!!11!!"

In reality (Bombable internally calculated effect):

1. A bullet whizzed harmlessly, 10 feet above the aircraft, made no contact of any kind.

Bombable doesn't just rely on FG's rather inexact calculation of impact. Rather it analyzes each supposed impact using a rather more careful model of where the impact was in relation to the target object, how large that particular craft is, and where its most vulnerable areas are. Bullets whizzing by 5 or 10 feet above the aircraft add no damage, whereas those hitting near the center of the object are likely to do a lot of damage.

Bombable's model is far from perfect as well but it is far closer to reality than what you see visually on FG.

If you watch carefully during a dogfight you'll notice that 'impact points' that are actually way off the to the side or above or below the target add no damage. Whereas those that are actually hits to the center of the target, do indeed add damage.

(And FWIW, Bombable also discriminates between an explosive charge or bomb, which sends out shrapnel etc and damages things at a distance from the impact point, and simple projectiles, which only damage if they directly hit. One thing that might be confusing you is you are shooting something like a machine gun but the visual effects in FG tend to make those impacts, even ones that simply pass **near** the target aircraft, look like explosions or shrapnel. Yes, if there were that many explosive rounds detonating near the aircraft it would certainly take it out, but simple machine gun rounds don't do have that effect. Again--dont' be fooled by FG's visual effects.)
flug
 
Posts: 219
Joined: Wed Jun 17, 2009 2:06 am

Re: AI & MP Dogfighting now working! Bombable ships, aircraft...

Postby flug » Mon Jun 07, 2010 3:45 am

jackmermod wrote:I've noticed a major defect in the realism of bombable effects. In an ai scenario, I can pepper a plane all I want(I sometimes put thousands of rounds into one plane), and it can take over 5 minutes to go down! I'll help fix this if anyone will join me. :D


To put it another way, hitting a moving aircraft from another moving aircraft with a machine gun fixed to that aircraft is hard.

Really, really hard.

I've followed an aircraft and shot *many thousand* of rounds pretty close to it, in its general direction, and missed *all* of them. Many times.

(And not just in FlightGear, either--in other similar simulators that seem to have a more sophisticated way of detecting the impacts. It was many, many hours practice in Combat FS before I could get even 1% hits on a combat mission. So FWIW!)
flug
 
Posts: 219
Joined: Wed Jun 17, 2009 2:06 am

Re: AI & MP Dogfighting now working! Bombable ships, aircraft...

Postby Thorsten » Mon Jun 07, 2010 7:35 am

I repeat my earlier comment:

Neither the GAU-8/A nor the M61 Vulcan are machineguns. The Vulcan fires 20 mm rounds with 1050 m/s, the GAU-8/A 30 mm rounds with 1070 m/s. That's an anti-tank gun, it can chew through 7 cm steel at 500 m distance. If you hit an aircraft, it does massive damage, as aircraft as a rule don't use 7 cm steel armour (otherwise takeoff would be a bit difficult with all the weight). For comparison, a typical WW-I machine gun fires 8 mm rounds with 900 m/s exit velocity - destructive power rougly should scale with the square of the velocity and the cube of the caliber - so there's at least a factor 80 in destructive power per round.

Unlike in WW-I aircraft, where hits often meant that you punched a few holes into canvas, modern aircraft have a much higher density of critical components - the wings are usually not just lifting surface but contain tanks for example.

So you can argue that it should take quite some time to down the Fokker with a machinegun - fine. But it should not take long to down an A-10 with the GAU-8/A - a single burst of rounds should basically do it, if it is on the mark.

Now, you can argue that I didn't actually hit, but that's beside the point as the bombable script wrote out that I hit and caused damage - I just disagree massively with your idea of a realistic amount of damage caused by that hit.

A second thing that I noticed is that 'dead' planes take quite some time to go down. I used the MiG-15bis recently to go after Cessna targets, followed up from behind, shot a burst of rounds (again, the MiG-15 carries 23 and 37 mm cannons designed to take down a B-29 in a pass) and saw, one after the other, erupt five planes into flames. Now, each time I turned, I saw the planes flying on, altering course and in general evading. After I had gone empty, I turned and saw three still burning and flying, two down and smoking. After landing and exiting, I inspected the script which told me I had killed every plane with 100% damage on the initial pass (I had chosen 'super-easy' to simulate a realistic amount of damage). So even after being killed immediately, the targets were able to be airborn and maneuver for more then 4 minutes, falling from an altitude of 600 ft.

You have done good work with the bombable script, but I think you cannot dismiss every criticism of damage level as unfounded - I think the damage caused by the modern cannons is grossly underestimated, essentially the script pretends they'd be nothing more than MGs.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: AI & MP Dogfighting now working! Bombable ships, aircraft...

Postby flug » Tue Jun 08, 2010 7:40 am

Thorsten wrote:A second thing that I noticed is that 'dead' planes take quite some time to go down.


This is an inherent problem of this approach. To fix it you would have to get in and change FG's internals somehow.

What bombable does instead is try to work with FG's AI routines and give them hints--"make this plane go downwards now" etc.

The trouble is that due to the way it works internally it will only take hints to a certain, very small degree.

I've tried just forcing the planes down faster (you can simply alter their position directly) but it just looks really really fake.

So yeah, this needs to be fixed but that's going to be a major project for someone and far, far beyond the rather simple methods Bombable employs to work with the AI aircraft system in FG.

In the meanwhile we can pretend that those little airplanes are just gliding, gliding to their doom . . .
flug
 
Posts: 219
Joined: Wed Jun 17, 2009 2:06 am

Re: AI & MP Dogfighting now working! Bombable ships, aircraft...

Postby Thorsten » Tue Jun 08, 2010 7:50 am

It may a matter of framerate loss, but the tanker.nas script is an example of a plane completely controlled by Nasal by direct alteration of the position - looks nice to me (since it gets a position update every frame, it moves as smoothly as anything else). And it flies a racetrack pattern, so it works for turns as well as straight lines.

Technically, I don't suppose a control loop running every frame, going through all AI craft, checking a flag if they are destroyed and changing their position from z to z - vz dt where dt is the time duration of the last frame would be very complicated. Also, altering the pitch of the plane going down is just a property away. You write it looks fake - why? What happens?

I have some experience controlling objects from Nasal (used that for clouds before letting the shaders do the job) - maybe I can give you a few useful pointers.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: AI & MP Dogfighting now working! Bombable ships, aircraft...

Postby flug » Tue Jun 08, 2010 9:03 am

Thorsten wrote:So you can argue that it should take quite some time to down the Fokker with a machinegun - fine. But it should not take long to down an A-10 with the GAU-8/A - a single burst of rounds should basically do it, if it is on the mark.


Well, I'm not going to say that the damage model can't be improved, because I'm quite sure it can.

Also you have a point about the "direct hit" terminology--all "direct hit" means is the round has landed within the damage radius, and the damage radius is typically about the distance from the center of the plane to the wingtip. So think of a sphere with the aircraft in the middle of it and the wingtips just reaching the surface of the sphere. Your round hit somewhere within that sphere--and you'll notice there is more empty space than airplane in the sphere--especially out towards the edges of it.

If FG could tell us precisely where a round impacts on the surface of the aircraft, then we could make some really nice and precise damage estimations.

In the meanwhile what Bombable does is take a bit of a probabalistic approach. If your "close hit" is near the center of the damage radius then the chance of it doing total damage is very high; if it is out near the edge its chance is lower.

And FWIW according to the formula in the program the GAU-8/A does create many times the damage of a machine gun round. I just loaded up the A-10 and the scenario to go hunting some Cessnas, and a single round of the GAU-8/A does 749% damage to the Cessna whereas something like a Vickers machine gun will do maybe 3-4%.

And by the same token I just took out a Warthog with a single GAU-8/A round which registered over 100% damage (and that with both easy & super-easy modes disabled). However I'm using the latest ver. of Bombable which incorporates the observation made earlier on this thread, that Warthogs are probably more like twice as easy to damage as the M-1 tank, rather than twice as hard.

So again I'm not saying the damage formulas can't be tweaked some--they can--and if you have specific suggestions I'm all ears, but to really solve the problem you want to solve is going to take much, much more specific info out of FG that it just can't give right now, plus much more specific info about damage vulnerabilities of specific aircraft and systems and the damage inflicted by various specific weapons.

In the meanwhile, the formulas bombable uses now already incorporate the general thrust of research like this:

http://eaw.wikispaces.com/Technical+Tools--Gun+Power

(Which is that the damage power of rounds increases with their mass, but with a fairly hefty bonus added in by virtue of the fact that larger rounds generally incorporate something or other, like high explosives, that magnifies their damage. Thus the GAU-8/A does way, way more damage than a small caliber machine gun round.)

If you really want to get into it you could incorporate damage data like that for each and every type of weapon and use that to calculate the damage totals. But again--just that project would be some thousands of times the size of Bombable--which is big enough already!
Last edited by flug on Tue Jun 08, 2010 9:52 am, edited 1 time in total.
flug
 
Posts: 219
Joined: Wed Jun 17, 2009 2:06 am

PreviousNext

Return to New features

Who is online

Users browsing this forum: Cyber_Gamer and 6 guests