Author Topic: Variations to predictable pseudo number calculations (was: Real random numbers)  (Read 1043 times)

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Since glest introduced multiplayer ( I think it was 3.0.0 ) real randoms were replaced by a system which calculates pseodo randoms to let all clients/server play the same game. Maybe this can be tweaked a bit ? Maybe starting the pseudo random calculation with a preshared real random or something like this?  

This would bring us really random games/ais back again.  
« Last Edit: 9 June 2011, 06:59:38 by tomreyn »
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: Real random numbers
« Reply #1 on: 12 September 2010, 23:33:46 »
Does this actually matter, though?  I mean, whether the numbers are random or pseudo-random, does the player experience a difference?

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Real random numbers
« Reply #2 on: 13 September 2010, 02:30:29 »
Glest would never have used 'real' random numbers, real random number generators require special hardware (good ones use decay of radioactive materials).  Previously it would have used random numbers provided by the C runtime, which is a pseudo random sequence, just like the current 'in source' one.

The C runtime version of rand() is of course is different on different platforms, hence the in code version.  We use pre-shared seeds for AI's in GAE, whether it makes much of a difference is debatable, it should make them less predictable at the start of game but their options a rather limited then anyway.  By the time the game 'gets going' human intervention is enough to ensure they don't keep making the same decisions. (Ie, it forces the 'random' numbers out to be used for different things).
Glest Advanced Engine - Code Monkey

Timeline | Downloads

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: Real random numbers
« Reply #3 on: 13 September 2010, 08:34:56 »
I intentually only only had preshared starting randoms in mind. thats what I meant with "better" randoms.

update:
Maybe we should think about two kinds of random Systems:
One is always the same order and the other one is based on this, but adds a starting random on top of the given result.

So maps for example will always look the same, while other things(like AI ) behave different each time you play.
« Last Edit: 13 September 2010, 10:23:54 by titi »
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

 

anything