Topic on Talk:Move Speed

Jump to navigation Jump to search

The Path Cost section is completely wrong.

1
Talonos (talkcontribs)

It shows what the UI says if you hover over the terrain, which is nice, or at least it would be if the UI didn't lie to you.

What that shows is how the path affects a *normal human* moving across the map. Really the formula (1.6, `CostToMoveIntoCell`, line 780) is

`totalCost = ticksPerMove + terrain.pathCost + edifice cost`

Where ticks Per Move is 60 / moveSpeed, clamped to a minimum of one.

So let's say you have at least 30 but less than 60 move speed. TicksPerMove is 2. So you move 30 tiles/sec on concrete. However, soil has a path cost of 2. This means TicksPerMove is 4. You literally have *half* movement on soil than you do on concrete.

This is reasonably easy to verify. Boost a pawn to between 30 and 60 speed, use debug commands to make a map entirely concrete, move to one corner, and time how long it takes for the pawn to move to an adjacent corner. Then, make the entire map soil and do it again. You'll see that it takes twice as long.

This was a very rude surprise for me as I was working on trying to optimize pawn movement. It also means that smoothing floors inside a cave dwelling is *way* more important than I gave it credit for; it can literally double your speed if your move speed is 60+. Obstacles are also way more effective against fast pawns than slow pawns. (An item stack on the ground makes a super-fast pawn move at 1+15 = 16 ticks = 16x slower over items, whereas a normal pawn moves at 13+15 = 28 ticks, or 2.15x slower over items.

Reply to "The Path Cost section is completely wrong."