Aircraft queueing & planespeed

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

CobraA1
Route Supervisor
Route Supervisor
Posts: 480
Joined: 07 Nov 2003 17:52
Location: USA

Post by CobraA1 »

Hooray! Finally! An updated version of my 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
wimg
Engineer
Engineer
Posts: 3
Joined: 28 Sep 2006 20:34

Virus in patch ?

Post by wimg »

Right after installing the patch, my antivirus scanner started giving notifications that my system was infected with W32/Stanit

Is the patch infected ?
CobraA1
Route Supervisor
Route Supervisor
Posts: 480
Joined: 07 Nov 2003 17:52
Location: USA

Post by CobraA1 »

Nope, scanned my files here, and my patch and OpenTTD files came out clean. Either it's a false positive, or it was already on your system and spread to OpenTTD.
"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
User avatar
skidd13
OpenTTD Developer
OpenTTD Developer
Posts: 522
Joined: 03 Mar 2005 10:49
Location: Germany

Post by skidd13 »

The patch is really awesome, but ATM out of sync with trunc. =( I just want to ask if you could update it.

Another feature could maybe added to the patch. The different holding entry procedures. They might remove the annoying 180deg turn in air. =)
What does that mean - the circumstances? I determine what circumstances prevail. -- Napoleon Bonaparte
---
If we cannot end now our differences, at least we can help make the world safe for diversity. -- John F. Kennedy
---
Our problems are man-made, therefore they may be solved by man. No problem of human destiny is beyond human beings. -- John F. Kennedy
CobraA1
Route Supervisor
Route Supervisor
Posts: 480
Joined: 07 Nov 2003 17:52
Location: USA

Post by CobraA1 »

Hmm, I updated and resolved conflicts, but it currently throws linker errors - common stuff like argc and argv? Odd.

The entry procedures look nice, but may be a bit of a pain to implement. Unfortunately, I no longer have the time or desire to implement new features in my patch, so somebody else will have to do it.
"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
CobraA1
Route Supervisor
Route Supervisor
Posts: 480
Joined: 07 Nov 2003 17:52
Location: USA

Post by CobraA1 »

The patch is now updated :).
"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
User avatar
Mambaru
Engineer
Engineer
Posts: 42
Joined: 29 Apr 2006 18:34
Location: Middlesex U.K

Post by Mambaru »

Would not patch for my against the current trunk 7312. I get a lot of errors. Yeah I know it's not exactly helpfull. But it's late over here and I'm tired. :)

I'll provide more info once I've had some sleep.
CobraA1
Route Supervisor
Route Supervisor
Posts: 480
Joined: 07 Nov 2003 17:52
Location: USA

Post by CobraA1 »

Yikes, the trunk changed pretty quickly :shock:. Updated again.
"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
Yuffie
Engineer
Engineer
Posts: 10
Joined: 30 Nov 2004 10:31

Post by Yuffie »

I've tried to patch r7483 against this but it failed? Is there an updated version? Someone is working on it or I should give it a try at fixing?
Yuffie
Engineer
Engineer
Posts: 10
Joined: 30 Nov 2004 10:31

Post by Yuffie »

Ok, I gave it a try, but too much stuff has changed (in particular in order_cmd.c). I know basically nothing of the inner workings, so there's now way I'll be able to fix this.
At the same time, the patch I have is against a very old release, where should I dowload the latest one?
TIA
User avatar
bulb
Engineer
Engineer
Posts: 68
Joined: 21 Jan 2007 13:15
Location: Europe/Prague

Comments for patch as of 2007-01-18.

Post by bulb »

Hi Folks,

I tried the patch as currently available in the first post and I have a few comments to it:
  • There is a bug in the patch: In station_cmd.c in DestroyStation it frees the queues twice. Causes a crash at runtime when an airport is destroyed (eg. when AI goes bankrupt).
  • I didn't try the fast aircraft yet, but the slow ones act unrealistically in that they land at their full speed, while take off at absurdly low speed.
  • The economy adjustment for days in transport falls short of it's goal. More on this below.
Airplane speed

I think the initial acceleration is too low. The aircraft should speed up to ~1/4 of the speed on the runway and not just slightly less than 1/10 as it is now (Lockheed Constellation taking off at ~50km/h when it has max speed 485 or so).

On the other hand the properller aircraft land at their cruise speed, which is just plain weird. The aircraft should land at less (or the same, that would be easier) speed they took off.

I would suggest tuning the speeds and accelerations so, that properller aircraft take of and land at 1/3 their cruise speed, jets at 1/4 and supersonics at 1/8. Or just all at 1/4 if it's too hard to switch, but the reduced acceleration of supersonics would be useful as it'd make them less useful for short distances.

Aircraft economy

Current code multiplies the days in transport with the plane speed multiplier. However, that has relatively small effect on profit, since that value affects payment only a little (say at most twice).

What really makes faster aircraft make a lot more money is that they can make many more trips a year. To compensate for that, they should simply cost more to operate. Therefore I suggest multiplying the aircraft running cost by the aircraft speed-up factor and dropping the adjustment for days in transport.

The increased payment due to less days in transit can make up for the fact that the twice faster aircraft makes less than twice as many rounds, since the loading and taxiing times did not increase. If operating aircraft proves too hard than, a running cost increase factor could be added that would be something like speedup^0.75 or speedup^0.5 (with whatever exponent it will feel play-balanced). It would be precalculated -- after all it's just 8 discreete speed-up values.
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5602
Joined: 13 Sep 2004 13:21
Location: The Moon

Re: Comments for patch as of 2007-01-18.

Post by PikkaBird »

bulb wrote:I would suggest tuning the speeds and accelerations so, that properller aircraft take of and land at 1/3 their cruise speed, jets at 1/4 and supersonics at 1/8. Or just all at 1/4 if it's too hard to switch, but the reduced acceleration of supersonics would be useful as it'd make them less useful for short distances.
Acceleration/deceleration and landing speeds can be grf controlled, via aircraft action 0 property 0D and callback 36 respectively. To keep grf files compatible between the two games, I suggest the acceleration model is made similar to that in TTDP.
Therefore I suggest multiplying the aircraft running cost by the aircraft speed-up factor and dropping the adjustment for days in transport.
Both the planeset and av8 already adjust the aircraft running costs to compensate for planespeed by checking Action D patch variable 0x10, so it's not necessary (and would be much less flexible) to hard-code such adjustments into the game.
User avatar
bulb
Engineer
Engineer
Posts: 68
Joined: 21 Jan 2007 13:15
Location: Europe/Prague

Re: Comments for patch as of 2007-01-18.

Post by bulb »

PikkaBird wrote:Acceleration/deceleration and landing speeds can be grf controlled, via aircraft action 0 property 0D and callback 36 respectively. To keep grf files compatible between the two games, I suggest the acceleration model is made similar to that in TTDP.
Thanks. Good to know.

Unfortunately I don't have TTDP around, so I can't check how it works there, but the way it works in the patch attached to first post in this thread does not seem right. Basically the acceleration is always the same in game speed. That means at plane-speed 8 the aircraft accelerates only 2/3 speed after flying some 250 squares.

Note, that I am using planeset 1.5.3
PikkaBird wrote:Both the planeset and av8 already adjust the aircraft running costs to compensate for planespeed by checking Action D patch variable 0x10, so it's not necessary (and would be much less flexible) to hard-code such adjustments into the game.
Hm, than the patch again mishandles it. Because when I multiplied the running cost manually, it came out correct (ie. the value at planespeed 1 multiplied by the planespeed).

Unfortunately I don't know openttd codebase well. I will try to look at how to properly export the planespeed value for the newgrfs to use.
User avatar
bulb
Engineer
Engineer
Posts: 68
Joined: 21 Jan 2007 13:15
Location: Europe/Prague

Re: Comments for patch as of 2007-01-18.

Post by bulb »

PikkaBird wrote:Acceleration/deceleration and landing speeds can be grf controlled, via aircraft action 0 property 0D and callback 36 respectively. To keep grf files compatible between the two games, I suggest the acceleration model is made similar to that in TTDP.
Aside to the fact, that callback 0x36 is not handled in OpenTTD at all, the documentation (at the link you gave) says that only property 0C, ie. speed, can be adjusted. Is there more up-to-date documentation anywhere?

Anyway, I will assume it is used for both 0C and 0D. I will have to figure out how exactly it should work though.
PikkaBird wrote:Both the planeset and av8 already adjust the aircraft running costs to compensate for planespeed by checking Action D patch variable 0x10, so it's not necessary (and would be much less flexible) to hard-code such adjustments into the game.
OpenTTD does not support reading patch variables (yet). The current planespeed patch does not include that functionality. But I found where it should be implemented, so I can try to do it.

Could you please tell me what value should be used to represent realistic plane speed (I would assume 8, but want to check with someone who knows TTDP).
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

"Realistic" is ambiguous. Some people seem to think that it's 8x; others 4x.

The sprite "-1 * 9 0D 01 00 10 FE FF FF 00 00" should load the value 1 into parameter 1 if the planes travel as fast as they do in TTD, the value 2 if the planes travel twice as fast as in TTD, 3 if the planes travel three times as fast, and so on.
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
User avatar
bulb
Engineer
Engineer
Posts: 68
Joined: 21 Jan 2007 13:15
Location: Europe/Prague

Post by bulb »

DaleStan wrote:"Realistic" is ambiguous. Some people seem to think that it's 8x; others 4x.
Ok. I didn't ask clearly enough. By "Realistic" I mean that if the plane says it has max speed 300mph and a train engine says it has max speed 300mph, they both move at the same speed in the game. And I want to know this for TTDP. For OpenTTD I know it (it's 8x).
DaleStan wrote: The sprite "-1 * 9 0D 01 00 10 FE FF FF 00 00" should load the value 1 into parameter 1 if the planes travel as fast as they do in TTD, the value 2 if the planes travel twice as fast as in TTD, 3 if the planes travel three times as fast, and so on.
That I understand. However I want to do it so that the value here means the same game speed in TTDP and OTTD.

Now when I played TTD looong time ago, I recall that 90mph train was just very slightly faster than DC3, which says (if OTTD values match) 293mph. That'd be 73.25mph when divided by 4 and mean that TTD really used 1/4 modifier for aircraft. So unless someone tells me better, I will return 1/2 of the OpenTTD multiplier, rounded up. The odd steps (1, 3, 5, 7) will likely be less playable though, because the aircraft will be slower but have running cost for the higher even step.

By the way, the av8 is uplayable, at least in early days (from 1920), in OTTD, probably because the running cost (difficulty setting medium) is calculated for aircraft flying twice faster, which would support my suspiction that aircraft are slowed down too much in OTTD.
peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1732
Joined: 30 Mar 2005 09:43

Post by peter1138 »

bulb wrote:
DaleStan wrote:"Realistic" is ambiguous. Some people seem to think that it's 8x; others 4x.
Ok. I didn't ask clearly enough. By "Realistic" I mean that if the plane says it has max speed 300mph and a train engine says it has max speed 300mph, they both move at the same speed in the game. And I want to know this for TTDP. For OpenTTD I know it (it's 8x).
It's 4x in both TTDPatch and OpenTTD.
He's like, some kind of OpenTTD developer.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

Can someone (anyone?) PLEASE explain to me where this whole "8x is realistic" concept came from?

Yes, I know aircraft use mph*8 as their speed unit, but if that's the reason, why aren't trains accelerated to 1.6x, and road vehicles and ships to 3.2x? After all, trains use mph*1.6 as their unit, and ships and RVs both use mph*3.2.
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
User avatar
bulb
Engineer
Engineer
Posts: 68
Joined: 21 Jan 2007 13:15
Location: Europe/Prague

Post by bulb »

DaleStan wrote:Can someone (anyone?) PLEASE explain to me where this whole "8x is realistic" concept came from?
I don't know where it came from, but I certainly got it from the current plane speed patch for OpenTTD.

I checked it with a current MiniIN without planespeed and it indeed is 4x, not 8x. Mea culpa. I should have checked it earlier.
hertogjan
Director
Director
Posts: 560
Joined: 03 Jan 2006 20:45
Location: Netherlands

Post by hertogjan »

DaleStan wrote:Can someone (anyone?) PLEASE explain to me where this whole "8x is realistic" concept came from?

Yes, I know aircraft use mph*8 as their speed unit, but if that's the reason, why aren't trains accelerated to 1.6x, and road vehicles and ships to 3.2x? After all, trains use mph*1.6 as their unit, and ships and RVs both use mph*3.2.
That's not exactly true. Trains use 1.0 km/h as speed unit, which is 1/1.6 mph (approximately, as a mile is not exactly equal to 1.6 km), and road vehicles and ships use 0.5 km/h, which is 1/3.2 mph. I do not exactly know what aircraft use; this may indeed be 8 mph (not 1/8 mph, which seems unlikely).
This factor seems to be unrelated to the multiplier. In order to find out the correct multiplier, one should do this analytically (by examining the code responsible for aircraft movement in relation to the corresponding part for other vehicle types) or experimentally (compare the aircraft speed in-game to the other vehicles). The former may be a little more difficult to perform, but it gives a rigorous solution to the problem.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 24 guests