Brave Lieutenants and Capable Captains [IMPLEMENTED]

Is "Brave Lieutentants" a good addition?


  • Total voters
    27

raystuttgart

Civ4Col Modder
Joined
Jan 24, 2011
Messages
9,672
Location
Stuttgart, Germany
"Brave Lieutenants" is just an idea to add some flavour to the game.

I am basically talking about a "light weight version" of "Great Generals".
However these "Brave Lieutenants" will be more common.

It is not going to be a big game changer.
But it might still be fun.

It also be little effort to implement, since the concept belows avoids huge efforts for changes in Models or Unit Animations.
(Except the Unit "Brave Lieutentant" itself of course.)

Except the Unit itself (which we might already have suitable graphics for) it is just coding simple feature logic and some text for Colopedia.
(It will of course also require XML changes for feature configuration and balancing.)

AI logic of Great Generals can be reused and adpated.
(Most likely it can simply use the AI of Great Generals without having to code a new one.)

1. How to acquire Brave Lieutenants?

When a Combat Unit wins a battle there is a small chance that a "Brave Lieutenant" is generated.
(It will be spawned in your Capitol city just like Generals.)

Message displayed:
"A soldier has displayed outstanding bravery and tactical skills in battle.
He was sent to our capitol to be promoted to Lieutentant and now awaits your orders."

2. What do Brave Lieutentants do?

Well, you can attach them to a Combat Unit and that Unit will get some XP and a new Promotion "Brave Lieutenant".
(However it will be less XP than a General gives and the Promotion will not unlock further Promotions.)

Considering the Bonusses given by the Promotion:
I am not sure yet. I am open to suggestions.

Theoretically it is also possible that a "Brave Lieutentant" gives one out of 10 Unique Promotions.
(So it would be Promotions that only Brave Lieutentants can give)

3. Will it change the Unit Model and Anmiations of the Unit it is attached to?

No, I want to keep it simple.
It would otherwise be too much work for Schmiddie to do all the Unit Model changes.

4. Will AI use it?

Of course. It will treat it just like Generals.

5. Will it allow you to attach a General additionally to it?

No, you will need to attach your Generals to another Unit.
So you need to choose which Units you leave for your stronger Generals.

Reason:
There might be a future expansion of this e.g. with Model and Animations.
I simply want to make sure that this possibility is not blocked by the current solution.

6. Can I attach it also to Ships?

No, just to land Units.
We could of course implement something similar as "Great Admirals" as well.

7. Will the "Brave Lieutenants" have unique historic names like Generals?

No, I want to keep this simple. But of course you can rename them manually.
It would otherwise get way too much effort to collect all the historic names for these Lieutenants.

----------

Feedback? :)

@Schmiddie :
Do you like the idea?
Do you already have graphics that might suit the "Brave Lieutentant"?

If you have, I can most likely fully create and test this feature in about an afternoon.

Edit:
However, when I think about it, we could also use it as a practice example for one of the new programmers
to get started with Civ4Col modding that want to join us. :think:
 
Last edited:
Sure, I like it and graphics are no problem:

Here is an early version that can be easily updated:

brave_lieutenant-jpg.563011
 

Attachments

  • brave_lieutenant.jpg
    brave_lieutenant.jpg
    45.1 KB · Views: 1,172
Sure, I like it and graphics are no problem:

Cool. :)

Here is an early version that can be easily updated:

Actually that graphics reminds me more of a Ship Captain because of the looking glass and his hat. :think:
In general he is cool though. :think:

Summary:

Why not use your graphics to introduce "Capable Captains" for Ships (basically the concept is almost identical as described above).
For a "Brave Lieutenant" for Landtroops I would imagine more of something like a single "European Line Infanterist". :dunno:

But of course, you are our graphics specialist and I fully trust in the graphics you create. :thumbsup:
 
Please note the following: Such glasses are correct for such time period also for land troops! Modern spyglasses as we know them have been introduced in the late 19th century.

And as I said: This is an early version. he will only get a single epaulette and another hat.

This was just to show something. I will create something as far as I know it will be needed.
 
@Schmiddie:

If I get the graphics, I will implement this feature as suggested.

Considering graphics I would need:

(for Brave Lieutentant and if you want also for Cabable Captains)

1. 3D Unit Graphics (World Map)
2. 2D Unit Graphics (City Screen / Europe Screen)
3. Unit Buttons in Unit-Atlas
4. Promotion Buttons in Promotion-Atlas (looking similar to Great General Promotion / Great Admiral Promotion)
5. Unit Art configs in XML (just as an extract that I can copy in the graphics config XML)

considering Promotion Buttons:
For now, I would need only 1 new Promotion Button for Brave Lieutenant (and an additional 1 for Capable Captains if we want to implement it)

You could simply attach the package as a ZIP in our modders chat or here in this thread.
If you have questions, just let me know.

The rest (actual feature implementation) I would then do myself:

1. Setting up UnitClass and Unit
2. Programming feature logic in DLL (including AI logic)
3. Setting up XML for balancing
4. Setting up XML for message texts
5. Writing ColoPedia entries
 
@Schmiddie
As I wrote you, I found the graphics you had sent me again. :thumbsup:
I had thought something was missing.

So sorry, that was my fault - otherwise this feature would probably already be done.
I get old. :lol:

But I had everything except the Promotion Buttons - but those I could have tried myself by simply recolouring the "Great General" Promotion / "Great Admiral" Promotion.
(similar to the "Great General" Promotion / "Great Admiral Promotion" - I would need one for "Brave Lieutenant" Promotion and "Capable Captain" Promotion)

I will finish it after "Large Rivers". :thumbsup:
That might take a while though.
 
True. :)

I should most likely implement these small features first, before starting bigger and completely new features like "Naval Promotion System".
This is would really a good candidate to start with once I can do new features again. (But we will see in the discussion of the next release plan.)

Yesterday we had the discussion about focussing all energy to finally merge our diverging branches, test, finish (correctign bugs) and after so many months finally publish.

@Nightinggale and myself thoroughly discussed that until then:
  • We only finish work already in the mod and do not start implementing new stuff until we published.
  • Otherwise only bugfixes and improvements (correcting balancing, better texts and translations, better sounds, better graphics, ...)
-----

Summary:

I have changed the title of this thread to "[ACCEPTED]". :thumbsup:
And since it is a pretty small feature I could put it on top of the list if the team decides like that in upcoming release plan.

Let us now however all concentrate on giving community a release again. :grouphug:
After that I will happily be working on new features again.

However, we also discussed that after the release we make a proper release plan again,
Every team member can then participate in discussion which things we will implemented and prioritised.
 
This feature is now fully implemented. :)
It took a while but today I finally found the motivation to implement.

Now you will from time to time also get "Brave Lieutenants" and "Capable Captains".
(You only get them by Combats won and it is also a bit chance based. In average every 10th Combat won, you may get one of these.)

They are a lot weaker than Generals, i.e. do not unlock special Promotion Paths. They also cannot be used together with Generals.
(So you should kind of decide which Unit you want to give to them. I would keep the strongest Units to the Generals.)
 

Attachments

  • Civ4ScreenShot0000.JPG
    Civ4ScreenShot0000.JPG
    196.8 KB · Views: 61
  • Civ4ScreenShot0002.JPG
    Civ4ScreenShot0002.JPG
    202.8 KB · Views: 65
  • Civ4ScreenShot0008.JPG
    Civ4ScreenShot0008.JPG
    242 KB · Views: 78
  • Civ4ScreenShot0009.JPG
    Civ4ScreenShot0009.JPG
    240.1 KB · Views: 63
  • Civ4ScreenShot0010.JPG
    Civ4ScreenShot0010.JPG
    235.1 KB · Views: 67
  • Civ4ScreenShot0011.JPG
    Civ4ScreenShot0011.JPG
    233.8 KB · Views: 69
Last edited:
Hey ray,

this is a small feature that should not be forgotten. :thumbsup::lol:
Sorry, that it took me so long to implement it. :)
(But now I am trying to finish some of that small stuff finally.)
 
Would it be suitable to extend this concept to a kind of "brave scout", i.e. that due to exploration from time to time brave scouts will be created in the home colony which than can be added to military units or other scouts so that they may become a little bit faster outside the colonies / when there is no (paved) road ahead?
 
Would it be suitable to extend this concept to a kind of "brave scout", i.e. that due to exploration from time to time brave scouts will be created in the home colony which than can be added to military units or other scouts so that they may become a little bit faster outside the colonies / when there is no (paved) road ahead?
Actually I feel that Scouts are already overpowered in the game.
Especially once you get the FF for it and give them a few Promotions.

We already have Experts for Scouts, and I would not like to have several "Super Experts".
Having a single unique Scout (e.g. a "Native Scout") given by a Python Event would again be fine for me though.

Let us please keep "Super Experts" rare / unique. :)
Othewise they will not feel special anymore ... and the feature gets boring
 
Right, I always keep my scouts safe until they end their journey - they always become the core of my cavalry troops then. :crazyeye:

However, I was not talking about making scouts stronger! The idea was adding scouts to other military units in order to find a faster way outside of a colony. We do not need to add them to other scouts if this is a point.
 
Hi, first off I am really enjoying the Brave Lieutenants. I find them very immersive and enjoyable. I like that they spawn right near the action and you can use them where they are triggered.

The Capable Captains I find vexing for the opposite reason, they spawn at your capital city and no where near the action that triggered the event. I'm sure there are plenty who like how it currently works, but this was triggering me :crazyeye:

I made it so the Captains are automatically applied to your ship, and if the ship already has a leader then it will get some XP instead. It would be really cool if your Captain could level up and become an Admiral, but I haven't done that.

It could have XML settings to control using the old or new behavior and for the amount of XP awarded.

Probably lots of things wrong with this code.

Maybe it will inspire someone.

Spoiler :

Diff:
diff --git a/Project Files/DLLSources/CvPlayer.h b/Project Files/DLLSources/CvPlayer.h
index de570be0..ee7b37c7 100644
--- a/Project Files/DLLSources/CvPlayer.h  
+++ b/Project Files/DLLSources/CvPlayer.h  
@@ -372,7 +372,7 @@ public:
    // R&R, ray, Great Admirals - END
    // WTP, ray, Lieutenants and Captains - START
    void createBraveLieutenant(UnitTypes eBraveLieutenantUnit, const Coordinates coord);
-   void createCapableCaptain(UnitTypes eCapableCaptainUnit, const Coordinates coord);
+   void createCapableCaptain(UnitTypes eCapableCaptainUnit, const Coordinates coord, CvUnit* pUnit = NULL);
    // WTP, ray, Lieutenants and Captains - END
    int getGreatGeneralRateModifier() const;
    void changeGreatGeneralRateModifier(int iChange);

diff --git a/Project Files/DLLSources/CvPlayer.cpp b/Project Files/DLLSources/CvPlayer.cpp
index 8909ca75..2a53d728 100644
--- a/Project Files/DLLSources/CvPlayer.cpp
+++ b/Project Files/DLLSources/CvPlayer.cpp
@@ -13364,7 +13364,7 @@ void CvPlayer::createBraveLieutenant(UnitTypes eBraveLieutentantUnit, const Coor
 }
 
 
-void CvPlayer::createCapableCaptain(UnitTypes eCapableCaptainUnit, const Coordinates coord)
+void CvPlayer::createCapableCaptain(UnitTypes eCapableCaptainUnit, const Coordinates coord, CvUnit* pUnit)
 {
    CvUnit* pGreatUnit = initUnit(eCapableCaptainUnit, GC.getUnitInfo(eCapableCaptainUnit).getDefaultProfession(), coord);
    if (NULL == pGreatUnit)
@@ -13373,6 +13373,10 @@ void CvPlayer::createCapableCaptain(UnitTypes eCapableCaptainUnit, const Coordin
        return;
    }
 
+   if (pUnit) {
+       pGreatUnit->getGroup()->pushMission(MISSION_LEAD, pUnit->getID(), -1, 0, false);
+   }
+
    CvPlot* pPlot = coord.plot();
    CvCity* pCity = pPlot->getPlotCity();
    CvWString szReplayMessage;

diff --git a/Project Files/DLLSources/CvUnit.h b/Project Files/DLLSources/CvUnit.h
index 027b350b..85259207 100644
--- a/Project Files/DLLSources/CvUnit.h
+++ b/Project Files/DLLSources/CvUnit.h
@@ -696,6 +696,7 @@ public:
    void setFreePromotionCount(PromotionTypes eIndex, int iValue);
    void resetPromotions();
    void setPromotions(PromotionTypes ePromotion = NO_PROMOTION);
+   bool hasLeader();
 
    int getFreePromotionCount(PromotionTypes eIndex) const;
 
diff --git a/Project Files/DLLSources/CvUnit.cpp b/Project Files/DLLSources/CvUnit.cpp
index 193720aa..14a2a031 100644
--- a/Project Files/DLLSources/CvUnit.cpp  
+++ b/Project Files/DLLSources/CvUnit.cpp  
@@ -888,6 +888,26 @@ bool CvUnit::testWillGetNegativePromotion() const
    return false;
 }
 
+bool CvUnit::hasLeader()
+{
+   bool bHasLeader = false;
+   UnitTypes eGeneralUnit = (UnitTypes)GC.getCivilizationInfo(getCivilizationType()).getCivilizationUnits(GC.getDefineINT("UNITCLASS_GREAT_GENERAL"));
+   UnitTypes eAdmiralUnit = (UnitTypes)GC.getCivilizationInfo(getCivilizationType()).getCivilizationUnits(GC.getDefineINT("UNITCLASS_GREAT_ADMIRAL"));
+   UnitTypes eLieutenantUnit = (UnitTypes)GC.getCivilizationInfo(getCivilizationType()).getCivilizationUnits(GC.getDefineINT("UNITCLASS_BRAVE_LIEUTENANT"));
+   UnitTypes eCaptainUnit = (UnitTypes)GC.getCivilizationInfo(getCivilizationType()).getCivilizationUnits(GC.getDefineINT("UNITCLASS_CAPABLE_CAPTAIN"));
+
+   int iGeneralPromotion = GC.getUnitInfo(eGeneralUnit).getLeaderPromotion();
+   int iAdmiralPromotion = GC.getUnitInfo(eAdmiralUnit).getLeaderPromotion();
+   int LieutenantPromotion = GC.getUnitInfo(eLieutenantUnit).getLeaderPromotion();
+   int iCaptainPromotion = GC.getUnitInfo(eCaptainUnit).getLeaderPromotion();
+
+   if (isHasPromotion((PromotionTypes) iGeneralPromotion) || isHasPromotion((PromotionTypes) iAdmiralPromotion) || isHasPromotion((PromotionTypes) LieutenantPromotion) || isHasPromotion((PromotionTypes) iCaptainPromotion))
+   {
+       bHasLeader = true;
+   }
+
+   return bHasLeader;
+}
 
 void CvUnit::resolveCombat(CvUnit* pDefender, CvPlot* pPlot, CvBattleDefinition& kBattle)
 {
@@ -1034,11 +1054,12 @@ void CvUnit::resolveCombat(CvUnit* pDefender, CvPlot* pPlot, CvBattleDefinition&
                        if (iCapableCaptainChance > randomValue)
                        {
                            UnitTypes eCapableCaptainUnitTypes = (UnitTypes)GC.getCivilizationInfo(pDefender->getCivilizationType()).getCivilizationUnits(GC.getDefineINT("UNITCLASS_CAPABLE_CAPTAIN"));
-                           int iLoop;
-                           CvCity* capitalCity = GET_PLAYER(pDefender->getOwnerINLINE()).firstCity(&iLoop);
-                           if (capitalCity != NULL)
+                           if (pDefender->hasLeader())
+                           {
+                               setExperience((getExperience() + 4));
+                           } else
                            {
-                               GET_PLAYER(pDefender->getOwnerINLINE()).createCapableCaptain(eCapableCaptainUnitTypes, capitalCity->coord());
+                               GET_PLAYER(pDefender->getOwnerINLINE()).createCapableCaptain(eCapableCaptainUnitTypes, pDefender->coord(), pDefender);
                            }
                        }
                    }
@@ -1093,7 +1114,13 @@ void CvUnit::resolveCombat(CvUnit* pDefender, CvPlot* pPlot, CvBattleDefinition&
                            const CvCity* capitalCity = GET_PLAYER(getOwnerINLINE()).firstCity(&iLoop);
                            if (capitalCity != 0)
                            {
-                               GET_PLAYER(getOwnerINLINE()).createCapableCaptain(eCapableCaptainUnitTypes, capitalCity->coord());
+                               if (hasLeader())
+                               {
+                                   setExperience((getExperience() + 4));
+                               } else
+                               {
+                                   GET_PLAYER(getOwnerINLINE()).createCapableCaptain(eCapableCaptainUnitTypes, coord(), this);
+                               }
                            }
                        }
                    }
 
Back
Top Bottom