Board index FlightGear Development Nasal

Is there interest in a Nasal introduction?

Nasal is the scripting language of FlightGear.

Re: Is there interest in a Nasal introduction?

Postby redneck » Wed Aug 11, 2010 11:26 pm

Alright. I'll keep an eye on this stuff.
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: 3630
Joined: Mon Feb 02, 2009 2:17 am
Location: Pennsylvania, USA
Version: 240

Re: Is there interest in a Nasal introduction?

Postby skyop » Wed Aug 11, 2010 11:30 pm

I'll add my support to this movement for a nasal introductory page. When I first started out in the nasal world, there was just so much to comprehend and figure out, and much too little documentation.

The following should be highlighted:
  • Loading and calling scripts in aircraft
  • Loading and calling scripts in scenery models
  • How to integrate nasal into XML property trees

stuff like that.
Aircraft: [ CRJ700-family | DC-10-30 ] Scenery: [ KBFL ]
skyop
 
Posts: 3047
Joined: Mon Jun 14, 2010 12:40 am
Location: Austin, Texas, USA
IRC name: skyop
Version: next
OS: Fedora 23/Windows 10

Re: Is there interest in a Nasal introduction?

Postby Arthur Maiden » Thu Aug 12, 2010 8:46 pm

Id be interested in learning the scenery side of nasal, call me a wuss but i like things simple and a plane has too many different files in it for me, witch is why i stick to liveries, i also have several scenery models available that are supposed to be clickable and all that but i just cant make head nor tail of the nasal, if you want you could use them as an example...
FGUK - A FlightGear community in the United Kingdom and Republic of Ireland
Callsign: G-PHEN
AVA Callsign: AVA0016 - RETIRED
The development of the S92 has infected my Avatar...
User avatar
Arthur Maiden
 
Posts: 681
Joined: Sat Oct 03, 2009 10:42 pm
Callsign: G-PHEN
Version: GIT
OS: Vista, Ubuntu 10.04

Re: Is there interest in a Nasal introduction?

Postby jack » Sat Aug 14, 2010 10:30 am

I am certainly interested in learning nasal. I know a bit of nasal, enough where I've made a livery select menu and a weapons reload nasal. What I'm really interested in, is nasal controlled ai objects, something that seems to be increasing in popularity. I'd like to use nasal to construct working Aim-54 Phoenix's and Aim-7 Sparrow Air-to-Air missiles, and maybe one day, AI anti aircraft...this would consist of nasal controlled SAM or FLAK batteries that would fire at aircraft within a certain range and field of view. A better understanding of nasal could definitely help my development and efficiency.
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.
User avatar
jack
Retired
 
Posts: 1440
Joined: Tue Mar 02, 2010 11:26 pm
Location: KLVK
Callsign: Alpha-J, Rescue1
Version: GIT
OS: Mac OS X

Re: Is there interest in a Nasal introduction?

Postby Hooray » Sun Aug 15, 2010 9:52 pm

jackmermod wrote:I am certainly interested in learning nasal. I know a bit of nasal, enough where I've made a livery select menu and a weapons reload nasal. What I'm really interested in, is nasal controlled ai objects, something that seems to be increasing in popularity. I'd like to use nasal to construct working Aim-54 Phoenix's and Aim-7 Sparrow Air-to-Air missiles, and maybe one day, AI anti aircraft...this would consist of nasal controlled SAM or FLAK batteries that would fire at aircraft within a certain range and field of view. A better understanding of nasal could definitely help my development and efficiency.


Well, we already talked about this in the "AI guided missiles" thread a couple of weks ago: Basically, xiii has illustrated that this is perfectly possible, and there are plans in place to generalize the existing code to turn it into a reusable Nasal module for the $FG_ROOT/Nasal directory eventually, so that all users can easily create new AI objects that can be controlled from Nasal, just by subclassing an existing Nasal class: viewtopic.php?f=23&t=7791&start=45#p84834

This will all depend on solid background knowledge of Nasal, and the AI system (its properties) however - so the best thing you can do right now, is reading more about Nasal to see how it works. Even if the approach had already been fully documented, and if the module would be available right now - you would still need to know Nasal.
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: 11496
Joined: Tue Mar 25, 2008 8:40 am

Re: Is there interest in a Nasal introduction?

Postby jack » Sun Aug 15, 2010 10:05 pm

Hooray wrote:Well, we already talked about this in the "AI guided missiles" thread a couple of weks ago: Basically, xiii has illustrated that this is perfectly possible, and there are plans in place to generalize the existing code to turn it into a reusable Nasal module for the $FG_ROOT/Nasal directory eventually, so that all users can easily create new AI objects that can be controlled from Nasal, just by subclassing an existing Nasal class: viewtopic.php?f=23&t=7791&start=45#p84834

This will all depend on solid background knowledge of Nasal, and the AI system (its properties) however - so the best thing you can do right now, is reading more about Nasal to see how it works. Even if the approach had already been fully documented, and if the module would be available right now - you would still need to know Nasal.


My plans are to completely re-do the missile script for 3 reasons:

1) The Missiles I am interested in are guided based off a completely different system: Radar, not a heat signature. (Radar guided missiles such as the Aim-7 have to be locked on manually)

2) Xiii has stated that he "wrote his missile script in his own 'unreadable' nasal." Read here: http://www.flightgear.org/forums/viewto ... +TM#p81814

3) Xiii's missile script is completely made to suit the F-14B only, and cannot easily be implemented on other aircraft....my plans are to make a "package" that can easily be adapted for an aircraft, so I can implement the missile system on multiple aircraft, easily.

As for the FLAK and SAM batteries, I believe that I cloud make a field of view for the ai battery, and have it update that frame 4 or more times a second, and when a vehicle is detected, it could trigger a property where the battery would begin firing at the vehicle until it exits the field of view. I could use flug's bombable to record damage on the vehicle, making a realistic anti-aircraft experience. This would make WWII and Vietnam War scenarios much more historically accurate, and a bit more interesting.
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.
User avatar
jack
Retired
 
Posts: 1440
Joined: Tue Mar 02, 2010 11:26 pm
Location: KLVK
Callsign: Alpha-J, Rescue1
Version: GIT
OS: Mac OS X

Re: Is there interest in a Nasal introduction?

Postby Hooray » Sun Aug 15, 2010 10:25 pm

Well, your plans do sound ambitious to say the least.

But while I don't really know how familiar you really are with Nasal programming yourself, I would personally really not read too much into xiii's comments: xiii has made countless rather sizable contributions to FlightGear, including some fairly advanced Nasal scripts doing basically unprecedented things with existing FlightGear technology (like for instance those Nasal driven AI missiles!) - statements like "All of this is in the usual un-readable-un-maintainable xiii's nasal code TM." is probably what most of us would refer to as exaggeration, which should be considered "tongue in cheek" in my opinion.

If you know Nasal, and once you actually understand a script written by someone else, you can see for yourself.
Really, xiii's code is not only pretty well structured and even uses OOP to separate code and data into distinct modules, but is also well commented.

In my opinion, xiii's script would be an excellent place to start generalizing the whole concept of Nasal controlled AI objects, starting to rewrite anything from scratch without looking at xiii's code would be a big mistake from my point of view.

While the "tanker.nas" script used to be the de facto example for illustrating how to script AI objects, xiii's code has in my opinion become the standard for showing how to combine scripted AI objects with custom, scripted FDMs to create autonomous objects.

Basically, if you need help understanding xiii's current code, it is pretty unlikely that you'll be able to come up with a generic module, like the one you described.
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: 11496
Joined: Tue Mar 25, 2008 8:40 am

Re: Is there interest in a Nasal introduction?

Postby jack » Sun Aug 15, 2010 10:35 pm

Hooray wrote:Well, your plans do sound ambitious to say the least.

But while I don't really know how familiar you really are with Nasal programming yourself, I would personally really not read too much into xiii's comments: xiii has made countless rather sizable contributions to FlightGear, including some fairly advanced Nasal scripts doing basically unprecedented things with existing FlightGear technology (like for instance those Nasal driven AI missiles!) - statements like "All of this is in the usual un-readable-un-maintainable xiii's nasal code TM." is probably what most of us would refer to as exaggeration, which should be considered "tongue in cheek" in my opinion.

If you know Nasal, and once you actually understand a script written by someone else, you can see for yourself.
Really, xiii's code is not only pretty well structured and even uses OOP to separate code and data into distinct modules, but is also well commented.

In my opinion, xiii's script would be an excellent place to start generalizing the whole concept of Nasal controlled AI objects, starting to rewrite anything from scratch without looking at xiii's code would be a big mistake from my point of view.

While the "tanker.nas" script used to be the de facto example for illustrating how to script AI objects, xiii's code has in my opinion become the standard for showing how to combine scripted AI objects with custom, scripted FDMs to create autonomous objects.


Is there a problem with me making a new script? I feel it's necessary, and I don't understand why you're so eager to keep me from doing so.

Basically, if you need help understanding xiii's current code, it is pretty unlikely that you'll be able to come up with a generic module, like the one you described.


Well thanks for the motivation! I don't understand, I'm interested in learning nasal, and you seem to be trying to discourage me. Why is that? :roll:
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.
User avatar
jack
Retired
 
Posts: 1440
Joined: Tue Mar 02, 2010 11:26 pm
Location: KLVK
Callsign: Alpha-J, Rescue1
Version: GIT
OS: Mac OS X

Re: Is there interest in a Nasal introduction?

Postby Hooray » Sun Aug 15, 2010 11:26 pm

No, you are getting me totally wrong: I am not at all trying to discourage you. Quite the opposite: I would love to be proven wrong actually!
In fact, I am the one who originally brought up the idea of generalizing the modules provided by xiii, so I would truly love to see your ideas turn into code that is reusable!

And really: please do feel invited to rewrite every single line of code in FlightGear that you deem necessary :lol:

Seriously, if I remember correctly you are the one who recently asked me in another thread to write some documentation for the Nasal/AI techniques that xiii uses for controlling AI objects in Nasal, right?

Similarly, you have repeatedly indicated an interest in learning Nasal, which is a good thing - really!

Believe me, I am really not at all trying to keep you from learning Nasal! The more people know Nasal programming, all the better for FlightGear!
So I really think you have a big misconception here.

The opposite is actually the case: I would now go as far as saying: I *want* you to learn Nasal! :-)

But, I assert that you will find learning Nasal incredibly tricky if you try to learn it by scripting such advanced things like the ones we are talking about here. I am obviously saying this without knowing anything about your background, though!

Just believe me, Nasal in itself is really not at all complicated. But the stuff you are planning to do is complicated in and of itself, regardless of the programming language being used.

It is possible that -depending on your background- you may find many things easy that would usually be considered non trivial, in that case: learning Nasal will probably be a no brainer for you.

What I am trying to tell you is to take a careful look at the code written by more experienced contributors, like xiii in this case.

Really, doing from scratch what xiii has done with the AI guided missiles script, will require a solid understanding of both, Nasal and the AI systems, as well as a good background in physics, maths and FlightGear in general. All of this will get blatantly obvious to you, once you actually look at and understand the code in question!

For example, are you familiar with 3D maths, vector/matrix operations?
This is just one thing that xiii makes use of!

In this sense, it would really be a bad project for trying to learn Nasal in my opinion, especially if you lack the background in programming, maths or physics. Such advanced addons, are no longer just about learning ONE new thing, but mostly about APPLYING knowledge of a number of different fields.

I am REALLY convinced that trying to learn Nasal with such a big project would probably be a pretty frustrating experience for most people, who lack the corresponding professional background.

So, I don't know about your professional background, but if it is not in any way related to software development, physics or maths, I am pretty sure that trying to contribute the way you hope, will provide for a rather steep entry barrier - especially without a solid understanding of the corresponding FlightGear systems involved.

Really, believe me: Learning Nasal is one thing(a couple of weeks will do for basic things, especially if you are already familiar with JavaScript) , getting to know the AI system another (another 2-3 weeks) - creating scripted FDMs yet another (fancy maths), but applying ALL these principles to create a completely new hybdrid solution, is a huge non trivial undertaking which is not well suited for providing a good "learning experience" with direct gratification.


Don't try to run before you can walk...
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: 11496
Joined: Tue Mar 25, 2008 8:40 am

Re: Is there interest in a Nasal introduction?

Postby jack » Mon Aug 16, 2010 11:08 pm

A little bit about my background:

I understand and can script fluently in the following scripting languages:

- html
- xml
- htaccess(learned a few months ago, but have used it a bit and am quite familiar with it)
- php (I've used this for requiring passwords to pages, along with htaccess and know it decently)

as for math/science, I have a lot of experience with Algebra involving geometric shapes, and I have studied physics a bit.
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.
User avatar
jack
Retired
 
Posts: 1440
Joined: Tue Mar 02, 2010 11:26 pm
Location: KLVK
Callsign: Alpha-J, Rescue1
Version: GIT
OS: Mac OS X

Re: Is there interest in a Nasal introduction?

Postby Hooray » Tue Aug 17, 2010 12:19 am

jackmermod wrote:I understand and can script fluently in the following scripting languages:

- html
- xml
- htaccess(learned a few months ago, but have used it a bit and am quite familiar with it)
- php (I've used this for requiring passwords to pages, along with htaccess and know it decently)

Well, to be brutally honest: three out of those four are actually not "scripting languages" at all, they are so called "markup languages" (or configuration files, in the case of htaccess) and not even programming languages in the first place.

HTML and XML are meant to describe content: http://en.wikipedia.org/wiki/Markup_language
A scripting language (and more generally any programming language) however has a different purpose: http://en.wikipedia.org/wiki/Scripting_language

If you don't just know HTML, but also DHTML and JavaScript, learning Nasal should be really easy though!
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: 11496
Joined: Tue Mar 25, 2008 8:40 am

Re: Is there interest in a Nasal introduction?

Postby jack » Tue Aug 17, 2010 12:23 am

I used javascript on a website, once. But other than that the closest thing to it that I've used a lot is php. I call them scripting languages, and it's all the same IMO.
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.
User avatar
jack
Retired
 
Posts: 1440
Joined: Tue Mar 02, 2010 11:26 pm
Location: KLVK
Callsign: Alpha-J, Rescue1
Version: GIT
OS: Mac OS X

Re: Is there interest in a Nasal introduction?

Postby Hooray » Sat Dec 04, 2010 10:12 pm

After some discussions with Algernon, I got started with this and added some very basic tutorials to the wiki.
Would people interested in this please check out the wiki and provide some feedback:

http://wiki.flightgear.org/index.php/Ho ... sal_module
http://wiki.flightgear.org/index.php/Ho ... m_in_Nasal

This shouldn't require a lot of Nasal/FG knowledge to get started.
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: 11496
Joined: Tue Mar 25, 2008 8:40 am

Re: Is there interest in a Nasal introduction?

Postby Hooray » Fri Feb 03, 2012 9:39 pm

This is just intended to be an update:

About 1 year ago we last talked about the most suitable format for a Nasal introduction. In the meantime, some users have added a bunch of Nasal "howto" tutorials to the wiki, myself included:



I've been getting some occasional feedback by PM since then, and according to the wiki stats, these tutorials did get to see some visitors, about 700-1200 within 12 months actually.

Overall, my impression has been, that it's important for tutorials to be simple to create. That's why I tried to keep them as simple and as short as possible. While there are a number of tutorials that are more complex and not yet finished (or even started), I feel that's the most promising format in the long run.

This is because it doesn't take the writer a lot of time to write such a tutorial (usually it took me about 10-30 minutes actually, often much less because I simply copied/pasted stuff) and it doesn't take very much time for readers to walk through everything. And the most important thing actually is that there are no obligations involved whatsoever, nobody is committing to work through tutorials or to create tutorials regularly.

Given the number of tutorials, this turns out to be about 1 tutorial per month on average - which seems okay to me. All questions that are answered by creating new tutorials won't need to be answered again here (on the forum).

So, if anybody else is interested in creating Nasal tutorials, I'd also suggest to keep things as simple as possible. One year ago, we started collecting ideas, many of which are still available today: http://wiki.flightgear.org/Nasal_introduction
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: 11496
Joined: Tue Mar 25, 2008 8:40 am

Re: Is there interest in a Nasal introduction?

Postby sgofferj » Fri Feb 03, 2012 9:53 pm

If I may comment... The current portal system in the Wiki sucks big time. There's the main page, then the developer portal and then again some sub-stuff. Way too complicated and nested.
I would put a box with quicklinks to the most important topics to the left. And a quicklink to the Nasal Category Page IMHO would be in the top 5 of the most important things to quicklink!
FG 3.1 GIT / Opensuse 12.3 / Phenom II X4 / GForce GTX560
Stefan's little Flightgear corner | The Finnish Weather Center | Wolves in Finland

Working on: EFTP
COM: IAX2:home.gofferje.net/stefan (MO-FR 0700-2000 UTC, SA+SU 0900-2000 UTC)
sgofferj
 
Posts: 790
Joined: Mon Dec 05, 2011 4:13 pm
Location: EFTP
Callsign: OH-SW
Version: 3.1 GIT
OS: Opensuse

PreviousNext

Return to Nasal

Who is online

Users browsing this forum: No registered users and 1 guest