Challange: Test combat odds yourself

I am surprised no one has brought up the possibility of mods messing with the odds lol.

I mean I play several mods and most at least have the option for the showing of advanced combat odds.

Now I turn that off because I feel as if those odds are usually wrong.

Before you go nutty on me for saying that when I say wrong I mean inacurate becuase of how preciss the information is. I do like seeing the info broken down for me like that but in the end I just want to know if I will win or lose.

Also to the person/people who say that you can just look at the code, I would ask if the code actually selects the number itself or if it calls a "built in" or "helper function" to do it?

I have not looked at the code and I have very little coding experience, but from what I have learned/seen, many languages have a built in function you can call to give you a number. This way the programmer does not have to acctually have to write the function. Granted I would assume any programmer could write a rng program. Just a thought/question I was hoping someone could shead some light on it.
 
I've had strange experiences in my game where I have had amazing luck against most of my enemies apart from Ghandi where the opposite has happened. For some reason against Ghandi I constantly lose when the combat odds are below 80% but against other leaders I can wipe out 3-4 cities without even a single loss. It's just a coincidence of course. Some you win some you don't.
 
Also to the person/people who say that you can just look at the code, I would ask if the code actually selects the number itself or if it calls a "built in" or "helper function" to do it?

I have not looked at the code and I have very little coding experience, but from what I have learned/seen, many languages have a built in function you can call to give you a number. This way the programmer does not have to acctually have to write the function. Granted I would assume any programmer could write a rng program. Just a thought/question I was hoping someone could shead some light on it.


They could have used a function from the libraries that came with their compiler (there is always at least one, and often two or more different algorithms available), but they didn't.

Civ uses its own code to generate the numbers. The functionality is in CvRandom.cpp. In game it is called via the CvGame object's getSorenRand(...) method which references an object of type CvRandom. The actual number generation is done, ultimately, via CvRandom::get(...) which manipulates the current seed to get both the next seed value and the output number (which is the upper 16 bits of the next seed value adjusted via some math to be in the desired range as passed to it in the parameters of the get function which I have hand-waved away with the "..."). (There is also a second random number stream used for map generation, accessed via the CvGame object's getMapRand(...) method. This also references a CvRandom type object.)

Anyhow, it's in there.

The only place where things happen in the game where you can't really see is in the main game executable, for which the source is not provided. If something were to pass data back to that and get data from it then shenanigans could happen. But the random number generation is in the DLL, for which the source code is provided. Likewise for the combat calculations and the calculations for the displayed odds: they are done in the DLL.
 
Which brings me to an actual point. You don't have to "test combat odds". The combat is controlled by the software. You have the source code for the software. You can, therefore, just look at the program and see how it does what it does. If it alters the outcome for the player depending on any factor, like the current score, then code that does that will be present in the source code. If there is no such code, then it doesn't do that. No "looks like" or "seems like" or "its close", just "it does this" or "it doesn't do this".
We don't have the source code for Civ4's RNG.
 
I don't think the combat odds tell the complete story of what happens when you commit to an attack. They're more a comparison of one unit's base strength to another's. I still think the relative directions the attacker and defender are facing is also a factor in deciding combat outcomes.

I play multi-unit graphics display, so this has a lot to do with why I hold this idea. For example, if I attack a unit that isn't dug-in from the rear or from either flank, it sure SEEMS like I get better results than if I were to attack the same unit head-on.

If a unit IS dug-in, attacking from the direction where there is a single ready defender (the end points of the Y) also seems to give more favorable results than attacking from a direction between the branches (where two ready defenders provide overwatch support of each other).

Maybe I'm just seeing things, maybe I'm not, but one thing I have learned from playing this game for years is not to underestimate the amount of thought that goes into the details of this game, nor to casually dismiss these details as mere dressing, and eye (or ear) candy.
 
It would be really annoying if there was a slight difference depending on your direction of attack as there is no ingame info to that effect, which would be misleading. And you can play with single unit graphics which would remove that information should it exist. So I doubt that is the case.
Do you play with the combat scenes on? I don't anymore so I never know if I'm attacking front on or what :p
 
I don't think the combat odds tell the complete story of what happens when you commit to an attack. They're more a comparison of one unit's base strength to another's. I still think the relative directions the attacker and defender are facing is also a factor in deciding combat outcomes.

I play multi-unit graphics display, so this has a lot to do with why I hold this idea. For example, if I attack a unit that isn't dug-in from the rear or from either flank, it sure SEEMS like I get better results than if I were to attack the same unit head-on.

If a unit IS dug-in, attacking from the direction where there is a single ready defender (the end points of the Y) also seems to give more favorable results than attacking from a direction between the branches (where two ready defenders provide overwatch support of each other).

Maybe I'm just seeing things, maybe I'm not, but one thing I have learned from playing this game for years is not to underestimate the amount of thought that goes into the details of this game, nor to casually dismiss these details as mere dressing, and eye (or ear) candy.

It's a great concept, but there is no evidence to support this unfortunately. Unit position does not come into effect. After using large chunks of the programming code for different projects I can inform you that it does not take into account which direction the unit sprite is facing.
 
It's a great concept, but there is no evidence to support this unfortunately. Unit position does not come into effect. After using large chunks of the programming code for different projects I can inform you that it does not take into account which direction the unit sprite is facing.

Like I said earlier, I have no evidence to point to either, just some interesting observations. For example:

1) Have you ever noticed when you end a turn next to a panther or wolf that is exactly one tile away, that they will often not move directly into your units square to attack, but will use both movement points they have, moving first to another tile, and then attacking from there? When this happens, it seems to be to avoid a direct, head-on attack. If they start at your flank, they tend to move in a way so that they attack your rear flank. Why?

2) Barbarian units occupying barbarian cities, oddly enough, rarely seem to be fortified in the cities when you approach them. They do face a certain direction, and this direction seems to change based on which direction they were last attacked from. Why?

3) Attack a city with siege to lower its defenses and you'll often see one fortified defender go from the fortified position to the ready position showing which direction it was facing when it entered the city. Why?

4) In multi-unit graphic display some units come in threes, some in pairs, and some as single units. Thus, wounded units of one type leave the same footprint as healthy units of another type. Accident? Coincidence?

(By the way...ALL units leave footprints...even so-called "invisible" ones. That is absolutely no accident.)


I'll admit I haven't seen the slightest bit of code, let alone large chunks of it, but isn't it possible that Firaxis may have reserved some core bits of code for themselves that are NOT accessible to modders?
 
Back
Top Bottom