Florian Schie�l wrote:
I make my master thesis about the development of a virtual sports game.
The user will be hanging in some sports machine. He can move his arms
and feet and fly like a bird. Sensors pick up the movement. He can fly
through a virtual reality that is represented on a computer display.
lol...when dreams come true - sounds like fun :-)
I develop the simulation software. I want to use Flight Gear as a basic
structure. I have some questions regarding your oppinions what the best
place or method for implementeing some features is.
I will pulbish everything under the GPL. And It will still be obvious
for the user that FlightGear is the basic software. I dont want do
change stuff in the source code of FlightGear, so that it is a real
addon.
There is currently no such thing as a "plugin (sub)system", so I'm
afraid you will very will have to change a couple of things within
FG sources - either by doing it yourself or finding someone who
can help you to do that.
Your best bet would probably be to described very detailed what
you want to do so that you get pointers from the right people
into what sources you should look and what should be implemented
where/how.
But of course, for some features written code could be useful for
Flightgear. The property system seems to be very powerfull, but I havent
still found out all details. Maybe u can help me.
1. GUI question.
I want to have a startup that is in the middle of the screen where the
user can choose the scenarios he wants to do. I dont need the menu bar.
You can disable the menubar by checking the property path /sim/menubar -
where you can change the visible property in order to hide it.
The user needs to input some dates like weight, height, gender.
Can I start FlightGear with some start parameters that would allow that ?
IF I understood you correctly, then you need some simple GUI to allow
the user to enter specific values ?
You could make such values either available by using a command line:
--prop:name=value
for example:
--prop:/stoned-flying-bird/user/weight-kgs=150
or
--prop:/stoned-flying-bird/user/height-cms=120
or
--prop:/stoned-flying-bird/user/gender=metro
These values will the be made available within the property tree
using the specified path/node - so you can then access these
values within the prop tree.
Accessing them can be either done using plain C++ or using the
FlightGear's integrated scripting language "Nasal" that allows
you to use getprop/setprop functions in order to deal with the
property tree.
For testing purposes you can simply take any of the above command
line parameters, start up FG using them - and then check the
property tree by using the property tree browser: you'll see
newly created paths/values within the property tree.
If you'd prefer to use a GUI instead of the above command line
parameters in order to put values into FlightGear's property tree
you could on the one hand write a simple XML dialog with a couple
of edit fields and an "okay" button - or alternatively you could
also use Nasal (not really an advantage in most cases right now).
In order to check out how XML dialogs are implemented, check out
$FG_ROOT/data/gui/dialogs
where you'll find many XML dialogs - also there's documentation about
that under $FG_ROOT/data/Docs available.
2. Panels
I would need some panels that show stuff like burned calories or flown
meters. I also need to keep some kind of Highscore board. This should be
easy with the XMLs ?
Yes, you would create custom panels and instruments that are "driven" by
custom values from the property tree - so essentialy it might already be
sufficient to simply use two differently colored texture files (*.rgb
in SGI format) and transform them accordingly.
The actual calculations (kcal/hr etc.) could be done using a Nasal
script that you put into $FG_ROOT/data/Nasal - every Nasal file
that you put there is made available as a separate module.
So, you could have a simple function such as:
cal_consumption = func {
weight = getprop("/stoned-flying-bird/user/weight-kgs");
height = getprop("/stoned-flying-bird/user/height-cms");
age = getprop("/stoned-flying-bird/user/age");
gender = getprop("/stoned-flying-bird/gender");
BMI = weight / (height*height);
if (gender =="male") {
# do calculations for men
}
else if (gender == "female") {
# do calculations specific to women
}
}
So, that way you could incorporate all information that is
required - in case that you should need to use external
variables, make sure to also check out the httpd/telnet
interface (again: 'fgfs --help --verbose') in order to
see how to start FlightGear in a manner so that it exports
its property tree via either a web server or a telnet server.
(Or even both)
3. I need a new flight model, that is similar to a birds flight model.
Is there something like it or can i bend one of the existing to be
satisfying.
don't know about that - on the other hand what I do know: there are
many DIFFERENT kinds of birds, and eagle's style of flying differs
from a pigeon's one ... etc.
So I would first agree on what exact bird you want to "model" - and
then I would probably not try to mathematically model a bird but
rather split up the potential maneuver of YOUR bird so that you can
feed in the maneuver directly ...
4. I need an abstract flight scenario, where there is no real landscape
but maybe a red floor, a green canyon and blue walls.(the colors were
just for the example) Can i use terragear for that ?
I think terragear is specific to creating terrain (don't know exactly,
though)
What you describe, though should be relatively straight forward to
do using merely FlightGear's underlying simulation engine: SimGear
(http://www.SimGear.org)
5. I need a network modus where two players can fly against each other.
wow, it's getting tricky !
Is the network modul already able to do this or do I need to rewrite or
enhance it.
There is a multiplayer subsystem I think, you'd probably want to create
new aircraft that look like the kind of bird that you want to resemble
I would submit these changes of course to the offical source
code if requested.
YES, it would propably be very interesting to meet a confused pigeon
at FL350 :-)
6. I need to be able to add objects dynamically to the virtual reality.
For example, i plan to have a scenario where the user hast to fly
through gates in the right order within a specific time. Is it possible
allready just with the properties system or do i need to write code.
I'm afraid you'll have to use plain C++ - alternatively you could
probably use (static) SCENERY as a compromise.
As far as I know, the Property System itself doesn't (yet) allow you
to create dynamic scenery.
7. Is there a collition detection in the code ? I want the user to be
able to collect for example coins that hang in the mid air. :)
it's really getting fun :-)
collision detection can probably be found in SimGear, so it's most
likely also available in FlightGear - but again: certainly not easily
available via any kind of abstract scripting (XML) interface.
8. Is there a "shoot on each other code" in FlightGear. I would like to
have a mutliplayer modus where two players can hunt each other down by
shooting. (always remember that they have to do real sport to manuveur
in the game) :)
There's the possibility to use so called "submodels", so you could use
a ballistic submodel to shoot (or sh*t) at eachother ;-)
9. Can I add a new vrml model that represents a human hanging in some
kind of glider.
You would probably simply use A3C to design an "aircraft" that looks
like someone hanging in a glider - FlightGear doesn't really care what
kind of model it is that you want to display - so, if you want to you
could also texture an image of Heid Klum on top of your glider pilot ;-)
----------
Boris
_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d