Breaking Save Game Compatibility for v37

In python you have to use whatever indentation is there. A tab is not the same as spaces to fill out the tab because that number may change from one set-up to another giving you indentation errors. If spaces are used in the code use spaces, if tabs use tabs. To be sure I copy the indentation from existing line and paste it before any code I enter.

My modding machine has crashed big time.Not sure when I will be back. :(
 
Oh no! :(

JosEPh
 
Along the way...
@Harrier & Toffer & DH & whoever wants to get in on this stuff:

Well done - knew you would crack it eventually. :king:

I will start on the SpawnInfo file, if that is OK. When I am done Toffers and then DH can make additional changes as they see fit.

As there is over 200 animals, I will not list changes just post the changed file.

I will of course ask for suggestions as I go through the file.
 
I just think an animal that has a very low iAggression (translate: not bloodthirsty), would not jump at every chance to attack units on the same tile.
Some animals are mostly shy but can suddenly decide to sneak attack a target if in a special mood and have nothing better to do.

The wolverine (passive animal team) might be set up with - bDefensiveOnly=1, bAssassinate=1 (known to sneak ambush bears just for the f*ck of it), StealthDefense=0 (not very territorial), iAggression=3.
Ah... what I think you may need to know about assassination is that it can only be used specifically against units on the same plot that are defined as a priority target for that unit. This means the use of either of these tags MUST be in use on the unit to enable assassination to be possible (this is the difference between ambush which launches a normal attack on the same plot and assassination which goes after ONLY priority target units on the same plot):
<UnitCombatTargets> and
<UnitClassTargets>

I've also added a tag, <TargetUnitCombatTypes> for promotions that adds new UnitCombatTargets for the promoted unit.

What this would mean on animals is that we can define the types, by unitcombat or unitclass specifically, that they prey on. It would make sense to make animals much more aggressive in hunting their natural prey than they would be to go after anything they don't eat.

In python you have to use whatever indentation is there. A tab is not the same as spaces to fill out the tab because that number may change from one set-up to another giving you indentation errors. If spaces are used in the code use spaces, if tabs use tabs. To be sure I copy the indentation from existing line and paste it before any code I enter.

My modding machine has crashed big time.Not sure when I will be back. :(
I'm terribly unhappy to hear that as well.

With the tabbing/spacing issue, even with the language set to Python in notepad++, it doesn't make it very clear if spaces or tabs should be utilized. This is what my python editor program clarifies (and can do a sweep to be sure it's all validated properly.) Which is why if it goes past a little adjustment to text I'd be using that program to manipulate that particular file.

I'll set the iAggression levels on every animal, as well as any assassination/stealthdefense/onlydefensive that I find logical.
Sounds good. I have strong trust in your abilities to insightfully work that side of the structure.

Well done - knew you would crack it eventually. :king:

I will start on the SpawnInfo file, if that is OK. When I am done Toffers and then DH can make additional changes as they see fit.

As there is over 200 animals, I will not list changes just post the changed file.

I will of course ask for suggestions as I go through the file.
Thanks for your confidence Harrier!

And again, it sounds like you'll have this side of things well covered as well.

Would anyone have any objection to making Harrier an honored team member that can commit to the SVN the changes he's working on here as he goes?
 
Spoiler :
Ah... what I think you may need to know about assassination is that it can only be used specifically against units on the same plot that are defined as a priority target for that unit. This means the use of either of these tags MUST be in use on the unit to enable assassination to be possible (this is the difference between ambush which launches a normal attack on the same plot and assassination which goes after ONLY priority target units on the same plot):
<UnitCombatTargets> and
<UnitClassTargets>

I've also added a tag, <TargetUnitCombatTypes> for promotions that adds new UnitCombatTargets for the promoted unit.


What this would mean on animals is that we can define the types, by unitcombat or unitclass specifically, that they prey on. It would make sense to make animals much more aggressive in hunting their natural prey than they would be to go after anything they don't eat.
Aha, I was a bit unclear on how assassination function worked.

Would anyone have any objection to making Harrier an honored team member that can commit to the SVN the changes he's working on here as he goes?
None.
 
I'll set the iAggression levels on every animal, as well as any assassination/stealthdefense/onlydefensive that I find logical.

Need some clarification on - Passive/aggressive.

If an animal can attack another animal (i.e. a Razorbill [bird] can attack fish) - should it be set to aggressive.

Then, the iAAggression modifier tag - will stop it attacking humans.

Consistent with what was said about Barn Owls, in a previous post.
 
Need some clarification on - Passive/aggressive.

If an animal can attack another animal (i.e. a Razorbill [bird] can attack fish) - should it be set to aggressive.

Then, the iAAggression modifier tag - will stop it attacking humans.

Pretty much that's to be the rule of thumb. Of course you have cases where Snakes attack mice but are attacked by hawks. But since we don't have mice in the game it becomes a bit easier to clarify for us (making snakes more of a passive animal team player that has aggressive tendencies as defined on the unit itself.)
 
<snip>

Would anyone have any objection to making Harrier an honored team member that can commit to the SVN the changes he's working on here as he goes?

None here. Make it so.

JosEPh :)
 
@DH:
Aging Animals... the way this is programmed makes it difficult to adjust for me.
Code:
# AgingAnimals
#
# by ori
# 
#

from CvPythonExtensions import *
import CvUtil
import PyHelpers
from Popup import PyPopup

# globals
gc = CyGlobalContext()
PyPlayer = PyHelpers.PyPlayer
PyInfo = PyHelpers.PyInfo
game = CyGame()
localText = CyTranslator()
eBarbarian = gc.getBARBARIAN_PLAYER()
pyBarbarian = PyPlayer(eBarbarian)
I need pyBarbarian to mean either of the animal players really. But the way it's setup it's dedicated to only taking one player. I'll be leaving this on basically broken until I can at least get your help reprogramming it. There's a few too many steps to adjust this one for my level of python ability.
 
@Toffer:
You're going through the animal units at the moment and I wonder if now would be a good time to implement an idea I've had for Size Matters - variable group size spawning.

The way it would work would be you would have a tag like this:
Code:
<GroupSpawnUnitCombatTypes>
	<GroupSpawnUnitCombatType>
		<UnitCombatType>UNITCOMBAT_GROUP_SOLO</UnitCombatType>
		<iChance>1</iChance>
	</GroupSpawnUnitCombatType>
	<GroupSpawnUnitCombatType>
		<UnitCombatType>UNITCOMBAT_GROUP_PARTY</UnitCombatType>
		<iChance>3</iChance>
	</GroupSpawnUnitCombatType>
</GroupSpawnUnitCombatTypes>
Which would mean that when this animal spawns, IF on Size Matters, it has a 1 out of a total 4 chance to be a Solo Group Volume and a 3 out of a total 4 chance to be a Party Group Volume.
As more GroupSpawnUnitCombatType entries are added, they add to the overall total of the random check so if another line was added that said UNITCOMBAT_GROUP_COMPANY and gave it an iValue of 1 then the solo would be a 1 out of 5 chance, the party a 3 out of 5 chance and the company a 1 out of 5 chance.

I'd add this to the spawns themselves except that it could inspire more spawn entries than necessary and the size of that list should be kept to only what's needed given the recent changes will cycle that list multiple times per round now (not too many but enough that if the list starts taking on thousands of spawn info entries then it could cause noticeable delay).

This would thus mean that we'd define these by animal (and other units too if we wanted barbs themselves, when spawned through the spawninfo generator, to vary by group volume as well.) Since you're going through that now and you've got a keen mind for this sort of thing, would you be willing to work the tag if I put it together immediately?
 
@Toffer:
You're going through the animal units at the moment and I wonder if now would be a good time to implement an idea I've had for Size Matters - variable group size spawning.

The way it would work would be you would have a tag like this:
Code:
<GroupSpawnUnitCombatTypes>
	<GroupSpawnUnitCombatType>
		<UnitCombatType>UNITCOMBAT_GROUP_SOLO</UnitCombatType>
		<iChance>1</iChance>
	</GroupSpawnUnitCombatType>
	<GroupSpawnUnitCombatType>
		<UnitCombatType>UNITCOMBAT_GROUP_PARTY</UnitCombatType>
		<iChance>3</iChance>
	</GroupSpawnUnitCombatType>
</GroupSpawnUnitCombatTypes>
Which would mean that when this animal spawns, IF on Size Matters, it has a 1 out of a total 4 chance to be a Solo Group Volume and a 3 out of a total 4 chance to be a Party Group Volume.
As more GroupSpawnUnitCombatType entries are added, they add to the overall total of the random check so if another line was added that said UNITCOMBAT_GROUP_COMPANY and gave it an iValue of 1 then the solo would be a 1 out of 5 chance, the party a 3 out of 5 chance and the company a 1 out of 5 chance.

I'd add this to the spawns themselves except that it could inspire more spawn entries than necessary and the size of that list should be kept to only what's needed given the recent changes will cycle that list multiple times per round now (not too many but enough that if the list starts taking on thousands of spawn info entries then it could cause noticeable delay).

This would thus mean that we'd define these by animal (and other units too if we wanted barbs themselves, when spawned through the spawninfo generator, to vary by group volume as well.) Since you're going through that now and you've got a keen mind for this sort of thing, would you be willing to work the tag if I put it together immediately?
Go ahead, I'm on-board.
 
Does iAggression=0 make the unit OnlyDefensive, or will the unit still attack once in a while?
Does iAggression work for e.g. Neanderthal barbarians or is it limited by civ or AI_ANIMAL.


Perhaps UNITCOMBAT_ANIMAL_COMBAT_CHARGING & UNITCOMBAT_ANIMAL_COMBAT_POUNCE, should give bStealthDefenseChange +1.
If an inappropriate animal gets it we could just give UNITCOMBAT_ANIMAL_COMBAT_HIDING or UNITCOMBAT_ANIMAL_COMBAT_FLEEING bStealthDefenseChange -1. Or reconsider the unitcombat assignments for that animal.

As far as I can see this should give quite appropriate results.
 
Go ahead, I'm on-board.
Awesome! You'll have the tag later today then.
Does iAggression=0 make the unit OnlyDefensive, or will the unit still attack once in a while?
It makes it basically never attack with a few exceptions. If the unit has leveled it's faced a bit of combat previously and becomes more aggressive (base aggression = iAggression + current level). It also doesn't gain other benefits associated with Only Defensive like tile sharing with other only defensive units. Additionally, with the way the assassination from animals will work, it won't stop them from going after prey.

Does iAggression work for e.g. Neanderthal barbarians or is it limited by civ or AI_ANIMAL.
It's a function within AI_ANIMAL only at the moment. Not sure we need it elsewhere, at least not yet.


Perhaps UNITCOMBAT_ANIMAL_COMBAT_CHARGING & UNITCOMBAT_ANIMAL_COMBAT_POUNCE, should give bStealthDefenseChange +1.
If an inappropriate animal gets it we could just give UNITCOMBAT_ANIMAL_COMBAT_HIDING or UNITCOMBAT_ANIMAL_COMBAT_FLEEING bStealthDefenseChange -1. Or reconsider the unitcombat assignments for that animal.
I'm good with that.

As far as I can see this should give quite appropriate results.
Make it so!
 
It makes it basically never attack with a few exceptions. If the unit has leveled it's faced a bit of combat previously and becomes more aggressive (base aggression = iAggression + current level). It also doesn't gain other benefits associated with Only Defensive like tile sharing with other only defensive units. Additionally, with the way the assassination from animals will work, it won't stop them from going after prey.
Does iAggression=10 mean always attack or is that at some higher value, gained trough leveling, like 12?
 
Does iAggression=10 mean always attack or is that at some higher value, gained trough leveling, like 12?

Exactly. At it's core it means 10 out of 12 chance to attack with some margin for being even more aggravated. Even then the current health may cause the animal to hold off and only Deity level puts all animals at 100% of their base aggression. (Settler starts at 25% and it gradiates upwards from there.)
 
@Toffer:
What if I were to include an additional nested tag for GroupSpawnUnitCombatTypes where we can specify a text key that gets added to the unit name when the unit spawns?

Such as:
Code:
	<GroupSpawnUnitCombatType>
		<UnitCombatType>UNITCOMBAT_GROUP_PARTY</UnitCombatType>
		<iChance>3</iChance>
		<Title>TXT_KEY_FAMILY</Title>
	</GroupSpawnUnitCombatType>
TXT_KEY_FAMILY linking to say:
"Family of " (in english anyhow)

When spawned, with this, the unit might be a "Family of Brown Bear".

You think this is over the top or the 'way to go'?

EDIT: I think what I'll do is include it and make it fairly optional so that it doesn't have to be fleshed out overnight. I'm convinced it would be beneficial to have the option to utilize it at least.
 
@Toffer:
What if I were to include an additional nested tag for GroupSpawnUnitCombatTypes where we can specify a text key that gets added to the unit name when the unit spawns?

Such as:
Code:
	<GroupSpawnUnitCombatType>
		<UnitCombatType>UNITCOMBAT_GROUP_PARTY</UnitCombatType>
		<iChance>3</iChance>
		<Title>TXT_KEY_FAMILY</Title>
	</GroupSpawnUnitCombatType>
TXT_KEY_FAMILY linking to say:
"Family of " (in english anyhow)

When spawned, with this, the unit might be a "Family of Brown Bear".

You think this is over the top or the 'way to go'?

EDIT: I think what I'll do is include it and make it fairly optional so that it doesn't have to be fleshed out overnight. I'm convinced it would be beneficial to have the option to utilize it at least.
Pack of lions currently is its own unit, this could reduce number of units needed in the long run.
It would be perfect if it could adjust the number of visible models of that unit as well.
<UnitMeshGroups>
<iGroupSize>X</iGroupSize>
 
Pack of lions currently is its own unit, this could reduce number of units needed in the long run.
It would be perfect if it could adjust the number of visible models of that unit as well.
<UnitMeshGroups>
<iGroupSize>X</iGroupSize>

I have been thinking it would be nice for the # of unit mesh groups made visible would be based on the group size if SM is on but that wouldn't necessarily be a matter for spawns, specifically, so much as a general rule for SM. Going to take a little evaluation of how those unit tags relating to 3d art actually process.

However, it would also be cool to implement spawns from spawns... aka, some animals may seek to merge as much as they can (they would seek other units of the same type and group size and travel together until they can get the third to join them and merge) and some spawn infos would then be based on being triggered by the existence of the 'animal' unit of a high enough group size - meaning the herd is giving birth to animals that go off wandering on their own, that would themselves eventually hope to find other animals of the same group size and merge again.

Might not work for all animals but it would be a cool way to make animals more organic. Probably not necessary to dive into this particular concept yet though.
 
Confirmed SVN 9124 breaks all previous save games.

JosEPh
 
Top Bottom