Available playersTop players Chat Forum External sites: Wiki

«

tedshroyer

Trooper

Offline

Hey, I'm working on some tools to help me calculate attacks, but my random number generator isn't doesn't seem to give the same answer as either the game or the WeeWar battle simulator. In the case where a unit is capturing it's most obvious to me because my calculation says the capturing unit should always die if a Bomber attacks it, but quite often the unit is left at 1 in game play. Would it be possible to let me know how random numbers generated in the game? Right now I'm doing a uniform distribution [0,1). What should I be doing instead to get accurate results?

spadequack

Heavy Tank

Offline

See the top of http://weewar.com/specifications. Part of the algorithm makes sure that there is always a chance not to eliminate a unit, if I recall correctly.

tedshroyer

Trooper

Offline

Thanks for responding, but I've read that several times and just again now and I must either be missing it or that part of the algorithm is no longer documented in the spec. It's quite possible that I'm missing it because I've been looking at a bunch tonight.

This message was edited 1 time. Last update was at 16/08/2008 04:00:47

spadequack

Heavy Tank

Offline

I guess the specs aren't all that clear. Here you go:
bert wrote:Random numbers are calculated in discrete values between 1 and 100 ( 1,2,3,4,5..., 99,100 ). But the equasion uses a lesser than ( < ). Due to the fact that the p value is capped at 100, there is always a 1% chance to miss for each roll of each subunit. If there is one miss in 60 rolls then there are only 9 sub units destroyed.

We think about changing the operator to <= ... so fights with a p value of 100 would always result in 10 destroyed subunits.

-- from the old forums, http://www.tangler.com/forum/weewar/topic/26793/

This message was edited 1 time. Last update was at 16/08/2008 06:01:33

Po

Berserker

Offline

So confused.

tedshroyer

Trooper

Offline

Thanks spadequack!