FlightGear Newsletter November 2009: Difference between revisions

Trains, Boats and Planes
mNo edit summary
(Trains, Boats and Planes)
Line 4: Line 4:


==What's new in CVS==
==What's new in CVS==
===shader support for Objects===
===Shader support for Objects===
Tim Moore added now support for shaders on objects. This means we can have stunning effects like chrome effect, fresnel shaders etc on aircrafts in a near future.
Tim Moore added now support for shaders on objects. This means we can have stunning effects like chrome effect, fresnel shaders etc on aircrafts in a near future. Tim has also integrated the 3D clouds code as an "Effect". This makes editing the cloud shaders significantly easier.
 
===Trains, Boats and Planes===
From Vivian Meazza:
 
As the song goes “but not for me”. But now they are for you in FlightGear. In a moment of madness on the IRC Channel I agreed to develop Ground Vehicles as an AI Class. It turned out that a few modifications to the AI Ship class would be a good jumping off point for the new class.  I started with trains, because I thought they would be big enough to see easily from an aircraft. A very simple train with just 1 carriage. These are relatively common on commuter routes in the UK. Jon Stockill knew just such a train, and was familiar with a suitable route in Wakefield. (Where’s Wakefield you might well ask – I had to – it’s near Leeds in Yorshire.)
 
As quick as a flash, he had written a script and extracted an accurate route for the railway. Not only that, but Jon added overhead power support pylons all along the route.  That was a bit of a challenge, because originally we had thought that the train could be fairly loosely guided between waypoints on the track, but now would have to run on the track accurately enough to go between them. So I had to add a cross-track error calculation, and after a bit of fine tuning:
 
The accurate track Jon extracts has a bit of a drawback: it isn’t the same as the one currently in the scenery. We hope that will be sorted out soon, when a few licensing issues are resolved.
 
Meanwhile, Jon added a nice bus and a bus route also near Wakefield.
It turned out that diesel and electric trains weren’t nearly as visible as we had thought. So why not a steam train? That should be easier to see, and there is a preserved railway up in the spectacular countryside of the North Yorkshire Moor which has just such a thing.
 
Next, Heiko Shultz produced a fine model of the ICE 3 train, and Jon extracted the route from Frankfurt to Essen, but with the addition that it was dual route so that we could run trains in both directions at the same time. The ICE 3 runs at high speed, but the existing train parameters has been optimised for 30 mph, so a bit more coding was needed. In particular the train does not run well at high speed in reverse, so it was necessary to have the trains reset to the start of the track at the end of their hour plus run.
 
All this is nice eye-candy, but what is the downside? There is a frame rate cost. Provided there are no more than 10 ground vehicles in the scenario this is usually small.
 
So what about boats? It seemed like a good idea at the time to extend some of the ideas we developed for trains into the MP Carrier scenario. We had some models converted from Savage models lying around, so how about some escorts for USS Vinson. In any case Alexis Bory had a dormant plan for some low-poly aircraft models for the deck park, so it was a good time to revisit the Vinson scenario. First, we added some aircraft to the deck park. Then Alexis took and completely reworked the Oliver Hazard Perry (FFG 7) into something very nice indeed. I worked up a new class: AI Escort. This enables stationing of an escort by range and relative or true bearing. The escort can have patrol range for the station, and can carry out a random patrol of the assigned station.
 
Then I found a very good model of the AIM9L Sidewinder which has been lying around in cvs for years. Too good: it includes the motor and warhead, and the unseen bolts which attach the fins. Too good to waste though, so after a bit of poly reduction, they got added as well.
 
Hey, that could be a real photo! It isn’t!
 
Next Alexis wanted a SAR helo which completes the Trains and Boats and Planes theme. So I modified the AI Escort Class (after all a helo is just a fast frigate), and between us we put together a model of the Seahawk H60B. This happily maintains a station half a mile on USS Vinson’s port side.
 
So, what else? There is also a close escort in the shape of a Ticonderoga class CG. This model isn’t particularly good, so I am working up a new one.
 
The current Battlegroup is completed by LPD17.
 
We added a cruise liner, just to make the Captain of the MP Carrier think about where he was taking his Battlegroup.
 
What is the downside to the Vinson Battlegroup? Pretty much none. So far, on my system, I have seen no adverse effect on frame rate. Your mileage may vary of course.
 
Hmm, the Mk41 Launchers are fully featured with cells and hatches. I have a simple model of a TLAM. I wonder if a modification to the AI Ground Vehicle stuff …
 
What else, where next?
 
We have a few more goodies in the pipeline. Some US railroad models. We await Jon to extract a suitable rail line for that one.
 
We have some wagons waiting in the wings.
 
 
And, if I can persuade Jon to use it, a whole container port. Which comes with its own container tractor, which uses the train code to pull trailers around the dockside. Container ports work around the clock, so there’s some floodlighting just to add a little more realism.
 
All this stuff is in cvs right now: if you want to see it make sure you have cvs-head data and source then:
 
Trains and Bus:
 
Select Leeds-Bradford (--airport=EGNM) airport, scenario railway_demo, fly 165 deg until you get to Wakefield. Look around: there is a railway line to the south of the city, and one to the east. The bus runs out to the west. Look carefully - the trains and bus are very hard to pick out.
 
Steam Train:
 
Select Topcliffe (--airport=EGXZ) airport,  --ai-scenario=steam_train_demo, fly 082 deg distance 21 nm. Look around: the railway line runs SW from the village of Pickering. You should easily see the steam from the engine.
 
ICE3:
 
Select Frankfurt (--airport=EDDF) airport,  --ai-scenario=ICE3_demo, hang about a bit, The ICE3 runs close to the main terminal, and is relatively easy to spot.
 
Vinson Battlegroup:
 
Just use --ai-scenario=vinson_demo, the various ships are all around. If you use MPCarrier, then the Battlegroup is visible on the radar.
 
And finally finally,
 
Thanks are due to Jon Stockill, Heiko Shultz and Alexis Bory for their contribution, and for their testing of the code.
 
Enjoy
 
Vivian Meazza


==In the hangar==
==In the hangar==