C2C SVN Changelog

Just pushed to SVN (3628):
  • Minor pathing fix that was causing some AI inefficiency
  • Fixed tendency for the AI to put its units in unintended danger

The second of these is actually fairly significant. I noticed in my current game that while I had a large stack sitting on a hill a few tiles away from an AI city (preparing to attack but not yet ready to do so), every now and again the AI would stick hunters or rogues on poor terrain next to it, where they could be easily picked off (and promote my great general up in the process).

It turns out that many (most) AI routines that selected targets for various missions (tiles to patrol to, units to attack) were not assessing the danger in the intermediary tile the unit would wind up on at the end of its first turn on the way to wherever it was going. So, for example, an AI hunter noticed a moose a few tiles past my death stack an considered it to be a good target, but didn't take account of the fact that to get to it, it would leave itself next to my death stack on the turn before it reached said moose (needless to say such hunters never actually got to meet their moose!)

Anyway, I've corrected this situation on all the AI routines it seemed appropriate to adjust (about 25 of them!), so these 'accidental' suicides should no longer occur.
 
Updates
- Tweaked Trading Post, Alchemists Lab, Antique Shop, Billboards, Book Store, Brass Instrument Maker, Brothel, Coffee Shop, Comicbook Store, Dive Bar, Pub, Tavern, Electricians Workshop, Forensics Lab, Learning Center, Plumber's Workshop, Mosaic Workshop, Stained Glass Workshop, Police Station, Post Office, Road Signs, Robotics Lab, Roller Derby Track, Seal Maker, Sausage Shop, Traffic Signals, Electric Street Lights and Scotland Yard.
 
It is a Tortoise Patch file that mostly contains DLL fixes. Koshling, what say you about this?

Well, if it's not to be reversed as soon as we lease something else then the source changes have to be merged. Do we have the source?
 
Well, if it's not to be reversed as soon as we lease something else then the source changes have to be merged. Do we have the source?

It's attached to his original post. I didn't look too hard, but it seemed like mostly small tweaks and changes. You might want to have a look at it before merging.
 
Hello everybody

I found a few small things(Mostly cosmetic fixes) while browsing the code and created a patch.

I have reviewed all the changes here and merged some, modified and merged some more, and not merged some that I am pretty sure are incorrect.

Basically they fell into 3 categories:
  • Outright bugs in the combat mod stuff recently added - taken your changes in these cases - thanks for spotting these
  • Cosmetic changes to declaration of loop variables. Which idioms the compiler (with default flags) objects to depends on which version you're using - I'm betting you're using VS2008 or VS2010 rather than the VS2005 the game was developed under? (unfortunately some of the things that make VS2008/2010 happy make VS2005 unhappy and visa versa). Anyway, I have switched to a safe idiom for both compiler versions (non-warning-generating that is)
  • Changes to loop breaks that are definitely NOT correct (mostly checking for cache hits). I have omitted those from the merge (we can discuss them individually if you want to - just PM me if so)

Merged version pushed as rev 3638.
 
I'm in the process of simplifying the promotion code in the DLL, and I notice that some of the complexity is down to the <PromotionOverrides> tag that Afforess defined but never used.

It appears to also be totally unused in C2C.

Anyone object if I remove it?
 
I have reviewed all the changes here and merged some, modified and merged some more, and not merged some that I am pretty sure are incorrect.

Basically they fell into 3 categories:
  • Outright bugs in the combat mod stuff recently added - taken your changes in these cases - thanks for spotting these
  • Cosmetic changes to declaration of loop variables. Which idioms the compiler (with default flags) objects to depends on which version you're using - I'm betting you're using VS2008 or VS2010 rather than the VS2005 the game was developed under? (unfortunately some of the things that make VS2008/2010 happy make VS2005 unhappy and visa versa). Anyway, I have switched to a safe idiom for both compiler versions (non-warning-generating that is)
  • Changes to loop breaks that are definitely NOT correct (mostly checking for cache hits). I have omitted those from the merge (we can discuss them individually if you want to - just PM me if so)

Merged version pushed as rev 3638.

I can't use the Pm System so i answer here.
I come from C# and F# programming so C++ is new to me and the break changes might be wrong.
I compiled the DLL with the Intel C++ Compiler to see if there is some Performance improvement or not.
 
I can't use the Pm System so i answer here.
I come from C# and F# programming so C++ is new to me and the break changes might be wrong.
I compiled the DLL with the Intel C++ Compiler to see if there is some Performance improvement or not.

Ok, well you definitely found some real bugs, and eliminated some warnings on some compilers, so it was a useful exercise - thank you for taking the time.

PS - my (professional) work is pretty much all C# also, and long term I'd love to do a rewrite of everything managed if someone with the necessary graphical skills came along to be able to develop the graphical part (that would replace the Civ EXE essentially)
 
Updates

Changes to Sikhism tech:
  • Moved to Renaissance Era
  • Moved location to X45 Y9
  • Increased base cost to 2406
  • Changed prerequisites to Critical Thought AND Hinduism AND Islam
 
Update
Small change to keep savegame compatibility when a civic is removed and got rid of some compiler warnings in CvGameTextMgr.
 
Update
Small change to keep savegame compatibility when a civic is removed and got rid of some compiler warnings in CvGameTextMgr.

1. I don't think removing civics was causing an issue in the first place, we've been playing old games fine since CivPlayer8's civics were added.

2. Cool, thanks for fixing those. What were they anyways?
 
2. Cool, thanks for fixing those. What were they anyways?
Just a complaint by the compiler that two local variables with the same name were defined, one of them in a for statement. It is bad style but the code was ok as the scope of the variable in the for loop statement was restricted to that for loop.
But some older compilers considered the for loop variable valid even after the for loop which changes the behavior (well, not really the way it was in that function) so they left a warning in there.
 
Back
Top Bottom