.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Air Assault Task Force- Save $8.00
Bronze- Save $10.00

   







Go Back   .com.unity Forums > Illwinter Game Design > Dominions 2: The Ascension Wars

Reply
 
Thread Tools Display Modes
  #1  
Old February 17th, 2005, 07:49 AM
Saber Cherry's Avatar

Saber Cherry Saber Cherry is offline
Major General
 
Join Date: Oct 2003
Location: Crystal Tokyo
Posts: 2,453
Thanks: 0
Thanked 0 Times in 0 Posts
Saber Cherry is on a distinguished road
Default Re: Random Magic Paths - is it truly random?

Furthermore, unless I'm just up too late and should really go to bed now (probably true), it seems that the chances of 20 random picks missing a least one path (in other words, getting 20 consecutive sages and still not having 8 paths between them) is 43.6%, which is relatively high. Math:

1-((1-.0692)^8), where the .0692 is derived from the same calculation as above.

As far as RNGs go, I found a really nice one, called the Mersenne Twister. It is a software RNG, but the software actually finds stray radioactive particles in the dust on your CPU and monitors them for randomness. If you clean your case a lot the randomness goes down, which may explain some of the problems in this thread.

On the other hand... I just disassembled dom2.exe and got this little code fragment... maybe this is the problem?

Code:

public int rand(){
for(int i=0; i<100; i++){
if(seemsRandom(i)){return i;}
}
return secret_very_random_number;
}

public boolean seemsRandom(int x){
// note: add some stuff here before Dominions 3 is released
return true;
}

private int secret_very_random_number=42;

__________________
Cherry
Reply With Quote
  #2  
Old February 17th, 2005, 02:06 PM
The_Tauren13's Avatar

The_Tauren13 The_Tauren13 is offline
First Lieutenant
 
Join Date: Jul 2004
Location: Albuquerque, NM
Posts: 605
Thanks: 0
Thanked 0 Times in 0 Posts
The_Tauren13 is on a distinguished road
Default Re: Random Magic Paths - is it truly random?

roflmfao
__________________
Every time you download music, God kills a kitten.
Reply With Quote
  #3  
Old February 17th, 2005, 02:28 PM
BigDaddy's Avatar

BigDaddy BigDaddy is offline
Second Lieutenant
 
Join Date: Feb 2005
Location: Central Illinois
Posts: 434
Thanks: 7
Thanked 3 Times in 3 Posts
BigDaddy is an unknown quantity at this point
Default Re: Random Magic Paths - is it truly random?

Arallen and Bummer_Duck, if you are actually seeing long strings of alternating air and earth mages, I would suggest that it is a bug, but with the sophistication of random number tables and RNG these days, I believe the flaw would be in the windows OS. If you're using a different OS, I almost can't comprehend the problem. Depending on the actual coding of course, it could be caused by an artifact in the memory of the computer, caused by windows clunky and inefficient memory management.

Reboot, and try again! But be warned random systems do do unexpected things, and thats the beauty of them.
Reply With Quote
  #4  
Old February 17th, 2005, 03:54 PM
BigDaddy's Avatar

BigDaddy BigDaddy is offline
Second Lieutenant
 
Join Date: Feb 2005
Location: Central Illinois
Posts: 434
Thanks: 7
Thanked 3 Times in 3 Posts
BigDaddy is an unknown quantity at this point
Default Re: Random Magic Paths - is it truly random?

Restarting the computer incessently is a dogmatic method of course, if you're not seeing a real pattern.

If the system wasn't random you could use and expert system (thats the engineers term for artificial intelligence) to predict the outcome. Of course with the turing machine's (a computer is a turing machine)inability to actually produce random numbers, with enough samples the expert system may eventually learn how predict the supposed randomness, but it would take quite a few samples and a very sophisticated expert system.

Has anyone learned anything from reading these posts?

(Corrected spelling)
Reply With Quote
  #5  
Old February 17th, 2005, 04:38 PM
Kristoffer O's Avatar

Kristoffer O Kristoffer O is offline
General
 
Join Date: Aug 2003
Location: Sweden
Posts: 4,463
Thanks: 25
Thanked 92 Times in 43 Posts
Kristoffer O is on a distinguished road
Default Re: Random Magic Paths - is it truly random?

I learned that Bone Daddy is a nerd
__________________
www.illwinter.com
Reply With Quote
  #6  
Old February 17th, 2005, 04:39 PM
BigDaddy's Avatar

BigDaddy BigDaddy is offline
Second Lieutenant
 
Join Date: Feb 2005
Location: Central Illinois
Posts: 434
Thanks: 7
Thanked 3 Times in 3 Posts
BigDaddy is an unknown quantity at this point
Default Re: Random Magic Paths - is it truly random?

Thats funny because i'm not bone daddy and Ivan's posts where nerdier. No offense intended Ivan.
Reply With Quote
  #7  
Old February 19th, 2005, 04:11 PM

Ivan Pedroso Ivan Pedroso is offline
Corporal
 
Join Date: Feb 2004
Location: Denmark
Posts: 67
Thanks: 0
Thanked 0 Times in 0 Posts
Ivan Pedroso is on a distinguished road
Default Re: Random Magic Paths - is it truly random?

Quote:
BigDaddy said:
Thats funny because i'm not bone daddy and Ivan's posts where nerdier. No offense intended Ivan.
Hehehe none taken

"20 sages in a row with exactly 1 path missing":
(7/8)^20 *8 = 0.554

Explanation:
the (7/8) is the chance of getting one of the 7 "good" paths when you hire a sage.
^20 is just 20 such sages in a row.
*8 stems from the fact that you can choose your pool of 7 "good" paths from the 8 possible paths in 8 different ways.

General formula:
(chance of one good)^(number in a row) * (ways to make a good pool)

Getting 20 in a row with exactly 2 paths missing:
(6/8)^20 * 28 = 0.0888
(28=(8!)/(6!2!) is the number of ways of taking 6 from a sample of 8)

Getting 20 in a row with 1 or more paths missing:
~65%

Surprisingly high ? or ?
__________________
If I have seen further, it is by standing on the shoulders of Niefel Jarls
- Sir Ice-ac Newton
Reply With Quote
  #8  
Old February 17th, 2005, 04:46 PM

Turms Turms is offline
Corporal
 
Join Date: Jan 2004
Location: Finland
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
Turms is on a distinguished road
Default Re: Random Magic Paths - is it truly random?

You reasoning is invalid BigDaddy. Johan Osterman already posted that Dominions II uses a pregenerated random number table. That means it's random number generator works exactly the same in any computer with any OS. If it didn't the battle replays wouldn't work.

I have still a question though:
How is the seed for a new turn generation chosen?
The normal way is to take it from the clock or something. That is the only place I could think that could somehow affect the randomness of picks (very unlikely).

Turms
Reply With Quote
  #9  
Old February 17th, 2005, 04:53 PM
BigDaddy's Avatar

BigDaddy BigDaddy is offline
Second Lieutenant
 
Join Date: Feb 2005
Location: Central Illinois
Posts: 434
Thanks: 7
Thanked 3 Times in 3 Posts
BigDaddy is an unknown quantity at this point
Default Re: Random Magic Paths - is it truly random?

OK, I didn't notice Johan's post (I was wondering what method was used). Pre-generated number tables are very common (they are more efficient), but I think an artifact could still cause problems.

I don't think the seeding technique is likely to be the problem. I believe the seeds are used to select a starting point on the table and a "movement" pattern around the table, and it can be made even more comples. Repeats are highly unlikely in any case.
Reply With Quote
  #10  
Old February 17th, 2005, 07:04 PM
Kristoffer O's Avatar

Kristoffer O Kristoffer O is offline
General
 
Join Date: Aug 2003
Location: Sweden
Posts: 4,463
Thanks: 25
Thanked 92 Times in 43 Posts
Kristoffer O is on a distinguished road
Default Re: Random Magic Paths - is it truly random?

BigDaddy: But it was Bone Daddy that claimed that we and he and his whole family were nerds

Turms: Clock I believe.
__________________
www.illwinter.com
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 10:42 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.