Can The AI Detect The Civ of Hidden Nationality Units?

Sarisin

Deity
Joined
May 15, 2006
Messages
2,796
Location
NJ
I think they can.

I mentioned one strategy I like to use is to build the Council of Esus, and, later in the game build HN Shadows. I send them out to the civs that are giving me problems or ahead of me in the standings and harass them by taking out weak units like Workers, Adepts, GPs (love that as the AI tends to stockpile GPs for Golden Ages!), etc. Then, as they get more powerful, I take out defenders leaving AI cities defenseless against barbs who raze or capture the cities.

A couple of related things tells me the AI knows who the HN Shadows belong to. I'm not sure if they should. I know if a HN Mercenary comes into my territory, I don't know who built that unit. The AI never builds the Council of Esus, so that would be the only way I can think of the AI could send HN units into your territory.

Anyway, consider this:

1. I have noticed relations deteriorate when I use the strategy above. Trade, border agreements, etc. are canceled. Why is that? Does the AI know the HN Shadows are mine?

2. Even more telling is this strange matter....When I check the diplomacy with the AI civ, I see the negative: "You razed one of our cities." Well, that simply is not true. I have never been at war with that civ. I didn't raze its city. However, as described, I took out the defenders with my HN Shadows, and then, the BARBS razed the city. Why pin this on me?;)

So the diplomacy is affected by what seems to be a phantom/untrue occurrence - that I razed a city. That could affect relations and may be the reason the agreements were canceled. Or, maybe the AI knows who the sneaky HN units belong to.

What do you think?
 
They also don't seem to use Pirates in your terrain when at peace with you, nor take out your Pirates in your terrain when at peace with you.
 
Here's the code for determining if a unit is your enemy (essentially, it is unless they are in their owner's city, in which case the default handler is used (are you at war with their owner?))
Spoiler :
Code:
bool PUF_isEnemy(const CvUnit* pUnit, int iData1, int iData2)
{
	FAssertMsg(iData1 != -1, "Invalid data argument, should be >= 0");

//FfH: Added by Kael 09/11/2006
	if (pUnit->isHiddenNationality())
    {
        if (iData1 != pUnit->getOwner())
        {
            CvPlot* pPlot = pUnit->plot();
            CvCity* pCity;
            bool bBypass = false;

            if (pPlot->isCity())
            {
                pCity = pPlot->getPlotCity();
                if (pCity->getOwner() == pUnit->getOwner())
                {
                    bBypass = true;
                }
            }

            if (bBypass == false)
            {
                return true;
            }
        }
    }

	return atWar(GET_PLAYER((PlayerTypes)iData1).getTeam(), pUnit->getTeam());
}
//FfH: End Add

However, what you're describing about razing (that you never razed one of their cities, yet they think you did) can occur, regardless of Hidden nationality:
Spoiler :
Code:
void CvPlayer::raze(CvCity* pCity)
{
	wchar szBuffer[1024];
	PlayerTypes eHighestCulturePlayer;
	int iI, iJ;

	if (!canRaze(pCity))
	{
		return;
	}

	FAssert(pCity->getOwnerINLINE() == getID());

	eHighestCulturePlayer = pCity->findHighestCulture();

	if (eHighestCulturePlayer != NO_PLAYER)
	{
		if (GET_PLAYER(eHighestCulturePlayer).getTeam() != getTeam())
		{
			GET_PLAYER(eHighestCulturePlayer).AI_changeMemoryCount(getID(), MEMORY_RAZED_CITY, 1);
		}
	}
The short version is that the player offended by your razing a city is not the owner of that city. It is the player with the highest culture in that city.

So in the example you give, the player you had been harassing might have had one of its cities taken over by another player. If you razed that city prior to the other player getting the highest culture in that city, you'd get the "credit" for razing that city with the original owner (not the present owner).
 
Grey Fox
Refuses to talk!!!
-10 You razed one of our cities

Omg I razed my own city after it was taken by Doviello, it had 99% of my culture! And now I won't speak with myself!
 
If someone sends mercs in to my ground, it usually takes me all of five seconds narrowing down the potential candidates, usually to one.

I earthquaked one of my opponents and gutted him of his military and workers using HN during peacetime and Runes. He became less agitated with me when his neighbors started making war with him. It doesn't look like the AI does anything with HN except treat those units as animals or barbarians. I've had loyal allies enthusiastically and unknowingly try to destroy my armies at one time.

I haven't had much oceans to test privateers or whatever they're called.
 
Is it possible that the Shadow is an exception to the code handling for Hidden Nation?

After all, even without Council of Esus, I can use Shadows to sabotage the enemy. And when I do - they most certainly DO have a chance to catch my shadows and the diplomatic relationship is damaged accordingly.

Maybe the "did you catch the shadow" code is over-riding the HN hiddenness :)
 
I hope the AI can detect the civ of HN units. I certainly can. Messages like "A Fishing Boats has been destroyed by a marauding Grigori Pirate!". Said pirate has HN. When I attack it: "Does this mean WAR against Cassiel?" Hmm...
 
I earthquaked one of my opponents and gutted him of his military and workers using HN during peacetime and Runes.

Better yet than using HN units to harrass, use the spell Dominate. Have your archmage in a civ with open borders and NICK stuff. Worker? GP? Now mine. Gotta have your archer, will help protect my wizz... You can even nick their unique leader too (I rem nicking Govanon!).:D Use your HN units to make the enemy numbers more serviceable.
 
Better yet than using HN units to harrass, use the spell Dominate. Have your archmage in a civ with open borders and NICK stuff. Worker? GP? Now mine. Gotta have your archer, will help protect my wizz... You can even nick their unique leader too (I rem nicking Govanon!).:D Use your HN units to make the enemy numbers more serviceable.

I mastered that too after experimenting with a quicksave and reload for a moment. I usually stick with cleaning out the area that i'm about to make a kidnapping in, rather than just have one archer doing escort. Better hope there aren't any forested hills near the target, though! :mischief:

Nothing is nearly as cool as having your own war machine while playing a sprawling, peaceful civ like the kuriotates. And it's level 1 because the Doviello are good from random personalities ... they never bothered to use it! (The Hunt for Red October, anyone?) You can also do neat things like kidnap wind knights from hippus, a few extra druids to liven up the terrain, and paladins from good civs why you're still evil! It works even with patriarchs if you have the right faith!

Have your archmage in a civ with open borders

Nope; don't even need open borders ... just click and drag a path a few plots into the other civ's territory, in .21f that is. It's just about the biggest cheese-tactic I've come across. But it's still hella fun, so...

Nikis-knight hinted that HN and domination are bugs... unintended exploits.
:shrug:
 
Nikis-knight hinted that HN and domination are bugs... unintended exploits. :shrug:

Only to ai... Players in online games might be slightly aggravated if you start nicking their stuff, and players know when to not assault Larry when he is next to them. ;) What makes ffh2 so cool (well, one example of many many) are the diverse spells (:goodjob: ), and the ability of HN units to soften them up for barbarian takeovers (you can then "liberate" cities).
 
In my current game, I was again affected by this 'you razed one of our cities' thing and HN units had nothing to do with it.

This time Charadon captured one of Varn Gosam's cities. About 200 turns later (marathon game), I razed the city.

I had good relations with Varn Gosam and an Open Borders agreement. I even helped him with his war against the Doviello. But, now, after razing the city, I found a big -8, the agreements were cancelled and he was Annoyed.

I realize the city was still even after 200 turns more Malakhim that Doviello (it really takes a long time!), but I think it should go by the owner of the city that is razed rather than anything else. I have to think the Malakhim would be happy I am kicking the Doviello's ass rather so upset that I razed a city they had 200 years ago!
 
In my current game, I was again affected by this 'you razed one of our cities' thing and HN units had nothing to do with it.

I had good relations with Varn Gosam and an Open Borders agreement. I even helped him with his war against the Doviello. But, now, after razing the city, I found a big -8, the agreements were cancelled and he was Annoyed.

I realize the city was still even after 200 turns more Malakhim that Doviello (it really takes a long time!), but I think it should go by the owner of the city that is razed rather than anything else. I have to think the Malakhim would be happy I am kicking the Doviello's ass rather so upset that I razed a city they had 200 years ago!

Bugger... :confused: Well, I find that Varn is always a pain in the whatsit to deal with.
 
Bugger... :confused: Well, I find that Varn is always a pain in the whatsit to deal with.

I play as varn... (albeit, a heavily modded version of him.)... I don't care for his IWD2 portrait either, so I switched it with cassiel's.

Do you play as evil? Do you play as the Illians?
 
Only to ai... Players in online games might be slightly aggravated if you start nicking their stuff, and players know when to not assault Larry when he is next to them. ;) What makes ffh2 so cool (well, one example of many many) are the diverse spells (:goodjob: ), and the ability of HN units to soften them up for barbarian takeovers (you can then "liberate" cities).

only if every plot on the map hasn't been enveloped in enemy territory... I think I fixed that by switching to archipelago rather than inland sea, lakes. :rolleyes:
 
Is it possible that the Shadow is an exception to the code handling for Hidden Nation?

After all, even without Council of Esus, I can use Shadows to sabotage the enemy. And when I do - they most certainly DO have a chance to catch my shadows and the diplomatic relationship is damaged accordingly.

Maybe the "did you catch the shadow" code is over-riding the HN hiddenness :)

Hidden nationality presently does not affect any of the spy-type missions. Anything within those missions will be handled normally, as if the owner owned the unit.
 
In my current game, I was again affected by this 'you razed one of our cities' thing and HN units had nothing to do with it.

This time Charadon captured one of Varn Gosam's cities. About 200 turns later (marathon game), I razed the city.

I had good relations with Varn Gosam and an Open Borders agreement. I even helped him with his war against the Doviello. But, now, after razing the city, I found a big -8, the agreements were cancelled and he was Annoyed.

I realize the city was still even after 200 turns more Malakhim that Doviello (it really takes a long time!), but I think it should go by the owner of the city that is razed rather than anything else. I have to think the Malakhim would be happy I am kicking the Doviello's ass rather so upset that I razed a city they had 200 years ago!

Actually, weren't you given the option to give the city to Varn Gosam instead? He'd probably be ticked that you didn't choose that option instead...
 
If you take a city that someone else took from a third person, I believe the option to give it back to that third person shows up along with 'raze it' and 'keep it'.

Yes, you usually see that option (unless it is a barb city), but only shortly after the city is taken by someone else. Often the barbs will take a city, and, a few turns later, if you take it, you have three options: Raze it, Take it Yourself, or return it back to the original owner.

After 200 turns though, maybe the AI forgot who it originally belonged to. ;)

I did not receive that third option.
 
Back
Top Bottom