Affinity?

No. Affinity means that the unit will gain extra strength per resource its owner controls (if doesn't technically have to be mana, but all the affinity in the game is currently for mana.)

Actually, I was planning to create a thread to complain about the way affinity is currently implemented. Since Your question has already been answered, and since the title wasn't too specific, I'll just hijack yours instead.


It bothers me that the damage type of each kind of affinity is set in the resource code, instead of being dependent on a particular unit. For instance, a for an Illian Hero/UU it might make since for Air Mana to cause cold damage (clilly, blizzard-like winds), while for arcane units lightning makes more sense, and for a ship might be good with no specific type to its strength.

I don't like that it is only implemented as a strength bonus, and isn't divided into attack and defense. I'd like to see it divided, so that a unit or promotion promotion could, for example, grant +1 attack and -1 defense per mana owned. (That sounds appropriate for a unit like a berserker or a promotion like burning blood.) I'd also like the ability to grant non-strength bonuses from affinity, like bonus movement (+1 movement affinity for Air mana would be a very nice way for fair winds to work.) There are plenty of other things that would be great tied to affinity, like the chances that a unit will turn barbarian from the Enraged or Burning blood promotions, the chances that promotions will expire, the % bonus versus specific units/units with specific promotions (e.g., monks could be 10% stronger versus barbarian per spirit mana), and the chances that a spell will fail/miscast.


I would also really like it it you could grant fractional affinity. Since movement, strength, etc, are defined as integers it probably isn't possible to have it really grant a fraction of a point of strength/movement, but you could make it round off or assign +x strength/movement/etc per y of a resource.

I realize this probably won't make it in on time for shadow, but it would be great
 
Do you happen to have a list of units that have affinities?
 
Spoiler :
No. Affinity means that the unit will gain extra strength per resource its owner controls (if doesn't technically have to be mana, but all the affinity in the game is currently for mana.)

Actually, I was planning to create a thread to complain about the way affinity is currently implemented. Since Your question has already been answered, and since the title wasn't too specific, I'll just hijack yours instead.


It bothers me that the damage type of each kind of affinity is set in the resource code, instead of being dependent on a particular unit. For instance, a for an Illian Hero/UU it might make since for Air Mana to cause cold damage (clilly, blizzard-like winds), while for arcane units lightning makes more sense, and for a ship might be good with no specific type to its strength.

I don't like that it is only implemented as a strength bonus, and isn't divided into attack and defense. I'd like to see it divided, so that a unit or promotion promotion could, for example, grant +1 attack and -1 defense per mana owned. (That sounds appropriate for a unit like a berserker or a promotion like burning blood.) I'd also like the ability to grant non-strength bonuses from affinity, like bonus movement (+1 movement affinity for Air mana would be a very nice way for fair winds to work.) There are plenty of other things that would be great tied to affinity, like the chances that a unit will turn barbarian from the Enraged or Burning blood promotions, the chances that promotions will expire, the % bonus versus specific units/units with specific promotions (e.g., monks could be 10% stronger versus barbarian per spirit mana), and the chances that a spell will fail/miscast.


I would also really like it it you could grant fractional affinity. Since movement, strength, etc, are defined as integers it probably isn't possible to have it really grant a fraction of a point of strength/movement, but you could make it round off or assign +x strength/movement/etc per y of a resource.

I realize this probably won't make it in on time for shadow, but it would be great

perhaps ships could get a movement bonus

=int(airmanatotal/2)+1
so the spell would give +1 movement to start,and +1 for every 2 air mana

(assuming int() rounds down, it may need to be changed if you use a diffrent function for rounding in vb or We...)
 
Considering that you need 1 air mana to get fair winds it seems pretty balanced as rounded down:
mana-+mov
1[TAB]+1
2[TAB]+2
3[TAB]+2
4[TAB]+3
etc
 
@IEATCRAYONS: do you need more elaboration on this?

@Magister
Changing it to something like this?
Code:
            <BonusAffinities>
                <BonusAffinity>
                    <BonusType>BONUS_MANA_AIR</BonusType>
                    <DamageType>DAMAGE_COLD</DamageType>
                    <iAffinityCombat>1</iAffinityCombat>
                    <iAffinityCombatDefense>0</iAffinityCombatDefense>
                    <iAffinityCombatChange>0</iAffinityCombatChange>
                    <iAffinityCombatDefenseChange>-10</iAffinityCombatDefenseChange>
                    <iAffinityMovement>1</iAffinityMovement>
                    <iAffinityMovementChange>25</iAffinityMovementChange>
                </BonusAffinity>
            </BonusAffinities>
Where 'Change' are percentages of the base value(-100 or higher). So for two air mana and a melee unit with 10/10(just to keep it simple) and 2 movement would change the unit to 10 melee +2 cold damage offense / 8 defense and 5 movement. movement: ((.25*2)*2)+(1*2) +2 ((movementChange*mana)*base)+(affinity*mana)+base

Modifying the % chances in the promotions(barbarian, miscast, etc) is a bit beyond me atm. I think it will take far more effort then the benefits though.
 
Sounds good to me! It may not have everything I could possibly want, but it would be a huge improvement over the current system.

This and allowing fractional affinity (rounded or truncated, of course), would be almost perfect.

The new PyPerTurn attribute of promotions which Kael just announced in the bug thread could also be useful in giving these abilities. Actually, I think affinity would work fine if were done only though the PyPerTurn python function, but I would still prefer to implement affinity in XML the way you suggested (well, the way I suggested, but the way you typed it out). That would be easier on modders and, since it relies on actually applying the affinity through C++ instead of python, it wouldn't slow the game down so much.

(also, I'm not quite sure where you got the strength (10 +2 cold offense)/8 defense; if you are going by the specific values wouldn't be (10+2 cold)/10 (with a -10% on the defense)? I would also like it if you could assign separate types for offensive/defensive strength, but that really isn't necessary since you could just give a unit affinity for the same mana type twice, once changing only offense and once changing only defense.)


(I'm not even sure about needed the percent changes to strength and movement, just about making it possible to set the damage type, provide different attack and defense, and add movement)
 
Affinity is constantly updated. You will get the strength when you get the mana, and will lose it when you lose the mana.

There are actually some bugs with affinity which I don't think we have completely figured out yet; sometimes a unit with affinity seems to continue to gain strength for no apparent reason. This usually happens with Druids or Dwarven Druids, since most units with affinity are summons and have a limited duration (they disappear after a turn or three). People have have noted (and even posted screen shots showing) that Yvain the Woodelf (the FoL Druid Hero, who has 2 nature affinity instead of just 1) with strength in the high 70's! This doesn't seem to happen in most games, but when it does it can really change things.
 
Well, if they happen to use my unit idea, then they have to put in negative affinity anyway. I have to admit, I didn't look at the code to see if it's possible... but since it can already add +1, I figured it could add -1 :p .
 
Units can already have negative affinity,although I don't think it works once the the strength lost from affinity surpasses the base strength. I'n also not sure how it works if the affinity subtracts a type os strength the unit doesn't have (like, making spirit affinity subtract holy damage from demons. What would that do?)
 
Units can already have negative affinity,although I don't think it works once the the strength lost from affinity surpasses the base strength. I'n also not sure how it works if the affinity subtracts a type os strength the unit doesn't have (like, making spirit affinity subtract holy damage from demons. What would that do?)

the base strength with affinity is calculated first so... it would reduce in net strength vs units, except those immune to holy damage...
(minimum 1 base strength i believe, 0 and below may be possible-but buggy)

the calculation would get really wonky with demon on demon action, as -50% resist would actually grow the decrease from negative affinity
(from 10 str-4 to 10str-6)

whew!


negative affinity would be coded to give enemies a positive bonus instead, based on "their" mana, to have the calculation most realistic.
 
Do you happen to have a list of units that have affinities?

Units with Affinity (Mana Type/Affinity Amount):
Air Elemental (Air/1)
Ars Moriendi (Death/2)
Druid (Nature/1)
Dwarven Druid (Earth/1)
Earth Elemental (Earth/1)
Fire Elemental (Fire/1)
Spectre (Death/1)
Wraith (Death/1)
Yvain (Nature/2)

just noticed Kael made the change to the affinity xml format i suggested heh
 
You were right, it makes life much easier. ;) (plus we needed it to make the banana golem with +3 banana affinity)
 
Any chance you'll go a step further and make the xml change that CXDamian and I suggested?
 
Back
Top Bottom