Breaking Save Game Compatibility for v37

OK, pigeons was the first animal I thought about when reading your last post. ^^

Edit: I still think that one of the checks are redundant with the other. Either bNeutral or the check that looks for ( iAnimalIgnoreBorders > 0 )

I do assume that both have to right (1 1) for an animal to spawn inside borders, not just either OR (1 0, 0 1).


It may serve a purpose if a spawn entry defines e.g. a lion and a pigeon (GroupSpawn) to spawn with bNeutralOnly=0 on the same plot and then only the pigeon spawns if it happens to occur within borders...
It's true that they are redundant when it comes to spawning, EXCEPT that if iAnimalIgnoresBorders didn't play a role then you could have many animals that shouldn't be allowed into improved plots or cities spawning directly into them.

A Moose, for example, perhaps should be able to spawn in and move throughout unimproved territory. Perhaps it could earn a promo that allows it another point on ignores borders so it can now move into an improved plot. But it should not ever be allowed to enter a city. Nor should a moose naturally feel ok to move into improved plots imo.

However, this only applies to animals. If you wanted a different NPC type spawn to take place within borders that isn't an animal player type, you can simply use bNeutralOnly=0, which was established early. I could've added a tag to give further depth to spawning specifically but it wouldn't have also worked to help establish the movement rules for those creatures as well.

Maybe you make a good case for removing bNeutralOnly except that for other NPC types, it's still useful.

My thoughts are that a lot of animals keep together, so could be in herds/packs. But some herds/packs are so small that it should only spawn one animal.

So as currently defined, the spawn would be one animal or a small group. {1 actual animal}

NEW
For some animals, that group in larger numbers, but not to large. [to be defined] - {2 actual animals}

EXISTING
For larger herds. (i.e.Wilderbeasts) - {3 actual animals}

And so on. The ranges just need to be defined and the numbers to be spawned.

Question?
Should I still research this, or wait till we get better spawning/attacking etc. with the new animal system? :)
I wouldn't worry too much about the instabilities in the animal systems to get rebalanced first... much of that is simply AI issues for the animals - I think a function I'm using isn't quite operating as I'd assumed it would. Sure some spawning rebalancing will be in order as well but I'm neutral as to whether such grouping spawns should be defined before or after general rebalancing... But DH probably has a better bead on that stuff.
 
I can't exactly remember the correct figures but in nature it is 200 prey for each hunter.

I am finding the early game exceedingly boring at the moment with very long turn times. My computer thinks the game has stopped running twice per turn at the moment.

Yeah my BRAND NEW PC, with a Nvidia 980 is taking about 10X loooonger to turn times. And this is only after 10 turns, it used to take 10 seconds for all of Ancient, now its over 30 seconds per turn(after 10 turns), really bad, thats why i bought this new PC. .

I have a few suspicions regarding potential problem spots.

To help to sort through suspicions (I don't find my system delaying at all btw, either that or the difference between 10 and 30 seconds is irrelevant and indecipherable to me - BUT my last playtesting was before some xml updates too which could be telling if I would note a slowdown now) the options you're testing with (from those newest last three) would be helpful to report along with these comments.
 
I have a few suspicions regarding potential problem spots.

To help to sort through suspicions (I don't find my system delaying at all btw, either that or the difference between 10 and 30 seconds is irrelevant and indecipherable to me - BUT my last playtesting was before some xml updates too which could be telling if I would note a slowdown now) the options you're testing with (from those newest last three) would be helpful to report along with these comments.

Yeah, but this is after only between 10-60 turns, and thats only 1 city, which would mean that if u have over 20 cities then it would take around 4 minutes per turn . .and to ME personally, if any game is over 30 seconds(and thats the entire game), I JUST QUIT, not worth playing, POINT BLANK...
 
It's true that they are redundant when it comes to spawning, EXCEPT that if iAnimalIgnoresBorders didn't play a role then you could have many animals that shouldn't be allowed into improved plots or cities spawning directly into them.
How? All animals that have bNeutral=0 also have "iAnimalsIgnoreBorders > 0", and the opposite is true as well; I guess it's good as a sanity check in the event of accidentally giving an animal with "iAnimalsIgnoreBorders < 1" bNeutralOnly=0.
 
My first test was with none of the new options on. I had assumed that the game would be the same as of old and I would only need to turn options on if I wanted to try the new stuff. My second was with the option on that keeps things almost the same as before ie Animals stay out selected.

BTW Animals are moving about as far as I can see.
 
Yeah, but this is after only between 10-60 turns, and thats only 1 city, which would mean that if u have over 20 cities then it would take around 4 minutes per turn . .and to ME personally, if any game is over 30 seconds(and thats the entire game), I JUST QUIT, not worth playing, POINT BLANK...
I'm not saying I don't think there's an issue to address. However, before overreacting, if the wild is taking a little longer to process, as the wild retracts and cities fill in, the delays in the wild will retract as well and you'll be left with about the same delay in an advanced game as you would've had before in an advanced game. Make sense?

However, there's a command in the animal AI that I suspect is a bit more delaying than it should be and causing potentially some other issues so I'm going to audit that command and potentially even remove it to address those other issues reported.

I think that would serve to speed up turns significantly.

How? All animals that have bNeutral=0 also have "iAnimalsIgnoreBorders > 0", and the opposite is true as well; I guess it's good as a sanity check in the event of accidentally giving an animal with "iAnimalsIgnoreBorders < 1" bNeutralOnly=0.
An animal with iAnimalIgnoresBorders > 1 allows the animal to spawn in an improved plot and one with iAnimalIgnoresBorders > 2 allows the animal to spawn in a city. Without this further control factor, animals with only bNeutral=0 could spawn in any of the above.

My first test was with none of the new options on. I had assumed that the game would be the same as of old and I would only need to turn options on if I wanted to try the new stuff. My second was with the option on that keeps things almost the same as before ie Animals stay out selected.

BTW Animals are moving about as far as I can see.
Ok, so aggressive animals is still off? Just to clarify.
 
Ok, so aggressive animals is still off? Just to clarify.

Yes. That option on is probably the cause and makes it extremely difficult to get units you get from goody huts back as they (the new units) can't ignore the animals while the recon can. The slow down is probably because of the number of units on each and every plot. Most plots seem to have 3 to 6 animals on them. Although those plots near my city have 0-2 on them as I try and keep the numbers down with my trackers.
 
Yeah, but this is after only between 10-60 turns, and thats only 1 city, which would mean that if u have over 20 cities then it would take around 4 minutes per turn . .and to ME personally, if any game is over 30 seconds(and thats the entire game), I JUST QUIT, not worth playing, POINT BLANK...

So is that a realistic point of view for playing C2C? Especially After a New Concept begins to be incorporated? I can understand the PoV After a concept has been worked out and is functional. The last time I made Ren Era I was dealing with 15+ min EoT's. And that is with a comp that is now almost 4+ years old with a 2nd gen i7 and a 1GB vid card.

Just sayin' boss that maybe during this time period for the Mod a bit more patience? Maybe?

JosEPh :)
 
So is that a realistic point of view for playing C2C? Especially After a New Concept begins to be incorporated? I can understand the PoV After a concept has been worked out and is functional. The last time I made Ren Era I was dealing with 15+ min EoT's. And that is with a comp that is now almost 4+ years old with a 2nd gen i7 and a 1GB vid card.

Just sayin' boss that maybe during this time period for the Mod a bit more patience? Maybe?

JosEPh :)

Forgot to take my meds, lol sorry everyone!! :mischief::crazyeye::p
 
It's okay boss. ;)

JosEPh
 
WARNING
Latest SVN updates starting with SVN 9141 and especially the latest SVN 9145 Will break saves or just out right Fail to Load at Initialization once you've reached the Load save game in C2C.

Suggestion to players: Revert to SVN 9140 to start New Games.

JosEPh

JosEPh
 
Yes. That option on is probably the cause and makes it extremely difficult to get units you get from goody huts back as they (the new units) can't ignore the animals while the recon can. The slow down is probably because of the number of units on each and every plot. Most plots seem to have 3 to 6 animals on them. Although those plots near my city have 0-2 on them as I try and keep the numbers down with my trackers.
It's not so much that an option is or is not a cause so much as it causes the AI to process differently which can be a source of delay.

And holy cow that's a lot of animals. The doubling of the spawn rate seems to have had its effect. Perhaps we need to halve the spawn rate if we're running with the Peace Among NPCs option.

I see, then it serves a purpose, sorry for pestering about it.
It was necessary discussion to show the functionality in full I think. No pestering about it.
 
@DH:
I'm reviewing the python for adjustments for Neanderthal NPCS and anything else I may have missed previously. We also now have new leaders for animals and may have a different one for neanderthals and there are references in the python specifically to the barbarian leader to control certain things that needs to get sorted out but it's a bit above my python skill grade to do so. Example:
Code:
	def placeLeaders(self):
		screen = self.getScreen()
		
		# Create and place a tech pane									
		list = self.getSortedList( gc.getNumLeaderHeadInfos(), gc.getLeaderHeadInfo )
		listCopy = list[:]
		for item in listCopy:
			if item[1] == gc.getDefineINT("BARBARIAN_LEADER"):
				list.remove(item)
			elif gc.getDefineINT("CIVILOPEDIA_SHOW_ACTIVE_CIVS_ONLY") and gc.getGame().isFinalInitialized():
				if not gc.getGame().isLeaderEverActive(item[1]):
					list.remove(item)
This is in CvPediaMain.py.

I'm not sure how to get the filter check for BARBARIAN_LEADER to include any potential NPC leader. Can you help with that?

As I go through I'll point out other spots I'm unsure about as there are probably more than a few to come.

EDIT:
Another one I'm not sure about:
Code:
def onEndPlayerTurn( argsList ) :
	
	iGameTurn, iPlayer = argsList
	bDoLaunchRev = False
	
	iNextPlayer = iPlayer + 1
	while( iNextPlayer <= gc.getBARBARIAN_PLAYER() ) :
		if( not gc.getPlayer(iNextPlayer).isAlive() ) :
			iNextPlayer += 1
		else :
			break
	
	if( iNextPlayer > gc.getBARBARIAN_PLAYER() ) :
		iGameTurn += 1
		iNextPlayer = 0
		while( iNextPlayer < iPlayer ) :
			if( not gc.getPlayer(iNextPlayer).isAlive() ) :
				iNextPlayer += 1
			else :
				break

	# Stuff before next players turn 
	#CvUtil.pyPrint("Rev - Recording civics for player %d"%(iNextPlayer))
	recordCivics( iNextPlayer )
This is in RevEvents.py. I'm not sure this one matters much but there are numerous places in python that have this sort of filtering that assumes the barbarian player is the last player in the list and I wonder if it should be changed to NPC1_PLAYER or not.

Just above that code is:
Code:
def onBeginPlayerTurn( argsList ) :
	iGameTurn, iPlayer = argsList

	#if( iPlayer == game.getActivePlayer() ) :
	#	CvUtil.pyPrint("Rev - Recording civics for active player")
	iNextPlayer = iPlayer + 1
	while( iNextPlayer <= gc.getBARBARIAN_PLAYER() and not gc.getPlayer(iNextPlayer).isAlive() ) :
		iNextPlayer += 1
	
	if( iNextPlayer > gc.getBARBARIAN_PLAYER() ) :
		iNextPlayer = 0
		while( iNextPlayer < iPlayer and not gc.getPlayer(iNextPlayer).isAlive() ) :
			iNextPlayer += 1
Which doesn't seem to be actually doing anything so I find it very odd in the first place.


In RevDefs.py we have another interesting situation:
Code:
# Players
# List of player numbers that BarbarianCiv will never turn into a full civ.  Allows minor civs in scenarios to keep minor status.
alwaysMinorList = [] #[0,1,2]
I'm THINKING that we need to add all other NPC civilizations into this empty list BUT I'm not sure how that's supposed to be done here.


Another spot in StartAsMinors.py that I'm not sure what it's actually doing but I suspect it may need to be adjusted to not assume that barbs are the last player:
Code:
########################## Turn-based events ###############################

def onEndPlayerTurn( argsList ) :
	
	iGameTurn, iPlayer = argsList
	bDoLaunchRev = False
	
	iNextPlayer = iPlayer + 1
	while( iNextPlayer <= gc.getBARBARIAN_PLAYER() ) :
		if( not gc.getPlayer(iNextPlayer).isAlive() ) :
			iNextPlayer += 1
		else :
			break
	
	if( iNextPlayer > gc.getBARBARIAN_PLAYER() ) :
		iGameTurn += 1
		iNextPlayer = 0
		while( iNextPlayer < iPlayer ) :
			if( not gc.getPlayer(iNextPlayer).isAlive() ) :
				iNextPlayer += 1
			else :
				break

In Revolution.py we have an interesting case that you may be able to decipher better:
Code:
			# Don't incarnate as either of these
			iMinor = CvUtil.findInfoTypeNum(gc.getCivilizationInfo,gc.getNumCivilizationInfos(),RevDefs.sXMLMinor)
			iBarbarian = CvUtil.findInfoTypeNum(gc.getCivilizationInfo,gc.getNumCivilizationInfos(),RevDefs.sXMLBarbarian)
			# Civs not currently in the game
			availableCivs = list()
			# Civs with similar style to cultOwner, if they exist
			similarStyleCivs = list()
			similarOwnerStyleCivs = list()
			for civType in range(0,gc.getNumCivilizationInfos()) :
				if( not civType == iBarbarian ) :
					if( not civType == iMinor ) :
						taken = False
						for i in range(0,gc.getMAX_CIV_PLAYERS()) :
							if( civType == gc.getPlayer(i).getCivilizationType() ) :
								# Switch in preparation for defining regions of the world for different rebel civ types
								#if( gc.getPlayer(i).isAlive() or gc.getPlayer(i).isFoundedFirstCity() or gc.getPlayer(i).getCitiesLost() > 0 ) :
								if( gc.getPlayer(i).isEverAlive() or RevData.revObjectExists(gc.getPlayer(i)) ) :
									taken = True
									break
						if( not taken ) :
							availableCivs.append(civType)
							if( not cultPlayer == None ) :
								if( gc.getCivilizationInfo( cultPlayer.getCivilizationType() ).getArtStyleType() == gc.getCivilizationInfo(civType).getArtStyleType() ) :
									#if( self.LOG_DEBUG ) : CvUtil.pyPrint("  Revolt - Potential similar style civ from culture: %s (%d)"%(gc.getCivilizationInfo(civType).getShortDescription(0),civType))
									similarStyleCivs.append(civType)
							if( gc.getCivilizationInfo( owner.getCivilizationType() ).getArtStyleType() == gc.getCivilizationInfo(civType).getArtStyleType() ) :
								#if( self.LOG_DEBUG ) : CvUtil.pyPrint("  Revolt - Potential similar style civ from owner: %s (%d)"%(gc.getCivilizationInfo(civType).getShortDescription(0),civType))
								similarOwnerStyleCivs.append(civType)
It appears to me that we may need to widen the barbarian reference here to any NPC player. I'm not 100% sure though, nor would I be safely able to change it since it goes after such specific to barbarian data to define that.


This, at the beginning of Revolutions.py:
Code:
	def onBeginPlayerTurn( self, argsList ) :

		iGameTurn, iPlayer = argsList

		# Stuff at end of previous players turn
		iPrevPlayer = iPlayer - 1
		while( iPrevPlayer >= 0 and not gc.getPlayer(iPrevPlayer).isAlive() ) :
			iPrevPlayer -= 1

		if( iPrevPlayer < 0 ) :
			iPrevPlayer = gc.getBARBARIAN_PLAYER()

		if( iPrevPlayer >= 0 and iPrevPlayer < gc.getBARBARIAN_PLAYER() ) :
			self.checkForRevReinforcement( iPrevPlayer )
			self.checkCivics( iPrevPlayer )

		iNextPlayer = iPlayer + 1
		while( iNextPlayer <= gc.getBARBARIAN_PLAYER() and not gc.getPlayer(iNextPlayer).isAlive() ) :
			iNextPlayer += 1

		if( iNextPlayer > gc.getBARBARIAN_PLAYER() ) :
			iNextPlayer = 0
			while( iNextPlayer < iPlayer and not gc.getPlayer(iNextPlayer).isAlive() ) :
				iNextPlayer += 1
is another situation where I'm not sure if we're incorrectly assuming the Barbarian is the last potential player or not.


In CvPediaMain.py:
Code:
	def placeLeaders(self):
		self.list = self.getLeaderList()
		list = self.list
		listCopy = list[:]
		for item in listCopy:
			if item[1] == gc.getDefineINT("BARBARIAN_LEADER"):
				list.remove(item)
			elif gc.getDefineINT("CIVILOPEDIA_SHOW_ACTIVE_CIVS_ONLY") and gc.getGame().isFinalInitialized():
				if not gc.getGame().isLeaderEverActive(item[1]):
					list.remove(item)
		self.list = list
		self.placeItems(WidgetTypes.WIDGET_PEDIA_JUMP_TO_LEADER, gc.getLeaderHeadInfo)
Again, perhaps too specific to the barb leader?

Ok, I think that about sums it up.
 
I agree that some of that code looks like it does absolutely nothing. It could just be the remains of code someone was removing or it could be the skeleton of some code someone was going to add. I either case it should go to avoid future confusion and stop wasting turn time.

The leader stuff in the main pedia is about removing leaders you will never be able to choose to play as far as I can see. We should still use them when we do diplomacy with those nations later but that still means we don't need them in the pedia.

BTW I play with Neanderthals off and would like to continue doing so.

I am going to need a coffee before I can answer in more detail.
 
I agree that some of that code looks like it does absolutely nothing. It could just be the remains of code someone was removing or it could be the skeleton of some code someone was going to add. I either case it should go to avoid future confusion and stop wasting turn time.

The leader stuff in the main pedia is about removing leaders you will never be able to choose to play as far as I can see. We should still use them when we do diplomacy with those nations later but that still means we don't need them in the pedia.

BTW I play with Neanderthals off and would like to continue doing so.

I am going to need a coffee before I can answer in more detail.

Out of curiosity, how do you disable neanderthals while not disabling other barbs?

I did add a Neanderthal Cities option so you have to select it for neanders to have any greater presence than spawning (and I suppose the POTENTIAL to gain a city through conquest.)
 
Out of curiosity, how do you disable neanderthals while not disabling other barbs?

In A_New_Dawn_GlobalDefines.XML set
Code:
	<Define>
		<DefineName>NEANDERTHAL_SPAWN_MODIFIER</DefineName>
		<iDefineIntVal>0</iDefineIntVal>
	</Define>

BTW I note I have animals at 250 rather than 150 which is the default, so that may explain the tiles with 10+ animals on them.

I did add a Neanderthal Cities option so you have to select it for neanders to have any greater presence than spawning (and I suppose the POTENTIAL to gain a city through conquest.)

I trust they will not be settling cities until someone gets Tribalism like the Barbarians do now
 
In A_New_Dawn_GlobalDefines.XML set
Code:
	<Define>
		<DefineName>NEANDERTHAL_SPAWN_MODIFIER</DefineName>
		<iDefineIntVal>0</iDefineIntVal>
	</Define>
Assuming that ties to the Spawn info somehow, I don't think that's going to be changed at all. I didn't encounter that define anywhere in my searches.

BTW I note I have animals at 250 rather than 150 which is the default, so that may explain the tiles with 10+ animals on them.
Yeah, might. Also goes a ways towards explaining slowdowns though I do think I figured out and fixed the main culprit.



I trust they will not be settling cities until someone gets Tribalism like the Barbarians do now
With the option on their cities will ONLY spawn during the prehistoric. If there's another check keeping barb cities from spawning (not settling btw, spawning - they certainly won't be building tribes or settlers until then and I don't think barb nations are given to train such units anyhow - the city AI is pretty much the same for neanders as barbs) that isn't related to a statement defined somewhere that makes the whole prehistoric era incapable of spawning barb cities then it would probably continue to hold true for Neanderthal cities as well. The only workaround I inserted was on a statement that asked if barb cities could exist in this given era. I assumed that was how they were being held off but it's possible elsewhere in the code a tech requirement was somehow inserted and if that exists then I didn't work around that.

I could use some help in crafting the NPC Neanderthal Civ so that it cannot train hardly anything but Neanderthal units. They don't gain techs with the normal handicaps barbs get either so their tech development will be nearly non-existent.
 
I could use some help in crafting the NPC Neanderthal Civ so that it cannot train hardly anything but Neanderthal units. They don't gain techs with the normal handicaps barbs get either so their tech development will be nearly non-existent.

There is a list of units that the barbarians can build. This is in XML and will need to be extended to the other NPCs in some way.

Originally the list that the barbarians had ignored all requirements except technology and was a subset of the full array units. EG they could build swordsmen without iron if they had the tech. This was probably done for game speed reasons. However in C2C instead of having a subset of units available to the barbarians all units were allowed them. This causes problems as they can then build Culture units including Heroes without requiring the Culture first, so the other requirements now have to be tested for when the barbarians build units increasing turn time. Also because they have access to every unit they spend a lot of time upgrading those units.

I think the barbarians should only get the main era unit from each line, ie no more that one unit from each line maximum per era. In fact I think this main unit should be a special barbarian unit that is slightly weaker than the corresponding player unit but has no requirements other than tech.
 
There is a list of units that the barbarians can build. This is in XML and will need to be extended to the other NPCs in some way.
Where? In the Barbarian Civilization Infos, we can isolate units as not being buildable or give replacement units under specific unitclasses. With the amount of units we have in C2C this becomes ridiculous to define if you only want a few unitclasses to be trainable at all. Buildings work the same way. I'm not 100% sure this is the same as what you're talking about.

Originally the list that the barbarians had ignored all requirements except technology and was a subset of the full array units. EG they could build swordsmen without iron if they had the tech. This was probably done for game speed reasons.
I've seen this portion in the code and have isolated that culture bonus requirements are still important to observe. It was done not for speed initially, but rather for allowing barbs to ignore resource requirements since they don't really focus much effort on workers and such and most cities are disconnected from any 'barb' trade network and they wanted axes and swords and such trainable regardless.

However in C2C instead of having a subset of units available to the barbarians all units were allowed them. This causes problems as they can then build Culture units including Heroes without requiring the Culture first, so the other requirements now have to be tested for when the barbarians build units increasing turn time. Also because they have access to every unit they spend a lot of time upgrading those units.
It's been a while since I've seen a barbarian cultural unit. I think we got the problem addressed but I'm still not 100% sure. There's a few ways barbs come into play and I'm hoping they're all taken care of.


I think the barbarians should only get the main era unit from each line, ie no more that one unit from each line maximum per era. In fact I think this main unit should be a special barbarian unit that is slightly weaker than the corresponding player unit but has no requirements other than tech.
I don't see any reason to make them weaker but keeping them to the core unit types is possible by defining the more basic unit type under each unitclass definition in the civilization list.


I suppose when I say I need help I mean I need someone to do a LOT of grunt work to ensure that the buildings and units that can be trained by Neanderthals (and Insectoids if they ever capture a city though this can wait - I suggest insectoids on earth should be given NoCapture anyhow) are correctly established. Since we have a HUGE list of buildings and units and EACH needs to be defined as possible or not for this to work properly, it's going to be a major effort.

So I'm calling to any of the junior modders who would be willing to assist with that effort!
 
Back
Top Bottom