Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2003:
[Freeciv-Dev] Re: (PR#3990) moves_left becomes non-sane after unit upgra
Home

[Freeciv-Dev] Re: (PR#3990) moves_left becomes non-sane after unit upgra

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: ChrisK@xxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#3990) moves_left becomes non-sane after unit upgrade
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 15 Jul 2003 13:01:25 -0700
Reply-to: rt@xxxxxxxxxxxxxx

ChrisK@xxxxxxxx wrote:
> On Tue, Jul 15, 2003 at 11:04:37AM -0700, Jason Short wrote:
> 
>>[ChrisK@xxxxxxxx - Sun Apr 13 16:16:12 2003]:
>>
>>
>>>A settler with 1 MP, which is updated to engineer, and has still 1 MP
>>>after the update, is not always able to move on a mountain top, because
>>>it has only half move points respecting to an engineer.
>>>
>>>A general soulution to this problem might be, to give the updated unit
>>>the same *percent* of move points as the obsolete unit has had.
>>
>>How about this?
>>
>>We scale the moves_left and the HP from the old unit to the new unit (so
>>the % remains the same).  We round down, but are careful not to let the
>>HP drop to 0.
>>
>>So for instance a unit may upgrade
>>
>>  HP 19/20  => 28/30
>>  MP 3/4    => 4/6
>>
>>  HP 1/30   => 1/20 (don't die)
>>  MP 1/2    => 0/1  (rounds down)
> 
> 
> I read this, a unit with 1 of 2 possible MP has 0 MP after the 'upgrade'.
> This is not good. Move points use to count 1/3 (0.333333~) wise. Can we
> compute with 0.33~ MP? A (better) example would be:
> 
>     MP 2/3 of 1 => 4/3 of 2        (read / as divide operator)
>     (Settler)   => (Engineer)

I forgot that each unit of MP is what the user sees as 1/3 movement 
point.  So the above examples are not good.

Your example is correct; a settler with 2 MP (out of 3 possible) 
upgrades to an engineer with 4 (out of 6 possible).

But note that the rounding-down can hurt you in some situations (though 
probably not in the default ruleset).  For instance if your "upgrade" to 
a unittype with fewer MP you can end up without MP entirely.  This is 
what my last example demonstrates (0/1 means 0 out of a possible 1 MP).

jason




[Prev in Thread] Current Thread [Next in Thread]