January 2018

MonTueWedThuFriSatSun
1234567
891011121314
15161718192021
22232425262728
293031    

Calendar Calendar


    Randomness calculation

    Share
    avatar
    lockie
    TSF Member
    TSF Member

    Posts : 3825
    Join date : 2014-07-24
    Age : 50
    Location : Ukraine, Kyiv

    Randomness calculation

    Post by lockie on Thu Mar 19, 2015 4:22 pm

    SF may calculate randomness of the units appearing.
    Let's take T-34/76 dif. modifications.
    ...data\k42\loc_rus\levels\levels\common\common_units.engcfg
    In the block random()
    We may see the next random units under the common name rkka_mtank4.
    rkka_mtank4,rkka_t34_stz,rkka_t34_war,rkka_t34_183,,;
    where
    rkka_t34_stz,550,2,rkkau_t34_stz,1,rkka_crew_t34,1,,,,,,;//Stalingrad Tractor Zavod (STZ) production, 1942
    rkka_t34_war,550,0.5,rkkau_t34_war,1,rkka_crew_t34,1,,,,,,;//Autumn 1941 production
    rkka_t34_183,550,1,rkkau_t34_183,1,rkka_crew_t34,1,,,,,,;//Kharkiv Tractor Factory N.183, 1942
    2/0.5/1 are the numbers of randomness.
    The calculation is:
    2+0.5+1=3.5

    Thus:
    For rkka_t34_183 we've the next random:
    3.5=100%
    1=x%
    x=1*100/3.5=29%
    For rkka_t34_war x=0.5*100/3.5=14%
    For rkka_t34_stz x=2*100/3.5=57%

    Finaly the randomness of appearing under the unit name rkka_mtank4 will be:
    1. 57% appear rkka_t34_stz
    2. 27% appear rkka_t34_183
    3. 14% appear rkka_t34_war
    It does that in game more often will appear tank T-34/76 STZ, coz it has appearance=57%.

    Thanks to will73 for help.

      Current date/time is Tue Jan 16, 2018 8:35 pm