On Mon, Jun 30, 2008 at 09:20:17AM +0200, jeremy rosen wrote:
>    On Sun, Jun 29, 2008 at 9:16 PM, Cameron J. Morland
>    <[EMAIL PROTECTED]> wrote:
> 
>      On Sun, Jun 29, 2008 at 05:30:47PM +0200, jeremy rosen wrote:
>      >    this sounds like an interesting patch, could you submit it to
>      >    [1][2]patches.wesnoth.org ?
> 
>      Yes, I will as soon as [3]gna.org sends me an email with my account
>      verification. In the mean time, here's an improved patch.
> 
>    ok, cool...

It's in; #1079.

>      >    4)  hp_dist[hp_dist.size() - 1] = 1 - hp_dist[0]; better written
>      with
>      >    hp_dist.back()
>      >         (I couldn't figure what that line was for, btw, but I did a
>      quick
>      >    review, so i probably missed something)
> 
>      It runs in a situation where if I engage in combat and don't die, I
>      will level up. (e.g. I'm 1 XP short, and fighting a level 1
>      creature.) It means "the probability of being fully healed is the
>      probability of not dying."
> 
>    ok, I'm still reading the patch  without applying nor testing it here,
>    but...
>    this assumes that hp_dist.front is "chances of being unharmed" and
>    hp_dist.back is "chances of dying"
> 
>    is this true even in cases where the unit can't die ? in
>    (theoretical) cases where the unit can't be unharmed ?

Maybe it's important to note that I changed hp_dist_size so it always
returns the full distribution, instead of trying to save at most a few
hundred bytes of memory. So hp_dist[x] is the probability of having x
hitpoints after the battle. hp_dist[0] = p(dead), and hp_dist[maxhp] =
p(fully healed).

Consider if my XP are 24 and I need 25 to level up. If I fight a level
1 creature, then there is a probability that I die (which may be
zero). If I die, I'm dead, and we forget about levelling up. But if I
don't die, then I will level up. So I won't be injured after the
battle, I will be fully healed.

If I can't be killed, then hp_dist.front == 0 so hp_dist.back = 1; I'm
guaranteed to be fully healed after the battle. Conversely, if I can't
survive the battle (possible if e.g. a berzerker attacks one of those
undead mages that don't defend), hp_dist.front == 1 so hp_dist.back = 0.

>    ok, tell me when the patch is submitted to gna, I'll make sure its
>    commited...

Cool, I though it was a fun little hack.

>      >      On Sun, Jun 29, 2008 at 10:46:47AM -0400, Cameron J. Morland
>      wrote:
>      >      > - sometimes the experience level of the opponent is not
>      correctly set
>      >      > in opp.u_
>      >      >
>      >      > - When the defendent can't hit back, both units show as being
>      >      > unharmed. I don't understand why this is.
> 
>      I believe I have fixed both of these bugs, which were related.
>      --
>      +-----------------------------------------------------------------
>      | PGP [4]http://www.cns.bu.edu/~cjmorlan/public-key.pgp
>      | Cameron Morland             ----             [EMAIL PROTECTED]
>      |
>      | The ink of a scholar is more sacred than the blood of the martyr.
>      |     --Mohammed
>      +-----------------------------------------------------------------
>      _______________________________________________
>      Wesnoth-dev mailing list
>      [EMAIL PROTECTED]
>      [6]https://mail.gna.org/listinfo/wesnoth-dev
> 
> References
> 
>    Visible links
>    1. mailto:[EMAIL PROTECTED]
>    2. http://patches.wesnoth.org/
>    3. http://gna.org/
>    4. http://www.cns.bu.edu/%7Ecjmorlan/public-key.pgp
>    5. mailto:[email protected]
>    6. https://mail.gna.org/listinfo/wesnoth-dev

-- 
+-----------------------------------------------------------------
| PGP http://www.cns.bu.edu/~cjmorlan/public-key.pgp
| Cameron Morland             ----             [EMAIL PROTECTED]
|
| When hydrogen 'U' played oxygen tech, the game had just begun,
| when hydrogen racked up two fast points, and oxygen still had none.
| Then oxygen scored a single goal, and thus it did remain,
| at hydrogen two and oxygen one: called because of rain.
|     --Wiley
+-----------------------------------------------------------------

_______________________________________________
Wesnoth-dev mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-dev

Reply via email to