[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: PRNG for Lua 4.0?
- From: Michael Horvath <mikh2161@...>
- Date: Tue, 10 Sep 2013 09:51:24 -0400
Here is the full output:
Tue Sep 10 09:49:00 2013
Loaded Archive: 'Homeworld2.big'
UTIL -- filepath failure, path doesn't exists
'D:\Homeworld2\data\locale\english'
Loaded Archive: 'english.big'
Uing ..profiles\ for profiles folder
GAME -- Using player profile Username|SF
Changing from a 32 bit colour depth in winNT (5.1 build 2600), Service Pack 3
Using NVIDIA Corporation's 4.3.0 GeForce GTX 460/PCIe/SSE2 renderer
(Suspected driver is nvoglnt.dll 0)
Loaded Archive: 'englishSpeech.big'
Loaded Archive: 'Music.big'
Build name: The Dust Wars - AutoBuild3569 - Ordered by smmatte
Built by : mrbuild
Data path : D:\Homeworld2\data
Resetting fp control word.
CmdLine: -w 1920 -h 1080 -refresh 60 -overrideBigFile -luatrace -ssTGA
-nomovies -nosound
Starting Level: data:LevelData\Multiplayer\Deathmatch\4P_RANDOM_TESTING.LEVEL
24
build available
generic build available
build available
generic build available
Warning, screen with name SMFiltersMenu does not exist
On Tue, Sep 10, 2013 at 9:50 AM, Michael Horvath <mikh2161@gmail.com> wrote:
> The output is "24".
>
> On Tue, Sep 10, 2013 at 8:03 AM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
>> 2013/9/10 Michael Horvath <mikh2161@gmail.com>:
>>
>>> OK since this code is not working for me, does anyone have a
>>> suggestion for a different PRNG implementation I could use instead?
>>
>> We're talking about code that runs under standard Lua 4.0.1
>> but not on some non-standard Lua 4.0 that has been modified in some
>> undocumented way by some unidentified game developer.
>>
>> I.e. the problem is not the code, it's the Lua modification. For example,
>> Lua 4.0 uses a file called 'config' which contains these lines:
>>
>> # Lua uses double for numbers. To change this, uncomment one of the lines below.
>> #NUMBER= -DLUA_NUM_TYPE=double
>> #NUMBER= -DLUA_NUM_TYPE=float
>> #NUMBER= -DLUA_NUM_TYPE=long
>> # Optionally, you may also want change how numbers are converted to strings,
>> # and vice-versa. Look for LUA_NUMBER in llimits.h and in the rest of the code.
>>
>> If the developer made Lua use float instead of double, of course any code
>> that relies on properties like the product of two 16-bit integers being exactly
>> representable is not going to work.
>>
>> Run this code under your Lua and tell us the output:
>>
>> x=1; for k=1,64 do x=2*x; if x-(x-1)~=1 then n=k-1 break end end; print(n)
>>