Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2004:
[Freeciv-Dev] Re: (PR#9570) battle or win chance corrupted
Home

[Freeciv-Dev] Re: (PR#9570) battle or win chance corrupted

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: chrisk@xxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#9570) battle or win chance corrupted
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 1 Aug 2004 19:40:20 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=9570 >

Christian Knoke wrote:
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=9570 >
> 
> On Sat, Jul 31, 2004 at 02:53:23PM -0700, Per I. Mathisen wrote:
> 
>><URL: http://rt.freeciv.org/Ticket/Display.html?id=9570 >
>>
>>On Sat, 31 Jul 2004, Christian Knoke wrote:
>>
>>>Attack howitzer on grassland/river with veteran mech inf from Cambridge.
>>>
>>>The popup gives a win chance of 88%, that is what you might expect.
>>>
>>>I tried several times; the battle was always lost.
>>
>>The randomness seed is stored in the savegame, so unless you do other
>>randomness-related actions before attacking, you will (at least should)
>>always get the same result.
> 
> 
> I have verified this with the following script:
> 
> for i in 50000 100000 150000 200000 250000 300000 350000 400000 450000
> 500000 ; do sed "s/^randseed=.*$/randseed=$i/g" < test.sav > random.sav ;
> grep randseed random.sav ; civserver -f random.sav ;  done
> 
> The result is quite the same all the time. The howitzer nearly died, but
> nearly.

Changing the randseed doesn't do it; that's just the game's initial 
seed.  The up-to-date seed is saved in some esotericly-named variables. 
  If you want to change the seed just run a battle somewhere else.

However there's no reason you need to reproduce this.  It's the same as 
PR#8399.  The cause is obvious (the chance-to-win is the chance against 
the "visible" unit, not the minimum chance against all units).  Fixing 
it should be that hard but I haven't gotten around to it.

A design question; what should the "defend" chance say?  Obviously there 
the same bug here too.  But here the desired behavior isn't entirely 
obvious.  Should it show the chance of the current unit defending 
against the best attacker?  Or the chance of the best defender on the 
current tile defending against the best attacker?

jason




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