Physics patches

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

User avatar
Gedemon
Traffic Manager
Traffic Manager
Posts: 150
Joined: 29 Apr 2004 21:53

Post by Gedemon »

but record is still 581 km/h so far for maglev, and operational speed of 360 km/h is planned for 2011... so they tried and reach 581 km/h. unless something new has happened since 2003, and I'll be happy if you can point me on the new record.

edit my bad : 360 km/h in 2011 is for japanese maglev
Shangai (China) maglev is already at 430 km/h on a short track (and only 250km/h average because of accelerating and stopping time...)


ha, ok, sorry I stop the OT here :)

cause I would also like to see some maglev in game accelerating slowly with physic patch to 1000+ km/h on big map somewhere between 2020-2030...
Last edited by Gedemon on 23 Jan 2006 00:32, edited 1 time in total.
hertogjan
Director
Director
Posts: 560
Joined: 03 Jan 2006 20:45
Location: Netherlands

Post by hertogjan »

Then I have good news and bad news:
The good news is: The physics patch indeed allows to get rid of the maximum speed restrictions.
The bad news is: The force by air drag is proportional to the square of the speed, and the force delivered by traction decreases with increasing speed, so you would need an awful lot of power to get to 1000 km/h. Also, it takes a very long track without bridges (tunnels and wide curves are fine, gradients are also possible but may have a negative effect on speeds). On a 256x256 I reached 214 m/s (770 km/h, 479 mph) with a train with a power of 126000 kW (170000 hp). I needed to go around the corner because the map is too small. This is the evidence:
Attachments
This overpowered MagLev train reaches 214 m/s. The displayed speeds and forces are accurate. If you look closely, you see that the train is still accelerating.
This overpowered MagLev train reaches 214 m/s. The displayed speeds and forces are accurate. If you look closely, you see that the train is still accelerating.
speedrecord.png (62.39 KiB) Viewed 2547 times
User avatar
Gedemon
Traffic Manager
Traffic Manager
Posts: 150
Joined: 29 Apr 2004 21:53

Post by Gedemon »

realism is good news ;)
User avatar
XeryusTC
Tycoon
Tycoon
Posts: 15415
Joined: 02 May 2005 11:05
Skype: XeryusTC
Location: localhost

Post by XeryusTC »

Looks really nice, I'll give it a try :)
Don't panic - My YouTube channel - Follow me on twitter (@XeryusTC) - Play Tribes: Ascend - Tired of Dropbox? Try SpiderOak (use this link and we both get 1GB extra space)
Image
OpenTTD: manual #openttdcoop: blog | wiki | public server | NewGRF pack | DevZone
Image Image Image Image Image Image Image
hertogjan
Director
Director
Posts: 560
Joined: 03 Jan 2006 20:45
Location: Netherlands

Post by hertogjan »

Just to show that the old acceleration method (the one which is used with the "realistic acceleration" patch switched off) is highly unphysical: It seems that that method uses linear acceleration, no matter what speed is involved. By a bug in my patch, it actually accelerated a train to over 1200 m/s (yes, that is 4320 km/h). My patch only managed to get it to 260 m/s or so, which is way more realistic.

If everything goes well, I'll post a version (which will be a debug version of course) of the patch tomorrow, along with the formulas I used.
hertogjan
Director
Director
Posts: 560
Joined: 03 Jan 2006 20:45
Location: Netherlands

Post by hertogjan »

As promised: Here it is.
It is somewhat buggy at some points. Especially braking is still a bit clumsy. I still have to write a piece of code that will handle red signals and bridges (with speed limits) ahead. Now, this is done by different functions.

But there are also things that do work. I will list some of the features:
-Improved curve handling. This is dependent on mass: Lighter trains can take curves quicker.
-More traction modes available than only brake and accelerate.
-If you disable the speed limits, trains can go beyond their speed limit. If you don't, some sort of cruise control will ensure that trains keep their maximum speed.
-All coefficients can be changed easily. In the future, things as friction coefficients, maximum brake power, may become vehicle properties (instead of railtype properties).
-And most important of all: realistic (i.e. physically correct) acceleration.

I can't guarantee that it is error free. If you find one that I do not already know of, please post it in this topic.
(You don't have to tell me about round-off errors, or that the physics details display looks ugly. Those I already know. But please do inform me if the numbers seem to be incorrect.)
Attachments
patch(debug)_physics_r3411_22-01-2006.patch
Physics patch (debug version) - 22 jan 2006 - r3411
(27.92 KiB) Downloaded 443 times
qball
Engineer
Engineer
Posts: 13
Joined: 28 Jul 2004 08:42
Contact:

Post by qball »

gonna try it instantly
qball
Engineer
Engineer
Posts: 13
Joined: 28 Jul 2004 08:42
Contact:

Post by qball »

AlienKing
Engineer
Engineer
Posts: 27
Joined: 19 Jan 2006 23:49
Contact:

Post by AlienKing »

For maglevs, you may want to try to model the speed and acceleration that is used on the maglev test line in Japan. Supposedly 500km/h is the target speed for commercial use.

Edit: forgot link

http://video.google.com/videoplay?docid ... 3&q=maglev

Edit more links:
Current commerical maglev in Japan, slightly over 430km/h
http://video.google.com/videoplay?docid ... 4&q=Maglev
http://video.google.com/videoplay?docid ... 5&q=Maglev
Last edited by AlienKing on 22 Jan 2006 21:55, edited 1 time in total.
hertogjan
Director
Director
Posts: 560
Joined: 03 Jan 2006 20:45
Location: Netherlands

Post by hertogjan »

I wished to make a train with twelve coal cars, that reached 1000 km/h. It computed that it would take at least 56 maglev engines to accomplish this. I already got over 1000 km/h with 30 maglev engines (use the MagLev3 engine, it is best because it has the most power per unit) and 4 coal trucks.

I also claim that the sound barrier (340 m/s) cannot be reached. With these settings, 304 m/s is the absolute maximum for maglev trains. This can be proved mathematically.
qball
Engineer
Engineer
Posts: 13
Joined: 28 Jul 2004 08:42
Contact:

Post by qball »

I've got maglev 3 (a REALY LOT OF THEM) going a top of 1075km/h.
can't get above that.. (maybe with some hill down action)
it had 1.275.000 hp. that is: 85 loc's..
Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Post by Patchman »

Technically, the speed at which you switch from low-speed (constant force) mode to high-speed (constant power) mode should depend on the maximum tractive effort of the engine, i.e. the point where power divided by velocity is below the maximum tractive effort.
Josef Drexler

TTDPatch main | alpha/beta | nightly | manual | FAQ | tracker
No private messages please, you'll only get the answering machine there. Send email instead.
peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1790
Joined: 30 Mar 2005 09:43

Post by peter1138 »

Hmm, it doesn't behave particularly well for lower power engines. They accelerate far to fast (almost instantly) but don't reach their top speed.
He's like, some kind of OpenTTD developer.
peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1790
Joined: 30 Mar 2005 09:43

Post by peter1138 »

Here's a modification that includes loading tractive effort and air drag from newgrf. The default TE is 0.30.

http://195.112.37.102/ottd/te.diff

I've stripped out the GUI parts and kept the existing acceleration model in.
The units for air drag are not specified, so I made a rough guess on that one. I don't know if that's the correct place for the TE, or that's even how it should work... :)
He's like, some kind of OpenTTD developer.
User avatar
Brianetta
Tycoon
Tycoon
Posts: 2567
Joined: 15 Oct 2003 22:00
Location: Jarrow, UK
Contact:

Post by Brianetta »

peter1138 (in his patch) wrote:Give an extra kick if the force is not sufficient
That made me smile. (:
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
User avatar
AlienDNA
Engineer
Engineer
Posts: 97
Joined: 12 Apr 2004 08:53
Location: Leiden, Netherlands

Post by AlienDNA »

This is a very interesting development. It gave me two ideas:

Maybe we can ditch the maximum train speed, and reconfigure train power and weight so that top speed is always dependent on train power and weight. Sure, 4 maglevs with 3 coal-cars will be fast, but not profitable. That way trains will behave a lot more realistic, and will make planning the trains a lot more interesting.

Second, you could also keep the maximum speed, and allow to overpower the trains. It will turn max speed off, but double maintenance. Surely train operators will keep a train running in safe ranges, to ensure maximum durability and efficiënt use of their train. If you make it run even faster, it has a slightly higher risk of breaking down, and greater wear and tear on the parts. However, such things might balance when dealing with for instance a lot of slopes in the track, or a track which requires a lot of accelerating and deccelerating. Kind of "traintuning" :)

Both should be open to a hefty discussion first :)
"I'm gonna rip his leg off and kick him with it!", Sanjuro, Shogo-MAD
AlienKing
Engineer
Engineer
Posts: 27
Joined: 19 Jan 2006 23:49
Contact:

Post by AlienKing »

AlienDNA wrote:This is a very interesting development. It gave me two ideas:

Maybe we can ditch the maximum train speed, and reconfigure train power and weight so that top speed is always dependent on train power and weight. Sure, 4 maglevs with 3 coal-cars will be fast, but not profitable. That way trains will behave a lot more realistic, and will make planning the trains a lot more interesting.

Second, you could also keep the maximum speed, and allow to overpower the trains. It will turn max speed off, but double maintenance. Surely train operators will keep a train running in safe ranges, to ensure maximum durability and efficiënt use of their train. If you make it run even faster, it has a slightly higher risk of breaking down, and greater wear and tear on the parts. However, such things might balance when dealing with for instance a lot of slopes in the track, or a track which requires a lot of accelerating and deccelerating. Kind of "traintuning" :)

Both should be open to a hefty discussion first :)
The only problem with that is actually how the engines and drive trains are designed.

A large V8 truck has a lot more horse power than your average small car, but the car probably has a higher top speed. Gear ratios, engine RPMs, etc have a much bigger effect on max speed than horsepower.

The same is true with most trains. Electrics and diesel-electrics max speed is governed by the motors that power the trucks. Transmition diesels are limited by engine RPM and gear ratios. I'm not too knownledgeable about how steam works, but I'm sure theres something to that affect as well. Possibly piston length and wheel size.
User avatar
gkirilov
Chief Executive
Chief Executive
Posts: 696
Joined: 03 May 2005 09:32
Location: Othala

Post by gkirilov »

That's not true. The Vmax is dependent on the power(A LOT). THere are cars with 5 gears that reach their Vmax on 4th gear. That's because they dont have the power to do that on 5th.
But you are right the Vmax AND the accelaration are functions with many parameters.
OTTDCoop NewGRF Pack|Different sets of GRFs for TTDPatch (some of them work in OTTD) - 1|- 2|GRF sets for OTTD|OTTD nightly
Image
I hooked up my accelerator to my brake lights. I hit the gas, people behind me stop, and I'm gone.
Understeer is when you hit the wall with the front of the car. Oversteer is when you hit the wall with the rear of the car. Horsepower is how fast you hit the wall. Torque is how far you take the wall with you. Spoilers and bodykits are how much of the wall you take with you. Rollcages and windownets are how much of a mess you leave on the wall.
hertogjan
Director
Director
Posts: 560
Joined: 03 Jan 2006 20:45
Location: Netherlands

Post by hertogjan »

peter1138 in te.diff wrote:// Maglev engines don't count (why?)
I forgot to tell that maglev braking is different from braking for conventional or monorail trains.
Conventional trains (engines and carriages), monorail trains (engines and carriages) and maglev carriages (not the engines!) have normal brakes, i.e. there is a constant force which is the maximum amount of force opposite to the velocity of the train (well not quite, yet...). Maglev engines brake by going in reverse ("negative traction"). Since the power of maglev engines is quite large, this is quite a big force, generally.
peter1138 wrote:Hmm, it doesn't behave particularly well for lower power engines. They accelerate far to fast (almost instantly) but don't reach their top speed.
That is physics: If the maximum speed is lower, then it takes a shorter time to get close to it, compared to a higher maximum speed (with the same acceleration). And you shouldn't overload low powered trains. You will have to be more careful with which engines you select for a certain job.
But if the acceleration happens too quick in your opinion, then lowering ACCEL_MAGIC_CONSTANT might fix your problem. Also, lowering some friction coefficients will increase the maximum speed of your trains.
As I said, the friction coefficients need some tweaking. Moreover, I think that they should be vehicle-dependent, i.e. different values for different trains.
What you told about maximum tractive effort, and getting airdrag coefficients from newgrf: I will take a look at it.
User avatar
AlienDNA
Engineer
Engineer
Posts: 97
Joined: 12 Apr 2004 08:53
Location: Leiden, Netherlands

Post by AlienDNA »

I remember trains and trucks in simutrans as having a gear ratio. Maybe this would be the variable to look for. Would make for high speed trains behaving different than high power trains. Especially when hauling large loads or moving through mountains.

And I would actually like to have situations in which the train just can't reach the top of a mountain. That way you would have to consider a tunnel or slalomming up to the top, just like in real life. Makes a nice challenge for building good networks, especially with weak trains.
This would probably need a new button, like emergency, that gives a train 4 times it's power to help it where it needs to get, instantly hitting you with the bill of the rescue-service that made that possible. To use with care. :)

This patch sounds really promising!
"I'm gonna rip his leg off and kick him with it!", Sanjuro, Shogo-MAD
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 18 guests