The International Simutrans Forum

 

Author Topic: 11.3: Odd tram behavior (no accel. after climb)  (Read 2242 times)

0 Members and 1 Guest are viewing this topic.

Offline zook2

  • *
  • Posts: 321
11.3: Odd tram behavior (no accel. after climb)
« on: December 29, 2013, 09:54:21 AM »
(11.3, current Pak-Brit.128Ex)
It's 1861 and I built a tram (1 Horse, 1 Small Double-Deck Tram Trailer, weight 5t, max. speed 18 km/h). The funny thing is that after a single upward sloped tile, which slows it down from 18 to 4 km/h, the tram does not accelerate until the next curve. Happens after every slope, empty or loaded.

Except at one point in the network, where the tile directly after the slope is a curve, not a straight. Then it begins to accelerate on the second straight tile after the curve. But not if there are four straight tiles after the slope.

I haven't tried it with the other available trailer yet.

Correction: it begins accelerating from 4 to 18 km/h on the fourth tile after the climb. Is that normal behavior?

Correction #2: the other trailer (3 tons) accelerates after two tiles. So it probably works as intended...
« Last Edit: December 29, 2013, 10:05:29 AM by zook2 »

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18425
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: 11.3: Odd tram behavior (no accel. after climb)
« Reply #1 on: December 29, 2013, 12:10:32 PM »
Hills are a difficult thing to simulate in Simutrans, as they do not slope gently as in real life: rather, the land is either flat or sloped at a single, very steep, angle. Newer (and as yet unreleased) versions of Standard have improved upon this somewhat by adding the ability to have a second angle (defined by the pakset) so that slopes can be either shallow or steep, but this has not yet been incorporated into Experimental.

The hill climbing physics in Experimental are therefore somewhat of a compromise. The drag coefficient created by the hill and exerted upon a vehicle is based on the number of hill tiles that the vehicle has passed in the last X tiles (the X being customisable in simuconf.tab). This means that a hill like this:
       _
   _/
_/

is treated as being steeper than a hill like this:

                        ______________
       ________/
___/

which in turn is treated as being steeper than a small undulation:

                _______________________
_______/                                               \________________

to make this work, the vehicles have to treat a few tiles after a hill as part of the hill (but with a lessening degree of drag for each tile), which is why you do not see these trams accelerating until after the hill.

I should add that 4km/h is a minimum speed hard coded in the game to prevent vehicles from getting totally stuck when they cannot cope with the load, so if your horses are pulling a tram designed for horses up an ordinary one tile hill and are reaching 4km/h, there is something off with the physics. From my latest research on early trams, I suspect that the trailers are too heavy: the double deck trailer should probably weigh no more than 2t. I shall be enhancing the trams presently, so this should hopefully be fixed by the next pakset release.

Offline asaphxiix

  • *
  • Posts: 723
Re: 11.3: Odd tram behavior (no accel. after climb)
« Reply #2 on: December 29, 2013, 11:09:17 PM »
very nice, thank you James!

I never realised the reason for vehicles stalling after the hill. Perhaps, vehicles could treat the hill in Simutrans as a longer, and proportionately to that, less steep incline than the (quite unrealistic indeed) 45 degrees in Simutrans?

That could be a very nice workaround, albeit somewhat unintuitive. However given the mechanism you described and drew above, it would make sense, wouldn't it?

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18425
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: 11.3: Odd tram behavior (no accel. after climb)
« Reply #3 on: December 29, 2013, 11:32:28 PM »
If I understand you correctly, that is already what is done: the physics applied are consistent with an incline of much less than 1:1 (which does not exist on any railway or road of which I have ever heard: the 1:5 hill near my flat (on a road and former tramway) is probably about the steepest that one will ever get).

Offline asaphxiix

  • *
  • Posts: 723
Re: 11.3: Odd tram behavior (no accel. after climb)
« Reply #4 on: December 29, 2013, 11:42:28 PM »
great :) I thought it might be but wasn't sure. What's the logic behind the gradualness? I see a two horse stage coach goes from 15 to 8 on the slope tile, then reaching the second tile after the slope at 11, the next at 14, and then 15, so that's 4 tiles I think for the slow down, and the calculated slope is average 1:4?

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18425
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: 11.3: Odd tram behavior (no accel. after climb)
« Reply #5 on: December 30, 2013, 12:39:39 AM »
I cannot remember the figures off the top of my head, but the basic principle is that each tile of hill adds a certain amount in resistance, and each tile not on hill removes a certain (lesser) amount until the base level of drag for a level way is reached. Downhill tiles have a negative drag coefficient.

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2269
Re: 11.3: Odd tram behavior (no accel. after climb)
« Reply #6 on: December 30, 2013, 01:03:16 AM »
Just a note here that standard slopes in simutrans are 22.5 degrees - shallow slopes are 11.25 degrees (for pak64 the new steep slopes are indeed 45 degrees).