Questions about The BUG Mod

It returns every relation BUT those between A and B. (But I already said most of that in #1371.)

Amazingly, I only just realized this the other day. It seems odd to hide those items when the original game didn't have the icons BUG has showing war and WE status. While the function is called otherRelations, as you said, the 3.19 patch did add the display of WE status in one direction between the two leaders.

My thought is to allow the function to take NO_PLAYER as the second player. In that case it will show all relations. When two valid players are passed in it will show only the relations between them. I can make this an option in BULL, too. In that case, should it continue to hide one direction of the WE status and the war status of the two players? That seems like a bad idea no matter how I look at it, but maybe I'm missing something.
 
I completed my change last night and played with it a little. I really like it personally, but I think I can make it optional to give us both what we want. ;) Given that my way gives both views on the same screen simply by pointing to the header icons versus the grid intersections, I wonder if maybe I'm just not explaining myself well.

If you hover over the intersection between Ghandi (column) and Isabella (row) you will see at most:

  • Ghandhi
  • At war with Isabella (or Peace Treaty with Isabella)
  • Isabella is Worst Enemy
  • Worst Enemy of Isabella
  • Defensive Pact with Isabella
This is the restricted pair view I added. Now, if you want to see the old (but updated) view that shows relations Ghandi has with all rivals, you hover over Ghandi's icon. To see all relations that Isabella has, hover over Isabella's icon. In both of these cases relations with you will be pulled out to the top.

While one view (cell) shows less information, overall the screen now shows more information by providing three different views. Unfortunately, the row/column icons are set to show the leader's relations with you for some unknown reason, so this will be less useful without the latest BUG. I don't think anyone uses BULL without BUG, so I'm not too concerned here.

Do you still want to show all relations Ghandi has when hovering over the intersections in his column when you can see them by hovering over his icon?
 
Will the intersections of the first row (mine) act the same way, showing only relations between the rivals and me? (It probably should, for consistancy)
Leaderhead hover & scoreboard still showing all info? Then I guess even I can live with that, and option just for me to always show all info even at intersections might be nice (because I'm used to it) but probably not necessary, I can really just hover over leaderheads or use the scoreboard.

You once said you still needed an icon for defence against bombardment; I tried today, but ended up spending a lot more time on looking for where it is hidden than actually playing with photoshop but w/e, here you go. If the icon looks too bad to use I could try again sometime, I just didn't feel like trying to find out how to actually make the new icon appear ingame today (though I think only CvEnum.h needs a new entry or two and then it should already be working as expected).
 

Attachments

Will the intersections of the first row (mine) act the same way, showing only relations between the rivals and me?

Yes.

You once said you still needed an icon for defence against bombardment; I tried today, but ended up spending a lot more time on looking for where it is hidden than actually playing with photoshop but w/e, here you go.

Thanks! I'll see how quickly I can merge it in (hopefully for 1.1). This will be the first case where BULL will need an icon from the BUG font file, so anyone using BULL without BUG will get a ? instead.
 
Or you could simply check if BUG is there and not display anything.

But what I actually wanted to say, I must have misclicked somehow before saving GameFont.tga, some black pixels on the alpha channel that shouldn't be there, so I reuploaded just now.
 
To make comparing CvDLLWidgetData::parseContactCivHelp() a bit easier to compare for me and WinMerge, could you introduce the same variables as jdog? It gets a tiny bit hard to read when even lines that are identical in meaning are marked as different.

Here the first few lines of that function from BBAI:
Code:
void CvDLLWidgetData::parseContactCivHelp(CvWidgetDataStruct &widgetDataStruct, CvWStringBuffer &szBuffer)
{
[COLOR="Green"]/************************************************************************************************/
/* BETTER_BTS_AI_MOD                      04/03/09                                jdog5000      */
/*                                                                                              */
/* DEBUG                                                                                        */
/************************************************************************************************/
	// do not execute if player is out of range[/COLOR]
	PlayerTypes [B]ePlayer[/B] = (PlayerTypes) widgetDataStruct.m_iData1;
	if (ePlayer >= MAX_PLAYERS)
	{
		return;
	}

[COLOR="Green"]	// do not execute if player is not a real civ[/COLOR]
	CvPlayerAI& [B]kPlayer[/B] = GET_PLAYER(ePlayer);
	if (kPlayer.getCivilizationType() == NO_CIVILIZATION)
	{
		return;
	}

	[COLOR="Green"]// make sure its empty to start[/COLOR]
	szBuffer.clear();

	TeamTypes [B]eTeam[/B] = (TeamTypes) kPlayer.getTeam();
	CvTeamAI& [B]kTeam[/B] = GET_TEAM(eTeam);

	PlayerTypes [B]eActivePlayer[/B] = GC.getGameINLINE().getActivePlayer();
	TeamTypes [B]eActiveTeam[/B] = (TeamTypes) GET_PLAYER(eActivePlayer).getTeam();
	CvTeamAI& [B]kActiveTeam[/B] = GET_TEAM(eActiveTeam);
 
Help.

I took the plunge to merge from BUG rev 2098 to 2135. I have no interface and the PythonErr2.log has this to say.

Code:
load_module CvCorporationScreen
load_module CvCivicsScreen
load_module CvVictoryScreen
load_module TechUtil
[COLOR="Red"]load_module GameSetUpCheck
GameSetUpCheck import failed
Traceback (most recent call last):
  File "<string>", line 1, in ?
  File "<string>", line 52, in load_module
  File "CvEventInterface", line 17, in ?
  File "<string>", line 52, in load_module
  File "BugEventManager", line 102, in ?
  File "<string>", line 52, in load_module
  File "CvEventManager", line 12, in ?
  File "<string>", line 52, in load_module
  File "CvScreensInterface", line 10, in ?
  File "<string>", line 52, in load_module
  File "CvVictoryScreen", line 24, in ?
ImportError: No module named GameSetUpCheck[/COLOR]

I don't, and probably never will, use BUFFY. I don't have a BUFFY.ini, but I thought it didn't matter since BUFFY was defaulted to off. Although I don't think it's the problem, I also don't know where to put the GameSetUpCheck folder that contains GameSetUpCheck.txt. Again, I thought it didn't matter.

I run BUG out of myDocs, not as a mod. I confirmed that the correct version of GameSetUpCheck.py is in <\My Documents\Games\Civilization IV\Beyond the Sword\CustomAssets\Python\BUFFY> along with Buffy.py.
 
To make comparing CvDLLWidgetData::parseContactCivHelp() a bit easier to compare for me and WinMerge, could you introduce the same variables as jdog?

I didn't change any of that code--it's vanilla BTS up to the

Code:
// BUG - start
		// Espionage and CTRL instructions moved below
// BUG - end

after the Refuses to Talk check. Does the rest of the function use those variables? Can you please post the whole function so I can merge it in on my end?

BTW, when merging the UP 1.4 I went ahead and swapped out my fixes and comment style for jdog's to make it easier (I hope!) to merge with BAI. I am about to commit the merged code to the BULL SVN, so if that will make it harder speak up now. :D

I don't, and probably never will, use BUFFY.

BUFFY should quietly sit inactive in BUG. I merged its code into BUG to avoid future work and errors during release time. The code is tiny and easily switched off, so it seemed safe. As long as you have GameSetUpCheck.py somewhere in your Python folder hierarchy (same with all Python modules) it should load fine. Double-check the name of the file and that it is in the right Python folder (i.e. did you definitely put it into CustomAssets?).

Can you please post PythonDbg.log so I can see what's happening?

I also don't know where to put the GameSetUpCheck folder that contains GameSetUpCheck.txt.

It should go in a folder name GameSetUpCheck (yes, really :() in the "BUG Mod" folder in your BTS folder--a sibling to the UserSettings folder. However, now that you mention it that file should not be needed if BUFFY is off, so I'll make sure that's the case (it probably is needed right now).
 
Quick feedback on BULL r135 & BUG r2135:

Scoreboard: I notice you moved the espionage string to after the attitude stuff. For purely aestetical reasons (or maybe just a little bit of consuetude) I'd like it back to where it was (or where it still is for every other hover): Right between
<leader name> from <civ>
(<trait1>, <trait2>)
and
<attitude> todards <me>
Those 3 lines are all white, I really like how the black and red espionage button serves as a sort of seperator between traits line and attitudes string. Is moving it away really necessary and are you planning to change that for all other hovers too?

Glance page is nice, first impression: That's the way it should have worked from the very beginning.:goodjob:

Relations page: I was expecting leaderhead hovers identical to leaderhead hovers from the glance page when no leader is selected, and in case one is selected leaderhead hovers identical to intersection hovers from the glance page.
With a leader selected, the behaviour was almost as expected, only the hover for a leader that the selected civ had not met yet would show all relation info, instead of either 1) no relation info at all, just a "civ1 has no met civ2 yet" message which needs yet another txt_key or 2) no hover at all (there is nothing on an intersection of 2 civs that haven't met either)
With no selection it acts as if the active player was selected, thus the leaderhead hovers are all showing only relations to me, instead of all relations.

I'm guessing you just didn't get that far yet? I assume there are a few other places with hovers that might need to be adjusted so that's as far as I went for today's inspection.
 
I notice you moved the espionage string to after the attitude stuff.

I did it to avoid adding yet another blank line to that hover, but I can move it back and get rid of the extra blank line. It'll just mean more changes to things that didn't need to change before. I hate doing that just to remove blank lines since it makes more work for mergers, but aesthetics are important to me as well.

Glance page is nice, first impression: That's the way it should have worked from the very beginning.:goodjob:

Great, glad you like how it turned out. Once I started testing the final product in a quick game, I was happy I made those changes. If you can think of text changes that would make intersections even clearer, I'm all ears.

Relations page: I was expecting leaderhead hovers identical to leaderhead hovers from the glance page when no leader is selected, and in case one is selected leaderhead hovers identical to intersection hovers from the glance page.

That's what I was going for as well, but I must have broken it after fixing something else. I had to make several changes in BUG to make it detect the DLL and swap what it shows. The other F4 and F5 pages should all be working. Please let me know if you spot more.

Thanks for checking these. :goodjob:
 
BUFFY should quietly sit inactive in BUG. I merged its code into BUG to avoid future work and errors during release time. The code is tiny and easily switched off, so it seemed safe. As long as you have GameSetUpCheck.py somewhere in your Python folder hierarchy (same with all Python modules) it should load fine. Double-check the name of the file and that it is in the right Python folder (i.e. did you definitely put it into CustomAssets?).

Can you please post PythonDbg.log so I can see what's happening?

Wow, I just got schooled by SVN on this one. I run a local repository to keep by BTS folder in check. I have a working copy outside of myDocs where I do my changes & commits. I then update into the myDocs as necessary. I had copied over the BUFFY folder from an active BUG working copy (from your repository) and the .SVN folder inadvertainly came with it. This created nested working copies so when I comitted, the BUFFY folder missed it. Hence when I updated myDocs, there was indeed no BUFFY folder.

Good SVN "lessons learned" on that one.

It should go in a folder name GameSetUpCheck (yes, really :() in the "BUG Mod" folder in your BTS folder--a sibling to the UserSettings folder. However, now that you mention it that file should not be needed if BUFFY is off, so I'll make sure that's the case (it probably is needed right now).

I had this in the right place originally, but thanks for clarifying. Seemed like the logical place to go.
 
I didn't change any of that code--it's vanilla BTS up to the

Code:
// BUG - start
		// Espionage and CTRL instructions moved below
// BUG - end

after the Refuses to Talk check. Does the rest of the function use those variables? Can you please post the whole function so I can merge it in on my end?
I know it's vanilla, it's still looking better (simpler) on jdog's side with "eTeam" instead of "GET_PLAYER((PlayerTypes)widgetDataStruct.m_iData1).getTeam()" etc
Using more variables instead of always repeating widgetDataStruct.m_iData1, and using the same names for them as jdog, is all I was suggesting. And I think you don't need the whole BBAI function with 1k lines of AI debug text for that.

This is what that part of my CvDLLWidgetData.cpp looks like now:
Code:
	[COLOR="Green"]//	Show score info instead if we are trying to contact ourselves...[/COLOR]
	if ( eActivePlayer == ePlayer || (gDLL->ctrlKey() && gDLL->getChtLvl() > 0) )
	{
		parseScoreHelp(widgetDataStruct, szBuffer);
		return;
	}

	szBuffer.append(gDLL->getText("TXT_KEY_MISC_CONTACT_LEADER", kPlayer.getNameKey(), kPlayer.getCivilizationShortDescription()));
	szBuffer.append(NEWLINE);
	GAMETEXT.parsePlayerTraits(szBuffer, (PlayerTypes)widgetDataStruct.m_iData1);

	if (!(kActiveTeam.isHasMet(eTeam)))
	{
		szBuffer.append(NEWLINE);
		szBuffer.append(gDLL->getText("TXT_KEY_MISC_HAVENT_MET_CIV"));
	}

	if( (kActiveTeam.isHasMet(eTeam)) || GC.getGameINLINE().isDebugMode() )
	{
		if (!(kPlayer.isHuman()))
		{
			if (!(kPlayer.AI_isWillingToTalk(eActivePlayer)))
			{
				szBuffer.append(NEWLINE);
				szBuffer.append(gDLL->getText("TXT_KEY_MISC_REFUSES_TO_TALK"));
			}

			if ( !((gDLL->altKey() || gDLL->ctrlKey()) && gDLL->getChtLvl() > 0) )
			{
				szBuffer.append(NEWLINE);
				GAMETEXT.getAttitudeString(szBuffer, ePlayer, eActivePlayer);
[COLOR="Green"]// BUG - start
		// CTRL instructions moved below
		//Fuyu moved espionage back up[/COLOR]
				szBuffer.append(NEWLINE);
				GAMETEXT.getEspionageString(szBuffer, ePlayer, eActivePlayer);
[COLOR="Green"]// BUG - end[/COLOR]
			}
		}
		if ( !((gDLL->altKey() || gDLL->ctrlKey()) && gDLL->getChtLvl() > 0) )
		{
			if (eTeam != eActiveTeam )
			{
[COLOR="Green"]// BUG - All Relations in Scoreboard - start[/COLOR]
				GAMETEXT.getAllRelationsString(szBuffer, eTeam);
[COLOR="Green"]// BUG - All Relations in Scoreboard - end[/COLOR]

[COLOR="Green"]// BUG - Deals in Scoreboard - start[/COLOR]
			}
			if (gDLL->ctrlKey() && ePlayer != eActivePlayer)
			{
				GAMETEXT.getActiveDealsString(szBuffer, ePlayer, eActivePlayer);
			}
[COLOR="Green"]// BUG - Deals in Scoreboard - end[/COLOR]

[COLOR="Green"]// BUG - start
		// moved from above to organize the hover text[/COLOR]
			if (!(kPlayer.isHuman()))
			{
				szBuffer.append(NEWLINE);
				szBuffer.append(gDLL->getText("TXT_KEY_MISC_CTRL_TRADE"));
			}
[COLOR="Green"]// BUG - end[/COLOR]
		}

		if (eTeam != eActiveTeam )
		{

			if( !(kActiveTeam.isAtWar(eTeam)))
			{
				if (kActiveTeam.canDeclareWar(eTeam))
				{
					szBuffer.append(NEWLINE);
					szBuffer.append(gDLL->getText("TXT_KEY_MISC_ALT_DECLARE_WAR"));
				}
				else
				{
					szBuffer.append(NEWLINE);
					szBuffer.append(gDLL->getText("TXT_KEY_MISC_CANNOT_DECLARE_WAR"));
				}

				szBuffer.append(NEWLINE);
				szBuffer.append(gDLL->getText("TXT_KEY_MISC_SHIFT_ALT_PREPARE_WAR"));
			}
		}
	}

	if (kPlayer.isHuman())
	{
[COLOR="Green"]//		szBuffer += "\n(<SHIFT> to Send Chat Message)";[/COLOR]
		szBuffer.append(NEWLINE);
		szBuffer.append(gDLL->getText("TXT_KEY_MISC_SHIFT_SEND_CHAT"));
	}
}
(I just find that a bit more readable)


BTW, when merging the UP 1.4 I went ahead and swapped out my fixes and comment style for jdog's to make it easier (I hope!) to merge with BAI. I am about to commit the merged code to the BULL SVN, so if that will make it harder speak up now. :D
You already had "// BUG - Unofficial Patch" style comments, making it easy to spot, and since I always knew BBAI is built right on top of the latest UP I could just ignore it (leave jdog's code alone) and move on to other differences. If they are identical they wouldn't even show up as differences though which I guess is still a bit of an improvent.
 
Using more variables instead of always repeating widgetDataStruct.m_iData1 . . .

I do that in new functions I write, but I've resisted my urge to improve Firaxis code when it doesn't need to be improved (broken or serious performance problems). I'm happy to fix this one since we've both essentially rewritten the function.

If they are identical they wouldn't even show up as differences though which I guess is still a bit of an improvent.

That's exactly why I did it. Sure, spotting a change, detecting that it differs only in comment style, and ignoring it takes a small amount of time. I wouldn't both reducing the time it takes for this task from 3 seconds to 2, but I'm quite happy to put in a little work and sacrifice my normal style to completely eliminate a task no matter how quick it is.

You can send me cookies or beer if you feel particularly generous over the change. :D
 
I just noticed that the diplomacy window uses the WIDGET_LEADERHEAD that I have now changed. I cannot change it to pass in NO_PLAYER as the second argument (show all relations), so I must change course.

I will create a new WidgetType: WIDGET_LEADERHEAD_RELATIONS which requires two players and always shows only the relations between them. I will then use this in just the cases where it makes sense (F4: RELATIONS with a player selected, GLANCE intersections, INFO :religion: and favorite civic modifiers; and F5: SIT-REP). All the existing uses of the original widget will continue to show the new all relations style with yours pulled up top whether you pass in one or two players.
 
relations hover is not working the way I expect it to, did I break that or is it supposed to behave this way?
Spoiler :

pic #1: 1st line (mine), 2nd row (Boudica):
:health: You are Worst Enemy.
:health: Worst Enemy of Montezuma, Ghandi
:yuck: but there is no "War with Fuyu" ("We are at War" would work too)

pic #2: 2nd line (Tokugawa), 3rd row (Montezuma):
:health: Boudica is worst enemy
:yuck: same problem: Where did the "War with Tokugawa" go?

pic #3: 4th line (Montezuma), 1st row (Tokugawa):
:yuck: "You are Worst Enemy" - which makes sense in line 1 were I am the relevant player. I'd like a "Fuyu is Worst Enemy" in all other lines.
:yuck: Not a word about the war, again.

pic #4: 4th line, 2nd row:
:yuck: "You are Worst Enemy" instead of "Fuyu is Worst Enemy" again
:health: Worst Enemy of Ghandi
:health: War with Fuyu


So basically, all entries in row 1 and 2 will say "You are Worst Enemy" instead of just one ("Fuyu is Worst Enemy" for the rest), yet when all entries in row1 should tell about the War with Montezuma, the Montezuma line says nothing.

If that's how it is supposed to work then that just shows how little I ever paid attention to diplomacy, I only started looking at it now because BBAI and BULL clash a bit here, and I'm assuming I did something wrong.

For the "You are Worst Enemy" everywhere issue: There's only a check for ActiveTeam, so I guess the behaviour is intended, or at least to be expected.
Spoiler :


As a new user of BUG I am a bit confused. My version of BUG 4.2 has different text in the Glance screen. Are these discussions just about future changes or there updates and releases that I'm missing?
 
Don't be confused, this is more development talk and is only relevant to the very latest (SVN, not release) BULL & BUG combination.
 
As a new user of BUG I am a bit confused. My version of BUG 4.2 has different text in the Glance screen. Are these discussions just about future changes or there updates and releases that I'm missing?

We are discussing the current development version of BUG: the latest code in the Subversion repository. You are always free to drink directly from the firehose, as they say, by using a program like TortoiseSVN to get the latest code.

@Fuyu - I have updated BUG and BULL by adding a new widget type as we discussed. Everything seems to be working okay now. I also moved the Espionage text back to where it was in the scoreboard hover. But note that that places it below the attitude modifiers. I'm inclined to move it up above them to match the other hovers and get rid of that ugly blank line.
 
Though I'm addicted to as much info in the game as I can possibly get, I think I'll just wait for further releases so that I don't hurt myself!
 
Back
Top Bottom