Development Thread

I got the images, no sweat, and maybe they really are too big for BULL svn to just include them; I was just thinking maybe you should add the required assets to Optional Assets, just in case clueless people compile their own dll with that flag on and get crashes when they try to load the game with and xml file that is missing the required tag.

You can use the MinOccurs = "0" in the schema's for Event Art.

Good point. I still would like to verify what things we can turn on by default. For example, if I enable this feature and use the new schema, you don't need to add the <EventArt> tag to any events. So it seems I can make this feature permanent without affecting save game compatibility. However, the tag is written in the write() function--I just don't know exactly when the Info objects are written into a saved game and when they aren't.

Just get rid of the read/write calls in CvInfos. It's just used to make sure people don't mess with Assets in MP or Locked games, and changing the art certainly won't affect the outcome of a game...
 
Removing read & write seems like a really good idea. Why were they there in the first place?

So with MinOccurs = "0", adding no EventArt tag has the same effect as adding an empty EventArt tag? (<EventArt></EventArt> or <EventArt/>) Then actually all that is needed is the updated schema file, and I can leave the cflag on. Yay

Spoiler :
Code:
{[I]CIV4EventSchema.xml[/I]}

(...)

	<ElementType name="bQuest" content="textOnly" dt:type="boolean"/>
[B][COLOR="Blue"]	<ElementType name="EventArt" content="textOnly"/>[/COLOR][/B]
	<ElementType name="bSinglePlayer" content="textOnly" dt:type="boolean"/>

(...)

	<ElementType name="EventTriggerInfo" content="eltOnly">
		<element type="Type"/>
		<element type="WorldNewsTexts"/>
		<element type="TriggerTexts"/>
[B][COLOR="Blue"]		<element type="EventArt" minOccurs="0"/>[/COLOR][/B]
		<element type="bSinglePlayer"/>

So, does anyone have other pictures? Arian's collection might be complete but I was hoping for more exciting pictures, like the one from that first post here.
 
Removing read & write seems like a really good idea. Why were they there in the first place?

So with MinOccurs = "0", adding no EventArt tag has the same effect as adding an empty EventArt tag? (<EventArt></EventArt> or <EventArt/>) Then actually all that is needed is the updated schema file, and I can leave the cflag on. Yay

Spoiler :
Code:
{[I]CIV4EventSchema.xml[/I]}

(...)

    <ElementType name="bQuest" content="textOnly" dt:type="boolean"/>
[B][COLOR=Blue]    <ElementType name="EventArt" content="textOnly"/>[/COLOR][/B]
    <ElementType name="bSinglePlayer" content="textOnly" dt:type="boolean"/>

(...)

    <ElementType name="EventTriggerInfo" content="eltOnly">
        <element type="Type"/>
        <element type="WorldNewsTexts"/>
        <element type="TriggerTexts"/>
[B][COLOR=Blue]        <element type="EventArt" minOccurs="0"/>[/COLOR][/B]
        <element type="bSinglePlayer"/>

So, does anyone have other pictures? Arian's collection might be complete but I was hoping for more exciting pictures, like the one from that first post here.
Do you have any access to the BAT SVN? I've got the Event Images thing all finished except for the FPK file, which I'm doing tonight. I hope to have it wrapped up for a commit before bed. All of the images and XML is there, and it will save you a lot of time. PM me if you don't have access, and I'll figure out another way to get it to you.

There are some alternate pictures available in Arian's thread IIRC...
 
@EF: I like that "Health Effects from Removing Features" feature :)lol:), you just got me a bit confused there with the junle creating "+14 hammers in Ghuzz"...?
 
You just got me a bit confused there with the [jungle] creating "+14 hammers in Ghuzz"...?

I took that from PieceOfMind's PIG Mod: Clearing a Jungle produces 50% :hammers: compared to a Forest. :D I knew I should have removed that for the pic.
 
Jungle has only -25 HealthPercent, so on average only every 4th jungle you clear actually gives -1 :yuck:, just as only every 2nd forest cleared gives -1 :health:.... And because at first I wasn't sure how you handled that I was going to ask but after actually reading the whole code I can only say :goodjob:

Multiple workers clearing multiple features in the vicinity of one city at the same time however will always show the same message though; so when clearing the first forest has no negative impact but clearing another one has, you'd need to wait for the first forest to be cleared to get the correct -1 :health: warning for the worker action that clears the second forest.

Spoiler :
Looping through every worker and storing the info (iTotalFutureFeatureHealthPercent and iTotalFutureFeatureUnhealthPercent) for every city where nearby worker actions clear features with health effect at the beginning of every turn, and updating that with every new relevant worker action, looks like a possible but complicated solution.
 
My plan was to check for Workers performing actions that clear features while calculating the current health from features (as an optional boolean). If I had done that would I have received two thumbs up? ;) I think this is a worthwhile addition, and since it only needs to loop over the units when you hover over the action* it won't matter if it takes several milliseconds longer.

* As Afforess found out and I validated when my first calculation core dumped, the hover text for each action is built when the icon is added to the panel. I don't know if it's saved to use when you actually hover over it, but it's something I'd like to disable especially for buildings as that causes some serious lag for RoM when selecting cities.​
 
I like the health effects thing, too. :)

BULL 1.3 anyone? :lol:
 
My plan was to check for Workers performing actions that clear features while calculating the current health from features (as an optional boolean). If I had done that would I have received two thumbs up? ;)
Nah, that would have earned you an instant :worship: or :bowdown: emoticon.

Because if I had thought of this, I might have tried to implement a "-0.25:yuck: in Ghuzz, Varanazi", and would have already been very pleased with myself if I made it that far :p And you go so much further ..

On a different topic:
You are using [COLOR_BLUE] for some hover text (Defensive Pacts iirc) which I find so hard to read it hurts my eyes. I changed it back to cyan, but maybe you can suggest some other colors? white,green,red,cyan,yellow are known to work, when I tried orange the text was no longer displayed :sad: I take it only those mentioned in Colors_Civ4GameText.xml work? That would mean magenta and 3 shades of grey are left .. and black.

I also seem to have troubles reading the numbers from the stack promotions feature. White numbers on a whitish, semi-transparent circular shape, where only the shadow of the font is dark. I assume a darker colored barkground shape would help, or a different color for the numbers.
 
You are using [COLOR_BLUE] for some hover text (Defensive Pacts iirc) which I find so hard to read it hurts my eyes. I changed it back to cyan, but maybe you can suggest some other colors?

The peace treaty is cyan, and defensive pact implies peace so it makes sense.

I take it only those mentioned in Colors_Civ4GameText.xml work?

I'm pretty sure any color in CIV4ColorVals.xml is acceptable.

I also seem to have troubles reading the numbers from the stack promotions feature.

You an me both. I tried black, red, orange, cyan, and green, and none of them were any easier. Another option would be to replace the whitish circle with some other color. There may even be enough room to shift the graphic and number a little to the right. If so we could use a solid circle and still make out the promotion icon.
 
I added code to consider current worker actions when displaying health effects of removing features. Any workers already removing the feature from the plot the selected worker is on are ignored as that made the most sense.

I also split out the calculation of spoiled food, starvation, and angry population from all the functions that calculate health and happiness effects. There is one function for each value on CvCity. I believe that Better BTS AI was using some of these functions to improve AI building selection, and it will need to be updated. Just pass iGood and iBad to get the spoiled food and angry population; pass the spoiled food to get the starvation.

Edit: This aspect is now optional as well. BTW, this should work seamlessly with mods that allow workers to add features, too.
 
:worship:

jdog doesn't update the BULL part, and I was using the function with only one argument, which still works.

Btw does anyone know what happens if I specify a dds file for an EventARt tag and that file is not found? Crash, pink square, or will the event just display as if there was no event art specified?
 
:worship:

jdog doesn't update the BULL part, and I was using the function with only one argument, which still works.

Btw does anyone know what happens if I specify a dds file for an EventARt tag and that file is not found? Crash, pink square, or will the event just display as if there was no event art specified?
IIRC, if the file isn't found, you would get a pink square in the popup box. The popup window still appears, but it's smaller and contains only the text and a small square. It doesn't crash for me when I've done that.
 
That doesn't sound so bad but is still not really acceptable either. I guess I'll have to turn Events With Images into a BUG option.

Oh right, I opened the tab, wrote this, and never actually posted it. It's an ingame option on the Main Interface tab now.
 
That doesn't sound so bad but is still not really acceptable either. I guess I'll have to turn Events With Images into a BUG option.

Oh right, I opened the tab, wrote this, and never actually posted it. It's an ingame option on the Main Interface tab now.

Lol, I did the same thing. Two weeks ago. :p
 
That doesn't sound so bad but is still not really acceptable either. I guess I'll have to turn Events With Images into a BUG option.

Oh right, I opened the tab, wrote this, and never actually posted it. It's an ingame option on the Main Interface tab now.
Neat! Would you mind sharing the code that makes it a BUG option? That is something I would really appreciate, and I could learn from it, too. :)
 
Yeah guys, I'm happy to incorporate stuff into BUG. I think that would be pretty obvious since that's how BUG got started! :D
 
Lol, I did the same thing. Two weeks ago. :p
:lol:
Ok, not entirely surprising, since you were the one who told me I don't need the read/write parts. And once those are gone, there is no reason left why this should only be a compile-time option.
It seems you first used a Define, now you're using a player-specific code. My version is just
Code:
// BUG - Events with Images - start
	if (getBugOptionBOOL("MainInterface__EventsWithImages", false, "BUG_EVENTS_WITH_IMAGES") == true)
	{
		if (kTrigger.getEventArt())
		{
			gDLL->getInterfaceIFace()->popupAddDDS(pPopup, kTrigger.getEventArt());
		}
	}
// BUG - Events with Images - end
and since I can't see how this could cause troubles in MP, I hope that's enough.
 
(double post? Nah, just 2 postings in quick succession)

@Lemon Merchant
Right, the code.

edit: In preparation to these 4 steps I removed all #ifdefs for Events with Images from all files, and removed the stream-read and write lines completely.

All I did was copy what was done in revision 200 of BULL and revision 2235 of BUG.
1.) SDK:
CvDLLButtonPopup::launchEventPopup()
Code:
[COLOR="Green"]// BUG - Events with Images - start[/COLOR]
	[B]if (getBugOptionBOOL("MainInterface__EventsWithImages", false, "BUG_EVENTS_WITH_IMAGES") == true)
	{[/B]
		if (kTrigger.getEventArt())
		{
			gDLL->getInterfaceIFace()->popupAddDDS(pPopup, kTrigger.getEventArt());
		}
	[B]}[/B]
[COLOR="Green"]// BUG - Events with Images - end[/COLOR]
2.) Python:
BugGeneralOptionsTab.py
Code:
	def createMiscellaneousPanel(self, screen, panel):
		self.addLabel(screen, panel, "Misc", "Misc:")
		self.addCheckbox(screen, panel, "MainInterface__GoldRateWarning")
		self.addCheckbox(screen, panel, "MainInterface__MinMax_Commerce")
		self.addCheckbox(screen, panel, "MainInterface__ProgressBarsTickMarks")
		self.addTextDropdown(screen, panel, panel, "MainInterface__BuildIconSize", True)
		self.addCheckbox(screen, panel, "MainInterface__CityArrows")
		[B]self.addCheckbox(screen, panel, "MainInterface__EventsWithImages")[/B]
3.) Config:
BUG Main Interface.xml
Code:
			[COLOR="Green"][B]<!-- Events with Images -->[/B][/COLOR]
			[B]<option id="EventsWithImages" key="Events with Images" 
					type="boolean" default="False" dll="5"/>[/B]
4.) Text:
BUG Main Interface Options.xml
Code:
	[B]<TEXT>
		<Tag>TXT_KEY_BUG_OPT_MAININTERFACE__EVENTSWITHIMAGES_TEXT</Tag>[/B]
		[I](... bla ...)[/I]
	[B]</TEXT>
	<TEXT>
		<Tag>TXT_KEY_BUG_OPT_MAININTERFACE__EVENTSWITHIMAGES_HOVER</Tag>[/B]
		[I](... bla ...)[/I]
	[B]</TEXT>[/B]

Note that I don't bother storing BULL option values in GlobalDefines because the values there are only ever used if BUG is not present, and even if that should happen there is still a default value coded into the dll, so it's just redundant.
 
@Fuyu:

I bow to your greatness. Thank you. :)
 
Top Bottom