Menu

#39 nav/march round mobility inconsistently

open
nobody
None
5
2003-07-22
2003-05-04
No

Nav or march work with floating-point mobility, and
round when the movement ends. They round towards zero.
This rounds mobility cost up when the final mobility
is positive, and down if it's negative.

Exploit: you can save up to one point of mobility per
sector travelled.

Discussion

  • Markus Armbruster

    • summary: nav/march round mobility inconsisently --> nav/march round mobility inconsistently
     
  • Markus Armbruster

    Logged In: YES
    user_id=596270

    `info Mobility' says:

    If the mobility cost for something is a fraction, for
    example 2.4,
    then there will be a percentage chance that the actual
    cost is rounded
    up or down. In our example, there would be a 60% chance
    that 2.4 is
    rounded down to 2 and a 40% chance that it is rounded up to 3.

    This makes sense, but it doesn't match the code.

    I suggest to create a function

    int <foo>_charge_mobil(double mcost)

    for each kind of <foo> that has mobility, with behavior
    matching `info Mobility', and use those functions
    exclusively to charge mobility.

     

Log in to post a comment.

MongoDB Logo MongoDB