v27 and above - Single Player Bug/Crashes report thread

Status
Not open for further replies.
@Koshling: It would be helpful to have your advice at least on how to go about making the National Culture level count (and while we're at it, probably all other National Total Commerce counts) into a long int. It seems like it'd be easy but I'm wondering if there's some pitfalls to be aware of? Apparently said gentleman above has already encountered a problematic calculation there that could be avoided by the change to a long int.

@Antaran: this was somewhat expected that there'd be a whacked out point one would reach there but are you sure its 3 million and not 3 billion?

Mostly mechanical BUT you'll need special conversion code in the read() routines to handle the old formats on game load. Should be no issues apart from that provided we're talking about per-player values (probably ok for per-city too). If you want to do it for per-unit or per-tile values you need to consider the implications for memory usage (or if the values concerned are in large arrays of some kind). For national culture it shouldn't be a problem.

However, do we REALLY see national culture go over 4 billion!!?? If it's bombing out at a few million it's likely down to some intermediate calculations that do something (purely made up example) of this kind:

Code:
iValue = (iValue * iModifier1);   // Modifier1 is percentage based and defaults to 100
iValue = (iValue * iModifier2);   // Similarly
iValue /= 10000; // renormalize

There is ton of code in C2C that does that sort of thing (to avoid rounding errors which you would get if you tried to divide by 100 immediately), but obviously it means that the intermediate values are circa 10000 times larger than the final value, and can therefore overflow much more easily.

Protect it with something like this:

Code:
int iDivider = 1;

//   Make sure we operate on non-overflowing values
while(iValue > MAX_INT/10000)
{
    iValue /= 2;
    iDivider *= 2;
}

iValue = (iValue * iModifier1);   // Modifier1 is percentage based and defaults to 100
iValue = (iValue * iModifier2);   // Similarly
iValue /= 10000; // renormalize

//    Multiply back for overflow renormalization
iValue *= iDivider;

Of course, if the quantity you're worried about goes through many such calculations it may well just be easier to make it a long as you originally suggested, but if it's only a few this is easier because it saves on backward compatibility headaches with save games.
 
OK went back into WB and changed the plot next to city to Plains and still not avail??

Unless again, it means Plains AND Grassland?? Hydro?? DH??

EDIT: Nope didnt matter i put grassland there also, still nothing/

OR does it mean (in vicinity) 2 tiles or 3 tiles away??
City vicinity means 2 tiles unless you open the 3 tile work radius with Metropolitan Administration or with the culture level influental, depending on your choice at the game set up.
Both resources have to be in city vicinity and must be connected and / or improved.
Having simply the resources doesn't work.
So you need a bison resource, which is connected and has the appropriate improvement and plains / grassland.
And of course, you have to build the wonder Culture Sioux to get access to the resource culture Sioux.
 
City vicinity means 2 tiles unless you open the 3 tile work radius with Metropolitan Administration or with the culture level influential, depending on your choice at the game set up.
Both resources have to be in city vicinity and must be connected and / or improved.
Having simply the resources doesn't work.
So you need a bison resource, which is connected and has the appropriate improvement and plains / grassland.
And of course, you have to build the wonder Culture Sioux to get access to the resource culture Sioux.

OK, thx, i KNOW alot of people have had the same question, so i just thought i'd put it out there for discussion, thx.

btw as you can see i am 3 tiles away (problem solved, thx).
 
OK, thx, i KNOW alot of people have had the same question, so i just thought i'd put it out there for discussion, thx.

btw as you can see i am 3 tiles away (problem solved, thx).

Yeah, this kind of stuff should be stated somewhere, prominently.
 
Mostly mechanical BUT you'll need special conversion code in the read() routines to handle the old formats on game load. Should be no issues apart from that provided we're talking about per-player values (probably ok for per-city too). If you want to do it for per-unit or per-tile values you need to consider the implications for memory usage (or if the values concerned are in large arrays of some kind). For national culture it shouldn't be a problem.

However, do we REALLY see national culture go over 4 billion!!?? If it's bombing out at a few million it's likely down to some intermediate calculations that do something (purely made up example) of this kind:

Code:
iValue = (iValue * iModifier1);   // Modifier1 is percentage based and defaults to 100
iValue = (iValue * iModifier2);   // Similarly
iValue /= 10000; // renormalize

There is ton of code in C2C that does that sort of thing (to avoid rounding errors which you would get if you tried to divide by 100 immediately), but obviously it means that the intermediate values are circa 10000 times larger than the final value, and can therefore overflow much more easily.

Protect it with something like this:

Code:
int iDivider = 1;

//   Make sure we operate on non-overflowing values
while(iValue > MAX_INT/10000)
{
    iValue /= 2;
    iDivider *= 2;
}

iValue = (iValue * iModifier1);   // Modifier1 is percentage based and defaults to 100
iValue = (iValue * iModifier2);   // Similarly
iValue /= 10000; // renormalize

//    Multiply back for overflow renormalization
iValue *= iDivider;

Of course, if the quantity you're worried about goes through many such calculations it may well just be easier to make it a long as you originally suggested, but if it's only a few this is easier because it saves on backward compatibility headaches with save games.

Good method. But yes, I do expect National Culture, Research, Gold, and Espionage values to start to exceed 3 Billion by the end of games before long, particularly on slower gamespeeds, so have identified that those probably should be converted.

Particularly National Culture. It was only making some crazy stuff happen on the charting before, but now that we have the new Developing Leader mechanism, it becomes critical to keep it straight. Even if its not going to be an issue now, it will be once we start going truly galactic and such.
 
For reference, in order to get 3 million culture I had 35 cities at 655 AD on noble difficulty and I'd been at that number for a while. (I really need to move the difficulty up :lol:)

EDIT: I forgot that the save I used to check on the bug was 150k before 3 million because I didn't save after I hit the bug.
 
Yeah... I can run this without a crash through the debugger. So either it was just something funny about the update and the way it was done causing file clash, which is pretty likely, or its something that's already been repaired possibly.

We have a new release scheduled for tomorrow. Might wanna just go with that one.

I have the older versions of c2c but before I install the new one I rename the older versions. Now I am trying to download the updated v27 through the mirror and not through desura but I cannot decompress the 7zip file with any decompress program (7zip, winrar, winzip) It says that the file cannot be opened. I read in another post that this could be an administrator problem but on my computer I am the only user and administrator. Through desura the file is properly downloaded and installed by desura.
 
I have the older versions of c2c but before I install the new one I rename the older versions. Now I am trying to download the updated v27 through the mirror and not through desura but I cannot decompress the 7zip file with any decompress program (7zip, winrar, winzip) It says that the file cannot be opened. I read in another post that this could be an administrator problem but on my computer I am the only user and administrator. Through desura the file is properly downloaded and installed by desura.

You need the latest version of 7zip.
 
Ok, I'm here again with the Deity AI being crippled by maintenance of the second city in the beginning -issue. I also bought a screenshot, I worldbuilded myself some espionage points and took a peek at my neighbor's city:

(big image)

Spoiler :

H7au9Xm.jpg

 
Ok, I'm here again with the Deity AI being crippled by maintenance of the second city in the beginning -issue. I also bought a screenshot, I worldbuilded myself some espionage points and took a peek at my neighbor's city:

(big image)

Spoiler :

H7au9Xm.jpg


Yeh, this is a known issue. The 'free' second city on deity for the AI is a hold-over from pre-C2C and is not really appropriate. We should give it a free unit or two instead IMO.
 
Bug: If I have Drydock I cannot train the medic, because it upgrades automatically to hospital ship, which doesn't provide health.

Bug2: Biodome doesn't create animals.
 
Hello C2C Dev,
Pls lock at my save game, my C2C game go freeze after click "end turn" - Most of my C2C games finish with this bug. Thank you.

Ok... will take a look.
 
V28 Vanilla:

-Automated Hunters still don't hunt, they just explore (and even this is bad)

- You don't need heroic I to get Heroic II Promotion. I got heroic 2 with my starting Clubman in turn 200 (eternity, GEM, raging barbs, deity) and this is WAY too early.
 
- You don't need heroic I to get Heroic II Promotion. I got heroic 2 with my starting Clubman in turn 200 (eternity, GEM, raging barbs, deity) and this is WAY too early.

Yeah ever since they changed these around they dont work properly anymore, wish they had just left them alone. . . SO

Mainly because HeroicII, i have fought now way over 200 battles and STILL no Golden Age from Heroic II, so 5% isn't much and for one whole game like Playtyping said will only happen once (if your lucky).
 
I also had a Heroic II promoted unit with way over 400 battles - still no Golden age.

To me it seems, this promotion isn't working. :sad:
 
Maybe it's not working than, but WHY can you get Heroic II before you have Heroic I?

Because I screwed it up and forgot to add Heroic I as a prereq for Heroic II? :mischief:

At any rate that is fixed now, and this thread should really be closed. I'll PM a mod about that.
Moderator Action: -> thread closed.
Please use the current stickies in this forum.
 
Status
Not open for further replies.
Back
Top Bottom