Pie AE K-MOD merge Project

With the new dll I'm getting this message ingame every turn:

upload_2021-6-6_16-8-52.png
 
Attached is a save (if the message doesnt come this turn, just go a few turns. It will come)


Another thing I realised: Animals are not entering my borders anymore. Seems like vanilla BtS.
Maybe you got that wrong with animals. We want them to be UNITCOMBAT_ANIMAL again and then let them enter borders and attack cities...

Pie changed it to UNITCOMBAT_MELEE because of that reason -> they didn't attack players in BtS

And with that Melee change, all Hunters got +100% against Melee... but that is not intuitive... as Melee is Animals in PAE, so far.
 

Attachments

cool ill check,
but, i already edited the dll....il have to reproduce i think.

animals, i will investigate, all i did is to disable the check is animals can enter owned tiles.
humm - so , should i set to melee or animals?

ah wait, the animals do have melee.
 
Last edited:
ah wait, the animals do have melee.
yes they have! But that's wrong!
We wanted to have them not melee, but animals again. AND let them attack cities / enter borders..
I think also the aggressiveness of animals against players is much higher because ot the Melee combat (together with BeAnimal=false). That they are really wanting to attack the player!

That should be implemented in the Animal setting somehow.

Most important (for me) is, that Hunters have strength against Animals again, not against Melee. AND let animals attack cities / enter borders anyway...

[EDIT] Maybe it's in the UnitAI rather than UnitCombat... I don't know.


_________________
Great work keldath! I really appreceate your effort here!
 
Last edited:
i got an assert error on a religion found on cartage,

void CvCity::changeReligionInfluence(ReligionTypes eIndex, int iChange)
{
FAssertMsg(eIndex >= 0, "eIndex expected to be >= 0");
FAssertMsg(eIndex < GC.getNumReligionInfos(), "eIndex expected to be < GC.getNumReligionInfos()");
m_paiReligionInfluence[eIndex] = (m_paiReligionInfluence[eIndex] + iChange);
FAssert(getReligionInfluence(eIndex) >= 0);
}


this is the function : gc.getGame().setHolyCity(
this is the only relevant place i could find:
def onReligionFounded(self, argsList):
in eventmanager.py.
this line:
gc.getGame().setHolyCity(iReligion, pCapitalCity, 0)

so i added this one :
#keldath fix - before setting a new holy city - make sure it get the designated religion
pCity.changeReligionInfluence(iReligion,1)
gc.getGame().setHolyCity(iReligion, pCapitalCity, 0)


***i checked the animals ai,
is quite barren,
random chance to attack (handicap influenced).
search for enemies ones tile away (maybe increase?)
cant find - heal,
if healed - do patrol.
thats it.
unitcombat just used for promotions and such.
maybe setting unit ai for animals as unitai_attack...


*****
another py error - added a fix i think.

def doSeewind():
terr_ocean = gc.getInfoTypeForString("TERRAIN_OCEAN")
terr_ocean2 = gc.getInfoTypeForString("TERRAIN_DEEP_OCEAN")
feat_ice = gc.getInfoTypeForString("FEATURE_ICE")
#keldath fix - a list starts at 0 :)
iNumDirection = 7#8


****
make sure you guys play with python error log are on.
 
Last edited:
cool kel,
I think, animals shall attack into borders but they don't really need to attack cities. it would be great, if animals stop attacking cities, when a city palisades/city walls.
 
i got an assert error on a religion found on cartage,

void CvCity::changeReligionInfluence(ReligionTypes eIndex, int iChange)
{
FAssertMsg(eIndex >= 0, "eIndex expected to be >= 0");
FAssertMsg(eIndex < GC.getNumReligionInfos(), "eIndex expected to be < GC.getNumReligionInfos()");
m_paiReligionInfluence[eIndex] = (m_paiReligionInfluence[eIndex] + iChange);
FAssert(getReligionInfluence(eIndex) >= 0);
}


this is the function : gc.getGame().setHolyCity(
this is the only relevant place i could find:
def onReligionFounded(self, argsList):
in eventmanager.py.
this line:
gc.getGame().setHolyCity(iReligion, pCapitalCity, 0)

so i added this one :
#keldath fix - before setting a new holy city - make sure it get the designated religion
pCity.changeReligionInfluence(iReligion,1)
gc.getGame().setHolyCity(iReligion, pCapitalCity, 0)

Ah good.

***i checked the animals ai,
is quite barren,
random chance to attack (handicap influenced).
search for enemies ones tile away (maybe increase?)
cant find - heal,
if healed - do patrol.
thats it.
unitcombat just used for promotions and such.
maybe setting unit ai for animals as unitai_attack...

Sounds plausible, let's try unitai_attack as default for animals.
I can do the rewriting of unitcombat_melee to _animal, or did you already start that?

another py error - added a fix i think.

def doSeewind():
terr_ocean = gc.getInfoTypeForString("TERRAIN_OCEAN")
terr_ocean2 = gc.getInfoTypeForString("TERRAIN_DEEP_OCEAN")
feat_ice = gc.getInfoTypeForString("FEATURE_ICE")
#keldath fix - a list starts at 0 :)
iNumDirection = 7#8

No, random returns from 0 to num-1, according to the comment in CvRandom.h. So rand(8) is fine to get numbers from 0 to 7.
 
new assert, new fix,
some units have
<DefaultUnitAI>UNITAI_COLLATERAL</DefaultUnitAI>
which is wrong , fails the code.
changed to
<DefaultUnitAI>UNITAI_ATTACK_CITY</DefaultUnitAI>.

**
hey Pie,
for now animals will not get into cities.
how about, extending the search range for animals - ? 2-3?

also,
since you like barbarians/animals - why not use platy pesky barbarians? its perfect, you can use it for animals.

edit - :

random - it gave out a py error of out of bonds index... so...better 7 :)
or at least add try: except: on it.
 
Some units? Maybe archers? They should do collateral damage and use their ranged strike for that.
 
im on fire:

@pie_at :

if (isAnimal())
{
//keldath for PAE - animals can get into owned tiles -start
/*
if (pPlot->isOwned())
{
return false;
}
*/
//keldath for PAE - animals cannot get into cities - due to the above.
//by Pie request - if a city has either def buiding, animals cannot attack cities. i hope...
if (pPlot->isCity())

{
bool walls = false;
bool castle = false;
CvCity* pCity = pPlot->getPlotCity();
for (int iI = 0; iI < pCity->getNumBuildings(); iI++)
{
int bIndex = GC.getBuildingClassInfo((BuildingClassTypes)iI).getDefaultBuildingIndex();
walls = GC.getInfoTypeForString("BUILDINGCLASS_WALLS") == bIndex;
castle = GC.getInfoTypeForString("BUILDINGCLASS_CASTLE") == bIndex;
}
if (walls || castle)
{
return false;
}
}

**
flunky - these untis: <Class>UNITCLASS_KAMPFHUND</Class>
seems collateral cant be default.
 
Last edited:
ok new dll and assets push:

- features (ice) now have water movable tag (also game option on the global defines)
- animals will attck cities unless they got walls or castles - tests needed
- animals have up to 3 search range for valid attacks - test on animals required.
-asserts fixes:
aiattitude
holy city move where theres no religion error
storms index larger than the list
other asserts i forgot about :)

not sure ill have more time this week, here and there,
keep on testing and reporting the errors + turn on python errors.
ALSO - fix Platyping - world building doesnt function when choosing items from the left list boxes...

cheers :)
 
Yeah, idk what's wrong with the world builder. The files from Platyping subfolder are unchanged and in WBDesc I find nothing suspicious. Or is that MainInterface?

I put up a pull request, I found some minor bugs in the merge.
 
PAE doesn't have a building called: BUILDINGCLASS_CASTLE
take BUILDINGCLASS_PALISADE instead of walls, because this is prereq for walls.

isAnimal function:
shouldn't be "if (pPlot->isCity())" in if (pPlot->isOwned()) {} ?

aninals range 2-3: 2 is ok, as it was before.

I don't know "platy pesky barbarians". What's special?

UNITAI_COLLATERAL: shall check and attack an enemy stack via ranged combat. no matter if on open plots or in cities.
 
Oh ops, i looked at doto xmls for buildingsby mistake.
Ill amend.

Animal,
First check if target plot is city, if so, run the building check.
The own is not needed any more, to allow entry to borders.

Animals ai, ok ill change to 2. Need to see how the ai handling it anyway.

Pesky barbs,
Look in platy mods, ill link later.
Barbs spawn everywhere, with some cool parameters to play with.

Ok, colatteral, will change to unitai_attack.
But ai code shifts between unitai depending on many factors.
 
Let me have a look at the combat AI regarding ranged/collateral. That concept is not in BtS, so probably AI doesn't know how to use those units.

Why not use the attack AI for animals? We could put a modified copy in the animal AI.
The search range should be 3, if we stay with the simple animal AI. Pie understood movement range, I guess.

Is there a more general way to check for defensive buildings? Defense value itself is not good, because in PAE not only walls give defense, also some temples or such. But only walls should block animals. The most verbose way would be a new XML tag bBlocksAnimal, but maybe there is a simpler way?
 
Hey,

If you gonna use other than unitai animal,
You subject the unit to a more complex ai.
Range in that matter is irrelevant.
More complex ai will make the animals more safe play, they also may show strange behaviors, due to no cities.
Yiu can try, but not sure how will. It work.
Animals should be more "stupid".

I urge once more, check pesky barbs, youll be able customise animal spawn.
In disguise as barbarian units.


Defensive,
Yes, a city has a totaldefense calculations functions,
I could just test for that above 0, dont attack.
Simple.
Thouhh i like the walls approach.
 
What I would like to see with animals: They should not attack every time.
Usually predators only attack humans when these are at bad health OR when the animals are extremely hungry and can't find other prey.

So I'd suggest, to let animals attack let's say only 33% of the cases. Let them run through player territory anyway.


Don't know how others like that idea.
But I find it more realistic, when animals are still a threat, but not so predictably attacking ALL the time...
 
Back
Top Bottom