1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. Photobucket has changed its policy concerning hotlinking images and now requires an account with a $399.00 annual fee to allow hotlink. More information is available at: this link.
    Dismiss Notice
  3. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  4. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  5. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  6. Dismiss Notice
  7. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

Commanders v. 0.1

Discussion in 'Civ4 - Mod Components' started by killmeplease, Jan 31, 2010.

  1. killmeplease

    killmeplease Mk Z on Steam

    Joined:
    Nov 22, 2007
    Messages:
    2,690
    Location:
    Samara
    Commanders v.1.0 beta fix 1

    Description
    This modcomp gives GGs a new function: increase abilities of other units in the stack. Each time any unit wins a battle, GG standing on its plot receives XP. He gets levels and obtains promotions as ordinary units do, but his promotions affect all units in his stack. See pictures below for clearness.

    Here is an army headed by the great general with a few promotions:


    Jaguar warrior receives +3% combat strength from the great general's promotions:


    Commander gets experience when units of his army win battles. he also has a limited control points, this mean that no more than [control points] units will receive commander's boost during a game turn. control points are being restored to their maximum value each next turn.


    Commander gets levels and can obtain various promotions increasing your army's strength:


    If there are 2 and more GGs on a plot, only one will receive XP (more skilled one). Commanders (Great Generals) have 2 abilities: control points that were mentioned above, and command range. Command range is a minimal distance between commander and some unit required for this unit to take commander's bonuses. Commander starts with zero command range, this mean he can boost only those units standing on the same plot with him. Command range can be expanded by taking certain promotions.

    In this mod there are 17 commander promotions (but you can easily add more by editing PromotionInfos):
    Spoiler :



    Operations I: +1 command range, +5 control points


    Operations II: +1 command range, +5 control points


    Operations III: +1 command range, +5 control points, +5% heal in neutral lands


    Operations IV: +10 control points, +5% heal in enemy lands


    Morale I: +2% to combat strength


    Morale II: +3% to combat strength


    Morale III: +4% to combat strength


    Morale IV: +5% to combat strength


    Morale V: +6% to combat strength


    Tactics I: +5% to withdrawal chanse


    Tactics II: +5% to withdrawal chanse


    Tactics III: +5% to withdrawal chanse


    Tactics IV: +10% to withdrawal chanse


    Initiative I: +1 first strike chanses


    Initiative II: +1 first strike chanses


    Initiative III: +1 first strike chanses


    Initiative IV: +1 first strike chanses, continues attack while at full :strength:


    Promotion tree:


    There is a possibility to add a wide variety of promotions if you want as far as most of possible abilities are supported by commander promotions.
    List of supported abilities:
    Spoiler :

    1. visiblity range
    2. extra moves
    3. move discount
    4. air range
    5. intercept
    6. evasion
    7. first strikes
    8. chanse first strikes
    9. withdrawal
    10. collateral damage
    11. bombard rate
    12. enemy heal
    13. neutral heal
    14. friendly heal
    15. combat
    16. city attack
    17. city defense
    18. hills attack
    19. hills defense
    20. domain modifier (e.g. -50 for bombers vs sea units)
    21. terrain attack (e.g. desert)
    22. terrain defense
    23. feature attack (e.g. forest)
    24. feature defense
    25. unitcombat modifier (vs unitclass promos)


    This mod also includes Defender Withdrawal modcomp: units with withdrawal ability can escape combat while defending (as well as in attack). Drill promotions also were modded to increase withdrawal chanse.

    Sources
    In CvGameCoreDLL source files changes are marked with //@MOD Commanders and //@MOD DWM (for defender withdrawal modcomp) comments.
    Changes to XML are marked with <!-- @MOD Commanders --> comment.
    Changes to Python are marked with #@MOD Commanders comment.

    About this release
    It's a beta version of modcomp, so there could be bugs i've missed. please let me know if you notice some.
    • Thanks KJ Jansson for fixing buttons gaphics!
    • Bug leading to CTD when attaching GG to a unit (tracked by PieceOfMind) was fixed.
    • Promotion tree was developed.
    • Initiative IV effect was changed.

    Download
    You can download it here (1.25 Mb).
     
  2. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    29,810
    Location:
    Germany / Netherlands
    Nice idea :goodjob:.
    After you've teached the AI, how to use it, it'll sure add a new part to combat strategy :).
     
  3. PieceOfMind

    PieceOfMind Drill IV Defender Retired Moderator

    Joined:
    Jan 15, 2006
    Messages:
    9,312
    Location:
    Australia
    Nice work!

    I'm interested to see how this turns out. :)
     
  4. skodkim

    skodkim Chieftain

    Joined:
    Jan 16, 2004
    Messages:
    2,084
    Location:
    Denmark
    That is really really fantastic. It is one of the most overlooked aspects of the game and I look so much forward to seing it be developed further - especially the AI part which is really important.

    Good job and good luck :goodjob:

    \Skodkim
     
  5. killmeplease

    killmeplease Mk Z on Steam

    Joined:
    Nov 22, 2007
    Messages:
    2,690
    Location:
    Samara
    thanks for the words of encouragement!

    About AI.. it seems i did it! :woohoo:
    This is how AI behave:
    • If there is an offensive war, AI tries to send his GG with SoD.
    • If there is a defensive war, AI tries to use GG for defending cities.
    • If there is no war, and GG's level is < 4 (or = 0 and it is the only commander AI has), AI uses it in a normal way (as a military instuctor, or to build an academy).
    here's the v.0.2 dll (1.5 MB). Replace an old one with it.

    any comments are welcomed ;)
     
  6. PieceOfMind

    PieceOfMind Drill IV Defender Retired Moderator

    Joined:
    Jan 15, 2006
    Messages:
    9,312
    Location:
    Australia
    killmeplease, I think you should post a link to this thread from the download page. It's always handy in case people stumble across that page without going through this one (e.g. if they're browsing the downloads database).

    Are you releasing the source for this mod? I wasn't able to find it.
     
  7. Shiggs713

    Shiggs713 Immortal

    Joined:
    Mar 11, 2007
    Messages:
    2,361
    Location:
    Indianapolis
    really nice killmeplease. This looks like a no brainer for ACW.
     
  8. killmeplease

    killmeplease Mk Z on Steam

    Joined:
    Nov 22, 2007
    Messages:
    2,690
    Location:
    Samara
    I've updated database page as well as post#1. Thanks PieceOfMind for advice.
    I plan to release version 1.0 beta at 14th february.

    PieceOfMind, as i'm working on souce code and it's quite messy now so i've decided to exclude it from download for a while. also i want to get rid of other modcomps mixed in there to release pure Commanders.
     
  9. PieceOfMind

    PieceOfMind Drill IV Defender Retired Moderator

    Joined:
    Jan 15, 2006
    Messages:
    9,312
    Location:
    Australia
    That's alright.

    I'm trying to get a heads up on how much this would affect ACO but I'm happy to wait til you're ready.

    Regarding the modcomp Defender Withdrawal:
    With ACO, the odds of attacker surviving will no longer be accurate. It mightn't be too hard to make it show how often the defender will withdraw but getting it to work out odds for the second defender will most likely be impractical and even if it were possible it'd probably start making the interface pretty ugly.

    I'm not really sure what to do if it is intended that this modcomp be included with mods that also use ACO. This is the first modcomp that I've noticed that has the potential to conflict with ACO, although I'm sure there'd be others out there already using ACO with another mod that should be imcompatible - I can't keep track of ACO everywhere it goes. :lol:

    If you're brave you could even try merging the two yourself and seeing the results. I'm not asking you to, just if you're interested is all. Merging ACO is actually fairly straightforward - there's pretty much just one massive function to merge.
     
  10. killmeplease

    killmeplease Mk Z on Steam

    Joined:
    Nov 22, 2007
    Messages:
    2,690
    Location:
    Samara
    I believe there will be no problem in merging Commanders with ACO as Commander's bonuses are added in getExtraXXX() functions - i assume ACO deals with them. For example, getExtraCombatPercent function:
    Code:
    int CvUnit::getExtraCombatPercent() const
    {
    	//@MOD Commanders [
    	if (!isCommander())
    	{
    		CvUnit* pCommander = getCommander();
    		if (pCommander != NULL)
    			return	m_iExtraCombatPercent + pCommander->getExtraCombatPercent();
    	}
    	//]
    	return m_iExtraCombatPercent;
    }
    
    On DWM+ACO, yeah its a big problem. I'll think on what can be done there.
     
  11. killmeplease

    killmeplease Mk Z on Steam

    Joined:
    Nov 22, 2007
    Messages:
    2,690
    Location:
    Samara
    Version 1.0 beta released

    Post #1 updated

    Download link updated
     
  12. Manifold

    Manifold ModderProtectionAdvocate

    Joined:
    Aug 27, 2007
    Messages:
    1,444
    Very cool, i will definitive try it!
     
  13. Valkrionn

    Valkrionn The Hamster King

    Joined:
    May 23, 2008
    Messages:
    14,450
    Location:
    Crestview FL
    Hmm... Have you looked at the commander system Xienwolf designed for Fall Further? It's rather similar to this, though the points are a bit different... Each commander can 'lead' a certain amount of units (Can be increased via promotion), and those units are the only ones to get promotions/bonuses from him. In return, they can grant the commander promotions, and grant him xp when they win.
     
  14. Shiggs713

    Shiggs713 Immortal

    Joined:
    Mar 11, 2007
    Messages:
    2,361
    Location:
    Indianapolis
    killmeplease - my mod uses ACO and I'm still a noob with doing SDK stuff, so I'll probably still need help merging if you are still offering. Plus I'm not really sure on how to use that makefile (or even if I can) using codeblocks. All your modcomps look great, I'd really like to have them in my mod.
     
  15. killmeplease

    killmeplease Mk Z on Steam

    Joined:
    Nov 22, 2007
    Messages:
    2,690
    Location:
    Samara
    i wish you enjoyed it ;)

    I have to look at it thanks for this info!

    I havent devised yet how to merge DW with ACO. But it is possible to use Commanders without DW in case i will not found a solution!
     
  16. killmeplease

    killmeplease Mk Z on Steam

    Joined:
    Nov 22, 2007
    Messages:
    2,690
    Location:
    Samara
    Button graphics were fixed (by KJ Jansson) :clap:
    on screenshots you see how they looked before fix.
    DB file was renewed.
     
  17. Ninja2

    Ninja2 Great Engineer

    Joined:
    Nov 17, 2005
    Messages:
    1,142
    Location:
    Denmarkia
    This looks very nice! :goodjob: How does the AI handle this?
     
  18. killmeplease

    killmeplease Mk Z on Steam

    Joined:
    Nov 22, 2007
    Messages:
    2,690
    Location:
    Samara
    AI sends GGs with SoDs (one GG per SoD) if there is an offensive war, otherwise it sends GG to a threatened city. In case there is no war and GG's level is not high, AI uses it in ordinary way (settle, build academies). It also pick control promotions if its SoD is larger than GG's control points, otherwise it picks morale, tactics etc. I'm going to improve promotion logic, it s quite primitive now.
     
  19. PieceOfMind

    PieceOfMind Drill IV Defender Retired Moderator

    Joined:
    Jan 15, 2006
    Messages:
    9,312
    Location:
    Australia
    Just to be clear, because it looks like this is the case from the screenshots and description, the new commander promotions replace the regular warlord promotions?

    On the promotion pictures, doesn't Initiative 1 look a bit like Initiative 4?


    By the way, if you try a merge of DWM with ACO let me know if you have any trouble, because I know ACO is not exactly the easiest code to read. It's also not easy to merge with other mods that use the same function in CvGameTextMgr.
     
  20. killmeplease

    killmeplease Mk Z on Steam

    Joined:
    Nov 22, 2007
    Messages:
    2,690
    Location:
    Samara
    No, commander promotions do not replace warlord's ones. Commander promotions are promotions of GG unit itself. When you use lead action great general unit gets deleted. Combat units with warlord promotion still can get exclusive promotions like tactics, morale, medic III, etc.

    I changed Initiative 1 promotion icon after those pics for post 1 were made (just forget to change pic). So actually they look more different.

    OK i'll ask you if something will go wrong. commanders use only getUnitHelp function in CvGameTextMgr i think there will be no conflict with ACO.
     

Share This Page