Fighting Mechanichs Mod Proposal

I don't know if it would combine well with this mod or not, but I've always felt there should be an option similar to fortify except for attack, so that for example I could move my units next to the city I want to attack and then set them to begin preparing for an attack, and each turn they spend preparing (up to a certain max limit) would give them an attacking bonus.

indirectly this is allready in this mod: usually you will have to bombard the city defences with your artillery for serveral rounds before you want to attack thus you get a kind of attack bonus for your patience with the aritllery. i know it's not what you ment but it's something in that direction.
 
Ok, I've included some promotion overrides to compensate the high default withrawal chance for units. this works fine with the numerical values, however it seems i'm unable to override the PromotionPrereq attribute for the tactics promotion (makes no sense to make leader a prerequisite if this promotion is granted by barracks already... wanted to make it require only combat1 or drill1 in case one has units not build in a city with barracks, but i cannot get rid of the leader prereq). any1 knows a solution?
 
Ok, I've included some promotion overrides to compensate the high default withrawal chance for units. this works fine with the numerical values, however it seems i'm unable to override the PromotionPrereq attribute for the tactics promotion (makes no sense to make leader a prerequisite if this promotion is granted by barracks already... wanted to make it require only combat1 or drill1 in case one has units not build in a city with barracks, but i cannot get rid of the leader prereq). any1 knows a solution?

Unfortunately in WoC modular you can only add stuff not remove or replace it. To remove it you would need to change the base files.
 
Aha, ok this is rather unfortunate. So i guess there is no way around than to make a new tactics promotion and add an impossible prerequisite for the old one... though this old promotion will still leave an entry in the civilipedia :(

BTW i've added negative withdrawl chance for fanatics promotion for testing; the game didn't give me an error so far. but will this work? and what would happen if the retreat chance goes below 0%?
 
Ok, i've tried this out a little and find it works quite well. the better AI makes much better choices and is surprisingly able to cope with that change: after a failed attack many units withdrew and have therefore next to no health. in this case i've observed the AI will retreat it's stack. Also if your attack fails the AI will immediently take advantage of your weakened stack and attack (even if you left a unit back to safeguard the tile in case of an counterattack).

but what does not satisfy me is the expirience you get: not only you will lose far less units you even get 1 xp from retreat - a battle that would normally be lost! especially a army lead by an great general will gain so many levels that it'll always win any fight - no matter how fortified a city may be. changing the xp gain from retreats to zero isn't an option because sige weapons will never earn any xp since they alway withdraw!

what bothers me too is that it's quite hard to get reasonable witchdraw chances for all units: i don't like to have units with 100% retreat chance (what happens very easy for cavalery); max should be 98% so there is the possibility of defeat. at the other hand most infanatry units will never go beyound 60% with means around every secound attack they are expected to die agains a have fortifed foe.

A 40% retreat chance form start on isn't that much as it would seem. but incresing it further to 60% conflits with the fact that cavaliery already has a natural retreat chance between 5% and 30% - meaning a 65% to 90% chance of retreat form start on for them: a huge variance because retreat propabilities are additive(!) not multiplicative - note that 60% means you'll die about ever secound battle while 95% means you are expected to die every 20th attack! i guess i'd need to modify these unit values explicitly.

another problem is that some unit classes coincide due to the upgrade trees. because of this a unit can get both flanking and later (after upgrade) guerilla promotion and therefore will easy go above 100% chance of retreat.

thinking of it: maybe siege/artillery class units could get 100% retreat chance on start - interpreting their health as ammunition maybe - meant to compensate for not beeing able to get xp exept when build?
 
I think the maximum retreat chance was limited in game defines to 90% or 95%.. evasion has similar modifiers. So even if you add promotions that increase this values, there's hard limit that prevents you getting units with 100% withdrawal.
 
I think the maximum retreat chance was limited in game defines to 90% or 95%.. evasion has similar modifiers. So even if you add promotions that increase this values, there's hard limit that prevents you getting units with 100% withdrawal.

Oh, that is good to hear. but this doesn't disolve the problem at it's core. i think i'll try what happens when i change that different withdraw chance bonus multiply instead of add up (like they would normally in propability theorey when they are assumed independent). this seems to be the best solution right now and it would make values called 'chances' behave like one - though it wount be that easy mental arithmetic to multiply all the different bonuses anymore. in that scenario one could even drop that 95% cut off since it would be extremly hard to achive anyway.

hmm... i'll guess this is done somewhere in the dll? calculating the effective withdraw chance of an unit i mean.
 
I think the maximum retreat chance was limited in game defines to 90% or 95%.. evasion has similar modifiers. So even if you add promotions that increase this values, there's hard limit that prevents you getting units with 100% withdrawal.

No, it's worse than that. Here's the code in the dll you are talking about:

Code:
bool CvUnit::isPromotionValid(PromotionTypes ePromotion) const
{
    if (!::isPromotionValid(ePromotion, getUnitType(), true))
    {
        return false;
    }

    CvPromotionInfo& promotionInfo = GC.getPromotionInfo(ePromotion);

    if (promotionInfo.getWithdrawalChange() + m_pUnitInfo->getWithdrawalProbability() + getExtraWithdrawal() > GC.getDefineINT("MAX_WITHDRAWAL_PROBABILITY"))
    {
        return false;
    }

    if (promotionInfo.getInterceptChange() + maxInterceptionProbability() > GC.getDefineINT("MAX_INTERCEPTION_PROBABILITY"))
    {
        return false;
    }

    if (promotionInfo.getEvasionChange() + evasionProbability() > GC.getDefineINT("MAX_EVASION_PROBABILITY"))
    {
        return false;
    }

    return true;
}

Basically, it means that if you make a promotion give too much withdraw chance, the game simply "obsoletes" the promotion, it has no effect. So if the promotion gave +1:strength: and 30% withdraw, and the 30% withdraw put the unit over the limit, the strength bonus would be ignored too. I would watch out for that.
i'll guess this is done somewhere in the dll? calculating the effective withdraw chance of an unit i mean.

Multiple places, but mostly, look in CvUnit.cpp. As for calculating the chance of withdrawel, the game simple gets a random number, between 1 and 100, and if it is in-between the withdraw probability's range, the unit withdraws from combat.

By the way, it's fairly easy to change the expierance from withdrawing in the dll, you could set up a python check in the code, or something of the kind.
 
No, it's worse than that. Here's the code in the dll you are talking about:

Multiple places, but mostly, look in CvUnit.cpp. As for calculating the chance of withdrawel, the game simple gets a random number, between 1 and 100, and if it is in-between the withdraw probability's range, the unit withdraws from combat.

By the way, it's fairly easy to change the expierance from withdrawing in the dll, you could set up a python check in the code, or something of the kind.

Ah, thx for the place to search for. As for the calculation of when a unit withdraws, i supposed it was determined that way. but i talked about how the chances, the procentual value itself is calculated: now the game just adds the bonuses from all promotions to the units natural retreat chance, which is quite odd for me. because hypothetically: if you have to promotions that would grant you both 50% retreat chance the game would juat add them together to 100%. so two times "retreat every secound lost battle" means "retreat every battle" - but it should be: "retreat in 3 of 4 battles", so it would be if they would multiply the chances (or they complements to be exact: (1 - (1-0.5)*(1-0.5)) = 0.75 = 75%).
 
Back
Top Bottom