Creating guided missiles: Difference between revisions

Jump to navigation Jump to search
http://flightgear.org/forums/viewtopic.php?p=90788#p90788
No edit summary
(http://flightgear.org/forums/viewtopic.php?p=90788#p90788)
Line 38: Line 38:


So be patient, in a year or two, we may begin to speak about the sparrow
So be patient, in a year or two, we may begin to speak about the sparrow
== Creating scripted AI missiles ==
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.
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.
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.
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...


== Related ==
== Related ==
* http://flightgear.org/forums/viewtopic.php?f=66&t=19864
* http://flightgear.org/forums/viewtopic.php?f=66&t=19864

Navigation menu