I just installed rust (experimental) server with steamCMD. All works fine. Before installing Oxide, I tried running the server vanilla from the commandline. One thing I dont get is server.seed
In the documentation http://rustdev.facepunchstudios.com/dedicated-server it says you can choose a seed between -2,147,483,647 and 2,147,483,647. But negative seeds dont work as expected, they default back to 1, even when placed between "". Using zero as seed will actually create a seed of 2.474.169.734. Wierd. So I thought the real min/maxvalues are 1 and UIntMax ( https://msdn.microsoft.com/en-us/library/296az74e.aspx ) but using UIntMax (4.294.967.295) will give a seed of 2.474.169.734. Using slightly less, for example 4.294.967.000 produces 4.294.967.040 as a seed. Which seems about right.
So I also noticed that not all big numbers can be used as unique seed. For example, all numbers between 4.294.967.000 and 4.294.967.040 will produce a seed of 4.294.967.040. I think the number on the commandline is converted to float, then back to int or something. http://en.wikipedia.org/wiki/Floating_point#Accuracy_problems
Perhaps a bug report on this would be in place?
RustDedicated.exe commandline option: server.seed questions
Discussion in 'Rust Discussion' started by BasKoning, Mar 19, 2015.
-
Created a test to reproduce the bug for all possible seeds: turns out 98 percent of them are not working.
That is: out of 4.294 million seeds, only under 84 million seeds actually give a different map.
Made a bug report about it: http://support.facepunchstudios.com...-server-seed-does-not-always-work-as-expected
Code:import numpy#experimental tool to determine the amount of seeds (=different maps) RustExperimental can use #uses 'numpy' library for python #assumes a conversion loss bug: int to float32 to intx=numpy.empty([1]) def check(seed): x[0]=seed float32Value= x[0].astype(numpy.float32) convertedBackValue=int(float32Value) return convertedBackValue, float32Valuedef checkSeed(fromValue, toValue=0, resetAveragePerBlock=True, blockSize=1000000): #resetAveragePerBlock is default set to True: will reset the counters so averages are per block #when set to False: will carry counters, so the averages are totalled for the entire test area #check for valid input errorString='usage:\ncheckSeed(integerFromValue, integerToValue=0, boolResetAveragePerBlock=True, integerBlockSize=1000000)' if (not isinstance(fromValue, int)) or fromValue<1 or fromValue>4294967295: raise Exception(errorString+'\nfromValue should be integer from 1 to 4294967295') if (not isinstance(toValue, int)) or toValue<0 or toValue>4294967295: raise Exception(errorString+'\ntoValue should be integer from 1 to 4294967295, defaults to zero:ignore') if (not isinstance(resetAveragePerBlock, bool)): raise Exception(errorString+'\nresetAveragePerBlock should be a boolean, defaults to True') if (not isinstance(blockSize, int)) or blockSize<1 or blockSize>4294967295: raise Exception(errorString+'\nblockSize should be integer from 1 to 4294967295, defaults to 1000000') if toValue>0: if fromValue>toValue: raise Exception(errorString+'\nfromValue cannot be greater as toValue') #no toValue? Give detailed info on fromValue if toValue==0: convertedBackValue,float32Value=check(fromValue) print str(fromValue)+'='+str(float32Value)+'='+str(convertedBackValue)+'='+str(convertedBackValue==fromValue) return #exit function #cycle from fromValue to toValue counter=0 areIn=0 while fromValue<=toValue: convertedBackValue,float32Value=check(fromValue) if convertedBackValue==fromValue:#the number converted to float and back is the same areIn+=1 counter+=1 if counter%blockSize==0 or fromValue==toValue:#report back to user once in a while (or at end of search) print 'at:'+str(fromValue)+': '+str(areIn)+' (OutOf) '+str(counter)+'='+str(areIn/(counter/100.000000000000000000000000000000))+'% available' if resetAveragePerBlock: counter=areIn=0 fromValue+=1for i in range(4294967020, 4294967051): checkSeed(i)#always gives 4294967040, confirms theory checkSeed(1000000,2999999)#100 percent available checkSeed(11000000,11999999)#100 percent available checkSeed(19000000,19999999)#50 percent available checkSeed(36000000,36999999)#25 percent available checkSeed(4293967296,4294967295)#0.3906 percent available!! checkSeed(1,4294967295,False,2500000)#check all possible seeds, dont reset averages at each block checked, and report back every 2.500.000 checks (one block) made#will give final result after a while: #at:4.294.967.295: 83.886.079 (OutOf) 4.294.967.294=1.95312497763% available #that means: over 98 percent of all seeds wont work...
-
I believe this was fixed a day ago on the development branch. Seed precision issues should be resolved after next weeks Rust update.