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 Hooray » Tue Jul 27, 2010 7:38 am

AFAIK bombable.nas doesn't trigger any problem when installed in a Git installation. You may want to keep a clean Installation beside the one you will use with bombable but it isn't mandatory.

Alexis


Actually, assuming that most of you run git/HEAD (next) anyway, the easiest thing to do is to create a separate branch in the base package checkout (clone) just for installing custom addons (i.e. a branch named "bombable" or "addons"), that way you can easily update (git pull) from HEAD, while still installing your addons in a branch.

For running fgfs, you can then simply switch to the corresponding branch ("git branch addons").
This is also a neat way for having multiple configurations (preferences.xml), while still being able to update directly from gitorious.

But in the long run it would be really great if bombable could be generalized and abstracted, so that it can become a part of the official base package - that should make it much easier for all of us to get the latest code, without having to do any manual merges. I really feel such a significant contribution belongs into HEAD!
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

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

Postby Thorsten » Tue Jul 27, 2010 7:56 am

I had segmentation faults from earlier versions of bombable in certain scenarios - for example in the first warthog invasion, I could never fly to the Golden Gate Bridge without generating a segmentation fault first. That went away by not using bombable.

I also happen to know that Nasal is able to trigger segmentation faults (I got a spectacular one by attempting to set the size of a vector to a negative number). My assumption is that this relates to internals like where in memory pointers actually (mis-)point - and the memory allocation may well be different between different GIT versions.

Given that, I think it's worth checking if bombable has still potentially dangerous code in.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

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

Postby Hooray » Tue Jul 27, 2010 8:18 am

I had segmentation faults from earlier versions of bombable in certain scenarios - for example in the first warthog invasion, I could never fly to the Golden Gate Bridge without generating a segmentation fault first. That went away by not using bombable.

I also happen to know that Nasal is able to trigger segmentation faults (I got a spectacular one by attempting to set the size of a vector to a negative number). My assumption is that this relates to internals like where in memory pointers actually (mis-)point - and the memory allocation may well be different between different GIT versions.


Yes, that's true - and it is actually fairly easy to trigger segfaults using Nasal. There is a whole number of ways. One pretty easy and "reliable" way would be to simply use the "break" expression outside loops. That should segfault reliably. On the other hand, such things are mostly related to the scripting interpreter itself, which is maybe not yet sufficiently "hardened".

To be honest, in scripting space there should really be no way for crashing the host application in the long run. No matter how poorly the script was coded, instead exceptions should be raised and caught, showing helpful error messages in the console (i.e. "break used outside loop"). This is especially true because Nasal scripts will usually be written by people who are not primarily developers.

So I really feel that this is more an issue of the underlying interpreter, than the end user scripts themselves.
No doubt, there are plenty of scripts that contain bugs or at least problematic code, the Nasal interpreter should better be hardened to provide useful diagnostic messages, instead of requiring careful code reviews.

Unfortunately, Nasal does not seem to be actively developed or maintained at the moment?
So even if I were to look into providing some patches, they would probably not be reviewed right away...

Given that, I think it's worth checking if bombable has still potentially dangerous code in.


Of course that'd be worthwhile, but on the other hand it is unrealistic to do this for all code.
It will really be easier to just accept that it's a work in progress and on going development.
Committing it to HEAD doesn't necessarily imply that it would be running by default.

That would be one easy way for dealing with this: add it to the base package, while disabling it by default - and maybe provide an option to enable it using the debug/development menu, that way everybody would know right away that this is an extension that is currently work in progress.

This could work pretty much like your local weather package, which is also runtime configurable to a certain degree.
So the bullet proof way would be to only load the script on demand, at runtime - by setting a listener property "load-bomable=true".

That would make it very easy for people to keep bombable in their base package, without also necessarily executing it.

The other important thing would be to really harden the Nasal interpreter itself...
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

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

Postby runtujazz » Tue Jul 27, 2010 11:04 am

I can not make visible the Zero green livery present in the set Bombable. When I start FG, appears completely dark gray. I read in submodel.txt to eliminate portions of the code but nothing happens. What is the correct procedure?

Thank you and sorry for the slight off-topic. :oops:
FG v.2, MacBook Pro 17", 2.66 GHz Intel Core Duo, 4 GB ram, NVIDIA GeForce 9600 GT VRAM 512 MB, monitor Eizo CG 21".
http://www.flickr.com/photos/carlorondinelli
runtujazz
 
Posts: 45
Joined: Mon Jul 05, 2010 7:00 pm
Location: Bracciano (near Air Force Museum) Roma - Italia
Version: 2

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

Postby xiii » Tue Jul 27, 2010 5:18 pm

Hooray wrote:Unfortunately, Nasal does not seem to be actively developed or maintained at the moment?
So even if I were to look into providing some patches, they would probably not be reviewed right away...


I'm sure Andy has a eye on the devel list. And the devel is definitely the place where you should write about this.

Alexis
If the engines are Pratt and Whitney, the seats best be Martin Baker
xiii
 
Posts: 472
Joined: Tue Jan 08, 2008 11:04 pm

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

Postby Thorsten » Wed Jul 28, 2010 7:17 am

To be honest, in scripting space there should really be no way for crashing the host application in the long run.


Very true - I was surprised you could do it at all... But since I don't know how to make the Nasal interpreter catch errors, but I do know how to avoid them inside Nasal, I'll just fix the Nasal part 8)
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

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

Postby Hooray » Wed Jul 28, 2010 10:57 am

Thorsten wrote:
To be honest, in scripting space there should really be no way for crashing the host application in the long run.


Very true - I was surprised you could do it at all... But since I don't know how to make the Nasal interpreter catch errors, but I do know how to avoid them inside Nasal, I'll just fix the Nasal part 8)


This is really an important issue, it's like a javascript crashing your browser ...
Maybe this is another thing that could be covered in a beginner's Nasal introduction?

You can catch errors by using the explicit "call" library function to call a Nasal function, that provides a way for catching exceptions and dealing with them:

http://plausible.org/nasal/lib.html
call(fn, args=[], me=nil, namespace=nil, error=nil)
Calls the given function with the given arguments and returns the result. The optional arguments can be used to specify the "me" reference for a function call and the local variable namespace. The error argument, if present, must be a vector. If the called function terminates due to a runtime error or die() call, the error (either a string or the argument to die() is appended to the vector, followed by the file name at which the error occurred, followed by the line number in that file, followed in order by each file/line number on the call stack.


In code it looks like this:

Code: Select all
var killme = func break;
var errors = [];
call(killme,[],nil, nil, errors);
if (size(errors)) print("exception raised!");


This will basically just do killme(); but also provides a way for catching exceptions, which are then appended to the errors vectors.
For passing arguments, you need to populate the first vector with your parameters, for passing a me reference (OOP), you need to pass it as the 3rd argument, and a custom namespace (enclosing hash) can be passed as the 4th arg.

For checking if any exceptions were thrown, you can simply check the size of errors vector - which should be 0 if everything's ok, or != 0 otherwise.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

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

Postby Vodoun da Vinci » Tue Aug 03, 2010 12:03 pm

New video featuring FGFS 2.0 and Flug's latest Bombable Script 3P for the AI combat scenes. While long the movie documents to advance of Bombable Script and show the new agility of AI opponents pretty well I think.



Thanks, Flug. and thanks to everyone who contributed to the troubleshooting and testing providing feedback to make Bombable Script better with each release.

VooDoo
FGFS version 2.4.0 on Windows 7
Primarily Flying Warbirds, Jet and Prop - Visit: http://www.fguk.eu
VooDoo's FGFS/FGUK Movies!: http://www.youtube.com/user/VooDoodaVinci?feature=mhee
"Imagination is more important than knowledge"
A. Einstein
User avatar
Vodoun da Vinci
Retired
 
Posts: 405
Joined: Thu Mar 25, 2010 4:29 pm

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

Postby rico001 » Thu Sep 02, 2010 10:46 pm

Vodoun da Vinci wrote:New video featuring FGFS 2.0 and Flug's latest Bombable Script 3P for the ...

Thanks, Flug. and thanks to everyone who contributed to the troubleshooting and testing providing feedback to make Bombable Script better with each release.

VooDoo
For the spad 7 if possible the bullets need bigger tracer and maybe smoke coming from the guns after a clip is fired, maybe wav file play for a gun jam. Here is link to free wav file sites: http://www.wav-sounds.com/vehicle_wav_sounds.htm
I was wondering if HUD targeting was operational?
This youtube video by TheMasterofmod shows a missle armed and fired from an F14b in FG.

We could find out how ai tracking on the pilot HUD works in real life, for now (suggestion) in the cockpit view we could have it put a green (to match hud color) circle on objects that move... :P
Is there a website for this mod? Good Job on it!
Unofficial flightgear portable 1.0 windows 32-bit gpl2
https://sourceforge.net/projects/flight ... -portable/
A FlightGear Newsletter: https://wiki.flightgear.org/FlightGear_ ... tober_2023
rico001
 
Posts: 73
Joined: Wed Oct 17, 2007 7:14 pm
Version: 20.3.6 1.0
OS: Win10 64

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

Postby redneck » Thu Sep 02, 2010 10:58 pm

rico001 wrote:for now (suggestion) in the cockpit view we could have it put a green (to match hud color) circle on objects that move... :P

This is already available. Simply get in a plane that has radar, bring up the HUD with "h", and press Ctrl+i to switch to a different HUD, which displays radar contacts exactly as you have described.
Call Signs: redneck, ATCredn (unspecified freq atc)
FGFSCopilot
FGFSCopilotATCEdition
System Specs
Model: Alienware M15x, OS: Windows 7 Professional 64-bit, RAM: 3 GB, CPU: Intel i3 quad core at 2.4 GHz, GPU: Nvidea GeForce GTX 460M 1.5 GB GDDR5
redneck
 
Posts: 3617
Joined: Mon Feb 02, 2009 3:17 am
Location: Pennsylvania, USA
Version: 240

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

Postby xiii » Fri Sep 03, 2010 8:30 am

rico001 wrote:Is there a website for this mod? Good Job on it!


Thanks, The f-14b with the last guided missiles and basic attack symbology in the HUD is available in official Git version here:

http://mapserver.flightgear.org/git/?p=fgdata;a=snapshot;h=c5c93576f4ad0ac90915bdeee1f71462b9436f35;sf=tgz


Enjoy,
Alexis
If the engines are Pratt and Whitney, the seats best be Martin Baker
xiii
 
Posts: 472
Joined: Tue Jan 08, 2008 11:04 pm

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

Postby hardy » Fri Oct 22, 2010 2:11 pm

Vodoun da Vinci wrote:
Thanks, Flug. and thanks to everyone who contributed to the troubleshooting and testing providing feedback to make Bombable Script better with each release.

VooDoo



I helped a lot when it came down to testing Bomable
taking over the Salt Lake City Fly in for now
hardy
 
Posts: 168
Joined: Thu Aug 26, 2010 10:35 pm

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

Postby hvengel » Wed Oct 27, 2010 1:20 am

Vodoun da Vinci wrote:New video featuring FGFS 2.0 and Flug's latest Bombable Script 3P for the AI combat scenes. While long the movie documents to advance of Bombable Script and show the new agility of AI opponents pretty well I think.

Thanks, Flug. and thanks to everyone who contributed to the troubleshooting and testing providing feedback to make Bombable Script better with each release.

VooDoo


Nice video. It does show the AI aircraft doing some maneuvering but it all appears to be basically 2D in nature. Is anyone looking at making the AI aircraft maneuvers more 3D with some of these going into the vertical (immelmann's, split S's, high and lo YoYo's...)?

Hal
hvengel
Retired
 
Posts: 1127
Joined: Sun Dec 24, 2006 5:35 am
Location: Minden Nevada

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

Postby Hooray » Wed Oct 27, 2010 10:41 am

hvengel wrote:Is anyone looking at making the AI aircraft maneuvers more 3D with some of these going into the vertical (immelmann's, split S's, high and lo YoYo's...)?


that's the sort of stuff that is really hard to get right, especially for different types of aircraft.
At the moment, the AI "bots" are based on AI objects that are scripted using Nasal. So one would need to create custom configurations for each aircraft to make this look at least "somewhat realistic".

So basically there is already some sort of "pseudo FDM" being used for controlling these, which is scripted in Nasal. This in and of itself is already complicated and has many restrictions obviously.
Now starting to support aerobatics is even more complicated as you surely know. This doesn't just apply to the AI traffic system, but also to the native FDMs supported by FG.

The best solution would probably really be to use a full featured FDM for driving the AI objects, and then only use Nasal for driving the control inputs.
Then, people could use a real FDM for manually tweaking the performance of different aircraft.

At the moment, the performance shown by AI aircraft doesn't match what's possible with FG FDMs.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

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

Postby i4dnf » Sat Nov 06, 2010 7:45 pm

Hi, there seems to ne a problem with the latest version of this, at least here. This is missing:
Code: Select all
AI/Aircraft/Ballistic/bullet.xml
in fact the whole Ballistic folder is missing, which causes the bombable.nas script to crash FG at startup.
That file is requested by bombable.nas in line 146:
Code: Select all
var put_ballistic_model = func(myNodeName="", path="AI/Aircraft/Ballistic/bullet.xml ") {

(On the bright side this might have lead me to discover another bug in the nasal parser, but that's another story)
i4dnf
Retired
 
Posts: 743
Joined: Wed Sep 09, 2009 8:17 am
Location: LRBS
Callsign: YR-I4D
Version: GIT
OS: Gentoo Linux ~amd64

PreviousNext

Return to New features

Who is online

Users browsing this forum: No registered users and 4 guests