Advertisement
Civilization Fanatics' Center  

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.

Go Back   Civilization Fanatics' Forums > CIVILIZATION IV > Civ4 - Creation & Customization

Notices

Reply
 
Thread Tools
Old Jan 24, 2007, 08:08 AM   #1
Exel
Prince
 
Exel's Avatar
 
Join Date: Nov 2001
Location: Finland
Posts: 440
Science 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!
Exel is offline   Reply With Quote
Old Jan 24, 2007, 08:13 AM   #2
Kael
Deity
 
Kael's Avatar
 
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());
The important part here is the bolded line. That is a modifier based on the relative strength of the two units. So if the defender has 50% more strength than the attacker he gets 50% more xp, etc.

So in effect your idea is already in place.
Kael is offline   Reply With Quote
Old Jan 24, 2007, 08:44 AM   #3
Exel
Prince
 
Exel's Avatar
 
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?
Exel is offline   Reply With Quote
Old Jan 24, 2007, 10:36 AM   #4
Kael
Deity
 
Kael's Avatar
 
Join Date: May 2002
Location: Ohio
Posts: 17,392
Quote:
Originally Posted by Exel View Post
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?
Yes, iDefenderOdds could modify the result.
Kael is offline   Reply With Quote
Old Jan 24, 2007, 12:06 PM   #5
Exel
Prince
 
Exel's Avatar
 
Join Date: Nov 2001
Location: Finland
Posts: 440
Quote:
Originally Posted by Kael View Post
Yes, iDefenderOdds could modify the result.
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.
Exel is offline   Reply With Quote
Reply

Bookmarks

Go Back Civilization Fanatics' Forums > CIVILIZATION IV > Civ4 - Creation & Customization > Experience modifier for Combat Odds ˇCODING NEEDED!

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


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


Advertisement

All times are GMT -6. The time now is 11:36 PM.


Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
This site is copyright © Civilization Fanatics' Center.
Support CFC: Amazon.com | Amazon UK | Amazon DE | Amazon CA | Amazon FR