Page 1 of 1

[b18] different treatment of spell times

Posted: Sun Jan 23, 2011 3:06 pm
by marchewka
Regarding spell effects lingering on targets, there's no uniformity of just when do they get removed.

Example:
If the target is "Burning(1)", on the next turn the burning effect disappears (and there's no burn effect on the next round).
To compare - after "Time Prison(1)" there's another round with "Time Prison(0)", when the target is still imprisoned.

Re: [b18] different treatment of spell times

Posted: Sun Jan 23, 2011 6:15 pm
by yufra
marchewka wrote:Regarding spell effects lingering on targets, there's no uniformity of just when do they get removed.

Example:
If the target is "Burning(1)", on the next turn the burning effect disappears (and there's no burn effect on the next round).
To compare - after "Time Prison(1)" there's another round with "Time Prison(0)", when the target is still imprisoned.
This bug has already been reported here, and actually has to do with fractional durations. Basically the issue is that durations in descriptions are rounded down (5.2 becomes 5) but in terms of the game they are rounded up (5.2 becomes 6).

Re: [b18] different treatment of spell times

Posted: Sun Jan 23, 2011 7:39 pm
by darkgod
fixed, now setEffect will always round up the duration

Re: [b18] different treatment of spell times

Posted: Mon Jan 24, 2011 1:04 am
by Marcotte
darkgod wrote:fixed, now setEffect will always round up the duration
That's great. While I agree that for the engine itself a deterministic rounding is better, wouldn't it make more sense to use random rounding in the game itself?
I mean using:

Code: Select all

dur = math.floor(dur + rng.float(0,1))
Then a duration of 1.4 turns as 60% chance of lasting 1 turn and 40% chance of lasting 2 turns.

Re: [b18] different treatment of spell times

Posted: Mon Jan 24, 2011 3:41 pm
by yufra
Alternatively the setEffect duration could always be floored to stay always match the formatting in the talent descriptions. The %d format always rounds down, so a duration of ([[%d]]):format(1.2) will appear as "1" but actually be 2 right now. All of the effect durations could be forced to use math.ceil as well, but that seems like an invitation for discrepancies and confusion.

EDIT: fixed a typo

Re: [b18] different treatment of spell times

Posted: Mon Jan 24, 2011 3:48 pm
by darkgod
You do have a point there ..