A New Dawn Beta Builds

For the last reply of mine: I updated some assets files from SVN, I have already overwritten them in my game folder.

Oh, I forgot it: I reported a bug that caused by the file Assets\Modules\MLF_CIV4ModularLoadingControls.xml, that was not wrong. I missed the differents of "Custom Buildings" and "Custom_Buildings", "Custom Units" and "Custom_Units". So that file needn't to change. The real problem is, when I finished the installing of AND with installer, the file "Assets\Modules\Custom_Units\CIV4ModularLoadingControlsSchema.xml" is missing. I don't know why, maybe something is wrong in the install script, you'd better to check on it.
 
What I did was:

  1. Updated the revision from 46 to 47
  2. Copied over new Sources folder to my separate folder of Dev folder
  3. Copy over that updated GameOptionsInfos.xml to the same place in my RoM (In updated revision, you see c++ sources and GameOptionsInfos.xml as updated)
  4. Compile a fresh Final Release of the updated sources
  5. Voila! You have the new dll. Copy it over to RoM/Assets

My save game that crashed in the "End Turns" before now runs smoothly :D. No more CTDs. Zappara makes a very strong upgrade. Harder to defeat AIs now that the units level up fast :D.
 
Yes, I updated all the new files and compiled a new DLL, then I found that the Mercenary modmod option had disappeared in the Custom Game Options.

Edited: ( The bugs listed below is caused by my old DLL, needn't to debug. )
And for More:

1. The score board is missing.
2. Sometimes the tile informations will be displayed at the bottom of the screen, and under the main panel. ( I guess that's caused by the same problem. )

I'm working on it now.
 
At revision 44 : Added new map symbol on scoreboard when players have an embassy.

Traceback (most recent call last):

File "CvScreensInterface", line 987, in forceScreenRedraw

File "CvMainInterface", line 3431, in redraw

File "CvMainInterface", line 7584, in updateScoreStrings

AttributeError: 'CyTeam' object has no attribute 'isHasEmbassy'

Afforess added the attibute 'isHasEmbassy' to the CyTeam, and it indeed exists in my local file of 'CvTeam.cpp'. Did I not compile and overwrite the new DLL after updating? Maybe....


I didn't compiled the new DLL successfully because of this:

1> del Final_Release\CvGameCoreDLL.dll Final_Release/_precompile.obj …………
1>无效开关 - "_precompile.obj"。
1>NMAKE : fatal error U1077: “del”: 返回代码“0x1”
1>Stop.

And I missed this information.
 
Another bug ( wrong scientific victory ) has been catched:

File: CvGame.cpp
Line: 7420

If I'm right, this below is the reason of the bug.

This function is for testing victory conditions. In the begining of it, you set a bool variable to true first, and check each victory condition after that. If it is not met, you set bValid to false.
Code:
bool CvGame::testVictory(VictoryTypes eVictory, TeamTypes eTeam, bool* pbEndScore)// removed const
/************************************************************************************************/
/* Afforess	                         END                                                        */
/************************************************************************************************/	
{
	FAssert(eVictory >= 0 && eVictory < GC.getNumVictoryInfos());
	FAssert(eTeam >=0 && eTeam < MAX_CIV_TEAMS);
	FAssert(GET_TEAM(eTeam).isAlive());

	bool bValid = isVictoryValid(eVictory);
	if (pbEndScore)
	{
		*pbEndScore = false;
	}

	if (bValid)
	{
		if (GC.getVictoryInfo(eVictory).isEndScore())
		{
			if (pbEndScore)
			{
				*pbEndScore = true;
			}

			if (getMaxTurns() == 0)
			{
				bValid = false;
			}
			else if (getElapsedGameTurns() < getMaxTurns())
			{
				bValid = false;
			}
			else
			{
				bool bFound = false;

				for (int iK = 0; iK < MAX_CIV_TEAMS; iK++)
				{
					if (GET_TEAM((TeamTypes)iK).isAlive())
					{
						if (iK != eTeam)
						{
							if (getTeamScore((TeamTypes)iK) >= getTeamScore(eTeam))
							{
								bFound = true;
								break;
							}
						}
					}
				}

				if (bFound)
				{
					bValid = false;
				}
			}
		}
	}

SameFile
Line: 7723
At here, for check the if the mastery victory is enabled, you defines another bVaild variable as the same name. ( notice the red text ) If the mastery victory is enabled, it will be set to false. So even some victory condition is met, the bVaild will be set to false here. If the mastery victory is disabled, I guess that then you want to check the scientific victory by the python function "isVictory", and depend on its results to determine whether win the game.
Code:
if (bValid)
	{
/************************************************************************************************/
/* Afforess	                  Start		 12/26/09                                                */
/*                                                                                              */
/*                                                                                              */
/************************************************************************************************/
		if(GC.getUSE_IS_VICTORY_CALLBACK())
		{
			//Skip the check if the mastery victory is enabled
			[COLOR="Red"]bool bValid = true;[/COLOR]
			for (int iK = 0; iK < GC.getNumVictoryInfos(); iK++)
			{
				if (GC.getVictoryInfo((VictoryTypes)iK).isTotalVictory())
				{
					if (isVictoryValid((VictoryTypes)iK))
					{
						[COLOR="red"]bValid = false;[/COLOR]
						break;
					}
				}
			}
			[COLOR="red"]if (bValid)[/COLOR]
			{
				long lResult = 1;
				CyArgsList argsList;
				argsList.add(eVictory);
				gDLL->getPythonIFace()->callFunction(PYGameModule, "isVictory", argsList.makeFunctionArgs(), &lResult);
				if (0 == lResult)
				{
					bValid = false;
				}
			}
		}
/************************************************************************************************/
/* Afforess	                     END                                                            */
/************************************************************************************************/

/************************************************************************************************/
/* Afforess                                     12/7/09                                         */
/*                                                                                              */
/*                                                                                              */
/************************************************************************************************/
#if defined QC_MASTERY_VICTORY
//Sevo Begin--VCM
		else
	  {
			starshipLaunched[eTeam] = true;	  	
	  }
//Sevo End VCM
#endif
/************************************************************************************************/
/* Afforess	                         END                                                        */
/************************************************************************************************/	
	}

	return bValid;
}

If all I said above is right, I propose to change the code to below. ( I have already tested it when mastery victory is off, but in the situation of mastery victory is enabled, I did not test it. )
Code:
if(GC.getUSE_IS_VICTORY_CALLBACK())
		{
			//Skip the check if the mastery victory is enabled
			bool bMasteryVictoryValid = false;//bool bValid = true;
			for (int iK = 0; iK < GC.getNumVictoryInfos(); iK++)
			{
				if (GC.getVictoryInfo((VictoryTypes)iK).isTotalVictory())
				{
					if (isVictoryValid((VictoryTypes)iK))
					{
						bValid = false;bMasteryVictoryValid=true;//bValid = false;
						break;
					}
				}
			}
			if (!bMasteryVictoryValid)//if (bValid)
			{
				long lResult = 1;
				CyArgsList argsList;
				argsList.add(eVictory);
				gDLL->getPythonIFace()->callFunction(PYGameModule, "isVictory", argsList.makeFunctionArgs(), &lResult);
				if (0 == lResult)
				{
					bValid = false;
				}
			}
		}
 
Unfortunately, I got a new bug with AND 1.70 revision 47.

The people will request changing the leader when the revolution, if you accepts their terms, the AI will not take the control of player's civilization.

That's the code that make it wrong, but I don't know how to fix it. I can't find where is the message handler.

Code:
Traceback (most recent call last):

  File "CvEventInterface", line 34, in applyEvent

  File "CvEventManager", line 207, in applyEvent

  File "Revolution", line 6777, in controlLostHandler

IndexError: tuple index out of range
ERR: Python function applyEvent failed, module CvEventInterface

File: Revolution.py Line:4989
Code:
if( self.isLocalHumanPlayer(pPlayer.getID()) ) :
					# Additions by Caesium et al
					caesiumtR = CyUserProfile().getResolutionString(CyUserProfile().getResolution())
					caesiumtextResolution = caesiumtR.split('x')
					caesiumpasx = int(caesiumtextResolution[0])/10
					caesiumpasy = int(caesiumtextResolution[1])/10
					[COLOR="blue"]popup = PyPopup.PyPopup(RevDefs.controlLostPopup, contextType = EventContextTypes.EVENTCONTEXT_ALL)[/COLOR]
					if( self.centerPopups ) : popup.setPosition(3*caesiumpasx,3*caesiumpasy)
					# End additions by Caesium et al

					gameSpeedMod = RevUtils.getGameSpeedMod()

					if( revData.dict.get('bIsElection', False) ) :
						iNumTurns = int(math.floor( 15/gameSpeedMod + .5 ))
						bodStr = localText.getText("TXT_KEY_REV_HUMAN_ELEC_LOSS",())
					else :
						iNumTurns = int(math.floor( 24/gameSpeedMod + .5 ))
						bodStr = localText.getText("TXT_KEY_REV_HUMAN_CEDE",())

					bodStr += '\n\n' + localText.getText("TXT_KEY_REV_HUMAN_CONTROL_RETURNED",()) + ' %d '%(iNumTurns) + localText.getText("TXT_KEY_REV_TURNS",()) + '.'
					popup.setBodyString( bodStr )
					[COLOR="Blue"]popup.setUserData( (iNumTurns,) )[/COLOR]
					popup.launch()

SameFile Line:6773
Code:
def controlLostHandler( self, iPlayerID, netUserData, popupReturn ) :
		if self.isLocalHumanPlayer(iPlayerID) :	
			if( self.LOG_DEBUG ) : CvUtil.pyPrint("  Revolt - Handling local control lost popup")
			iPlayer = netUserData[0]
			[COLOR="blue"]iNumTurns = netUserData[1][/COLOR]			iNewLeaderType = netUserData[2]
			CyMessageControl().sendModNetMessage(self.netControlLostPopupProtocol, iPlayer, iNumTurns, iNewLeaderType, 0)
 
Could you give me a more detailed description of your updating? I only updated the file "CvGame.cpp" in the sources folder, and it changed the code for event updateGame that I metioned. Is that what you mean?

The CTD bug was in CvInfos, and had to do with new art define tags for units.

Another bug ( wrong scientific victory ) has been catched:

File: CvGame.cpp
Line: 7420

If I'm right, this below is the reason of the bug.

This function is for testing victory conditions. In the begining of it, you set a bool variable to true first, and check each victory condition after that. If it is not met, you set bValid to false.
Spoiler :

Code:
bool CvGame::testVictory(VictoryTypes eVictory, TeamTypes eTeam, bool* pbEndScore)// removed const
/************************************************************************************************/
/* Afforess	                         END                                                        */
/************************************************************************************************/	
{
	FAssert(eVictory >= 0 && eVictory < GC.getNumVictoryInfos());
	FAssert(eTeam >=0 && eTeam < MAX_CIV_TEAMS);
	FAssert(GET_TEAM(eTeam).isAlive());

	bool bValid = isVictoryValid(eVictory);
	if (pbEndScore)
	{
		*pbEndScore = false;
	}

	if (bValid)
	{
		if (GC.getVictoryInfo(eVictory).isEndScore())
		{
			if (pbEndScore)
			{
				*pbEndScore = true;
			}

			if (getMaxTurns() == 0)
			{
				bValid = false;
			}
			else if (getElapsedGameTurns() < getMaxTurns())
			{
				bValid = false;
			}
			else
			{
				bool bFound = false;

				for (int iK = 0; iK < MAX_CIV_TEAMS; iK++)
				{
					if (GET_TEAM((TeamTypes)iK).isAlive())
					{
						if (iK != eTeam)
						{
							if (getTeamScore((TeamTypes)iK) >= getTeamScore(eTeam))
							{
								bFound = true;
								break;
							}
						}
					}
				}

				if (bFound)
				{
					bValid = false;
				}
			}
		}
	}

SameFile
Line: 7723
At here, for check the if the mastery victory is enabled, you defines another bVaild variable as the same name. ( notice the red text ) If the mastery victory is enabled, it will be set to false. So even some victory condition is met, the bVaild will be set to false here. If the mastery victory is disabled, I guess that then you want to check the scientific victory by the python function "isVictory", and depend on its results to determine whether win the game.
Code:
if (bValid)
	{
/************************************************************************************************/
/* Afforess	                  Start		 12/26/09                                                */
/*                                                                                              */
/*                                                                                              */
/************************************************************************************************/
		if(GC.getUSE_IS_VICTORY_CALLBACK())
		{
			//Skip the check if the mastery victory is enabled
			[COLOR="Red"]bool bValid = true;[/COLOR]
			for (int iK = 0; iK < GC.getNumVictoryInfos(); iK++)
			{
				if (GC.getVictoryInfo((VictoryTypes)iK).isTotalVictory())
				{
					if (isVictoryValid((VictoryTypes)iK))
					{
						[COLOR="red"]bValid = false;[/COLOR]
						break;
					}
				}
			}
			[COLOR="red"]if (bValid)[/COLOR]
			{
				long lResult = 1;
				CyArgsList argsList;
				argsList.add(eVictory);
				gDLL->getPythonIFace()->callFunction(PYGameModule, "isVictory", argsList.makeFunctionArgs(), &lResult);
				if (0 == lResult)
				{
					bValid = false;
				}
			}
		}
/************************************************************************************************/
/* Afforess	                     END                                                            */
/************************************************************************************************/

/************************************************************************************************/
/* Afforess                                     12/7/09                                         */
/*                                                                                              */
/*                                                                                              */
/************************************************************************************************/
#if defined QC_MASTERY_VICTORY
//Sevo Begin--VCM
		else
	  {
			starshipLaunched[eTeam] = true;	  	
	  }
//Sevo End VCM
#endif
/************************************************************************************************/
/* Afforess	                         END                                                        */
/************************************************************************************************/	
	}

	return bValid;
}

If all I said above is right, I propose to change the code to below. ( I have already tested it when mastery victory is off, but in the situation of mastery victory is enabled, I did not test it. )
Code:
if(GC.getUSE_IS_VICTORY_CALLBACK())
		{
			//Skip the check if the mastery victory is enabled
			bool bMasteryVictoryValid = false;//bool bValid = true;
			for (int iK = 0; iK < GC.getNumVictoryInfos(); iK++)
			{
				if (GC.getVictoryInfo((VictoryTypes)iK).isTotalVictory())
				{
					if (isVictoryValid((VictoryTypes)iK))
					{
						bValid = false;bMasteryVictoryValid=true;//bValid = false;
						break;
					}
				}
			}
			if (!bMasteryVictoryValid)//if (bValid)
			{
				long lResult = 1;
				CyArgsList argsList;
				argsList.add(eVictory);
				gDLL->getPythonIFace()->callFunction(PYGameModule, "isVictory", argsList.makeFunctionArgs(), &lResult);
				if (0 == lResult)
				{
					bValid = false;
				}
			}
		}

Stupids Redefinitions....

Unfortunately, I got a new bug with AND 1.70 revision 47.

The people will request changing the leader when the revolution, if you accepts their terms, the AI will not take the control of player's civilization.

Really? I need to test that then. That sounds like a RevDCM bug.
 
For the stupid string encoding error message, I finally find the reason:

Code:
Traceback (most recent call last):
  File "BugEventManager", line 363, in _handleDefaultEvent
  File "CvEventManager", line 865, in onCultureExpansion
  File "CvUtil", line 306, in pyPrint
  File "CvUtil", line 266, in convertToStr
UnicodeEncodeError: 'latin-1' codec can't encode character u'\u9627' in position 10: ordinal not in range(256)
Traceback (most recent call last):
  File "BugEventManager", line 363, in _handleDefaultEvent
  File "CvEventManager", line 871, in onCityGrowth
  File "CvUtil", line 306, in pyPrint
  File "CvUtil", line 266, in convertToStr
UnicodeEncodeError: 'latin-1' codec can't encode character u'\u9627' in position 5: ordinal not in range(256)

Code:
def onCultureExpansion(self, argsList):
		'City Culture Expansion'
		pCity = argsList[0]
		iPlayer = argsList[1]
		CvUtil.pyPrint("City %s's culture has expanded" %(pCity.getName(),))
	
	def onCityGrowth(self, argsList):
		'City Population Growth'
		pCity = argsList[0]
		iPlayer = argsList[1]
		CvUtil.pyPrint("%s has grown" %(pCity.getName(),))

This could not slience it.
Code:
def pyPrint(stuff):
	# < Revolution Mod Start >
	# Attempt to silence encoding errors for some city names after Python reload
	[COLOR="Red"]stuff = 'PY:' + convertToStr(stuff) + "\n"[/COLOR]	# < Revolution Mod End >
	sys.stdout.write(stuff)

Please change it to:
Code:
stuff = 'PY:' + stuff + "\n"
 
I edited my last reply. I check the change log of file 'Revolution.py' between revision 43 and 44, Was it changed by you?

No.

For the stupid string encoding error message, I finally find the reason:

Code:
Traceback (most recent call last):
  File "BugEventManager", line 363, in _handleDefaultEvent
  File "CvEventManager", line 865, in onCultureExpansion
  File "CvUtil", line 306, in pyPrint
  File "CvUtil", line 266, in convertToStr
UnicodeEncodeError: 'latin-1' codec can't encode character u'\u9627' in position 10: ordinal not in range(256)
Traceback (most recent call last):
  File "BugEventManager", line 363, in _handleDefaultEvent
  File "CvEventManager", line 871, in onCityGrowth
  File "CvUtil", line 306, in pyPrint
  File "CvUtil", line 266, in convertToStr
UnicodeEncodeError: 'latin-1' codec can't encode character u'\u9627' in position 5: ordinal not in range(256)

Code:
def onCultureExpansion(self, argsList):
		'City Culture Expansion'
		pCity = argsList[0]
		iPlayer = argsList[1]
		CvUtil.pyPrint("City %s's culture has expanded" %(pCity.getName(),))
	
	def onCityGrowth(self, argsList):
		'City Population Growth'
		pCity = argsList[0]
		iPlayer = argsList[1]
		CvUtil.pyPrint("%s has grown" %(pCity.getName(),))

This could not slience it.
Code:
def pyPrint(stuff):
	# < Revolution Mod Start >
	# Attempt to silence encoding errors for some city names after Python reload
	[COLOR="Red"]stuff = 'PY:' + convertToStr(stuff) + "\n"[/COLOR]	# < Revolution Mod End >
	sys.stdout.write(stuff)

Please change it to:
Code:
stuff = 'PY:' + stuff + "\n"

Done.
 
Okay, Beta1.70 is out. It's earlier than I would like, so you won't notice a huge change from AND 1.64. I fixed some of AND's bugs, added some new features, and reworked Better RoM.

For those who care:
Better RoM's civic & building changes are basically the same, but all the resource changes were scrapped, and it is using Tejon's better resource placement, but doesn't alter the resource yields anymore. Units changes were also removed, since Zappara used most of them himself in RoM 2.9

I'm playing a test game, and all seems good. Mounted Units are quite useful again; I'm egypt and whipping nearby civs with my War Chariots. The increased XP from RoM 2.9 may make Barbarian Generals and Great Commanders more interesting. I improved Ruthless AI a bunch more; expect wiser diplomacy from them. Also, developing city AI was rewritten and improved, and the Siege Weapon Workshop AI code was revamped, so the AI isn't so in love with spamming them.

Most of the changes are hidden. The mercenaries mod is not satisfactorily finished yet, so it's been hidden for now. I'm about 1/3 done with the Inflation code.

Also, the recommended install got some serious attention. I moved 5 modmods off of Recommended Install (Ideology, Firestorm, Education, NIMBY, & Fortifications.) I'm trying to make the Recommended Install as balanced and presentable as possible. Those who were fans of those options can still play with those, but now must use a custom install.

One last note: On the scoreboard, the globe symbol indicates you have an embassy with the other player.

Have Fun. ;)
 
Congrats!!! :king:

The non-inflation part of "It's the Economy, Stupid" (ItES!) is ready? I mean the techs, the buildings, the civics...

What about the 1.64 RoM 2.9 compatible version? Its release will be also today?
 
Congrats!!! :king:

The non-inflation part of "It's the Economy, Stupid" (ItES!) is ready? I mean the techs, the buildings, the civics...

What about the 1.64 RoM 2.9 compatible version? Its release will be also today?

Nope. I don't plan on continuing the 1.6x series.
 
Is this beta revision ahead of 47? Or can I play what I have now and have it be the same as 1.70beta?
 
Don't want to spam the threads with thank yous, but thanks for getting the latest beta out so quickly Afforess- I've been waiting impatiently for it.
 
Hey Afforess, I am getting a runtime error whenever i try to use the new Rom_Perfecworld2 map, it worked with just regular RoM. Any thoughts? what do you need me to upload?
 
Back
Top Bottom