Native AI mobilization war behavior - event popup?

Natives going on the warpath event popup / rumors from more distant lands

  • Yes, I would love to see this

    Votes: 3 42.9%
  • No, this is normal behavior and warrants no special drama

    Votes: 4 57.1%

  • Total voters
    7

FlaviusBelisarius

Chieftain
Joined
May 13, 2020
Messages
59
Location
Finland
I recently encountered a dramatic event that I feel has a lot of potential for ambience and immersion that is lost now.

So basically, native AI can (and will) perform a "full mobilization" because native civilian units are also their military units (no equipment bottlenecks involved). By full mobilization, I mean that every single available native worker can turn into a brave in one turn. In the game, this just silently happens with no drama or announcement (while we have wonderful popup events for situations like first time construction of a building type). So silence even in a situation where (as I experienced) the extent of the mobilization was close to a hundred braves all at once, 100% of native population (excluding the single remaining worker in every camp).

I would love to have even a global event heard throughout the foreign lands of such a happening. "Natives going on the warpath" or something similar. It would in my opinion greatly add flavor to the often quite uneventful wars against natives (grinding away their braves until no brave stands is the present experience in a nutshell).

From a technical point of view, is it simple to detect such a happening without having to e.g. calculate every turn how many braves were activated against the full population etc? AI must have some sort of trigger to perform this, right?

Another thing is that I would like to better understand how the AI comes up with such decision. It did little sense to time it as it did when I saw it. Basically, AI would have been better off to respond earlier either right away to my declaration of war or for example the razing of its first camp. Now, AI did little with its ~150 potential braves and let me pick them off happily, destroy three camps, and seemingly randomly woke up to do the mobilization much later. When I was already well positioned and had my armies established. There might be historically understandable reasons for such behavior (internal conflicts in the tribe supporting war/peace, causing inaction and chaos) but that would also be very nice to be explicitly pointed out to the player.

AI and events are completely foreign to me at the moment, so I would be interested in implementing my idea with some support from the more experienced modders - assuming my idea gains support. So what do you think?
 
Now, AI did little with its ~150 potential braves and let me pick them off happily, destroy three camps, and seemingly randomly woke up to do the mobilization much later. When I was already well positioned and had my armies established. There might be historically understandable reasons for such behavior (internal conflicts in the tribe supporting war/peace, causing inaction and chaos) but that would also be very nice to be explicitly pointed out to the player.


I would like that.
Anyway by core would like many new events.

But as for AI events I cannot offer much in technical regard.

In case you feel desire to implement offer into your attention the diplomatic events too:
https://forums.civfanatics.com/threads/diplomacy-with-king-and-other-europeans.657372/
 
@FlaviusBelisarius

It would in my opinion greatly add flavor ...

Well ok, I think nobody would really mind such an "Event Message". :dunno:
It would be triggered in every (successful) Native War though at some point, once Native AI starts to lose too many Villages.

Once AI feels extremely threatened it will simply do that.
It is not something "unexpected" it is actually something "normal".

----

AI (Native and Colonial) does have certain "Strategies" for Peace / War Preparation / Limited War / Full Scale War
Basically this triggers how it e.g. how it handles its Units.

Those "Strategies" can be read in the code and you could write your own logic to react on it.
Thus a Pop-Up or even easier a warning message (red message top of the screen) with a warning sound (e.g. "War Sound")

Please do not try to do anything by "counting Natives remaining in Villages" - you would trigger a message unnecessarily.
(e.g. When someobdy builds a Map in Worldbuilder)

----

So what do you think?
As I said, technically it is not difficult.
Basically you just add some code in the "War Strategies" logic that triggers your new logic.

But you also need to prevent that it is triggered every turn.
Because once AI decides it is in "Full Scale War" it will stay there until it has either won or has been eradicated or there is peace again.

----

Summary:

I am not afraid that this is difficult or not possible.
I am more afraid that this "flavour message" will become annoying very soon.

----

By the way:

I did not vote, because it simply depends on the implementation (flavour or annoyance) if I like it or not.
Thus simply implement it if you like the idea and show us the result. :thumbsup:
 
Last edited:
@FlaviusBelisarius

Those are the strategies AI may use:

Code:
enum StrategyTypes
{
   NO_STRATEGY = -1,

   STRATEGY_SMALL_WAVES,
   STRATEGY_BUILDUP,
   STRATEGY_CONCENTRATED_ATTACK,
   STRATEGY_DISTRIBUTED_ATTACK,

   STRATEGY_DIE_FIGHTING,

   STRATEGY_FAST_BELLS,
   STRATEGY_CASH_FOCUS,
   STRATEGY_SELL_TO_NATIVES,
   STRATEGY_DENSE_CITY_SPACING,
   STRATEGY_MILITARY_BUILDUP,   // TAC - AI Military Buildup - koma13
   STRATEGY_REVOLUTION_PREPARING,
   STRATEGY_REVOLUTION_DECLARING,
   STRATEGY_REVOLUTION,

The strategy that causes "Full Mobilization" is this one here:
(It is related to how many of its cities you have destroyed.)

STRATEGY_DIE_FIGHTING

Alternatively you can check for this here:
Code:
enum WarPlanTypes
{
   NO_WARPLAN = -1,

   WARPLAN_ATTACKED_RECENT,
   WARPLAN_ATTACKED,
   WARPLAN_PREPARING_LIMITED,
   WARPLAN_PREPARING_TOTAL,
   WARPLAN_LIMITED,
   WARPLAN_TOTAL,
   WARPLAN_DOGPILE,
   WARPLAN_EXTORTION,

WARPLAN_TOTAL

You can also check this method her:
void CvPlayerAI::AI_doNativeArmy(TeamTypes eTeam)

-----

By the way:

This here is one of the coolest attributes in DLL. :D
(And no, I am not kidding, it really exists.)

bKnockKnock_WhoseThere_Monty_MontyWho_MontyAndHisHordeDieDieDie
 
Last edited:
Thanks for the hints and very helpful information! I think communicating the AI internal state more explicitly to the player would greatly increase the atmosphere. The classical colonization had both per camp exclamation marks and textual descriptions of the tribal aggression level while visiting their villages.

My raw idea for the trigger would be more like "percent of native workers being converted into braves in one turn > threshold value", where threshold could even be ~75% of all worker population. And with additional conditions avoiding triggering when most workers already are braves (maybe additional lower threshold against total population). But it seems a much more simple trigger would be to use the AI strategy change state.

Could this repeat several times per tribe per war? Will the AI return those masses of braves back to camps only to soon mobilize them back again? According to what you said, no. The event would not return unless peace is made in between. So it should be fine in that respect regardless of the implementation.
 
~75% of all worker population
Again, do NOT do something like this.
Depending on the amount of Native Units you kill, this 75% threshold can occur several times in a war.
  • 9/12
  • 6/8
  • 3/4
  • ...

PLEASE listen to me:
The only thing that makes sense is to check "War Plans" or "Strategies".
NOT counting Unit numbers.

But it seems a much more simple trigger would be to use the AI strategy change state.
That is the only thing that makes sense. :thumbsup:

Could this repeat several times per tribe per war?
Not 100% sure about that. :dunno:
Better check the code yourself.

But if I remember the code correctly it should be possible only once per War. (STRATEGY_DIE_FIGHTING)
(AI should then fight to death of one side until for some reason peace is forced by some other logic - but then the war is over as well.)

The classical colonization had both per camp exclamation marks ...
There is no such thing as "per camp" in Civ4Col.
There is only the "Native Player" (Leader) and you can already see his attitude very clearly in diplomacy.
(Or e.g. in score list.)

So showing attitude is fine.
But anything beyond that I personally consider "immersion breaking".
(There is no such thing as "espionage in Native villages".)

Also there is the Game Option "No More Hidden Variables" which gives massive information about Attitude.
Have you ever tried to activate that Game Option?

----------

Otherwise please do not make visible any information on War Plans or War Strategies to the Player in UI!
That is both unimmersive and also bad for game play.

----------

I am fine with a small message for "Native Mobiliziaton".
But I am not fine telling the Human secret plans and strategies of AI.
 
Last edited:
But won't this be a spoiler of some sort? After all, you are required to scout and fortify border colonies so that you don't get caught with your pants down:lol:

If we do add this, then the European AIs would have to deal with it as well
 
But won't this be a spoiler of some sort?
Yes, that is also a reason why I do not really like it. :dunno:
Basically we are telling "secret Native war strategies / war plans" to the Human player.

So showing attitude is fine.
But anything beyond that I personally consider "immersion breaking".
(There is no such thing as "espionage in Native villages".)

Everything beyond a small message like "... has declared his complete tribe to be on the war path." is definitely too much for me.
And if it happens more than once a war it would even become annoying for me.

Let us simply see what @FlaviusBelisarius implemented, once he is done. :thumbsup:
It is his own effort he invests, so everything is fine.
 
Last edited:
  • Like
Reactions: nci
I am against such popups. This is normal AI behavior, popup is unwarranted.
 
I had forgotten about the hidden variables option, thanks Ray for reminding me! Certainly useful for keeping on during development / test games.

And worry not, if I do this, it will work as intended. I.e., rarely if ever.

Regarding immersion: I am not sure if we are having difficulties understanding each other or do we simply have vastly different opinions? To me, immersion is something that helps me attune myself to the theme and imagination side of what happens in a game instead of the "Excel" side of the game (numbers, optimization, "playing to win"). So if a "next door neighbor" native tribe makes the full warpath move and I notice that if I keep looking at the numbers denoting the native camp sizes alone, that is not "immersive" to me. That is Excel to me.

Instead, I would imagine that in the imaginary story side of the game, the colonists would hear rumors, see signs and be terrified about them at the latest when it happens and this feeling could be transmitted to the player better via a message / text and image etc vs. tracking numbers manually. If I, the player, can see a camp size number on my screen change, surely my subjects in the colonies / military in the field laying siege to the camps would see the mobilization in action? I think the player should be rightly scared when this message pops up unless thoroughly prepared (warranting of course that the AI is not entirely foolish in handing war). And yet, it would be basically too late to make drastic counter moves any more.

There are of course two possible different lines of thought here too: 1) the natives try to perform some sort of a surprise attack on the colonies and in this case, making a noise with a popup would totally be stupid and spoil the AI attempt. Or 2) natives want to be heard and to be seen, i.e., scare tactics, terror, demoralization with boasting behavior, show of force, and so forth.

To me, full scale mobilization is not a surprise move to be kept hidden when it happens. Before, yes perhaps.

Basically, if we have drastically different views on what is immersive, I will have little motivation to move forward with this.
 
... I will have little motivation to move forward with this.
Simply implement it and show us the result. :thumbsup:
There is no point in endlessy discussing personal tastes, so let us not do it.

----

Generally I like to be suprised and not know everything ahead of time.

So I do not really like to know that the complete army of Natives - which I can not even see in unrevealed terrain (fog of war) - might be approaching.
It is simply not immersive for me that the game tells me such things before I see these Units at my borders ...

I much more prefer not to know ahead of time which strategy / warplan AI is currently following.
(Once I see its army at my borders and its empty cities later I will figure out myself.)

Sure, I knot it is "War". And that is all I can actually know.
But knowing if it is "Limited War" / "War" / "War until death", is too much knowledge.

But if that is interesting and immersive to you simply implement it. :thumbsup:

----

... when it happens.
That is the point actually.

It would be fine for me to get a message when all these Natives are at my borders.
(Because then the news would spread in my own cities and an atmospheric message e.g. about "panic" could be posted.)

But it would not be fine for me if those Natives are still in "fog of war" 5 turns away.
Do you really think the Natives would inform their enemies about their war plan / strategy?

In war first surprise is extremely valuable - fear and horror come after it and are actually caused by it.
The natives would definitely not have sent a messenger politely warning the white colonists about their total militarization.

... would hear rumors ...
From where or from who? This was vast wilderness and armies were small.
Not like today where an army can impossible move without being spotted because it is either too large or the landscape is too closely settled.
(And espionage as we know it today did not work in Native villages.)

The rumors would come once the first colonial villages / settlements would have been razed.
Maybe after massive numbers of Natives would already have been seen at the boarders. But before that?

If I, the player, can see a camp size number ...
And how do you want to check in the game logic "I the player can see it." ?
This is simply not possible without ruining performance.

And that is exactly the point where I consider your feature logic a bit flawed.
You simply assume the player can always see all Native villages and all Native warriors

But I promise you that is not always the case - especially on Gigantic Maps.
Fight e.g. against 14 Inca villages. You will simply not know what happens in all of them.

And worry not, if I do this, it will work as intended.
No worries here. :thumbsup:
We would review the code anyways if you like.

----

To summarize it:

If I can see that stuff going on, sure, give me a nice atmomspheric message.
But do not simply spoiler to me what is going on in fog of war 5 plots away.

----

Otherwise it is as simple as this:
  • Considering the stuff I mod it matters mostly what I want myself.
  • Considering the stuff you mod it matters what you want yourself.
  • If we share some common idea, we may cooperate to speed up things.
  • Otherwise we simply implement it anyways and share the results with the rest of the community.
----

As I said, I will let myself be surprised by the result. :thumbsup:
 
Last edited:
My first thought was that I like it, until reading the point I had missed about scouting. I mean, word of a massive fullscale mobilization would likely get around, wouldn't even have to be /your/ war to hear about it. But maybe set an event like natives being more likely to make alliances against a hostile European nation.

Example. Spanish attack Mayan, burn a couple villages, trigger the mobilization. Aztec are alarmed at neighbor tribe being massacred, Mayan and Aztec join against Spain, both full mobilization. Now /that/ would send an event notification across the new world. Obviously a lot of logic and probably work involved. Aztec in this scenario would need negative view of Spain, positive relations with Maya, and actually be local to war. But would be neat and by my memory not unrealistic. Native hostility would logically increase if you're going around attacking native tribes, why wouldn't they preemptively attack you?
 
Last edited:
Very good discussion here. Brief comments follow.

I like the idea of native alliances and coordination against obvious European atrocities (massacring whole villages etc). This would not happen easily since the natives were often divided and the divisions were taken advantage of by Europeans equally often. However, just the freak chance of that happening would be a deterrent to be too arrogant in campaigning against the natives. At the moment, I feel a competent human player with a modest army well positioned can run around circles with vastly bigger native troops killing them off relatively safely and there seems to be quite nothing the AI can do about it.

Regarding Ray's worries on intelligence / surprise, you seem to be reading lines of thought from my text that are not there. My example case was literally a situation where I am besieging several camps, have my troops and colonies "watching" a large proportion of the native lands and so forth. Yes, your point with "unseen mobilization" not been announced is a relevant one that would probably need to be addressed. Is that going to happen though with the present AI? Maybe in isolated cases where the human player kills off an unconnected native camp and that is the last straw to trigger the natives? (While at the same time having fog of war covering the rest of the natives.)

I have hard time understanding the performance concern. Let's say we have two preconditions for the event / message:
1) Natives decide to mobilize fully.
2) The player has sufficient proximity to have it happen "in their face" instead of far away.
Event 1) Is relatively rare so no computation happens most of the time. Once 1) happens, we can check fog of war / native camp proximity - whatever is most efficient to do. Isn't the fog of war very simple to check? What is expensive here?
 
I have hard time understanding the performance concern.
I was talking just about "checking actual visiblitiy" as being bad for performance - because you would need to loop through Units or Cities and the Plots in their visibility radius massively.

Isn't the fog of war very simple to check?
No it is not, see above.
There is no easy and performant way to check "fog of war" considering a specific player to my knowledge.

---

Massively looping Units, Cities and their visibility radius every turn just for a "pop-up message" without any gameplay value is normally a nogo for me.
But maybe you find a better and performant solution. (e.g. checking the strategies and warplans as I suggested and still not spoilering)

---

Considering my current feeling none of us other core modders is really exited about this.
But if it is well implemented we most likely also would not mind if it would get integrated.

Most importantly, the only person that really needs to like it is yourself. :)
I also mostly mod for myself at the moment.

---

As I said, simply go ahead and implement whatever you consider best. :thumbsup:
Images of results speak more than 1000 words considering a theoretical concept.
 
Last edited:
Top Bottom