AND2 and SVN Bug Reports - A New Dawn 2 ONLY

Out of curiosity I switched to a civ with power plants already, and tried the recalc command. It does in fact add up employed citizens, and selling the plant doesn't free them back.
But so far I never had problems with income when conquering cities, so as long as recalcs are done before power plants are built (i.e. changing versions) things should be fine.

P.S. Thanks 45° for the chipotle!
Ma sei di Trieste?

Update 2: Well this is interesting, now my cavalries are produced as they should, with the correct xp. Only thing that comes to mind is that in the meantime I built the Red Cross in the same city, maybe that new free promotion somehow fixed things?
 
45°38'N-13°47'E;12322719 said:
@urtho: I see 2 problems here;
  • recalc shouldn't be used as you do, it should be used only when you switch between different revisions; that doesn't solve the problem, and recalc should surely be revised. This is why I keep saying that there's something wrong in maxcomp saves; to tell the truth the problem is probaby in recalc (which again should be used only if you switch between different revisions). I'll have to look deeper into this matter.
  • the other problem is the reason why you're recalculating: I've never had such huge imbalance when capturing a city, so there must be something there too.

As a temporary solution, I might re-enable normal saves so that people can use maxcomp saves only when needed switching from one revision to another.

@Noyyau: IIRC there's a way to change civ using ctrl+alt+l but I think you have to enable cheats in civilization.ini by changing the cheat code from 0 to "chipotle". Then ctrl+alt+l should work. At least I think so.

@45,
I would PM koshling 1st before you re enable normal saves. I doubt that Max Compat is the problem. Re-Calc takes more than 1 turn to get everything up to speed from the base New modifiers a new Revision introduces. And if ppl are doing Re-calcs at a whim then they are not even reading the pop-up that it generates.

JosEPh
 
45°38'N-13°47'E;12322719 said:
recalc shouldn't be used as you do, it should be used only when you switch between different revisions; that doesn't solve the problem, and recalc should surely be revised. This is why I keep saying that there's something wrong in maxcomp saves; to tell the truth the problem is probaby in recalc (which again should be used only if you switch between different revisions). I'll have to look deeper into this matter.

Well I don't do it for no good reason or just because I feel like doing it at some random moment, I do a recalc as it's the only way I know of as the player to fix my economy when it's broken by controlling a new city. Try it out in the save I posted, declare war on someone and take over a city of theirs or even found a new city somewhere on the map. The economy will immediately go into the tank, and if you don't recalc you will go broke very quickly if you take no action and don't adjust your sliders as it will keep getting worse with each sucessive action that triggers the bug. It's a clear error somewhere in the economy numbers, I just don't know where to tell you to find it.

Here, I'm feeling generous so I'll do it for you - I loaded up the save I posted and ran a few turns doing exactly as I've outlined above. Have some more screenshots:

Game load screen of the save I posted (right away it's lying as it's asking to recalc for NO reason, nothing has changed at all - no edits to xml or anything else for that matter - no changes, nothing yet it thinks it needs to recalc for some reason):

Civ4ScreenShot0279.jpg

Gold per turn = + 11,964

I do NOT choose to recalc, just ignore it for the time being. Select Pioneer unit from the near my unit rally point in the center of my empire, send north to a colonizable tile near 2 of my northern cities, advance 1 turn and found city on next turn, screenshot:

Civ4ScreenShot0280.JPG

Gold per turn = - 7,509

So what is the change in gold per turn in my massive economy due to this minor little city being added to the rolls over the course of 1 turn in my Transhuman era empire with 53 (now 54) cities?

Change in Gold per turn = - 19,473

Note also that the numbers don't add up when it comes to totals either, in terms of what is in my treasury vs what you'd expect it to be. Is the interface outright lying to me as the player? It's either that or there's a major glitch in the economy calculations somewhere. As I've said before, I don't *want* to recalc, I have to or the game is broken and unplayable for me.

Even before this bug showed up I noticed things happening here where the numbers on reloading a save always seemed off to me. As in "that wasn't what I remember my gold/turn value being when I saved and quit last night" type of thing. And why does the game ask me to recalc on game load every single time as you can see in the screenshot? It does it for me everytime I load savegame. I don't change anything mid-game regarding xml yet it always asks me to recalc at game load saying things have changed, probably leading to more errors and bugs. Why??? This mod just puzzles me with strangeness more and more...

the other problem is the reason why you're recalculating: I've never had such huge imbalance when capturing a city, so there must be something there too.

It happens EVERY SINGLE TIME for me in this game. I'm just a mod user, I don't know where the problem is but it happens for me each and every time I gain control of a new city once I pass a certain threshold, usually in the 35-40 city range in the later eras. Perhaps related to the "employed" bug, perhaps not I can't say really as I don't know the inner workings of the code for this mod.

And if ppl are doing Re-calcs at a whim then they are not even reading the pop-up that it generates.

Ah another pearl of wisdom from Joseph. I really should just learn to ignore you altogether, would do my blood pressure wonders...

I don't do them at a whim, I know exactly what they're for and why you're supposed to do them or not. I do them as often as I do as it's the only way I know of to fix what appears to be a major f\/cking bug related to the economy and controlling new cities in this mod that apparently no one else experiences. I'm just lucky that way I guess, go me.

But please, brush off and ignore my concerns and this bug report here, I'm sure they mean nothing to you. I'm obviously just being delusional and imagining that this is happening in my game, I just spent close to an hour typing up a detailed bug report of my experiences in my original post, what I did to try and fix the problem, possible solutions or areas to look at for a fix and then organizing screenshots and uploading them as well as a savegame all for the sole reason that I could waste my time and yours. Oh and this post with more testing and screenshots? Yup, I just enjoy wasting my time and yours posting about non-issues that are make believe fantasy land problems.

I'll just go sit in the corner with a dunce hat on and allow you to revel in your superiority. Forget about my post, I'm sure it's nothing, WAD or user error and all that right oh all knowing one?
 
Out of curiosity I switched to a civ with power plants already, and tried the recalc command. It does in fact add up employed citizens, and selling the plant doesn't free them back.
But so far I never had problems with income when conquering cities, so as long as recalcs are done before power plants are built (i.e. changing versions) things should be fine.

Thank you for the test :)

P.S. Thanks 45° for the chipotle!
Ma sei di Trieste?

;)
Tu di dove sei (anche in privato, se preferisci)? :)

Update 2: Well this is interesting, now my cavalries are produced as they should, with the correct xp. Only thing that comes to mind is that in the meantime I built the Red Cross in the same city, maybe that new free promotion somehow fixed things?

Well, it shouldn't. I see no reason why a new free promotion should unlock the previous problem. I still have to test your save, I'll let you know.
 
@45,
I would PM koshling 1st before you re enable normal saves. I doubt that Max Compat is the problem. Re-Calc takes more than 1 turn to get everything up to speed from the base New modifiers a new Revision introduces. And if ppl are doing Re-calcs at a whim then they are not even reading the pop-up that it generates.

JosEPh

Don't worry, I'll check C2C revisions to see if the code has been changed in comparison with AND2 code. If the problem lies there, it will probably already be fixed in C2C. Then I'll PM Koshling if I can't find a solution myself. :)
 
(right away it's lying as it's asking to recalc for NO reason, nothing has changed at all - no edits to xml or anything else for that matter - no changes, nothing yet it thinks it needs to recalc for some reason):

I'll start with this one as it could be the main reason for all other problems.
You said you started having problems with imbalance when conquering/founding a city starting from modern times? Or did it happen in middle ages or earlier stages of the game?
Keeping to recalc to solve the gold imbalance problem isn't surely the way recalc is meant to be used, but thank you for reporting that because that way you discovered the employed people problem. Now, I'll try and find a solution for both the employed people problem (which shouldn't happen anyway, no matter how someone wants to use recalc) and the gold imbalance problem. I still have to test your save, I'll let you know how it goes.

One more thing, and this is to all of you: please, keep calm, it's a game guys. ;)
 
45°38'N-13°47'E;12323928 said:
You said you started having problems with imbalance when conquering/founding a city starting from modern times? Or did it happen in middle ages or earlier stages of the game?

I can't say with 100% certainty that it didn't happen earlier than late Industrial / Modern era in this game, but I certainly never noticed it happening before then as that's when it really started to present itself as a problem. It's only come up once I get into an advanced state in the game where I'm stable empire-wise and building out my cities and looking for weak targets and I usually leave that to the mid to late game as I'm usually not into a rush strategy with getting into early wars in this game.

When I got to 35 - 40 cities and was building items like Factories is when I noticed this issue. Could it have happened earlier and I didn't notice? Possibly but I don't think so. Where I've mentioned is probably the first place I'd look for any problems. Related to the employed issue directly? I can't say, but that is when the buildings that use that mechanic become available so perhaps there is a connection buried somewhere in the code.

Keeping to recalc to solve the gold imbalance problem isn't surely the way recalc is meant to be used, but thank you for reporting that because that way you discovered the employed people problem. Now, I'll try and find a solution for both the employed people problem (which shouldn't happen anyway, no matter how someone wants to use recalc) and the gold imbalance problem. I still have to test your save, I'll let you know how it goes.

That's all I ask, as I would like to see the issue solved as it has ruined what was a pretty good game I had going. Having the AI civs just up and die once they get power plants built due to me using recalc to fix another bug is just a real sad state of affairs and one that shouldn't happen. Hopefully you (and others) can reproduce what I'm seeing from the save as it's rather maddening to think that this is a glitch only in my specific copy of the mod. That should be impossible as aside from a few very minor xml tweaks to my copy (GG rates are still too slow imo) it's strait up a copy of the 620 SVN release.

One more thing, and this is to all of you: please, keep calm, it's a game guys. ;)

Oh I know this of course - I wouldn't be posting if I didn't know that and want to make the game better for myself and others. I'm generally a very calm person, Joseph just has a very dismissive posting style that I don't care for really and I tend to remark on it when it catches me the wrong way. I'll try to ignore him in the future when he goes on one of this little superior tirades, but we shall see. We're all human.
 
@urtho: ok, I've done a quick test with your save. It's definetly a problem with city maintenance. Looking at your economy advisor, you can see city maintenance going crazy each time your number of cities is changing. This should at least narrow a bit the problem. About the employed people problem, I've done a couple of recalc but I haven't been able to reproduce it; but I could be able to fix it as I've seen that this problem happened in C2C too a long time ago and it was fixed (hopefully). So I'll try by importing the code from C2C to see if it works. But I fear it won't restore the employed people to their correct status in your game, it will only stop it from happening again. I'll do some more testing and then I'll post an update.
Strange anyway how nobody (not even me!) had this problem with city maintenance.
 
I've had similiar issues with this as well that Urtho pointed out - honestly I was just too lazy to post about it...and I am not well versed enough in the technicalities of game to write intelligently about the problem. Last game I was playing I went from +200 in gold each turn to -1900 in gold after capturing a city.
 
45°38'N-13°47'E;12324186 said:
@urtho: ok, I've done a quick test with your save. It's definetly a problem with city maintenance. Looking at your economy advisor, you can see city maintenance going crazy each time your number of cities is changing. This should at least narrow a bit the problem. About the employed people problem, I've done a couple of recalc but I haven't been able to reproduce it; but I could be able to fix it as I've seen that this problem happened in C2C too a long time ago and it was fixed (hopefully). So I'll try by importing the code from C2C to see if it works. But I fear it won't restore the employed people to their correct status in your game, it will only stop it from happening again. I'll do some more testing and then I'll post an update.
Strange anyway how nobody (not even me!) had this problem with city maintenance.

Ah I'm very happy to see you say this. So I'm not going insane here and imagining things as there is a confirmed problem in the calculations for the mod - yay for not being insane at least. :)

For the economy advisor thing - I'm kicking myself as I knew that the problem showed up there but I'm not sure if I posted screenshots of those screens pre and post turns where the bug showed up. I know I mentioned that this happens on the F2 screen for city maintanence in an older post and I still have the screens and can post them if you want, but as long as you've seen that it happens on that advisor screen than perhaps that is enough. Should have posted them for sure if I didn't as it would have shown the problem very quickly, ah well. Thanks a lot for looking into this and for the future fix.

As for my save game, eh it happens so I'm not too upset - this is a mod still being worked on in development, as long as you've seen there is a problem and can try and fix it in a future release so everyone else benefits than losing out on a good game I had going, while annoying, is but merely a minor issue in the grand scheme of things. I'm just really shocked neither you or anyone else have seen this before now, just my luck to get hit by this I guess. I've been modding games on an end user and maker basis for a long time now so I know things can happen, just glad you've found that there's an issue and can hopefully solve it.

Think I'll just be using the save as an overview of the late techs and wonders and projects as I've never gotten this far with the mod. Lots of interesting stuff in the late Modern / Transhuman eras, almost worth starting a game off there to play it fresh heh. Again, thanks for your time looking into this situation.

Edit:

I've had similiar issues with this as well that Urtho pointed out - honestly I was just too lazy to post about it...and I am not well versed enough in the technicalities of game to write intelligently about the problem. Last game I was playing I went from +200 in gold each turn to -1900 in gold after capturing a city.

Ah another wanderer emerges! Even though you didn't post before now, I'm glad you have now. Good to see I wasn't the only one seeing this happen. Thanks Jacks!
 
I too have seen this. The bug has been around for at least a year. I never reported it because I couldn't reliably reproduce it and I was never sure if it wasn't being caused by my own personal modifications.
 
urtho wrote:Oh I know this of course - I wouldn't be posting if I didn't know that and want to make the game better for myself and others. I'm generally a very calm person, Joseph just has a very dismissive posting style that I don't care for really and I tend to remark on it when it catches me the wrong way. I'll try to ignore him in the future when he goes on one of this little superior tirades, but we shall see. We're all human.

@urtho,
Just put me on your ignore list and you'll never have to see another post by me. We didn't get off on a good footing with each other and I find you abrasive most of the time too. So just put me on your ignore list.

Have a good day and Be Blessed.

JosEPh
 
45°38'N-13°47'E;12324186 said:
@urtho: ok, I've done a quick test with your save. It's definetly a problem with city maintenance. Looking at your economy advisor, you can see city maintenance going crazy each time your number of cities is changing. This should at least narrow a bit the problem. About the employed people problem, I've done a couple of recalc but I haven't been able to reproduce it; but I could be able to fix it as I've seen that this problem happened in C2C too a long time ago and it was fixed (hopefully). So I'll try by importing the code from C2C to see if it works. But I fear it won't restore the employed people to their correct status in your game, it will only stop it from happening again.
Check if this line is present in CvCity::clearModifierTotals:
m_iNumPopulationEmployed = 0;

Otherwise every recalc will just add to the old value as it processes the buildings.
But if that line is there it should work properly (and also restore the falsely employed people to unemployed state).
 
Check if this line is present in CvCity::clearModifierTotals:
m_iNumPopulationEmployed = 0;

Otherwise every recalc will just add to the old value as it processes the buildings.
But if that line is there it should work properly (and also restore the falsely employed people to unemployed state).

Thank you AIAndy, I've already done that; that line was missing and I've seen it by comparison to C2C code (rev1959 fixed by Koshling). And yes, for urtho's joy employed people are correctly restored to their unemployed state if needed.

I'm now trying to fix the maintenance cost code because that was wrong too as I said above. I'm searching through different C2C revisions; I've almost fixed it, it looks like it's working now but every time I change view from main screen to any advisor or to the city screen, gold/research/culture change... but they get right again when I change +/- on the research/culture sliders.
It's a nightmare, a lot has been changed and there are a lot of files involved :crazyeye: I've seen many changes have been compiled by you, so thank you for fixing that, I'll certainly use your code; now, if only I can follow the right path through various cpp and h files, I think I can fix maintenance for AND2 too. :)
 
I'm currently experiencing random CTDs. I've attached the MiniDump, are there any log files I can provide?

SVN version is 624.


// Edit
It seems to always happen now if I zoom out to the cloud view, but I *think* these weren't the only occasions before.

// Edit 2
C2C doesn't crash when zooming out.

// Edit 3
Yep, crashing also when just scrolling around the map. Graphic settings all to lowest.
 

Attachments

I'm currently experiencing random CTDs. I've attached the MiniDump, are there any log files I can provide?

SVN version is 624.


// Edit
It seems to always happen now if I zoom out to the cloud view, but I *think* these weren't the only occasions before.

// Edit 2
C2C doesn't crash when zooming out.

// Edit 3
Yep, crashing also when just scrolling around the map. Graphic settings all to lowest.

Crashing when zooming out to map only occurs for me on very large maps with a high percent of terrain revealed. I figured this was a hard size limit in civ4s ability to produce the cloud view image but if C2C doesn't crash it makes me sad I didn't report before. Lost many a turn by accidentally spinning the scroll wheel 1 click to far.
 
Crashing when zooming out to map only occurs for me on very large maps with a high percent of terrain revealed. I figured this was a hard size limit in civ4s ability to produce the cloud view image but if C2C doesn't crash it makes me sad I didn't report before. Lost many a turn by accidentally spinning the scroll wheel 1 click to far.

I'm well aware of this bug and I also heard that it was at least partially solved in C2C; but IIRC the solution was to simply disable the display of some building, which can already be done in AND2 after I've imported part of the C2C code some months ago. It's just an xml change inside A_New_Dawn_GlobalDefines.xml (in xml folder). Simply change

<DefineName>SHOW_BUILDINGS_LEVEL</DefineName>

from 3 to something else (1 or 2 should be good). Not every building will be displayed on the map, but you should not have these reported CTDs. I still have to check if other changes have been made to C2C code to solve these CTD that happen when you click around the minimap or zoom out, but I think this was at least a temporary solution.

I'm still working on urtho's bug, it was a nasty one and it's been a hell of a work importing the code from C2C because the bug was corrected through almost 1500 revisions od C2C. The good news is that it will probably work very good, the bad news (for urtho's game) is that the correct income in his game is much lower than it was (or better, total expenses are much higher): and that's because as it's possible to see in the financial advisor there's a huge negative city maintenance which should of course be positive (something like -17000 gold which turns to +200 gold of expenses). So a bit of rebalancing will be needed probably.
 
45°38'N-13°47'E;12331437 said:
I'm well aware of this bug and I also heard that it was at least partially solved in C2C; but IIRC the solution was to simply disable the display of some building, which can already be done in AND2 after I've imported part of the C2C code some months ago. It's just an xml change inside A_New_Dawn_GlobalDefines.xml (in xml folder). Simply change

<DefineName>SHOW_BUILDINGS_LEVEL</DefineName>

from 3 to something else (1 or 2 should be good). Not every building will be displayed on the map, but you should not have these reported CTDs. I still have to check if other changes have been made to C2C code to solve these CTD that happen when you click around the minimap or zoom out, but I think this was at least a temporary solution.
I've changed the setting to 1, and haven't had a crash in my quick test. Going to play for a while and report back.

// Edit
Working fine!
 
On maps from Large and bigger I usually CTD if I just scroll around the map (when it's mostly explored) too much and too fast, I always figured it's due to my meager system and/or Civ's 2GB RAM limit.
 
On maps from Large and bigger I usually CTD if I just scroll around the map (when it's mostly explored) too much and too fast, I always figured it's due to my meager system and/or Civ's 2GB RAM limit.

IIRC it can be related to MAF (Memory allocation failure) but this can be solved:
http://forums.civfanatics.com/showthread.php?t=224178
I've done it and it works (of course the same procedure described here works for BTS too).
Anyway the suggestion I've given to sp00n will almost certainly work for you too. Basically as you said it's a problem of Civ4 engine limitations, but these workarounds that I've suggested usually work.
 
Back
Top Bottom