Plane maximum range
Moderator: OpenTTD Developers
Re: Plane maximum range
How do you prevent a plane that flies to an airport that is well within it's range from looping around, waiting for a clear runway until it runs out of fuel and falls from the sky?
By not accounting for it?
I think that this would not happen on a real airport, but is more than likely on a crowded OTTD airport if aircraft queuing is not being used.
By not accounting for it?
I think that this would not happen on a real airport, but is more than likely on a crowded OTTD airport if aircraft queuing is not being used.
Re: Plane maximum range
IMHO as I suggested, the range must be computed when affecting the orders. After, the plane should just fly as it fly now, without taking care of the time it actually flies.KrevRenko wrote:How do you prevent a plane that flies to an airport that is well within it's range from looping around, waiting for a clear runway until it runs out of fuel and falls from the sky?
By not accounting for it?
I think that this would not happen on a real airport, but is more than likely on a crowded OTTD airport if aircraft queuing is not being used.
I mean departure and approach times should not be considered.
-
- Traffic Manager
- Posts: 141
- Joined: 30 Apr 2007 10:26
Re: Plane maximum range
All it really needs is an error box etc that pops up when you try and give a plane an order that is out of range!
Then you dont need to touch the movment code.
Then you dont need to touch the movment code.
Re: Plane maximum range
So I order it to an intermediate airport, then order it to the distant airport, and then remove the intermediate order.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Re: Plane maximum range
And the program have just to compute again the range, and invalidate any unreachable airportDaleStan wrote:So I order it to an intermediate airport, then order it to the distant airport, and then remove the intermediate order.

This should be really easy to do IMO.
Thus it would automatically raise the "Vehicle has invalid orders" popup, so there is no need to do anything more

Re: Plane maximum range
What if you actually delete the intermediate airport? And do this mid-flight? Will the plane find an airport within range to land at? Or, if there is none, will it quietly exceed its range to go to the destination?
-
- Traffic Manager
- Posts: 141
- Joined: 30 Apr 2007 10:26
Re: Plane maximum range
Maybe this could be a new disaster type?KrevRenko wrote:What if you actually delete the intermediate airport? And do this mid-flight? Will the plane find an airport within range to land at? Or, if there is none, will it quietly exceed its range to go to the destination?
Re: Plane maximum range
OTTD isn't a flight simulator.
The plane won't go to the nearest airport... For what ? What does a train or a truck when it head to a station that is deleted ? It just tries to reach the next valid order. It just have to do the same.
Here is a small draft about what I'm thinking about : - The aircraft initial orders are A->B->C->D->E->F->G->H
- You remove the airport "C" (you destroy it, or you remove it from orders)
- The "RemoveOrder" function and the "Airport destructor" both raise a small check to ensure the plane range is still ok.
Algo (simplified)
=> This should update correctly any order list that uses the removed airport. Planes will just continue the updated order list.
The plane won't go to the nearest airport... For what ? What does a train or a truck when it head to a station that is deleted ? It just tries to reach the next valid order. It just have to do the same.
Here is a small draft about what I'm thinking about : - The aircraft initial orders are A->B->C->D->E->F->G->H
- You remove the airport "C" (you destroy it, or you remove it from orders)
- The "RemoveOrder" function and the "Airport destructor" both raise a small check to ensure the plane range is still ok.
Algo (simplified)
Code: Select all
For each orderlist that use the removed airport
curRange = FindPlaneWithShorterRange(orderlist).MaxRange
order = orderlist.firstorder
While order != null
If order.next = null and order.previous = null
break
If order.next = null and order.previous != null and Distance(order.previous.dest, order.dest) > curRange
order = order.previous
order.next = null
Else If order.next != null and Distance(order.dest, order.next.dest) > curRange
order.next = order.next.next;
Else
order = order.next;
End If
End While
End For
-
- Traffic Manager
- Posts: 141
- Joined: 30 Apr 2007 10:26
Re: Plane maximum range
obviously, not thinking straight today, my cats kept me up all night!
Re: Plane maximum range
But you don't want to simulate bus range or train range(diesel/steam). You want to simulate airplane range.MagicBuzz wrote:OTTD isn't a flight simulator.
The plane won't go to the nearest airport... For what ? What does a train or a truck when it head to a station that is deleted ? It just tries to reach the next valid order. It just have to do the same.
No, OTTD is not a plane simulator. But it is you who wants to add a simulation aspect to it, not me.
Imagine, for example, a very large map of the Atlantic ocean with US East Coast, France and the UK. I could build a regional jet, set up artificial islands spaced within plane range, build airports and then send the jet flying through the order chain, deleting intermediate airports as is convenient. And the plane can cross the Atlantic suddenly! It may even be profitable since the regional jets cost less to maintain, are high capacity and the distance is huge and so on.
Not like I can stop you from coding this the way you want it to have. Just don't call it plane range restriction, call it order distance fasc... restriction or something like that since what you're doing is not restricting a plane's range.
EDIT: spelling corrections
Re: Plane maximum range
I don't want it.KrevRenko wrote: But it is you who wants to add a simulation aspect to it, not me.
Read my first post in this thread : I don't like the idea. I think even huge maps (4096x4096) are not big enought to need a plane range.
Thus, when you play alone, you just have to choose yourself which plane can go where. The problem should only be present when playing on multiplayer games, that doesn't allow bigger maps (or you might experience desync).
My interventions in this thread are just some suggestion about a way to handle this feature, as the GRF format doesn't have much chances to handle this information as it need an update that is unusefull for TTDP that is the GRF specs owner.
I won't code anything. I can support someone that tries to implement this feature, but I won't design a patch, as I don't want it

The only thing I might work on, when the vehicle realistic physics acceleration feature will allow it, is on a "realist accidents" patch, where you planes could fall down out of fuel, and you trains crashing when taking a curve at with a too high speed. At this time I might need this feature, but currently I didn't started anything as this patch depends on some other patches mostly for overspeed.
Re: Plane maximum range
OK, sorry about directing my whole post at you. I was really trying to argue against the idea as it is, not a person (you or anyone else.). Just trying to reason out the best way to do this (or anything I poke my nose into).
I don't like this idea because the implementation would be:
a) hackish and would be one feature (restriction) dressed up to look like something else, or
b) prone to having planes falling down on city centers around airports, if implemented properly (which would be quite complex).
This is a post regarding the topic. Nothing personal, MagicBuzz.
I don't like this idea because the implementation would be:
a) hackish and would be one feature (restriction) dressed up to look like something else, or
b) prone to having planes falling down on city centers around airports, if implemented properly (which would be quite complex).
This is a post regarding the topic. Nothing personal, MagicBuzz.

- athanasios
- Tycoon
- Posts: 3138
- Joined: 23 Jun 2005 00:09
- Contact:
Re: Plane maximum range
Falling on city centers? That would be very complicated and require many many new graphics: Destroyed buidings sprites...
They could falll in the sea though.
They could falll in the sea though.
http://members.fortunecity.com/gamesart
"If no one is a fool I am also a fool." -The TTD maniac.
I prefer to be contacted through PMs. Thanks.
"If no one is a fool I am also a fool." -The TTD maniac.
I prefer to be contacted through PMs. Thanks.
Re: Plane maximum range
easy : just use the dynamit tool...athanasios wrote:Falling on city centers? That would be very complicated and require many many new graphics: Destroyed buidings sprites...
They could falll in the sea though.
Re: Plane maximum range
If I were implementing such a feature, I would re-use the UFO-landing and XCOM destroying code which makes a great job of avoiding destroying important things (eg. stations are immune, but track is not, unless it is occupied.)
OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
Who is online
Users browsing this forum: No registered users and 16 guests