A New Dawn Beta Builds

I didn't say that. I said that you don't feel emotions the same way everyone else does. I didn't say that you don't have emotions. Don't put words in my mouth.



Eh, not initialing variables usually doesn't cause errors, because the compiler will warn me if I try to use an uninitialized variable. Any help debugging would be nice though. I think the real reason that debug builds don't crash is because the debug builds use /Gd in the makefile, and final release uses a quicker but less safe, /Gr.



There are some people trying to get Rapture and some religion mods off the ground on the RoM forum, I would go there. Rapture is an unfinished product at the moment, I won't add it unless it gets closer to being finished.



Sometimes saves get corrupted. If you are trying to debug a save that won't load, you're wasting your time.



Eh, not really.



Everything on larger maps is slower, I don't consider that a bug.



The value of uiFlag shouldn't be very big, it is only used to keep save compatibility between patches, I haven't messed with. I suspect you are trying to load a save that won't open, probably because you've added new content to the game. Start a new game.



I am not going to add the Unit Fuel mod. The AI don't know how to use it. I do want to have to write that AI code.
Sorry :sad:
The Beta 3 build does seem to be a touch unstable. 230 turns into a Large/Normal archipelago game, I can't seem to reload a save in-game without it CTDing and I've had two or three random crashes as well.
I have that too in the latest non-beta
................ I know why you said that's waste of time. Does Firaxis encrypt the save by hiding the position of file pointer? If it's true, I surrender. -_-

Well, maybe I can find the solution in my dream, god bless me.

we can only hope Firaxis releases the exe
 
StrategyOnly, I think that it is your computer, not AND. I do not get CTD's very often, so I suspect either your graphics card or your computer in general is very old. Not my fault.
Honestly, i've played 3 games with the last beta, for about 500 turns, and got no CTD at all.
 
Some feedback after a little progress into my 2.81 + 1.60b3 game.

1) Thanks for the "Recommended Install" method. That makes it so much easier to coordinate installs for network games between friends. I used to mainly just include the new game mechanics and AI improvements but now play with your recommended building mods too.

2) Liking the trickier levels of health now. Playing this game on Monarch and I can just about drive the health along with my growth. Seems well balanced for the early stages of the game.

3) Suggest that the Storage Pit be altered to either only store 10% or 15% food from growth rather than 20% or to become obsolete quicker. It costs a fraction of a Granary and provides 2/3 of the benefit. Surely there should be a bigger difference between a granary and a hole in the ground? I'd fire the granary designer and dig a slightly larger hole in the ground!

4) Thank you for adding the No Generals option. I found though, that selecting the option had no effect at all in my Custom Game.

5) Move the National Mint national wonder to be listed against Banking. No point in teasing us with it in the Ancient Era when it requires 8 banks!

6) I think Town Watchmen are great, but they should have a reduction in strength outside of cities. As it is, they make superb stack defenders even in enemy territory. Please consider giving them something like -40% strength and +80% city defence.

7) If you are feeling more ambitious with Town Watchman, consider making Town Watchman a promotion rather than a unit and make that promotion available to a unit class or two so that any suitable melee / ranged / gunpowder unit can play the role.
 
6) I think Town Watchmen are great, but they should have a reduction in strength outside of cities. As it is, they make superb stack defenders even in enemy territory. Please consider giving them something like -40% strength and +80% city defence.

7) If you are feeling more ambitious with Town Watchman, consider making Town Watchman a promotion rather than a unit and make that promotion available to a unit class or two so that any suitable melee / ranged / gunpowder unit can play the role.

I like these ideas and concur with them wholeheartedly! :)
 
Yes, my source code is available on request, for beta builds. Here's a copy.

Thank you for sharing it. It took a day to figure out how to use gflags to debug the corrupted process heap - the CTD at loading was just a side effect. The bug itself is a buffer underrun at each end of turn in CvPlayerAI.cpp at line 20948:

Code:
for (iI = 0; iI < GC.getNumUnitClassInfos(); iI++)
	{
		if (m_aiUnitClassWeights[iI] > 0)
		{
			UnitTypes eUnit = (UnitTypes)GC.getUnitClassInfo((UnitClassTypes)iI).getDefaultUnitIndex();
->			m_aiUnitCombatWeights[GC.getUnitInfo(eUnit).getUnitCombatType()] += m_aiUnitClassWeights[iI];
		}
	}

Looks like the CombatType member is -1 (NO_UNITCOMBAT) for units where it was not defined in the .xmls, for example RoM's UNIT_TRADE_CARAVAN, but they still manage to have a positive m_aiUnitCombatWeights ("can only defend"?) Anyway, that piece of code modifies the vector at -1 in those cases. Changed it to

Code:
			UnitTypes eUnit = (UnitTypes)GC.getUnitClassInfo((UnitClassTypes)iI).getDefaultUnitIndex();
			int ctype = GC.getUnitInfo(eUnit).getUnitCombatType();
			if (ctype >= 0 && ctype < GC.getNumUnitCombatInfos())
				m_aiUnitCombatWeights[ctype] += m_aiUnitClassWeights[iI];

and now loading/saving looks rock solid from the game. It is truly a nasty one as it is just a single int length underrun. It can cause silent corruption in other places, as well as CTDs at end of turns.

While browsing through the code, I found another bug at CvInfos.cpp, line 6963:

Code:
for ( int iCivic = 0; i < GC.getNumCivicInfos(); iCivic++)

I believe it should be obviously

Code:
for ( int iCivic = 0; iCivic < GC.getNumCivicInfos(); iCivic++)

although it was not creating problems I am aware of.

The debugger also kept complaining about GC's getCommerceInfo(...) usage at the start, as a python call tries to get the first element of the empty array. I evaluates correctly to 0 (fortunately == NULL) in the caller, but it is quite a dangerous practice, so I would put into CyGlobalContext.cpp, line 170 the following:

Code:
if (GC.getCommerceInfo().size() == 0) return NULL;

Thats it for now. I will come back if I crash again ;)
 
Thank you for sharing it. It took a day to figure out how to use gflags to debug the corrupted process heap - the CTD at loading was just a side effect. The bug itself is a buffer underrun at each end of turn in CvPlayerAI.cpp at line 20948:

Code:
for (iI = 0; iI < GC.getNumUnitClassInfos(); iI++)
    {
        if (m_aiUnitClassWeights[iI] > 0)
        {
            UnitTypes eUnit = (UnitTypes)GC.getUnitClassInfo((UnitClassTypes)iI).getDefaultUnitIndex();
->            m_aiUnitCombatWeights[GC.getUnitInfo(eUnit).getUnitCombatType()] += m_aiUnitClassWeights[iI];
        }
    }
Looks like the CombatType member is -1 (NO_UNITCOMBAT) for units where it was not defined in the .xmls, for example RoM's UNIT_TRADE_CARAVAN, but they still manage to have a positive m_aiUnitCombatWeights ("can only defend"?) Anyway, that piece of code modifies the vector at -1 in those cases. Changed it to

Code:
            UnitTypes eUnit = (UnitTypes)GC.getUnitClassInfo((UnitClassTypes)iI).getDefaultUnitIndex();
            int ctype = GC.getUnitInfo(eUnit).getUnitCombatType();
            if (ctype >= 0 && ctype < GC.getNumUnitCombatInfos())
                m_aiUnitCombatWeights[ctype] += m_aiUnitClassWeights[iI];
and now loading/saving looks rock solid from the game. It is truly a nasty one as it is just a single int length underrun. It can cause silent corruption in other places, as well as CTDs at end of turns.

While browsing through the code, I found another bug at CvInfos.cpp, line 6963:

Code:
for ( int iCivic = 0; i < GC.getNumCivicInfos(); iCivic++)
I believe it should be obviously

Code:
for ( int iCivic = 0; iCivic < GC.getNumCivicInfos(); iCivic++)
although it was not creating problems I am aware of.

The debugger also kept complaining about GC's getCommerceInfo(...) usage at the start, as a python call tries to get the first element of the empty array. I evaluates correctly to 0 (fortunately == NULL) in the caller, but it is quite a dangerous practice, so I would put into CyGlobalContext.cpp, line 170 the following:

Code:
if (GC.getCommerceInfo().size() == 0) return NULL;
Thats it for now. I will come back if I crash again ;)

Incredible! As I am only an amatuer, with my knowledge of C categorized as "Dangerous", I missed all of those (as Did Firaxis.)

Any chance of you helping in the future? CFC only has 3-4 real professional programmers who mod, the rest of use just learn from practice (myself included).

Oh, and I'm crediting you for those fixes, I believe the CvInfos bug is part RevDCM (I need to contact them about that, that bug will ruin Modular loading with that XML tag.) As for the other fixes, could you submit it to the Unofficial Patch as well, so other Mods get the benefit of that fix too?
 
Honestly, i've played 3 games with the last beta, for about 500 turns, and got no CTD at all.

Glad to hear I'm not 100% crazy.

Some feedback after a little progress into my 2.81 + 1.60b3 game.

1) Thanks for the "Recommended Install" method. That makes it so much easier to coordinate installs for network games between friends. I used to mainly just include the new game mechanics and AI improvements but now play with your recommended building mods too.
Yeah NP, I figured the Custom List was getting a bit too long for regular users.

2) Liking the trickier levels of health now. Playing this game on Monarch and I can just about drive the health along with my growth. Seems well balanced for the early stages of the game.

3) Suggest that the Storage Pit be altered to either only store 10% or 15% food from growth rather than 20% or to become obsolete quicker. It costs a fraction of a Granary and provides 2/3 of the benefit. Surely there should be a bigger difference between a granary and a hole in the ground? I'd fire the granary designer and dig a slightly larger hole in the ground!

I noticed this in my games as well. I plan on increasing the cost a bit, and causing it to have some unhealthiness (your food may rot in a pit).

4) Thank you for adding the No Generals option. I found though, that selecting the option had no effect at all in my Custom Game.

Hmm, Really? I need to test that out more.


5) Move the National Mint national wonder to be listed against Banking. No point in teasing us with it in the Ancient Era when it requires 8 banks!

Lol, yeah, I need to correct that.

6) I think Town Watchmen are great, but they should have a reduction in strength outside of cities. As it is, they make superb stack defenders even in enemy territory. Please consider giving them something like -40% strength and +80% city defence.

7) If you are feeling more ambitious with Town Watchman, consider making Town Watchman a promotion rather than a unit and make that promotion available to a unit class or two so that any suitable melee / ranged / gunpowder unit can play the role.

City Defense Promotions fill that void in #7 fairly well, but I will take your #6 changes under consideration.
 
If takbal just found something that can lead to that failure to load savegame issue, and fixed it, then that is excellent news indeed.

:woohoo:
 
playing 2.81 + beta 3.

I see one problem with flexible difficulty:

The human player seems to be very strong in the opening phase but after a short time
the difficulty level rises too fast up so you stay among the top 20% for a very long time.

also if you are descending to the average and loose cities etc. your enemies will stay crazy
overpowered... though you don´t reach the least 20% because with Revolutions on there
will be always plenty of civs who are much worse than you...

my suggestion would be:

top 20%: increase +1

not top 20%: decrease -1 until "prince" or "noble"

last 20%: decrease -1 to the beginner levels

(maybe 40 rounds or even more should be by far enough to calculate)

I love this option but with snail it gets balls to the wall... :)

oh and I had one ctd in 550 turns (snail)!

regards
 
playing 2.81 + beta 3.
top 20%: increase +1

not top 20%: decrease -1 until "prince" or "noble"

last 20%: decrease -1 to the beginner levels
I second this suggestion. In the middle, pick the level where the AI don't get advantages. Don't remember which one it is.

Also, the middle could perhaps be 21-50% instead of 21-79%
 
Thank you for sharing it. It took a day to figure out how to use gflags to debug the corrupted process heap - the CTD at loading was just a side effect. The bug itself is a buffer underrun at each end of turn in CvPlayerAI.cpp at line 20948:

Code:
for (iI = 0; iI < GC.getNumUnitClassInfos(); iI++)
	{
		if (m_aiUnitClassWeights[iI] > 0)
		{
			UnitTypes eUnit = (UnitTypes)GC.getUnitClassInfo((UnitClassTypes)iI).getDefaultUnitIndex();
->			m_aiUnitCombatWeights[GC.getUnitInfo(eUnit).getUnitCombatType()] += m_aiUnitClassWeights[iI];
		}
	}

Looks like the CombatType member is -1 (NO_UNITCOMBAT) for units where it was not defined in the .xmls, for example RoM's UNIT_TRADE_CARAVAN, but they still manage to have a positive m_aiUnitCombatWeights ("can only defend"?) Anyway, that piece of code modifies the vector at -1 in those cases. Changed it to

Code:
			UnitTypes eUnit = (UnitTypes)GC.getUnitClassInfo((UnitClassTypes)iI).getDefaultUnitIndex();
			int ctype = GC.getUnitInfo(eUnit).getUnitCombatType();
			if (ctype >= 0 && ctype < GC.getNumUnitCombatInfos())
				m_aiUnitCombatWeights[ctype] += m_aiUnitClassWeights[iI];

and now loading/saving looks rock solid from the game. It is truly a nasty one as it is just a single int length underrun. It can cause silent corruption in other places, as well as CTDs at end of turns.

While browsing through the code, I found another bug at CvInfos.cpp, line 6963:

Code:
for ( int iCivic = 0; i < GC.getNumCivicInfos(); iCivic++)

I believe it should be obviously

Code:
for ( int iCivic = 0; iCivic < GC.getNumCivicInfos(); iCivic++)

although it was not creating problems I am aware of.

The debugger also kept complaining about GC's getCommerceInfo(...) usage at the start, as a python call tries to get the first element of the empty array. I evaluates correctly to 0 (fortunately == NULL) in the caller, but it is quite a dangerous practice, so I would put into CyGlobalContext.cpp, line 170 the following:

Code:
if (GC.getCommerceInfo().size() == 0) return NULL;

Thats it for now. I will come back if I crash again ;)

Great work! Thank you! Did you have a save that make heap corrupted? Or otherwise you started a new game and that happened in the rounds of begining? I just want to learn how did you find the underflow.
 
Few comments from playing 1.6 beta 3/RoM 2.81:

1. So far it seems to be more stable than previous versions of AND. I personally feel that some of the reported crashes have sth to do with the PC hardware..... since I find RoM and AND as really challenging for PC. Great work on removing CTDs!

2. Surprisingly, I got a lot of GG in my game..... Till 1 AD i received....11 GG (just from fighting barbs) Barbarian city of Cherokee got 4 (four!) GG in one turn (no screen though). I have to admit that this might have sth to do with the changes I introduced by myself. Before strarting a game I made some changes in XP points limits you can get from fighting animals and barbs. Then I noticed that barbarian generals option is in the game so I don't know now, if I messed up or not... Anyway, the way it works in my game is just crazy!

3. I complained about barbarian activity in this thread:
http://forums.civfanatics.com/showthread.php?t=348588
So I can say I'm satisfied now :) even though I didn't turn the raging barbs option on. In my game they seem to flow in waves and they can really make you busy with only short breaks. I rushed for Great Wall and now I can only see the hords wandering around my borders. On one hand my units got a lot of experience (positive feeling) but I lost couple of them in ridiculous 95+ combats :mad:

4. Civics still need tweaking. I don't know, maybe it just my conformity but monarchy/republic, free church (I like Shwedagon Paya very much :) the sooner the better), bourgeois and patrician (do people realize, how strong these two are??) is my only choice.

5. I'm not sure, but I got the feeling that productivity (nice increase) and food production (reasonable decrease) has been tweaked in a very good way. Is that true?

6. I don't know why is it so, but the power of civilizations in RoM/AND has nothing to do with reality. I just look on my list (10 civs) and I see Babylonian and Aztec on top, and Germans and French on the bottom :lol: By the way, I see Franco and Richelieu (I really appreciate graphic work, however he is a little bit odd :)) - forgive my incompetence, but have you incorporated new leaders to 1.6? Or I just had no luck to meet these guys before?

7. I made a small experiment, and changed the value of GP appering (reduce to 50) and now it seems that bulbing a tech by a GP is worth doing it again. However, I can totally understand possible opinion that I went much too far :D
 
4. Civics still need tweaking. I don't know, maybe it just my conformity but monarchy/republic, free church (I like Shwedagon Paya very much :) the sooner the better), bourgeois and patrician (do people realize, how strong these two are??) is my only choice.

I used Free Church and Caste till the end of the game, the former for the religion power, which not decreases over time and techs, and the latter for the amazing food bonus. IMO, they need tweaking too.
 
Any chance of you helping in the future? CFC only has 3-4 real professional programmers who mod, the rest of use just learn from practice (myself included).

I was just fortunate enough to have a CTD which I could reproduce, then the tools traced it down... ;) The second one was just pure luck.

I am not a pro at all, at least I am not earning my money purely by C++ coding, although it is part of my work. I think I am unable to contribute to projects regularly, but if I am going to have other CTDs while playing, I will try to debug them.
 
I used Free Church and Caste till the end of the game, the former for the religion power, which not decreases over time and techs, and the latter for the amazing food bonus. IMO, they need tweaking too.

I don't like Caste (I like :gold:, of course I can get it from food ----> specialist as well, but commerce means science) but lately I also use Free Church till the end of the game. Before, I used to switch for secular, but the happiness bonus from religions is lame, since there are so many other ways of making citizens happy.
 
To Afforess:

Could you give the read-only SVN accounts of your project to me and other guys who can debug the code by VC? It will help us tracing down the bugs and reporting them. Eh, Did you establish the SVN depository yet?

That's all OK if you would not, to modify and update the source termly by one person also is a good solution.
 
If takbal just found something that can lead to that failure to load savegame issue, and fixed it, then that is excellent news indeed.
:woohoo:

Probably you can try it yourself. I have attached a copy of the dll which has this bug fixed. Probably it will not help with saves already corrupted, but in-game loading should be better.
 

Attachments

  • CvGameCoreDLL_fix_load.rar
    1.1 MB · Views: 51
playing 2.81 + beta 3.

I see one problem with flexible difficulty:

The human player seems to be very strong in the opening phase but after a short time
the difficulty level rises too fast up so you stay among the top 20% for a very long time.

also if you are descending to the average and loose cities etc. your enemies will stay crazy
overpowered... though you don´t reach the least 20% because with Revolutions on there
will be always plenty of civs who are much worse than you...

my suggestion would be:

top 20%: increase +1

not top 20%: decrease -1 until "prince" or "noble"

last 20%: decrease -1 to the beginner levels

(maybe 40 rounds or even more should be by far enough to calculate)

I love this option but with snail it gets balls to the wall... :)

oh and I had one ctd in 550 turns (snail)!

regards

I haven't played the new beta yet, but also saw this and was intrigued. In all honesty, I would like to see the flexible difficulty work this way (or maybe create it as another option).

You move up as prescribed, but you cannot move below your original starting difficulty. I usually start at their Emperor or Immortal, and like the fact that I really struggle in the beginning game. I would hate to drop down to something like prince then have several hundred turns before getting back to something more difficult.

since I haven't tried it in real life, I should probably wait until I have the experience first hand :)

Afforess -- excellent mod -- I cannot tell you how much I have enjoyed playing AND. Finished my latest game on Immortal with a very lucky scientific victory beating out a spaceship by about 5 turns.
 
Probably you can try it yourself. I have attached a copy of the dll which has this bug fixed. Probably it will not help with saves already corrupted, but in-game loading should be better.

I'm already trying it by my own build dll that applied your fixed code. Yes, it not help with all my corrupted saves. And if there is any other bug that overflows the heap at each turn like you said, it will be hardly to trace down except I reload save for each turn or get a CTD fortunately.
 
Great work! Thank you! Did you have a save that make heap corrupted? Or otherwise you started a new game and that happened in the rounds of begining? I just want to learn how did you find the underflow.

I had a save where ending a turn and loading the save again was reliably crashing the game. The debugger told exactly that it is a heap corruption, then all I did was googling on how to use the appverifier/gflags tool to trace bugs like this down. These are really ugly ones, as the CTD used to happen very far from the faulty code. The tools place a protected area before or after the allocated memory, so when the bug tries to overwrite these, it is causing an immediate fault so you can catch it. Typically these are the errors which make the debug work, but crash the release (a harmless overwrite may become deadly within the more compact release version).
 
Top Bottom