FfH2 Bug Thread

Two issues and my suggestion to fix them.
  • Lich is team unit (3 allowed), but each player in same team can have 4 liches.
    You can have 4 liches and your ally Basium can have 4 liches, then one team can have 8 liches, even if only 3 allowed.
  • Multiple units can open only one chest multiple times.
    Multiple vampires can feed only one bloodpet multiple times.
 

Attachments

Two issues and my suggestion to fix them.
  • Lich is team unit (3 allowed), but each player in same team can have 4 liches.
    You can have 4 liches and your ally Basium can have 4 liches, then one team can have 8 liches, even if only 3 allowed.
  • Multiple units can open only one chest multiple times.
    Multiple vampires can feed only one bloodpet multiple times.

I have been fighting with those stack casts forever, thats a great find.

I think lich having the 3 team limit was a mistype (that didnt really impact anything since the limit was enforced by the lichdom spell). I switched it to the correct value.
 
I suspect the team limit was a holdover from when the unit had a player limit of 3 too.

Yeah, and since it was in the wrong field it wasnt caught by the copy/paste that updated them all.
 
Patch "m" is linked in the first post. It will break save games and fixes the following issues.

1. Customized the No Tech Trade Threshold (generally made the AI more willing to trade techs).
2. The AI should gold rush more frequently now.
3. Scorpion Clan Goblins now with 100% more scorpions (art from Kohan 2 converted by Deliverator).
4. New Avatar of Wrath model (art from Kohan 2 converted by Deliverator).
5. Fixed an issue with feasting Denev found (no idea what the actual impact would be, but it cant be good).
6. Fixed an error with the discovery chances string.
7. Updated all the leader attributes for Sephi's AI settings.
8. Disciples of Acheron/Sons of the Inferno will no longer be capturable by For the Horde (will fix a python error).
9. Genesis will now correctly remove all hell terrain from the players lands.
10. Rewrote genesis and correctly set some allowable terrain on some features to fix some feature wiping conditions.
11. Fix for stack casts (multiple units opening a chest as one, etc) by Denev.
12. Rust is 20% easier to resist.
13. Ring of Flames damage reduced from 20 to 15%.
 
[to_xp]Gekko;8855028 said:
awesome, thanx Kael! does it also fix the issue with AIs switching back and forth between religions btw?

I dont know. I broke save games pretty early so I couldnt load the sample saves and I adjusted the religious preferences to be more in line with WildMana. I didnt see any religion flipping in my games, and I played a few games all the way to the end.
 
First
This is not a bug, but my suggestion about genesis.
Genesis removes hell terrain, then I believe Snow-covered tile by Snowfall spell should be restored and be vitalized alike.
Genesis just vitalizes temporary terrain (snow terrain from snowfall), and doesn't change real terrain.
When tundra which is melted snow by genesis is vanished after 6 turns, you will know that genesis has not affected the tile after all.

I have modded so in my modmod. I hope you are interested in my suggestion, and check it. This is here.
If you are not, please ignore and never mind. :)


Second
Multiple opening chest cheating still remains.
When more than one treasure box exists in the same tile, you can still do it.
CvSpellInterface.py spellOpenChest() line 1986
Code:
		pTreasure.kill(True, 0)
This line should be the following.
Code:
		pTreasure.kill(False, PlayerTypes.NO_PLAYER)
This is same as spellCommanderJoin() doing.
spellFeed() is too.
Code:
		pVictim.kill(True, 0)
This should be
Code:
		pVictim.kill(False, PlayerTypes.NO_PLAYER)

Third
Treasure box's fire trap shows pink icon.
CvSpellInterface.py spellOpenChest()
Code:
				CyInterface().addMessage(iPlayer,True,25,CyTranslator().getText("TXT_KEY_MESSAGE_TRAP_FIRE", ()),'AS2D_POSITIVE_DINK',1,'Art/Interface/Buttons/Spells/[COLOR="Blue"]Ring of Flames.dds[/COLOR]',ColorTypes(8),pPlot.getX(),pPlot.getY(),True,True)
This should be the following.
Code:
				CyInterface().addMessage(iPlayer,True,25,CyTranslator().getText("TXT_KEY_MESSAGE_TRAP_FIRE", ()),'AS2D_POSITIVE_DINK',1,'Art/Interface/Buttons/Spells/[COLOR="Red"]Ringofflames.dds[/COLOR]',ColorTypes(8),pPlot.getX(),pPlot.getY(),True,True)


Forth
Last, this is repost of mine #2867.
Ira with Orthus's Axe gains +2 strength after defeating alive enemy unit.
Repentant Angel with Orthus's Axe loses no strength after defeating alive enemy unit.

This is suggestion sample code to fix them.
In addition, you should add "CvUnit::getTotalDamageTypeCombat()" function to Python API. (CyUnit.cpp, Cyunit.h, CyUnitInterface1.cpp)
 

Attachments

Something's still strange with leaderheadinfos.xml. For many leaders, many tags are missing.
 
Having a LOT of OOS problems with multiplayer as of patch m. Unsure why, there doesn't seem to be any trigger like there was with Hyborem's AV spread a while ago. But it's there. Every 5-10 turns we would get an OOS, starting around turn... 180 I think?
 
Got a CTD with patch M, shortly after acheron moved into a city close by (its culture expanding into my new city with no culture itself.)

Also, New forest seem to be slow to grow on improved tiles.
 
Can anyone check, does Sabathiel give a diplo penalty for following a different faith then the one he adopted?
 
First
About spell damage calculation

CvUnit::castDamage() calls doDamage() function.
iDmg is base damage value of each spell from XML.
Code:
	pLoopUnit->doDamage([COLOR="Blue"](iDmg / 2) + GC.getGameINLINE().getSorenRandNum(iDmg, "doDamage")[/COLOR], iDmgLimit, this, iDmgType, true);
First argument of doDamage() is max value of random damage.
castDamage() gives (iDmg / 2) + GC.getGameINLINE().getSorenRandNum(iDmg, "doDamage") on there.

Then, doDamage() receives it as "iDmg" and calculates final damage.
Code:
	iDmg = GC.getGameINLINE().getSorenRandNum([COLOR="Purple"]iDmg[/COLOR], "Damage") + GC.getGameINLINE().getSorenRandNum([COLOR="Purple"]iDmg[/COLOR], "Damage");
As can be seen, XML damage value is randomized twice. Is this intentional?
I think randomization process is needed only once, IMHO.
Twice process will weaken weight of XML value...



Second
CvPlot::changePlotCounter() has changed so nice! ;)
Spoiler :
Code:
void CvPlot::changePlotCounter(int iChange)
{
    bool bChange = false;
    m_iPlotCounter += iChange;
    if (m_iPlotCounter < 0)
    {
        m_iPlotCounter = 0;
    }
    if (m_iPlotCounter > 100)
    {
        m_iPlotCounter = 100;
    }
    [COLOR="Blue"]if (m_iPlotCounter < GC.getTerrainInfo((TerrainTypes)getTerrainType()).getPlotCounterDown())[/COLOR]
    {
        setTerrainType((TerrainTypes)GC.getTerrainInfo((TerrainTypes)getTerrainType()).getTerrainDown(), true,true);
        bChange = true;
    }
    [COLOR="Purple"]if (m_iPlotCounter > GC.getTerrainInfo((TerrainTypes)getTerrainType()).getPlotCounterUp())[/COLOR]
    {
        setTerrainType((TerrainTypes)GC.getTerrainInfo((TerrainTypes)getTerrainType()).getTerrainUp(), true,true);
        bChange = true;
    }
    if (bChange)
    {
        [COLOR="Red"]if (getFeatureType() != NO_FEATURE)
        {
            if (!GC.getFeatureInfo(getFeatureType()).isTerrain(getTerrainType()))
            {
                setFeatureType(NO_FEATURE);
            }
        }[/COLOR]
    }
}
But I believe this code doesn't work like your intention.
Blue marked line is always true when terrain is not hellish even if terrain is not changed.
Purple marked line is always true when terrain is hellish even if terrain is not changed.
Then, red marked lines can be reached even if terrain is not changed actually.
 
OP still has patch m labeled as unreleased. :)
 
Code:
	iDmg = GC.getGameINLINE().getSorenRandNum([COLOR="Purple"]iDmg[/COLOR], "Damage") + GC.getGameINLINE().getSorenRandNum([COLOR="Purple"]iDmg[/COLOR], "Damage");
As can be seen, XML damage value is randomized twice. Is this intentional?
Adding two random results is used here to produce a bell curve, where extreme results are rare and median results are more common. This is similar to what happens when two 6-sided dice are rolled and added. The result of 7 has a 6-in-36 chance to occur, but the each of the results 2 and 12 only has a 1-in-36 chance to occur. The result is that the damage can sometimes be higher or lower, but will most often be of a median amount.
 
Adding two random results is used here to produce a bell curve, where extreme results are rare and median results are more common.

Yes, I understand it. Twice randomize which I want to say is not about a bell curve.

First randomize is castDamage() doing.
Second randomize is doDamage() doing.

castDamage() calculates the ceiling value of spell damage with random factor.
I believe this process doesn't need random factor, because randomize process (bell curve) already exists in doDamage().
I think a bell curve is beautiful, necessary and sufficient for randomization.
 
These are from patch 'L', but i don't see them fixed in patch 'M'

Casting maelstrom and hitting an AI unit didn't start a war, despite injuring him

Is it intentional that Arcane units can't get sentry anymore?

3 Hero Mages were capped at 100 experience even from battles with non barbarians. At war with the bannor after 5 fights, each was still at 100xp.

Battlles are not occuring against the best defender, infact it seems quite random on ocassion. 3 identical , fully healed, mounted mercenaries attacked a stack of calabim troops, first odds with 99 against a catapult, then 97 against a catapult, then 50 against a vampire. in the stack were several skeletons, vampires and moroi, all fully healed, there were no marksman promotions or anything like that i could see, so shouldn't the best defender be the first defender. That is simply the only specific instance i can recall, i'm seeing the behavior constantly.
 
Vampires are channeling 2 units so they are among the last to defend.

Should have been the moroi then that defended(moroi is 4 + weapons promotions over the catapults 3 defense with no terrain bonuses) And like i said, this is just the specific instance i can remember.

And in regards to the defense order and arcane units, i would hope there is a threshold, since vampires can get ridiculously powerful.

EDIT: to avoid clutter, in response to emptiness's very valid point below, the mounted mercenaries did not have shock, only combat 1. So it still should have been the moroi who defended. Sorry for failing to provide all the neccessary information.
 
The attacker's promotions also affect who will defend the stack. If the mounted mercenaries had the Shock promotion, then the Moroi would have been weaker by comparison, which might have caused the Catapults to be the "best" defenders (other than the Vampires, which as Angrenost said are less likely to defend thanks to Channeling II).

There is a threshold for units with Channeling promotions (arcane or not). Those promotions make the unit less likely to defend, but if the odds for other units in the stack are poor enough, and the odds for the Channeling unit are large enough, the Channeling unit will step up.
 
Back
Top Bottom