Breaking Save Game Compatibility for v37

Ah... subdue. I'd misread you there. You have a very good point that wild animals should not be able to subdue. I'll have to look at the Combat Outcome coding and see if I can weave in an absolute block on that.
 
How does one affect animal subdue chances in unitcombats?

And I'm pretty sure I've subdued animals with units that has the bNoCapture=1, I may be wrong though.
Now that you've pointed this problem out to me, I've added bCapture tag to OutcomeInfos and if the unit has "No Capture" (I've also added an iNoCaptureChange tag to UnitCombatInfos) then it will not be able to enact the Outcome with bCapture set true. This obviously is a bigger issue than animals alone.

We have three unit capture mechanism:
  • <KillOutcomes> with OUTCOME_SUBDUE. Adffected by promos in the outcomeinfo.xml
  • <Capture> For 0 :strength: unit capture. Affected by bNoCapture
  • iCaptureProbabilityModifierChange/iCaptureResistanceModifierChange that decide the chance of obtaining a captive from battle.

All of these should be barred from animals.
At this point all three are addressed on my end. For education's sake, the middle one there isn't JUST for 0 str units... also counts for defeating units in battle that have a <Capture> tag. (such as rams)
 
I wonder, in the ages of exploration and colonisation where will be the vast herds of animals in Africa, the Americas and the Arctic circle? Where will be the weird and wonderful animals of Oceania? The barbarians in these places will be much stronger when you get there.

Turn times will be slower at the start of the game but faster later in the game.

Hippopotamuses are prey animals but they are the most dangerous animal, after man, in Africa. Pigs and sheep are prey animals but are also dangerous wild animals. I would put pigs as way more dangerous than any big cat.
 
I wonder, in the ages of exploration and colonisation where will be the vast herds of animals in Africa, the Americas and the Arctic circle? Where will be the weird and wonderful animals of Oceania? The barbarians in these places will be much stronger when you get there.
You make an interesting point that may suggest again that animals and barbs should not conflict.

Turn times will be slower at the start of the game but faster later in the game.
True. I may also look to Alberts2 to help me with one particular section of these code adjustments in the spawn mechanism... it MAY be unnecessarily slowed down by some things that could possibly be cached but I didn't quite see how I could.

Hippopotamuses are prey animals but they are the most dangerous animal, after man, in Africa. Pigs and sheep are prey animals but are also dangerous wild animals. I would put pigs as way more dangerous than any big cat.
Whether an animal is a 'passive' or 'aggressive' animal by team won't be the basis for their necessary level of aggression which can be defined by the specific animal. Since Hippos are indeed the most dangerous and aggressive animal in the world BUT do not prey on really any other species, they would fit well as being in the passive group but have a very high aggression level, making them a champion among Herbivores so to speak. Whether pigs are more 'dangerous' than cats I would contest unless you were simply saying that pigs are more likely to attack, which I agree with. But if I had a choice whether to be attacked by a pig or attacked by a cat, I'd prefer to have to fend off the pig! So boar aggression levels would be higher.

Bears are interesting. They might not actually have the highest aggression levels but with their high pursuit stats, they do tend to finish what get's started. They'd probably be among the Aggressive animal group since they are an alpha predator, even if they are omnivorous. But perhaps only a 5 or even 4 on the aggression scale imo. (Depending on the type of bear.)

I think this new animal AI and team structure will work very nicely to give animals the personalities they deserve.
 
Turn times will be slower at the start of the game but faster later in the game.

Slow times in early era, like PreH/Ancient i dont mind, but will this increase times after Classical?? if so, ummm??
 
Probably minimal impact on that stage. Some of it will be a wait and see how it pans out kind of affair. It's hard to say. You have both reasons for speed ups and reasons for slowdowns.
 
I think this new animal AI and team structure will work very nicely to give animals the personalities they deserve.

While these discussions are on going - I will only add a few passive animal changes. The easier ones like some birds, deer etc.

As a reminder, if any one wants it (for testing) - I have a spawn file with all animals set as agressive.
 
While these discussions are on going - I will only add a few passive animal changes. The easier ones like some birds, deer etc.

As a reminder, if any one wants it (for testing) - I have a spawn file with all animals set as agressive.

Well... yeah. Let me get your latest for now. Can you commit to the SVN?
 
Well... yeah. Let me get your latest for now. Can you commit to the SVN?

No.

But here it is. Not added passive animals yet - all are aggressive. (as is the current case.)
Called it NewCIV4Spawninfos.xml.
 
No.

But here it is. Not added passive animals yet - all are aggressive. (as is the current case.)
Called it NewCIV4Spawninfos.xml.

It looks like I may be beyond my ability here to convert the player string into something readable according to the #defines. What this means is that I'm going to have to make this PlayerType tag an integer and at the top of the file in the note lines give the integer that reflects the numeric value of the Player we're looking to indicate.

Therefore, with the PlayerType tag we may put something like:
<PlayerType>50</PlayerType> to represent the BARBARIAN_PLAYER.

I just don't have the functions that can grab BARBARIAN_PLAYER and convert it from a string into the equating #define value. And I certainly don't have the knowledge on how to build that. So for now, until a better programmer than myself can look into that, I'm limited to this solution.
 
It looks like I may be beyond my ability here to convert the player string into something readable according to the #defines. What this means is that I'm going to have to make this PlayerType tag an integer and at the top of the file in the note lines give the integer that reflects the numeric value of the Player we're looking to indicate.

Therefore, with the PlayerType tag we may put something like:
<PlayerType>50</PlayerType> to represent the BARBARIAN_PLAYER.

I just don't have the functions that can grab BARBARIAN_PLAYER and convert it from a string into the equating #define value. And I certainly don't have the knowledge on how to build that. So for now, until a better programmer than myself can look into that, I'm limited to this solution.

OK IF this is not going to work correctly, RIGHT NOW, pls dont put it in C2C (AT THIS TIME), thx . . SO
 
It'll work fine. It just asks the xml programmer to take a conversion step that we can later possibly find a way to resolve. Once resolved, changing from a number to a name to refer to the player index (which isn't mapped the same as every other index in the game) will be as simple as running a replacement command in notepad++. It's something that doesn't impact the underlying coding as much as the surface coding and would be considered rude to setup this way if I had any other way to go about it.

To be clear, ALL this means is that to refer to the player you must use the correct player index number with this tag rather than the tag name, such as BARBARIAN_PLAYER.
 
I'm butting heads with the exe at the moment so this could take a while to sort out some aspects of this matter of adding NPC players. I THINK this can be done but... it could take a lot of poking at it from many different angles to see how to get it done. Might mean some completely different approaches to what I had originally envisioned. Ugh...
 
I would like to officially report that I have successfully split barbs and animals and made room for additional NPC players as needed. :D

I have a lot of work to do to get the python stuff to play nicely with it all but the animals are spawning on the correct teams and for the most part things are working well. There's just about a thousand small bug issues it's now created that I BELIEVE are almost all python derived as there's quite a few hundred calls to barbarians there as well and the one bug I researched pointed in that direction. I'm sure there are many more and before I can be sure I've got any issues in the dll, I'll have to correct those.

@DH: I'll go ahead with that effort but be ready for any questions I might have ;) Should be fairly straightforward stuff and now that I can use an actual python editor program, my notepad++ won't be fouling me up with py, which it was at one point, making me pull my hair out.


THEN, still to come before I commit all this will be a major cleanup job where I go through and basically eliminate as many tags and data storages in all classes as I can get away with. This is best done when we're breaking saves anyhow. Options are only one element of this but I'll cleanup what would not be ever used in that list as well.

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

Team Tasks
  • Define the base <iAggression> tag on all wild animal unit infos (scale of 0-10 with 10 the most likely to attack anything it can) and I'll commit a new schema that lets us do that - won't have any effect until I get the dll in place but they need these definitions.

  • And we need to get the Passive or Aggressive players defined with care on all Spawn Infos for each animal. What I suggest is to go down the list and where its a question mark, bring it up in the forum immediately and we can discuss what to do with it.

  • We also need to consider how to define bDefensiveOnly and bStealthDefense on each animal Unit Info. (We could also give some animals bAssassin and give them targetUnitClasses or targetUnitCombats - this is how we COULD define their primary prey targets.)

I've got a LOT of work on my end yet to go but all this can be done in the meantime which would make this a fantastic team effort!


In relation to what I was saying earlier about how to define a PlayerType tag in the Spawn Infos, it does still need to be a numeric ID of the player, not the name of the player in text. I've put the chart at the top of the file and I'll be committing that to the SVN along with the new Unit Schema but for sake of reference:

BARBARIAN_PLAYER = 40
AGGRESSIVE_ANIMAL_PLAYER = 41
PASSIVE_ANIMAL_PLAYER = 42
NPC1_PLAYER = 50
NPC2_PLAYER = 49
NPC3_PLAYER = 48
NPC4_PLAYER = 47
NPC5_PLAYER = 46
NPC6_PLAYER = 45
NPC7_PLAYER = 44
NPC8_PLAYER = 43

So, for example, if you would normally want to put BARBARIAN_PLAYER in the PlayerType tag, you'd instead just put <PlayerType>40</PlayerType>
 
Congratulations!

Two questions:
Would iAgression affect the probability that an animal would use the bAssassin ability?
I'm curious about what kind of problem you had with editing python in notepad++? I haven't had any issues like that yet, and would like to avoid them in the future
 
Congratulations!

Two questions:
Would iAgression affect the probability that an animal would use the bAssassin ability?
I'm curious about what kind of problem you had with editing python in notepad++? I haven't had any issues like that yet, and would like to avoid them in the future

First ... Thanks! It was touch and go there for a moment til I figured out what the root of the problem I was having was... the new NPC civs weren't initializing because the exe was always given to initialize the civs + the barbarian. So I had to figure out how to initialize the new civs if they were to be in play. That was a little tricky. But I figured it had to be possible since Rev was able to do it and I think inadvertently they'd paved the way for me there by solving what would've been a nightmare of a problem in the process that had me thrown for a loop until I saw some notes others had left behind and the solution they were using.

1) iAggression could be made to not play a role in the Assassin ability. It would be very easy to check to see if assassination is possible and, if so, attempt it, and make that independent of the normal attack willingness based on iAgression. (Adding to my task list now as I assume this is what you're intending to insinuate.) What this would not accomplish, however, would be the infusion of desire to attack units of their target types when they are not on the same plot. But I could program something for that that shouldn't be too difficult nor slow to process. Could be able to put some of this into the hunting AI to improve that a bit too so that hunters aren't looking to take down neanderthals with the same desire as they would a deer so long as the odds were in their favor enough to warrant it.

2) The problem I can have in notepad++ applied to Python is that the spacing of a tab button is all screwy for python. There's probably a way to manipulate notepad++ to get it to tab properly for py files but I don't know how to go about that myself. If I'm just manipulating a little text within a line here and there and don't need to work with NEW lines of code, it usually isn't problematic. I'm finding I'm about a quarter of the way through the py files I need to work with for the barb references and have not yet had to work with a file outside of notepad++ but if it gets complicated I'll need to open that file in my py manager.
 
1) iAggression could be made to not play a role in the Assassin ability. It would be very easy to check to see if assassination is possible and, if so, attempt it, and make that independent of the normal attack willingness based on iAgression. (Adding to my task list now as I assume this is what you're intending to insinuate.) What this would not accomplish, however, would be the infusion of desire to attack units of their target types when they are not on the same plot. But I could program something for that that shouldn't be too difficult nor slow to process. Could be able to put some of this into the hunting AI to improve that a bit too so that hunters aren't looking to take down neanderthals with the same desire as they would a deer so long as the odds were in their favor enough to warrant it.

Nah, I actually would prefer iAggression to affect the willingness to use the assassination ability.

P.S. I'm pretty sure I've used tabs in the python I've edited without issues...


Have you tried setting the language to Python?
Untitled-1.jpg
 
Pretty sure when I was doing more there I did but maybe that was the problem.

Explain your thinking if you would on the iAggression issue...
 
Explain your thinking if you would on the iAggression issue...

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.
 
Back
Top Bottom