### Latest Posts

Posted at: 2021-06-18, 20:12

I have a question about steep (red and yellow marker) roads. The help says that the speed down is faster and up slower. Do they cancel out? Are all grades equal speed when traffic goes equally both ways? In other words does it take as much time to go back and forth over a green road as it does a red road?

--
To Boldly Go Where No Man Has Gone Before

Posted at: 2021-06-18, 20:32

According to the code, the walking-time along a slope (positive means up, negative means down) is calculated as

``````cost = BASE_COST_PER_FIELD * f
``````

with

``````f = 1.0 + d(Slope) - d(0)
d = (Slope + SLOPE_COST_STEPS) * (Slope + SLOPE_COST_STEPS - 1) / (2 * SLOPE_COST_DIVISOR)

BASE_COST_PER_FIELD = 1800 ms
SLOPE_COST_DIVISOR = 50
SLOPE_COST_STEPS = 8
``````

This gives the following results (in milliseconds):

-5 -4 -3 -2 -1 0 +1 +2 +3 +4 +5
900 1008 1152 1332 1548 1800 2088 2412 2772 3168 3600

And the accumulated sums (ms):

0 1 2 3 4 5
3600 3636 3744 3924 4176 4500

Meaning that steeper roads are less efficient.

(The red slope indicator is used to indicate slopes of 4 and greater; green for 1 and less; yellow in-between.)

Edited: 2021-06-18, 20:35

Posted at: 2021-06-18, 20:39

If I'm not mistaken this effect also occurs in real physics : )

Wanted to save the world, then I got widetracked

Posted at: 2021-06-19, 09:49

WorldSavior wrote:

If I'm not mistaken this effect also occurs in real physics : ) Yes that is correct

Posted at: 2021-06-20, 17:43

Nordfriese wrote:

According to the code, the walking-time along a slope (positive means up, negative means down) is calculated as `cost = BASE_COST_PER_FIELD * f` with ``` f = 1.0 + d(Slope) - d(0) d = (Slope + SLOPE_COST_STEPS) * (Slope + SLOPE_COST_STEPS - 1) / (2 * SLOPE_COST_DIVISOR)

BASE_COST_PER_FIELD = 1800 ms SLOPE_COST_DIVISOR = 50 SLOPE_COST_STEPS = 8 ```

This gives the following results (in milliseconds):

-5 -4 -3 -2 -1 0 +1 +2 +3 +4 +5
900 1008 1152 1332 1548 1800 2088 2412 2772 3168 3600

And the accumulated sums (ms):

0 1 2 3 4 5
3600 3636 3744 3924 4176 4500

Meaning that steeper roads are less efficient.

(The red slope indicator is used to indicate slopes of 4 and greater; green for 1 and less; yellow in-between.)

We can extend such interesting logical things. I like them very much and it gives a good gamneplay though its very easy change but moving speed.