 |
|  |
 |
|
E_T
|
 |
Orlando, Florida
Mar 2001 time: 00:31
|
|
quote: Originally posted by DeepO
Not having computed, or checked anything, I do have one question to ask: How do you exactly alter the RNG? I thought this game had preserve seed on, meaning that they can try different combinations of fights, to get the best sequence, but they can only improve this much.
.
[snip]
.
DeepO |
O.K., it has been found out that you can alter the RNG via one verified method, when you load the save, at the time that the city screen come up saying that a build has been completed AND you change the next build to a Wonder, this will somehow change the RNG.
There is also something that I had found out, but hadn't tested while playing an SP game. It involes diplomacy, using the D button on the status box that is on the lower right hand corner of the screen VS calling up the diplo screens Via the F4 screen. I didn't have too much more of a chance to test this, as my computer is an older, slower model and it would take a lot of time for me to do this. Can someone please test this??
As for the RNG and the Preserve Random seed, first off a little information about how random numbers are generated. There are various ways to produce the random numbers that are used in this game, BUT all of those methods REQUIRE a table of numbers, already randomly produced and embedded within the game programs, to produce those numbers from. All that the Preserving the Random Seed does, is to make sure that the start location is at the same point on the table everytime the save is loaded.
Say you have a table of 10 numbers, from 0 to 9, randomly placed on that table. For argements sake, lets say that that table looks like this:
code:
5 4 9 6 2 8 1 4 7 0
The game will first start from some location, determined when the game is created, and then it moves throught that table as a different Random number is called for. For our example, lets say that we start from the 6 and we move left to right, 1 number at a time and then cycle back to the start when we get to the end. Let's also say that. when that random number is generated, a 6 would become 60%. Also for this, lets say that a 0 is 0%
So, you have a 4/4 vs 4/4 unit combat, the chance of winning any round is 50% or better. Your battle goes like this:
code:
1st round - 60% - Win - 4/4 vs 3/4
2nd round - 20% - loss - 3/4 vs 3/4
3rd round - 80% - Win - 3/4 vs 2/4
4th round - 10% - loss - 2/4 vs 2/4
5th round - 40% - loss - 1/4 vs 2/4
IF the Unit attacking was able to retreat, it would, at this point in time, attempt to, using the next Value as that chance.
6th round - 70% - win - 1/4 vs 1/4
7th round - 0% - loss - Attacking unit dead, surviving Defending unit at 1/4
Test for Unit Promotion - 50% (lets say that it requires 80% or higher, so it's not promoted)
So, you can, with enough effort, determine the size of the above random table and the values of that table. From that, you can also determine, ahead of time, what the outcomes might be, if you know where you start from. Random number tables ARE limited in size!
Now, first how can we find out the size and compositon of that table?? One way is through some very exhastive testing, depedning on the size of that table. Another is by locating, in the program itself, that table. Once you know that, the other thing is to know where you start on it, i.e. your random seed. That part is embedded in the save file. How do you find that?? By having the Preserve Random seed turned off, load a save, then save it again, maybe repeating and making several files. Then you compair the files, byte by byte and determine the things that are different, that will be your seed. Then you test that number against a battle and you can then make some form of translation to get your position on the table and you then know what any battle outcome will be, because you can then Look up the probibities and then make your battle plans accordingly.
And, with that info, you can also test various things that will then change the RNG and then know what you need to do to make things better for you.
This is of coarse a possiblilty of what is happening, but it would also explain a lot, because, you then wouldn;t even have to resort to reloading, but just figure the best way to make full use of the odds, that you already know about.
E_T
|
|
|  |
 |
|
Shiber
|
 |
Haifa, Israel
Jul 2002 time: 07:31
|
|

Also, the RNG for Civ tends to generate chains of similar numbers for the random numbers table. e.g. If for cell A, the RNG generated the number 3, then it's more probable that for cell B the number 3 or a close number will also be generated than it is probable that any other individual number will be generated. What more, if cell B did receive the number 3, then it is even more probable that cell C will also receive this number or a close one. The longer the chain is, the higher the chances are that it will continue.
Naturally, chains will eventually be broken, but in the mean time, what the player might get is streaks.
Every civ fanatic (no relation to CFC) knows this phenomenon, whether he recognizes it or not - there are streaks of luck in the game. The noticeable ones are produced rarely, but they are produced. Sometimes, you will lose a lot of units in the face of weaker units, and sometimes you will win multiple battles in a row when the odds are against you. If you've lost a lot of battles already and have many before you this turn, it is usually a good idea to call off the attack - or, if you're the kind of player that resorts to cheating, to perform actions that advance the RNG in order to get over the "bad luck streak" and get some fresh results.
P.S. From my experience with these "chains of good/bad luck", I can tell that the RNG table for Civ is very long, and it would take extensive research to figure out its lengh. Otherwise, you would have these noticeable streaks of great or horrible luck much more often in the game, and the combat system would truly suck. (Imagine an entire game of unbelievable luck, and then an entire, though much shorter game of terrible luck. Anyone wanna play?)
|
|
|  |
 |
|
DeepO

|
 |
supporting Candle'Bre
Jan 2002 time: 06:31
|
|
Thanks E_T.
Is this random table thing confirmed? traditionally, a RNG works differently, in that it takes the last number, multiplies it with a large prime number, mod it with another, and divides it by the first again. It doesn't change the rest of your explanation, though, a RNG is cyclic, after a while (depending on the the prime you use as in the mod calculation) it gets back to where it starts. And if the seed doesn't change, the RNG will always lead to the same sequence.
I find it strange that Civ would store a table, when such an easy algorithm exists to generate random numbers. And without the exact algorithm, it is virtually impossible to determine the sequence, even if you have the seed. It simply takes too long before it cycles back.
But... it doesn't really change the rest of my question, though. Assume it is determined that there is only a 1 in 4000 chances of getting the right seed. Purely experimental, that will take GCA on average 2000 reloads before they find it... I don't know if that's even possible in 24h. If you can change the seed in-game, it does become more likely they could use that to cheat. But by reloading? Nah... not with those numbers.
DeepO
|
|
|  |
 |
|
OliverFA
|
|
Leeds, UK
Sep 2002 time: 06:31
|
|
I don't think that they are reloading 2000 times in 24h to get the best seed. What I think they are simply doing is to reload and test several of the combinations they have accesible (change an order attack here, an unit there) to end with the best possible result among the ones that they have available. For example, stop attacking once they reach to the point in which they start to lose units in the attack.
|
|
|  |
 |
|
vondrack

|
 |
Praha, Czech Republic
Jan 2002 time: 06:31
|
|
quote: Originally posted by DeepO
Is this random table thing confirmed? traditionally, a RNG works differently, in that it takes the last number, multiplies it with a large prime number, mod it with another, and divides it by the first again. It doesn't change the rest of your explanation, though, a RNG is cyclic, after a while (depending on the the prime you use as in the mod calculation) it gets back to where it starts. And if the seed doesn't change, the RNG will always lead to the same sequence. |
Effectively, there is no difference between using the algorithm you describe and a table - since the table would be filled using the very same algorithm. It just speeds things up.
Agreed with OliverFA - even reloading has its limits when the random seed is preserved (and it IS in this game). What I find shocking (and what still keeps me from openly saying "Yes, GCA cheats.") is that the number of tweaks they could do using the RNG tricks available, is quite limited... and YET, they would have been able to accomplish something which happens just once in 6 million times... I mean - they might be able to effectively choose from few hundred possible results (but probably less than a hundred, though). OK, that changes the probability from 1:6,000,000 to something like 1:60,000. That's still pretty slim, I'd say. If you can win a jackpot with the odds of 1:60,000, why would it be so impossible to win a jackpot with the odds hundred times worse...?
EDIT: What I wanted to point out was: even if they were cheating, they would still be unbelievably lucky...
|
|
|  |
 |
|
OliverFA
|
|
Leeds, UK
Sep 2002 time: 06:31
|
|
Vondrack, in my opinion it looks that they are lucky just because they don't lose units when attacking. And they don't lose (or lose very few ones) because they reload and don't attack with the losing units. Even with the limited options of just reloading they can save a lot of units, and this makes a big difference.
|
|
|  |
 |
|
vondrack

|
 |
Praha, Czech Republic
Jan 2002 time: 06:31
|
|
quote: Originally posted by OliverFA
Vondrack, in my opinion it looks that they are lucky just because they don't lose units when attacking. And they don't lose (or lose very few ones) because they reload and don't attack with the losing units. Even with the limited options of just reloading they can save a lot of units, and this makes a big difference. |
Well, not really... they still have to attack with something to get rid of the "bad" RNG values (since only very few things other than combat use up RNGs - bombardment comes to mind).
First, as we have discovered recently, you can shift the sequence by few positions by juggling with wonder builds at the beginning of the turn. BUT - that is VERY risky, since that just screams "CHEATING!" (and GCA's turns HAVE been replayed in the past).
Second, you can use up a number here and there by bombardment (if you have artillery units, that is).
Third, you can juggle with the order of units attacking. But since you have only several types (army, reg sword, vet sword, elite sword, vet horse, elite horse... and that's basically it), the number of possible attack sequences is quite limited. It does not matter if you attack with one vet horse or another - the RNGs make them equal. You would need a unit that is somehow different (A-rating or rank) to get a different outcome for a given attack.
|
|
|  |
 |
|
asleepathewheel
|
|
listening too long to one song
Mar 2002 time: 00:31
|
|
What about the various trainers out there, does anyone have any experience with them? I have none. Might be worth checking into at the very least, there might be one that will edit a save's seed or something.
|
|
|  |
 |
|
DeepO

|
 |
supporting Candle'Bre
Jan 2002 time: 06:31
|
|
bah, how could they edit in the right seed, and keep using that? Sure, there might be seeds that lead to a streak of good luck, but how would you find these? And in the end, such a seed gives bad numbers as well... it won' last for ever, it's (pseudo) random after all.
No, IMHO it also looks like they change the order of attacks, if they cheat. And yes, they might for instance use that to keep us from killing any unit on defense with a NM. That doesn't mean that none of their units die, as they could lose e.g. swords against MIs. And, as we don't know how many of their units have died, the above calculations aren't final either... it assumes none of their units died.
I wouldn't be surprised if this all turns out to be paranoia, and simply good luck on their part...
DeepO
|
|
|  |
 |
|
asleepathewheel
|
|
listening too long to one song
Mar 2002 time: 00:31
|
|
quote: Originally posted by DeepO
bah, how could they edit in the right seed, and keep using that? Sure, there might be seeds that lead to a streak of good luck, but how would you find these? And in the end, such a seed gives bad numbers as well... it won' last for ever, it's (pseudo) random after all. |
Well, there are trainers out there. And there's a lot of info we're sitting on that other teams possibly don't know about, ie. the galley fortify trick. Perhaps one of them knows how to unlock it? I don't know, idle speculation, something I'm good at 
quote: Originally posted by DeepO
That doesn't mean that none of their units die, as they could lose e.g. swords against MIs. And, as we don't know how many of their units have died, the above calculations aren't final either... it assumes none of their units died.
|
If they lost units against our mi, then they would have been total defeats, as we didn't, iirc have injured MI. not to mention no promotions. granted, both are easily possible.
|
|
|  |
 |
|
wervdon
|
|
I highly doubt there is a "table" of pre-generated random #'s in the save, its actually much, much easier to do than that.
There are two functions typically used for random #'s in C.
srand() and rand().
srand will "seed" the random # generator, and rand() will return a random value.
Doing this:
srand(some integer)
rand()
rand()
....
as many times as you want
will always give you the same sequence of random #'s if you srand() with the same value.
Ussually, to make things unpredictable, srand() is called with the current time at the start of a program......however for debugging purposes programmers often "save" this value to the file so they can reliably reproduce a given sequence of events.
So the easiest way to generate a random sequence of #'s that repeats, and only having to save one value to the save is this:
srand(time) .... one time only
x = rand()
srand(x)
y = rand()
srand(y)
etc.
Then when you save the game, you just save the last random # generated......... See no table involved 
This obviously will only guarantee the same sequence of #'s comes out of the calls to rand() though, which is why changing the sequence of events (if those events do a call to rand()) changes outcomes.
Edit:
Oh and I think that rand() automatically does an srand() with the # it generated as part of how it works, so strictly speaking you don't actually have to implicitly call srand() every time you call rand() to do this, but instead just keep track of the last # rand() generated and save that in the save, and when you reload use that value instead of the time to reseed the srand() call.
|
|
|  |
 |
|
DeepO

|
 |
supporting Candle'Bre
Jan 2002 time: 06:31
|
|
wervdon, the rand() function uses the algorithm as described above, IIRC it is even possible to change the primes if you want to. Many developers write their own RNGs, though, which basically do the same thing.
And yes indeed (if I understand you correctly), calling srand only puts the last number generated to the seed, rand() uses this number to calculate the next.
Sleepy, I realize that for any deaths on their part, they should be instant deaths... I'm not saying that is the case, but it is possible, it's just one of the possibilities which also leads to a certain percentage chance. So in order to see what we see, there are more possibilities than so far calculated, meaning that the incredible luck GCA seems to have is a bit less than reported. I still consider them real lucky, though, it's just not enough proof...
As to trainers: I don't have any clue what is available for civ... in principle it could of course be perfectly possible that the save file is hacked in such a way that everything is possible... but using a trainer is a big step for a team, it differs a lot from simply reloading if you don't like the outcome of a battle.
DeepO
|
|
|  |
 |
|
wervdon
|
|
DeepO's right, the stuff I posted about rand() was based on no knowledge on civ3, but just on general knowledge on how C programming works.
|
|
|  |
 |
|  |
 |
|  |
 |
|  |
 |
|
E_T
|
 |
Orlando, Florida
Mar 2001 time: 00:31
|
|
quote: Originally posted by MrWhereItsAt
Bloody hell! If this sort of collaborative effort was being put into the game itself...
|
It's because we are diverse in our knowledge of the game. Even, I suspect, some of the programers of the game aren't aware of aspects of other parts of the game.
quote:
vondrack's point is one I have touched on myself a few times in my thoughts - there is at this stage only a limited number of different permutations of orders that GCA can carry out to alter battle results - but then again they aren't winning every battle, hence some of our units are merely injured and not killed after their attacks.
|
True, there are a limited number, but that, in combination with things that might effect the RNG COULD give you enough wins to really damage an opponent and not lose too many units.
But Until we KNOW what is still in Algalord and what condition, can we have a better idea as to what had happened.
quote:
What I would like to know is how was this programming knowledge of Civ3 gleaned? Has someone done some hacking in the past, have Firaxis given up their secrets or are these just common practices in the game programming world? Is it possible we are just guessing at all of this? |
Well, there are versions of the game available that don't require the CD (the No CD Crack). It's possible, that someone has also done enough Disassembly/resourcing to figure out some of the combat routines. IF you know exactly how it works, then you can possibly predict how a battle will turn out. With that, you can take insane chances (spear attacking Immortal) and know that you have a better than average chance of winning.
If you had a way to crack into the game, and had the next 10 probibilities printed on the screen, you would know if you can attack with just a Vet or maybe a Elite and even get promotions and GL's. But that is all suppositions. But yes, it is possible, you just have to have the right tools to be able to do it.
E_T
|
|
|  |
All times are GMT. The time now is 05:31. Apolyton Time is 00:31. |
top of page
|
|
|
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
|
|
|
|
|
|