User mods, screenshots & videos > Aircraft

Flock of birds

(1/6) > >>

andfly:


Here's a little game ...   :))

A flock of birds flying in a completely autonomous manner in Anteworld sky.
I used the eagle  because it was the only bird I had available even if, in reality, the eagles do not fly in group ... but the purpose is just for demonstration: I liked the effect I had obtained, and the sense of majesty that inspired me, and ... I thought it was nice to share it.
Create the model was not overly complicated (I already had at their disposal a single eagle model).
Most of the time I employed in an attempt to endow the birds of the little artificial intelligence to know how to act in all possible flight situations, and then not crashing to the ground and do know where to go.
And, unfortunately, I have to admit to not have succeeded as I wanted.
I'm missing something basic: I have not found a function of JsbSim or of Outerra APIs that notify me of the presence of an obstacle on the route and the relative distance.
The one feature that all flight simulators fans know and that triggers the dramatic warning "Pull Up .. Pull Up !!" or "Eject.. Eject  !!" which invites you to immediately change a risky collision course with the ground.
The only comparison that, in the end, I could make was the one with the altitude above the ground, which works well enough if you fly on a hilly terrain and in any case with "soft" changes in altitude, but it does not work equally well if you have to overcome the barrier of a vertical rock wall.

The principle of operation of the model is simple.
As soon as you create the first eagle start the creation of twenty birds alike in the immediate vicinity.
Each bird takes as a reference, for its route, the location where it was created.
The flight directives are:
- Maintain the reference altitude.
- Maintain a fairly constant attitude: correct roll and pitch if they become too prominent.
- Pull up quickly if the height of the terrain becomes too small.
- Increase the frequency of flapping of wings and "take a nosedive lightly" when you approach the stall speed.
- Set a slight turn when you move too far from their point of reference.

Every bird of the flock will perform a wide circle (about two kilometers) and will return to the coordinates of its point of reference and, if no obstacles that break down, will continue to fly indefinitely.

The result seems pretty nice though, of course, after a while it gets boring ... ::)
The purpose of this model, in fact, is to "animate the scene" creating an environment a little "more alive" while using another driveable model or to decorate a movie!

TIPS:

The birds that I used (eagles of fifteen meters, I'd already available) are large enough to be visible from a distance, but also the flight path is vast and you are likely to "lose sight" or not being able to follow all the their evolution.
For this purpose it is very useful to set the "min_obj_size = 1.0" in the file "eng.cfg".

Another curiosity is to try the power of your computer:
If you stay at the controls of an eagle and, during the simulation, you press ALT + R, will cause the reload of the model and are created twenty other eagles in addition to those already present.
My Computer (Asus Laptop, Core i7, Nvidia 940M) bears fine until sixty eagles, begins to suffer with eighty and a hundred no longer offers an acceptable result.
Whereas the original model eagle single is already full of calculations enough I was very pleasantly surprised at how optimization of Outerra engine can allow this performance ... with more powerful computers is perhaps possible to achieve even better performance!

Good fun!


To download the model:
https://drive.google.com/file/d/0B6114pZ3kPTgaFpxUnpqaXNxclE/view?usp=sharing
( This Download is now updated to version which includes the recognition of the obstacles and the change of course to avoid them)

A short movie:

HiFlyer:
Awesome, as always!

cameni:
Great job!


--- Quote from: andfly on April 17, 2016, 08:39:00 pm ---I'm missing something basic: I have not found a function of JsbSim or of Outerra APIs that notify me of the presence of an obstacle on the route and the relative distance.
The one feature that all flight simulators fans know and that triggers the dramatic warning "Pull Up .. Pull Up !!" or "Eject.. Eject  !!" which invites you to immediately change a risky collision course with the ground.

--- End quote ---

There was a new function added in the api that can be used for that purpose:


--- Code: ---    ///Test if ray cast from model intersects with terrain
    //@param pos model-space position
    //@param dir model-space ray direction
    //@param maxdist max ray distance to check (keep short if possible)
    //@param joint bone id to be relative to
    //@return intersection distance or >= maxdist if no hit
    float ray_test( const float3& pos, const float3& dir, float maxdist, uint joint = -1 ) const;

--- End code ---

Acetone:
Wow, this is awesome  :D

If I'm not wrong it's the first public release of an AI flying object (well, several flying objects in that case) :)

KW71:
This is great, Andfly! It prints an awesome sense of life!

Navigation

[0] Message Index

[#] Next page

Go to full version