Aircraft queueing & planespeed
Moderator: OpenTTD Developers
Diffutils worked nicely, thanks
.
Problem with WinMerge is it only does one file at a time
.
WARNING: Current release contains code which allocates and deallocates memory. Although I think it releases everything it allocates, I cannot be sure!
I would like any feedback as to whether I released the Queue correctly.
Here it is, the queue patch, Win32 executable, and language files:
*Attachments deleted - from now on, attachments will be in first post*

Problem with WinMerge is it only does one file at a time

WARNING: Current release contains code which allocates and deallocates memory. Although I think it releases everything it allocates, I cannot be sure!
I would like any feedback as to whether I released the Queue correctly.
Here it is, the queue patch, Win32 executable, and language files:
*Attachments deleted - from now on, attachments will be in first post*
Last edited by CobraA1 on 04 Jun 2005 00:57, edited 2 times in total.
"If a man does not keep pace with his companions, perhaps it is because he hears a different drummer. Let him step to the music he hears, however measured or far away" --Henry David Thoreau
OK having taken your exe and copied it to my backup/testing OpenTTD folder I have noticed a few bugs.
Basically what I did was set the game year to about 2000 and then built 2 airports, I then built one of every type of aircraft and set them flying between.
Now for the Bugs I have noticed.
1. You cannot delete airports to upgrade, if you do it crashes the game (no crash.sav produced, just a windows abnormal termination report).
2. The aircraft do this rather strange thing, they fly up to an airport to about the point where they would decend to land, if a) the runway is not clear or b) they are not number one in the que the aircraft stop in midair, turn 45 degress then fly off, slowly speeding back up to full speed (over 2/3 tiles), this happens every time untill they are number 1 in the que when they land normally.
3. Large maps take forever to generate, I know they take a long time normally anyway, but I went for a shower while waiting for one to generate and came back to find that it still had not generated 20 mins later (map size 11*11 or 2048*2048)
At the moment that is all the bugs I have found for you, when I get a chance I will play seriously around and pick out more.........
Saying that, exelent work, great patch and keep it up, I look forward to future revisions.

Basically what I did was set the game year to about 2000 and then built 2 airports, I then built one of every type of aircraft and set them flying between.
Now for the Bugs I have noticed.
1. You cannot delete airports to upgrade, if you do it crashes the game (no crash.sav produced, just a windows abnormal termination report).
2. The aircraft do this rather strange thing, they fly up to an airport to about the point where they would decend to land, if a) the runway is not clear or b) they are not number one in the que the aircraft stop in midair, turn 45 degress then fly off, slowly speeding back up to full speed (over 2/3 tiles), this happens every time untill they are number 1 in the que when they land normally.
3. Large maps take forever to generate, I know they take a long time normally anyway, but I went for a shower while waiting for one to generate and came back to find that it still had not generated 20 mins later (map size 11*11 or 2048*2048)
At the moment that is all the bugs I have found for you, when I get a chance I will play seriously around and pick out more.........
Saying that, exelent work, great patch and keep it up, I look forward to future revisions.







Winmerge also does directory diffs (this means, all files in a directory and subdirs). Just specify a directory as a loading pane instead of a file.
Use 'Tools' -> 'Generate Patch' to make the diff (make sure to define 'unified' there).
Btw, I am downloading your build right now
EDIT: hehehe, they can brake in midair
I wish I'ld have a plane that could to that, heh
Also, helicopters won't use both heliports on the international airport for taking off when exiting a depot (only using one). For landing, they use both, although they also seem get queued behind airplanes, apparently... (not sure of that tho)
Use 'Tools' -> 'Generate Patch' to make the diff (make sure to define 'unified' there).
Btw, I am downloading your build right now

EDIT: hehehe, they can brake in midair

Also, helicopters won't use both heliports on the international airport for taking off when exiting a depot (only using one). For landing, they use both, although they also seem get queued behind airplanes, apparently... (not sure of that tho)
Last edited by LKRaider on 02 Jun 2005 16:06, edited 6 times in total.
-
- TTDPatch Developer
- Posts: 417
- Joined: 13 Apr 2004 13:35
- Location: Eindhoven, Netherlands
- Contact:
I guess that is caused by it being a debug build, and thus having all optimizations turned ofInvisble wrote:3. Large maps take forever to generate, I know they take a long time normally anyway, but I went for a shower while waiting for one to generate and came back to find that it still had not generated 20 mins later (map size 11*11 or 2048*2048)
Whatever's lying around in SourceForge. I'm not working in SVN right now . . .Hmm, maybe I'm too blind, but I cant see, which SVN-revision this patch was made for
OK, I'll look at it - the complete text of the error would be nice, though.1. You cannot delete airports to upgrade, if you do it crashes the game (no crash.sav produced, just a windows abnormal termination report).
I'll take a look at the aircraft stopping problem. The other stuff is expected, though. I haven't implemented the other features yet.2. The aircraft do this rather strange thing, they fly up to an airport to about the point where they would decend to land, if a) the runway is not clear or b) they are not number one in the que the aircraft stop in midair, turn 45 degress then fly off, slowly speeding back up to full speed (over 2/3 tiles), this happens every time untill they are number 1 in the que when they land normally.
That's a result of this being a debug build. It has a lot of debug stuff that slows it down, and it's not fully optimized.3. Large maps take forever to generate, I know they take a long time normally anyway, but I went for a shower while waiting for one to generate and came back to find that it still had not generated 20 mins later (map size 11*11 or 2048*2048)
"If a man does not keep pace with his companions, perhaps it is because he hears a different drummer. Let him step to the music he hears, however measured or far away" --Henry David Thoreau
Cobra, You desired the compleate text of the error report, well your wish is my command. please find attached one txt document that Windows generates to pinpoint the cause of the crash, I have no idea how much it may mean to you.
Hope it helps.
Hope it helps.
- Attachments
-
- 5c3e_appcompat.txt
- The Error Text (in XML format by the looks of things).
- (10.36 KiB) Downloaded 492 times
OK, found the source of the error - I was a bit overzealous in freeing memory, and it tries to free the memory twice.
It will be fixed in the next release of my patch.
I've also thought about perhaps coordinating incoming aircraft speeds, but that leads to another problem - what happens when the position in front of the aircraft recently landed is full, and the aircraft cannot get out of the way for a coordinated landing? It messes up the entire flight pattern for all aircraft landing. So no coordinated landings until airports are redesigned.
I can, however, speed up the airplanes, shorten the airport circling behavior, and if possible line it up with the runway. That may make it more efficient for use with the queue.
One of the major problems, unfortunately, is that airports in OpenTTD are not realistic - compare to a real airport.
In a real airports, the buildings are off to one side, and the runways are paralleled by taxiways, so the aircraft can quickly get off the runway. Also, there are multiple ways to come into the terminals, so that planes don't line up as much.
Even in the International airport in OpenTTD, the "taxiway" is very short, and right away any aircraft coming from the hangar can block landing planes! Very inefficient design, if you ask me.
I'm not about to re-design the airports right now, but I do feel they could be done better. Yeah, they take up a lot of space - but then again, so do real airports
!
Another thing that would help, BTW, is larger capacity aircraft - real 747s can hold 500+ people! Setting capacities to be realistic would also make aircraft a more viable choice for OpenTTD. In large cities, it is not unusual for me to see numbers in the thousands . . .
It will be fixed in the next release of my patch.
I've also thought about perhaps coordinating incoming aircraft speeds, but that leads to another problem - what happens when the position in front of the aircraft recently landed is full, and the aircraft cannot get out of the way for a coordinated landing? It messes up the entire flight pattern for all aircraft landing. So no coordinated landings until airports are redesigned.
I can, however, speed up the airplanes, shorten the airport circling behavior, and if possible line it up with the runway. That may make it more efficient for use with the queue.
One of the major problems, unfortunately, is that airports in OpenTTD are not realistic - compare to a real airport.
In a real airports, the buildings are off to one side, and the runways are paralleled by taxiways, so the aircraft can quickly get off the runway. Also, there are multiple ways to come into the terminals, so that planes don't line up as much.
Even in the International airport in OpenTTD, the "taxiway" is very short, and right away any aircraft coming from the hangar can block landing planes! Very inefficient design, if you ask me.
I'm not about to re-design the airports right now, but I do feel they could be done better. Yeah, they take up a lot of space - but then again, so do real airports

Another thing that would help, BTW, is larger capacity aircraft - real 747s can hold 500+ people! Setting capacities to be realistic would also make aircraft a more viable choice for OpenTTD. In large cities, it is not unusual for me to see numbers in the thousands . . .
"If a man does not keep pace with his companions, perhaps it is because he hears a different drummer. Let him step to the music he hears, however measured or far away" --Henry David Thoreau
You are right there, airports should be completely overhauled, and ideally, be modularized (so you can build/expand them at will).
Coordinating circling speed is a good idea, since planes don't stay at full speed while waiting in the airport landing pattern.
Lining up the circling behaviour would be good too.
Coordinating circling speed is a good idea, since planes don't stay at full speed while waiting in the airport landing pattern.
Lining up the circling behaviour would be good too.
Alright, another update! This time I'm putting it in the first post so it's easy to find
.
What I've done:
-Fixed some bugs - more specifically, the airport deletion crash and the aircraft slowdown when deciding whether to land.
-Impmented Benben's aircraft speed patch, which is currently buggy - for some odd reason, aircraft slows down sometimes, then speeds up.
-Implemented the aircraft holding pattern before the runway for the International airport only. This requires making changes to the finite state machine for each airport. This also means it's a permanent part of the patch - I know of no simple way to make it optional. I will probably implement new holding patterns for all airports in the next version of the patch.
NOTE: The idea to change aircraft altitude based on queue position can't be done currently - right now, all that is known about a queue is what's on top.

What I've done:
-Fixed some bugs - more specifically, the airport deletion crash and the aircraft slowdown when deciding whether to land.
-Impmented Benben's aircraft speed patch, which is currently buggy - for some odd reason, aircraft slows down sometimes, then speeds up.
-Implemented the aircraft holding pattern before the runway for the International airport only. This requires making changes to the finite state machine for each airport. This also means it's a permanent part of the patch - I know of no simple way to make it optional. I will probably implement new holding patterns for all airports in the next version of the patch.
NOTE: The idea to change aircraft altitude based on queue position can't be done currently - right now, all that is known about a queue is what's on top.
"If a man does not keep pace with his companions, perhaps it is because he hears a different drummer. Let him step to the music he hears, however measured or far away" --Henry David Thoreau

Okay, some impressions after a quick test:
- Helicopters also get queued behind aircrafts, even if heliport pads are free to use
Edit: They don't land if there's an airplane on the landing runway. Weird...

- Speed patch displays weird behaviour (maybe because it is a debug build?)
- Queue speed should be same for all aircraft (so they circle at same speed)
- Queue circling pattern should be retangular, not have that weird little curve to align with landing strip (you know?)
- I like the new position for the circling pattern !

- Aircraft should be able to enter the queue from any point, or from the four corners of the circling pattern, wichever is closer - (now it seems to be fixed on the upper position closer to the takeoff runway)
- Aircraft should have realistic acceleration (takeoff speed to cruise speed should take much longer and landing speed should be lower)

It is looking pretty good so far

(Done)- Helicopters also get queued behind aircrafts, even if heliport pads are free to use
Edit: They don't land if there's an airplane on the landing runway. Weird...
Heh, should've known - yeah, it doesn't distinguish helicopters/aircraft in code currently, so helicopters use the queue code also. Will be changed in next version.
(Done)- Speed patch displays weird behaviour (maybe because it is a debug build?)
Yeah, I know, I'm researching what causes it right now.
(Done)- Queue speed should be same for all aircraft (so they circle at same speed)
OK. Will be in next version.
EDIT: What speed do you want?
(Done)- Queue circling pattern should be retangular, not have that weird little curve to align with landing strip (you know?)
I'll move the points around to see if I can improve it.
(Done)- I like the new position for the circling pattern !
Thank you. I'll do all airports in the next version.
(rejected) - sorry, I see now easy way to do this currently.- Aircraft should be able to enter the queue from any point, or from the four corners of the circling pattern, wichever is closer - (now it seems to be fixed on the upper position closer to the takeoff runway)
That's because of the way the layout is designed for airports - the circling pattern is actually part of the airport layout.
I'll see what I can do about changing the conditions for entering the queue, though - perhaps when the aircraft enters a certain range?
Right now, the aircraft only enters the queue when it attempts to land.
(working on it)- Aircraft should have realistic acceleration (takeoff speed to cruise speed should take much longer and landing speed should be lower) Wink
The acceleration algorithm is quite weird, and I don't have a full grasp of how it works yet, but I'll see what I can do.
Thanks for all of the input


Last edited by CobraA1 on 04 Jun 2005 20:30, edited 2 times in total.
"If a man does not keep pace with his companions, perhaps it is because he hears a different drummer. Let him step to the music he hears, however measured or far away" --Henry David Thoreau
- lucaspiller
- Tycoon
- Posts: 1228
- Joined: 18 Apr 2004 20:27
Sounds good, but it doesn't seem to work with the recent revision. If it is for 0.4.0.1, I suggest you update it to work with the latest revisions because it is more likely to be applied then. Also then if you use svn, you can just use the 'svn diff' command (or similar in TortoiseSVN) to create the patch.
No longer active here, but you can still reach me via email: luca[at]stackednotion[dot]com
In real life, aeroplanes are not allowed to travel faster than 250 knots under 10000 feet. Applies to takeoffs and landings. Something to do with noise, I believe.(Waiting for input)- Queue speed should be same for all aircraft (so they circle at same speed)
OK. Will be in next version.
EDIT: What speed do you want?
I'm under that impression, but correct me if I'm wrong!
about plane acceleration, the diff I posted in benben's topic had a slow acceleration before he edit it, maybe looking at it could help you.
about slower plane, i hadn't tested, but using this code for broken airplane :
if(v->vehstatus&VS_AIRCRAFT_BROKEN) spd = min(spd, 27 * _patches.aircraft_speed_coeff);
could make slower plane going faster when broken, no ? (edit : not slowing)
same problem could occur in queue. good luck for adjusting it
and OT : seem that switch in latest SVN for plane altitude is not good when using newgrf and planes with a lot of different speeds...
about slower plane, i hadn't tested, but using this code for broken airplane :
if(v->vehstatus&VS_AIRCRAFT_BROKEN) spd = min(spd, 27 * _patches.aircraft_speed_coeff);
could make slower plane going faster when broken, no ? (edit : not slowing)
same problem could occur in queue. good luck for adjusting it

and OT : seem that switch in latest SVN for plane altitude is not good when using newgrf and planes with a lot of different speeds...
- Attachments
-
- plane_loan_crash.diff
- (13.38 KiB) Downloaded 386 times
Alright, alright - the next release will be diffed against the SVN.Sounds good, but it doesn't seem to work with the recent revision.
Now I have to live with possible instabilities of the development version, oh well

250 knots (about 288 mph, according to my TI-89) it is, then.In real life, aeroplanes are not allowed to travel faster than 250 knots under 10000 feet.
Agreed. I'm not going to fix it myself right now, but we should use an equation here instead of a switch.and OT : seem that switch in latest SVN for plane altitude is not good when using newgrf and planes with a lot of different speeds...
Fear not! I have fixed that problem!Especcially for bigmaps you need a realistic planespeed.
I do not Understand why this is not fixed.
EDIT: New version of patch released!
It's based off of SVN now, and contains fixes! All of the stuff labeled as (Done) in previous posts are in the new patch. Enjoy

"If a man does not keep pace with his companions, perhaps it is because he hears a different drummer. Let him step to the music he hears, however measured or far away" --Henry David Thoreau
Woo, nice work
New considerations:
- Maybe helicopters should wait in a standing queue? Don't know if it would be too hard to implement (probably is). They still seem to get queued behind planes tho...
(they only land if the landing strip is free)
- The new fixed circling speed is very nice. There is only one problem tho... very slow planes accelerate to the minimum speed, even if that exceeds their max. Maybe make slow planes go at their max speed (75% would be ideal tho), instead of exceeding their parameters?
- Very good circling pattern, I like it
- Hmmm, if there could be some check of plane distance in the queue, so that planes graphics don't stay one over the other...
- The problem with plane entrance point on the queue is that sometimes the plane goes to the entry spot and then makes a 180 degree turn to enter the queue traffic pattern. One way to avoid this would be to have multiple entry points (the four corners of the rectangular queue pattern would be enough), or restrict plane curves, so they are not able to turn so much on one tile.
I made an animation of an example of what happens because of the entry point:

New considerations:
- Maybe helicopters should wait in a standing queue? Don't know if it would be too hard to implement (probably is). They still seem to get queued behind planes tho...

- The new fixed circling speed is very nice. There is only one problem tho... very slow planes accelerate to the minimum speed, even if that exceeds their max. Maybe make slow planes go at their max speed (75% would be ideal tho), instead of exceeding their parameters?
- Very good circling pattern, I like it

- Hmmm, if there could be some check of plane distance in the queue, so that planes graphics don't stay one over the other...

- The problem with plane entrance point on the queue is that sometimes the plane goes to the entry spot and then makes a 180 degree turn to enter the queue traffic pattern. One way to avoid this would be to have multiple entry points (the four corners of the rectangular queue pattern would be enough), or restrict plane curves, so they are not able to turn so much on one tile.
I made an animation of an example of what happens because of the entry point:
- Attachments
-
- Plane makes an unrealistic (and ugly) 180 degree turn.
- 180-degree-turn.gif (93.23 KiB) Viewed 9519 times
Who is online
Users browsing this forum: No registered users and 2 guests