| General | Hosted Sites | Civ5 | CivRev | Civ4Col | Civ4 | Civ3 | Civ2 | Civ1 | Misc | Marketplace |
![]() |
|
|
Welcome to Civilization Fanatics' Center. You are currently viewing our site as a guest which gives you limited access to our site features. By joining our free community, you will be able to participate in the discussions, search the forum, send private messages, vote in polls, upload your own screenshots to the gallery, and access many other special features. Registration is fast, simple and absolutely free, so sign up today! If you have any problems with the registration process or your account login, please contact support. |
|
|||||||
![]() |
|
|
Thread Tools |
|
|
#1 |
|
Prince
Join Date: Nov 2001
Location: Finland
Posts: 440
|
Experience modifier for Combat Odds ˇCODING NEEDED!
I've been brainstorming possible ways to improve the Civ4 combat system. One aspect of it I want to improve is the way how experience is accumulated. I find the linear exp gain dull and unrewarding when it comes to winning battles with marginal odds. So I came up with the following.
The experience a unit gains from combat should be influenced by the odds of winning. Winning at only 40% odds should give your units more experience than casually wiping out the enemy at over 90% chances. It would be an incentive to use your units more aggressively, instead of "exping up" units against beat-up or weaker opponents. Maybe not the most original of ideas, but nevertheless something that is gravely missed and deserves implementing. I devised a simple way of achieving the desired result using experience multipliers. Solution: The experience points a unit gains after combat are multiplied by a value that is determined by its odds for winning. Odds / Exp Multiplier < 10% 3X 11-40% 2X 41-59% 1.5X 60-89% 1X > 90% 0.5X For example, if you Knight has a 60% chance of winning an enemy Maceman, it will after successful combat receive only the default amount of experience (multiplier 1). However if the same Knight is then attacked by a Pikeman and wins despite having only 40% chances, it will receive twice the experience (multiplier 2). If it gets attacked again and by some freak chance happens to win despite the attacker now having 97% odds, the Knight's experience points from that combat are tripled (multiplier 3). Cry for modders: I don't know if any of this is actually doable. If it is, coding it is beyond my abilities, them being limited to some basic XML editing. So I'm pleading for you who know your way around the tricks of Civ4 customization (yes, YOU!) to, if you like the idea, code this feature for the rest of us to enjoy. Thank you!
|
|
|
|
|
|
#2 |
|
Deity
Join Date: May 2002
Location: Ohio
Posts: 17,392
|
Here is the code from Warlords for the xp grant to a unit that has just attacked and defeated a unit (pDefender).
Code:
iExperience = pDefender->attackXPValue();
iExperience = ((iExperience * iDefenderStrength) / iAttackerStrength);
iExperience = range(iExperience, GC.getDefineINT("MIN_EXPERIENCE_PER_COMBAT"), GC.getDefineINT("MAX_EXPERIENCE_PER_COMBAT"));
changeExperience(iExperience, pDefender->maxXPValue(), !pDefender->isBarbarian(), pPlot->getOwnerINLINE() == getOwnerINLINE());
So in effect your idea is already in place.
__________________
Civ4: Fall from Heaven II (forum) (webpage), FfH: Age of Ice Civ5: Queen of the Iceni, Legions, Modders Guide to Civilization V Current Project: Fallen Enchantress |
|
|
|
|
|
#3 |
|
Prince
Join Date: Nov 2001
Location: Finland
Posts: 440
|
The problem with that is that it only takes into account the strengths of the combatants, not the combat odds. Most of the time that formula produces only marginal variation to the exp gained, unless you are beating tanks with knights. So it's insufficient for the purpose.
Is there some "iCombatOdds" value that you could replace the strength values with in that code? |
|
|
|
|
|
#4 | |
|
Deity
Join Date: May 2002
Location: Ohio
Posts: 17,392
|
Quote:
__________________
Civ4: Fall from Heaven II (forum) (webpage), FfH: Age of Ice Civ5: Queen of the Iceni, Legions, Modders Guide to Civilization V Current Project: Fallen Enchantress |
|
|
|
|
|
|
#5 |
|
Prince
Join Date: Nov 2001
Location: Finland
Posts: 440
|
Correct me if I'm wrong with the following.
If I used the formula iExperience = (iExperience * iDefenderOdds * 3); the attacker would get a 1,2X modifier for its experience having attacked with 60% odds and 2,1X modifier having attacked with 30% odds? If that's correct, then it gets pretty close to the original scheme I had.
|
|
|
|
![]() |
| Bookmarks |
|
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Combat odds ... | berserks01 | Civ4 - Strategy & Tips | 45 | Mar 11, 2010 02:07 PM |
| Adding combat modifier to technology? Possible? In need of XML help | zup | Civ4 - Creation & Customization | 9 | Aug 19, 2008 05:24 PM |
| Combat Odds | Sarisin | Civ4 - Fall from Heaven | 65 | Jul 20, 2008 02:32 PM |
| Simple Combat Modifier System | yoshi | Civ3 Conquests - Requests, Fixes, & Changes | 19 | Oct 10, 2003 09:52 AM |
| More Combat Modifier Flags ala 'Amphibious Attack' Bonus | yoshi | Civ3 Conquests - Requests, Fixes, & Changes | 6 | Sep 18, 2003 10:47 AM |