zlsa / atc

https://openscope.co/
342 stars 107 forks source link

Airport Elevation #613

Closed Fechulo closed 8 years ago

Fechulo commented 8 years ago

As I recently explained in #547, I'm working on an airport which has an elevation of ~2000ft, this means that when aircraft takeoff, they crash due to the terrain. This issue has also been pointed out in #558 . My idea is to add an option, where players can choose between taking airport elevation into account or disregarding it completely; Something like this: elev This should be pretty easy. Except that if the altitudes are simplified, aircraft will continue to crash in airports with terrain. We could just make realistic altitudes compulsory, but new players may find it very difficult and confusing. I personally think that we will need to add airport elevation, one way or another. But we must first find a way of solving the issues that brought by this. I am opening this issue to discuss possible solutions.

erikquinn commented 8 years ago

@fechulo I suppose I might understand the confusion new players would encounter, but it would be clear enough from the terrain coloring to indicate that the airport is elevated a bit (I would think). So personally, I wouldn't even put it as an option, just make the change. If it WERE to be an option, the only modification in my mind would be to allow selection between using "ft AGL" (above ground level, as in radar altimeter altitudes, aka QNH), and "ft MSL" (above mean sea level, as in barometric altitudes). Figures like QFE/QNE aren't necessary (at this stage). And again, I wouldn't even expose it as an option; people are smart and they'll figure out how it works, as that behavior is intuitive to anyone with any aviation experience whatsoever.

As for the solution, we should probably keep the physics all the same and make aircraft.altitude an object instead of a nuneric property, and give it properties of "msl" and "agl". Use the former for most things, and the latter just for terrain/obstruction clearance calculations. As long as the spawned departures begin at the airport elevation and the arrivals will follow a glideslope that is based on the airport elevation, I think we should pretty much be good. The dreadful part is to go through all the runways for all the airports and look up those altitudes; could be a bit of an annoyance...

eliuuk commented 8 years ago

@erikquinn Altitudes for runways are normally provided in AIPs. It's just the case to see if it is updated or not, and whether it is public or not.

Fechulo commented 8 years ago

@erikquinn That was pretty much exactly what I was thinking of. Unfortunately, I'm not a programmer and the only language I'm comfortable with is Java. Thankfully, Javascript isn't too different, so I can understand most of the code. Editing and adding code is what I struggle with, so any help is appreciated. I don't really think having the elevation for each runway is necessary; Most airports are relatively flat and there usually isn't much of a difference.

erikquinn commented 8 years ago

Well the code already is capable of reading in an altitude, in ft or m, as the third element of a "Position" such as those that define the runway endpoints (right @tedrek ?) So there's no need to add code there, but the easiest and cleanest way forward is to add heights to every single runway. It could be the elevation of the whole airport and not the runway specifically if we wanted to save some effort.

And I can assist with this sometime late this week maybe... I've just today arrived in Virginia today as I moved about 1,400 miles from Oklahoma. As I unpack everything and get the computer set up, I'd be happy to put some time in on this.

Fechulo commented 8 years ago

Congratulations for the move! 1,400 miles is pretty far away, although 2 years ago I moved 6,800 miles, so I'm not too impressed. :smile: Unless we're doing Courchevel Airport, I think the elevation of the whole airport should be realistic enough.

erikquinn commented 8 years ago

Sounds good. And wow that's a long way... I bet you didn't drive that whole thing while towing all your stuff in a 3500lb trailer though!!! :P

Fechulo commented 8 years ago

Fair enough, I may have comfortably flown on a B777.

tedrek commented 8 years ago

@erikquinn, congrats on the move. You are correct Positions can include an altitude. I also agree it should not be an option, just make the change.

My instinct is the aircraft.altitude property should remain in feet MSL. The altitude AGL will vary at different points so you will probably need to calculate it nearly every time anyway. For example you'll want to know if the aircraft is at 0 relative to the runway it is landing on, not another runway but at the same time you need to calculate if it is greater than 0 relative to the terrain it's over right now.

We will probably also want a minimum altitude property for the airport so you can't assign something lower than 3,000 for example at SAME.

@erikquinn, I took a stab at implementation last night. It's in my t-airport-elevation branch if you want to hack more, otherwise I'll probably get some progress Tuesday night. Departures work but arrivals can't seem to follow the ILS, probably due to a hard coded altitude some place.