Advertisement
Civilization Fanatics' Center  

Welcome to Civilization Fanatics' Center.

You are currently viewing our site as a guest which gives you limited access to our site features. By joining our free community, you will be able to participate in the discussions, search the forum, send private messages, vote in polls, upload your own screenshots to the gallery, and access many other special features. Registration is fast, simple and absolutely free, so sign up today! If you have any problems with the registration process or your account login, please contact support.

Go Back   Civilization Fanatics' Forums > CIVILIZATION III > Civ3 - General Discussions

Notices

Reply
 
Thread Tools
Old Sep 03, 2005, 01:32 PM   #1
muyendis
Chieftain
 
muyendis's Avatar
 
Join Date: Aug 2005
Location: Istanbul, Turkey
Posts: 33
EVREKA! i have a new theory

i dont know if someone of you have noticed or not; but i will say. in c3c or in ptw; war follows this order:

one turn bad results, other turn good results.

this is not "oh one try and make a theory" thing try and you will see.

for example; i was playin' for ottomans and had 15 sipahis missioned to conquer city of Berlin in emperor. i attacked and 5 musketmen in Berlin killed 12 sipahis. i couldn't accept this slaughter and load the game. then i waited for the next turn; attacked again.. WHA! one sipahi died; and i was in Berlin!

there are many examples in my experiences such as:

playing for japanese- attacked ottomans with 23 modern armor, 12 mech inf. 7 mech inf of ottomans killed 18 modern and 6 mech (that is the point when ıi kicked my computer ) , then i waited for the next turn WHA! 6 modern armor dead and i was in Edirne!

so it goes like that. good-bad-good-bad-good-bad.

try and you will see your game will become much easier.
__________________
Vöhey Vöhey Vöhey
muyendis is offline   Reply With Quote
Old Sep 03, 2005, 01:39 PM   #2
Steve2000
Mighty Pirate
 
Steve2000's Avatar
 
Join Date: Jun 2005
Location: Deep in the Caribbean...
Posts: 659
People love to look for patterns. It is a random number generator (RNG). Do the experiment of reloading your battles hundreds of times and record each result. Also, the game calculates each individual attack separately, not a group of attacks in the same turn.
Steve2000 is offline   Reply With Quote
Old Sep 03, 2005, 01:47 PM   #3
muyendis
Chieftain
 
muyendis's Avatar
 
Join Date: Aug 2005
Location: Istanbul, Turkey
Posts: 33
himmmm. i think i am one in the gruop who loves too look for patterns it makes me happy and i can say "damned computer, unluckiness bla bla bla, you know; i am never guilty
__________________
Vöhey Vöhey Vöhey
muyendis is offline   Reply With Quote
Old Sep 03, 2005, 03:55 PM   #4
I am the Future
Oi Oi Oi !!!
 
I am the Future's Avatar
 
Join Date: May 2005
Location: Western Spiral Arm of the Galaxy
Posts: 2,261
i nticed this befor too.
i w rome & i couldnt stnd the loss of 2 legion lode wte nd kick @ss

(my "eh" key wont work srry)
I am the Future is offline   Reply With Quote
Old Sep 03, 2005, 03:57 PM   #5
mastertyguy
I'm tired!
 
mastertyguy's Avatar
 
Join Date: Mar 2005
Location: In the garage
Posts: 1,533
It may be true, but try it [successfully] 1000 times and we're OK!
mastertyguy is offline   Reply With Quote
Old Sep 05, 2005, 03:37 PM   #6
SJ Frank
Spamalot Co-court
 
SJ Frank's Avatar
 
Join Date: Sep 2002
Location: The hill tile S-SE of San Francisco
Posts: 717
I think your theory is true, and it can be mathematically proven.

The theory states that for an event which has two possible outcomes, (A) and (B), in which (A) is more likely to occur than (B). If the first trial results in (B), then the next trial will more likely result in (A).

The theory is true because the previous trial results have no effect on the outcome of later trial results. Since result (A) is more likely to occur than result (B), after (B) occurs once, (A) is more likely to occur. The likelyhood of (A) is the exact same whether or not (B) occurs first.

To put it into civ terms (and to use the original example). If the probability of 12 Sipahis beating 5 muskets is 75%, then the probability of "having the Sipahis lose to the muskets, reload the game, wait a turn before attack, and winning" is also 75%.

Last edited by SJ Frank; Sep 05, 2005 at 03:43 PM.
SJ Frank is offline   Reply With Quote
Old Sep 06, 2005, 06:24 AM   #7
gunkulator
Emperor
 
Join Date: May 2003
Location: NH, USA
Posts: 1,265
Actually, the theory is not true. There is no good-bad-good-bad-good-bad pattern built into the RNG. The RNG has no idea whether it's being called upon for combat, pollution, flips, SGLs, MGLs, volcanos or any other random event.
gunkulator is offline   Reply With Quote
Old Sep 06, 2005, 07:07 AM   #8
nerovats
Emperor
 
nerovats's Avatar
 
Join Date: Feb 2004
Location: Fryslân
Posts: 1,591
Actually I remeber Moonsinger posting about the rng being not as random as one would aspect. She was thinking of writing an artical about it, never seen an artical tho.
nerovats is offline   Reply With Quote
Old Sep 06, 2005, 09:30 AM   #9
Fried Egg
Prince
 
Fried Egg's Avatar
 
Join Date: Jul 2005
Posts: 339
Does anyone know if the RNG is saved with the game?

For instance, I've tried saving before an attack, and when I carried out the attack I lost against all odds. I then re-loaded and tried again. Exactly the same result (including the number of health bars the enemy lost). No matter how many times I reloaded, I got the same result. However, when I waited one turn instead and tried again; success!
Fried Egg is offline   Reply With Quote
Old Sep 06, 2005, 10:32 AM   #10
Theoden
Deity
 
Theoden's Avatar
 
Join Date: Sep 2003
Location: Denmark
Posts: 2,569
The RNG is not as random as you would expect. An interesting post by oystein shows this:
Quote:
Originally Posted by Oystein
Civ3 uses a common multiplicative linear congruential prng.
You can find the same prng in the standard library for C.

Here is a java implementation:
Code:
public class Random {
    public int seed = 0;

    public int rnd() {
        seed = seed * 1103515245 + 12345;
        return ((seed >> 16) & 0x7FFF);
    }
}
In combat calculation, integral division by 32 is used. So there are only 1024 possible numbers compared to 32768 for other calculation.
There is no such thing as a good-bad-good-bad pattern in the civ RNG. Allthough it's results may seem like there is.

I've noticed too that it sometimes work to wait one more turn and then attack, but that has nothing to do with any pattern. It's as simple as SJ Frank explained.

@Fried Egg
If you have 'preserve random seed' on the game will store the random seed in the save file, and the same actions will produce the same results, even in a 1000 reloads.
__________________
"I have seen honest faces before. They usually come attached to liars."
GOTM | Quick Games
Theoden is offline   Reply With Quote
Old Sep 06, 2005, 10:33 AM   #11
Padma
the InBond
 
Padma's Avatar
 
Join Date: Dec 2001
Location: Omaha, Nebraska USA
Posts: 13,997
The RNG Seed *IS* saved with the game (unless you deselect the option to "Preserve Random Seed"). So if you reload, and do the same things in the same order, the results will be the same. If you change anything (especially if you delay your attacks by a turn), the results will *not* be the same.

Edit: Cross-post with Theoden.
__________________

1st Lieutenant, USAF (Retired)
Registered Linux User #233241
My View Ramblings of a Professional Computer Geek-- My Blogs.
Padma is offline   Reply With Quote
Old Sep 06, 2005, 10:39 AM   #12
MeteorPunch
#WINNING
 
MeteorPunch's Avatar
 
Join Date: Jan 2005
Location: TN-USA
Posts: 4,736
I think there is a string of prerolled yes/no variables that changes when a different move is selected (assuming you have preserve random seed on). If it was actually random, something different would occur within the same game.

Let's say you load a save and on the interturn something happens. Reload, the exact same thing happens. The RNG is prerolled into a string which is accessed so the same moves occur. If you do one attack different, the overall results from all your next battles will change.

just a theory though.

crosspost with Padma
MeteorPunch is offline   Reply With Quote
Old Sep 06, 2005, 11:18 AM   #13
Theoden
Deity
 
Theoden's Avatar
 
Join Date: Sep 2003
Location: Denmark
Posts: 2,569
Quote:
Originally Posted by MeteorPunch
crosspost with Padma
There was a six minute difference

But to the serious thinking...

I think the preserved random seed stored, results in the generation of a list like:
88, 67, 34, 01, 54, 34, 72, 94, 21, etc. (goes on like forever with random numbers)

Then when an action calls upon the RNG to roll, it picks the number, which is next in the list.
So if the first action in the turn is an archer attacking a warrior (approx. 80% chance) the archer will lose because the first number 88 is higher than 80. Then a warrior attacks a tank (approx. 2% chance) abd obviously loses, because 67 (the 2nd number) is higher than 2.
If you, however swapped the two units in the attack queue, then the warrior would lose on the 88 roll, but the archer would win this time using the 67 roll. This way the RNG can be manipulated when having preserve random seed on.

Just a theory based on a bit too few facts though
__________________
"I have seen honest faces before. They usually come attached to liars."
GOTM | Quick Games
Theoden is offline   Reply With Quote
Old Sep 06, 2005, 11:23 AM   #14
gunkulator
Emperor
 
Join Date: May 2003
Location: NH, USA
Posts: 1,265
"Prerolled" isn't quite correct, however since the sequence is pseudo-random and the seed is preserved, it has the same effect as a pre-rolled sequence. Then again, for performance reasons I supposed the game could pre-roll, although I doubt the performance enhancement would be worth the extra effort.

Typically, pseudo-random sequences are not seeded with 0, as the Java code above shows. Instead the clock is read and the time is used (e.g. seconds since 1970) as the seed.
gunkulator is offline   Reply With Quote
Old Sep 06, 2005, 01:09 PM   #15
Padma
the InBond
 
Padma's Avatar
 
Join Date: Dec 2001
Location: Omaha, Nebraska USA
Posts: 13,997
Quote:
Originally Posted by Theoden
There was a six minute difference
Posted times (my time zone) of 11:33 - 11:32 = 6 minutes?

As for the topic, you (and gunkulator) are very much on target. Once the seed is generated, the string of numbers returned will always be the same. So if you "replay" the turn, the PRNG results are identical. Of course, if you change anything, e.g., attack with the Warrior first instead of the Archer, the *game* results may change.

Also, IIRC, the seed is regenerated every turn, using the system clock. This would explain why people "shadowing" SGs find their games diverging from the *official* game, even though they do the very same things the official player does.
__________________

1st Lieutenant, USAF (Retired)
Registered Linux User #233241
My View Ramblings of a Professional Computer Geek-- My Blogs.
Padma is offline   Reply With Quote
Old Sep 06, 2005, 01:18 PM   #16
Theoden
Deity
 
Theoden's Avatar
 
Join Date: Sep 2003
Location: Denmark
Posts: 2,569
@Padma
So, are you saying I'm on the right track with my theory regarding the manipulation of results, i.e. different attack order means same random number list but sometimes different results? (as in my case with the archer and warrior)


PS: On my machine the time difference between the posts look like this :
Attached Thumbnails
Click image for larger version

Name:	Crosspost.JPG
Views:	178
Size:	57.7 KB
ID:	98183  
__________________
"I have seen honest faces before. They usually come attached to liars."
GOTM | Quick Games
Theoden is offline   Reply With Quote
Old Sep 06, 2005, 01:25 PM   #17
Padma
the InBond
 
Padma's Avatar
 
Join Date: Dec 2001
Location: Omaha, Nebraska USA
Posts: 13,997
Yes, the same Random numbers are produced, but with possibly different game results. The same seed is used for *all* random numbers used during a turn, not just combat.

I had a game a few years back, where I popped 2 goody huts at the beginning of a turn. The first hut gave me a tech, the second gave a conscript warrior. I needed the warrior near the other hut, though, so I reloaded, and popped the huts in the reverse order.

And yes, it was six minutes until MeteorPunch's post, but I cross-posted with *you*, and that difference is only one minute.
__________________

1st Lieutenant, USAF (Retired)
Registered Linux User #233241
My View Ramblings of a Professional Computer Geek-- My Blogs.
Padma is offline   Reply With Quote
Old Sep 06, 2005, 01:38 PM   #18
WackenOpenAir
Deity
 
WackenOpenAir's Avatar
 
Join Date: Sep 2003
Location: Eindhoven, the Netherlands
Posts: 2,841
I also play poker.

What you post here displays what makes poker a difficult game to play.
People are made to recognise patterns and learn from it. In poker, everything is random just like it is in civ3.
After getting an unlikely loss however, people are gonna fear that situation. They recognise the pattern, and they learn to fear it. Same when they win unlikely situations.

And that is the reason there are so many people who suck at poker It is also the reason for many conspiracy theories, belief in aliens and belief in religions.
__________________
Wacken Open Air - The greatest metal festival on earth
WackenOpenAir is offline   Reply With Quote
Old Sep 06, 2005, 02:35 PM   #19
Theoden
Deity
 
Theoden's Avatar
 
Join Date: Sep 2003
Location: Denmark
Posts: 2,569
Quote:
Originally Posted by Padma
Yes, the same Random numbers are produced, but with possibly different game results. The same seed is used for *all* random numbers used during a turn, not just combat.

I had a game a few years back, where I popped 2 goody huts at the beginning of a turn. The first hut gave me a tech, the second gave a conscript warrior. I needed the warrior near the other hut, though, so I reloaded, and popped the huts in the reverse order.
I guess that confirms my theories

Quote:
Originally Posted by Padma
And yes, it was six minutes until MeteorPunch's post, but I cross-posted with *you*, and that difference is only one minute.
sorry, seems like I misunderstood MeteorPunch's comment. I thought he was reffering to him and you crossposting and that he spent 6 minutes to make the post.
I see now that he reffered to me and you crossposting, but why is that so funny?
__________________
"I have seen honest faces before. They usually come attached to liars."
GOTM | Quick Games
Theoden is offline   Reply With Quote
Old Sep 06, 2005, 02:39 PM   #20
MeteorPunch
#WINNING
 
MeteorPunch's Avatar
 
Join Date: Jan 2005
Location: TN-USA
Posts: 4,736
RNG has something to do with belief in God? I don't see the connection there.
MeteorPunch is offline   Reply With Quote
Reply

Bookmarks

Go Back Civilization Fanatics' Forums > CIVILIZATION III > Civ3 - General Discussions > EVREKA! i have a new theory

Thread Tools

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Equator Theory.... teknalee Civ3 - General Discussions 1 Aug 16, 2004 11:58 PM


Advertisement

All times are GMT -6. The time now is 04:59 PM.


Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
This site is copyright © Civilization Fanatics' Center.
Support CFC: Amazon.com | Amazon UK | Amazon DE | Amazon CA | Amazon FR