The last challenge -- Team game -- Deity trial

Interesting that the moment we meet Willem/Churchill (presumably) those orange fist thingies appear. There have been several instances in my games where meeting a new civ causes BUG to display the fist icon with someone else the moment of first greeting, in each case the unveiled civ eventually turned out to be the target too. Is this just a coincidence? Bestsss, is there no chance that BUG might be somehow leaking information about Monty's/Ragnar's intended victim?

@obsolete
Agree on the military and settling plan. I vote for Monarchy next, and would be happy to risk not having the gold to cover certain random events for the sake of faster research.
 
Well, like mentioned earlier there is a bug in the code of BUG mod (unaltered my as.)
here is the code, i don't really know python and i dont like it but.. i can read that much
This is the bugged python code, I explain below where the bug is:
Code:
def isWHEOOH(playerOrID, askingPlayerOrID):
	"""
	Returns True if askingPlayerOrID can see that playerOrID is WHEOOH.
	
	In game terms, this is the case if the player gives the TOO_MANY_WARS denial type
	for a request to go to war against another civ.
	"""
	tradeData = TradeData()
	tradeData.ItemType = TradeableItems.TRADE_WAR
	askedPlayer, askedTeam = getPlayerAndTeam(playerOrID)
	askingPlayer, askingTeam = getPlayerAndTeam(askingPlayerOrID)
	for player in players(alive=True, barbarian=False, minor=False):
		if (askingPlayer.getID() == player.getID()
				or not (askingTeam.isHasMet(player.getTeam()) or gc.getGame().isDebugMode())):
			continue
		if (player.getID() == askedPlayer.getID() or askedTeam.isAtWar(player.getTeam())
				or not (askedTeam.isHasMet(player.getTeam()) or gc.getGame().isDebugMode())):
			continue
		tradeData.iData = player.getID()
		if askedPlayer.canTradeItem(askingPlayer.getID(), tradeData, False):
			denial = askedPlayer.getTradeDenial(askingPlayer.getID(), tradeData)
			if denial == DenialTypes.DENIAL_TOO_MANY_WARS:
				return True
	return False

The bug is that the code asks if Monty (most likely since he is the team leader) can declare war on Ragnar...

Here is the result:
Code:
DenialTypes CvTeamAI::AI_declareWarTrade(TeamTypes eWarTeam, TeamTypes eTeam, bool bConsiderPower) const
{
	PROFILE_FUNC();

	AttitudeTypes eAttitude;
	AttitudeTypes eAttitudeThem;
	bool bLandTarget;
	int iI;

	FAssertMsg(eTeam != getID(), "shouldn't call this function on ourselves");
	FAssertMsg(eWarTeam != getID(), "shouldn't call this function on ourselves");
	FAssertMsg(GET_TEAM(eWarTeam).isAlive(), "GET_TEAM(eWarTeam).isAlive is expected to be true");
	FAssertMsg(!isAtWar(eWarTeam), "should be at peace with eWarTeam");

	if (GET_TEAM(eWarTeam).isVassal(eTeam) || GET_TEAM(eWarTeam).isDefensivePact(eTeam))
	{
		return DENIAL_JOKING;
	}

	if (isHuman())
	{
		return NO_DENIAL;
	}

[B]	if (!canDeclareWar(eWarTeam))  // the function checks the teams
	{
		return DENIAL_VASSAL;
	}
[/B]
.....

Why it happens: the code in the BUG mod only check if the asking player (i.e. the human) has met some team (OBVISOULY Willem is the 1st player, will explain also why), since we had not yet. It skips Willem/Churchill and then the next player is Monty (if (player.getID() == askedPlayer.getID() results in continue) and then comes Ragnar and bam.. the code a little above.


The bug has an elementary easy fix: must be player.getTeam()==askedPlayer.getTeam().
::

Edit: I reviewed the code of "getTradeDenial" and war checks must be team, not player.
case TRADE_WAR:
return GET_TEAM(getTeam()).AI_declareWarTrade(((TeamTypes)(item.m_iData)), GET_PLAYER(eWhoTo).getTeam());//the typecast itself does nothing {since it's not Java to have cast checks}
break;

Internally both are just int, so they are the same type (a very good example of weakly-typed error prone code) and often they are in bijection, so I suppose it works ok in most of the case when teams are composed of a single player. However this part is incorrect as much as it can get: tradeData.iData = player.getID()
it must be the team not the player. (player.getTeam())
It's a very significant bug in the code and perhaps asking Monty to declare war on Ragnar would have worked but messing the team and the player is a very serious error.

::
On a side note if the game was compiled w/ asserts (perhaps mod developers should use such a version), the game would have broken.
---
If anyone wishes can point the issue to the BUG team (or I can do in in sf.net but I feel lazy), the code is in PlayerUtil.py
---

Cheers!
 
I apologize for bringing so much code and generally diluting the game w/ boring programming stuff.
Hopefully, you guys don't get too angry about.
 
Lurkerage:

Personally I find the programming stuff miles more interesting than CE vs SE pissing contests for example, keep it up ;) Especially since it's very relevant info for this game (= don't rely 100% on BUG showing you red fists when teams are involved).

Seems like a simple bug, and a weird one at that as both the team and player are fetched a couple rows up. I would guess that the mod is tested with asserts on but as you said it can only die horribly in a team game, which I guess wasn't tested or fell through the cracks.
 
NP bestsss, it's good having someone on the team with such a good knowledge of the code. :)
 
Excellent, detailed report, thanks! :goodjob: Yes, the problem is that BUG was passing in the player's ID instead of their team's ID. And due to the lack of type safety in Python (good and bad), the DLL accepts it just fine. It's fixed in the SVN of BUG and will go into the next official release.

Just to answer the question on testing, I have very little time to test. I do what I can, but I can't come close to testing all the variations played by the community. I depend on users like bestsss to come forward with bug reports. Even a simple "there's a problem with WHEOOH and team games" post to the BUG forum would have been enough to point me in the right direction. Don't feel you need to have as much detail before pointing out a problem, though it certainly made my job easier!

Thanks, again. Enjoy the game! :D
 
...Ok the fist thing will be fixed in the next version of BUG (or it's possible to get the problematic file form SVN, if anyone interested please drop a note)
---
I had another look at the code where the AI masses troops...and it doesn't depend on war target but the attitude multiplied by closeness (to any civ), wonders are added. In the end if the city is visible by the war target the weight for the city is reduces only 2 times. Also how far the city is from the unit is taken into consideration. There is no defined city where AIs build the stack but the stacks can be merged if not too far from each other (after getting to the city)

The attitude multiplied by closeness would explain why we don't see Monty stack, probably he is sending it next to Willem :D
 
Yes, turn #1 a giant stack by Monte makes its way toward us. Turn #3 the horn blows and between Shaka and Ragnar, we have 35 units already crossing the border, not to mention units trickling in behind.

I decided to stop here to re-evaluate with you guys on what to do here, since holding our capital is impossible.

Perhaps we should quickly make a new settler and sneak him off to some island for a safer heaven?

On the other hand.... I'm just kidding (For now!). Just making sure we don't miss anything before I start such an important set. I will not be surprised though, if over 30 units show up.
 
>>if over 30 units show up.
No way (at least not yet), they don't have so much power (yet).

So I think we still have a few turns left. Get control over the baba city and found a new one near the cows.
Ideally ragnar will come 1st w/ horse archers (but no catapults) and suicide them. So we get some war success points. We can't gift a city to Ragnar though but we can do it to Monty, since the war is a team effort it doesn't matter who will suffer the loss of units.

Btw, move the archer from the south to head to the hills city. I didn't check if the forest outside the city is prechopped, we might need it (not so sure, though).

C'mon, move on. And good luck!
 
Well, this war started sooner than I wanted....

A little bit of good news, and a bit of bad news.

First of all, stupid Ragnar got very lucky, and with his single swordsman he had scouting in our backlands, he captured a barb city on a hill without really getting a single scratch! No human would ever get that lucky.

Also, we are now the worst enemy of EVERYONE. Yes, that’s right, EVERYONE. Joao’s team hates us, Churchill’s team hates us, and since Ragnar’s team is going to DoW next turn, they will hate us too. Right now this god-aweful Hindu religion HAS TO GO! Everyone is Buddhism except for Monte’s team, and since it’s obvious they are crossing the borders next turn, we have to switch out of this crap this turn.

I have whipped the walls just now in our Bloody Hill city, and am rather glad now that my first build in that city was chopping a spear-man. It’s best to do spears in cities with no barracks since 10% compared to 100% is almost non-significant. Archers are best made in cities with barracks.

We are just about ready to capture another barb city down in the East, and maybe can grab another barb city even further East to use for peace when the time comes.

I have founded our RESOURCE city, but what to build first is the problem. Since obelisks suck, and we won’t get religion spread, I think we should chop a library first, to pop the borders, then chop a barracks and all military units from there on. I even 2-pop whipped a second fast worker to help get that online and pumping units as fast as possible.

Also, since we had no forges to burn down, or quarries to explode due to ******** random events, we were dealt some good ones for a change. We got 100-200 gold from one event, and then I chose the +3 relations from Monte from another event (I warned you we should always save money for these events).

Right now I have been keeping our cash no lower than 60 because I don’t want to risk losing out on another +3 diplo event. If we are going to play with game-breaking events, it’s rather stupid not to capitalize on the few GOOD ones, and only suffer penalties on all the bad ones.


P.S. For some more bad news, we did get hit by another EVENT bug. Despite paying 60$ for the +3, the game only gave us a +1 for it (unless it decayed in just a couple turns to +1 ?)

I always play with this ******** sh!t off, not sure why we even left this rookie-crap on in the settings. Full of nonsense is what it is.


f_kvlhju8adm_067039c.jpg

f_g7gdnf3m_a5c9cda.jpg
 

Attachments

Errata:

I just went now through the auto-saves to track down what happened. It looks like we did initially get the +3, and then before you can say "Gay-Events" it dropped down to +1 already.

Go figure... I should have known the game never gives you good events unless it's useless (i.e. +1 commerce on a mountain tile).
 
Happy New Year!
Well we got war for it. I will check a bit later and post some more.
 
DOh I will have to delay my observation.
In short: went to skate, the pain is sharp, my girlfriend till take me to xray in the morning.
I am sorry for the delay.
 
Happy New Year everyone!

Looks like that junk hill city turned out to be a strong move, though the situation appears pretty bleak. It's a pity we don't have Buddhism. Thinking out loud... is it worth switching to no state religion and OB with Willem/Churchill in hope that Churchill eventually sends us a missionary (OB diplo bonus might help too)? I'm doubtful there is any value in running Hindu for diplo purposes over the next 5 turns assuming "refusal to talk" applies. I haven't had chance to check the save yet, but if/when Toku/Joao OB with Churchill/Willem, it might not be inconceivable that Churchill spams Buddhist missionaries everywhere, establishing it as the main faith.

@bestsss
No rush, hope the injury isn't serious.
 
Alright, there it is

There is no fracture in the ankle but still it was quite painful and I could not sleep, spent the day in the bed, anyways. I took a glass of vodka as painkiller (the regular painkillers didn't work enough) and around 4am I decided to finally look at the save.

The plan was like that: Change Bombay to swordsman for 2pop whip and overflow fills perfectly an axe->archer. Delhi: finish swordsman (send towards Bombay) and start settler, archer(need happiness w/ monarchy), library. Copper city: finish granary->archer (in the city there is an axe healing), library (will need culture too). BloodyHill finish walls->archer in 2/chop/another archer, switch to the hill to speed up, back to the cottage.
Resource city: chop library, mine the grassland hill, chop the plain hill.

Monarchy: 100%, hoping on the next turn to get enough gold from capturing the barb city. Since taking another city will increase the cost it's better to switch to 100% right away.
Heal into the new city and take the other barb. city.
Try to sell some resource to anyone w/ money.

Most important: don't lose any units and pray Ragnar to suicide some on his own, so the dudes w/ dont talk = 10, can speak actually... Of course, plant the sucky city and gives it to Monty when he talks.

Don't switch out Hindu b/c the peace deal is cheaper if they are not furious towards us (any attitude helps, though) and it will hurt the happiness even more in Delhi.
----
Then I made something truly reckless and pressed enter. As predicted the war horns blew.
The actual problem is that I played the set to the end.

Since it was not discussed at all and I do realized I acted foolishly, if you wish you can drop me out of the game.

This is why I don't post the result.
Regards.
 
Then I made something truly reckless and pressed enter. As predicted the war horns blew.
The actual problem is that I played the set to the end.

Since it was not discussed at all and I do realized I acted foolishly, if you wish you can drop me out of the game.

This is why I don't post the result.
Regards.

I think this is too serious a matter to drop you out of the game. I propose we throw bestsss in the river instead!

Seriously, now that you have wet our appetites I think you may as well post the report, unless you would like us to offer some suggestions for your turn set first? :lol:
 
The river is damn frozen, so that would be sort of difficult, albeit not impossible the ice-fishers love it...

But seriously, if you, guys, think it was inappropriate...
 
I was catapulted off my bike 2 years ago and sprained the ankle. Very painful indeed. Your plan sounds alright to me, so let's have the results :goodjob:.
 
Back
Top Bottom