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: