Large GameFont Files without Modular Loading

Archid

Warlord
Joined
Oct 30, 2009
Messages
296
Location
North Wales, UK
For those who want to be able to use the large GameFont files from WoC but don't want the modular loading code that normally goes with it.

I have taken the WoC Lite mod from johny_smith and stripped out all the code related to the modular loading, leaving just what is necessary to allow the use of the big GameFont files. I have included the GameFont files from the C2C mod as they include lots of extra bonus, corporation & religion chars. I have added the few extra chars that are used by the BUG mod.

I have only included the SDK files that have changed and these are commented with TGA_INDEXATION

As I do not use the Properties from C2C in my mod I have commented out the code that reads these characters from the font files. If you want to include them uncomment the code block in the CvGameTextMgr.cpp::assignFontIds method. You can find the block by searching for AIAndy: Property symbols

None of the code has been written by me, I have just repackaged it.

Updated with new version to fix a bug - thanks AIAndy

The download can be found here: http://forums.civfanatics.com/downloads.php?do=file&id=19615
 
Thankyou for making the LargeGamefont I have added 54 bonus so far to this and is working real great.
 
Thanks for the feedback. its good to hear that someone is finding it useful.

I thought I should put something back into the forums after all the stuff I have downloaded and used myself.
 
Good to see someone isolating some of the changes that are buried in our big projects.
Mind though that the CvGameTextMgr::getFontSymbols you are using is incorrect. It does not properly describe the larger of the two fonts which is only used at very few positions, mainly the city bar icons. It is entirely down to chance (or maybe try and error) that it works if the number of bonuses are in a certain range. As soon as you get above that the icons displayed in the city bar will be incorrect (which was falsely considered a resource limit by some).

As I do not use the Properties from C2C in my mod I have commented out the code that reads these characters from the font files. If you want to include them uncomment the code block in the CvGameTextMgr.cpp::assignFontIds method. You can find the block by searching for AIAndy: Property symbols
I'd be somewhat surprised if anyone used the properties without basing a mod entirely on the C2C codebase as with time the different systems I have added have become quite interdependent. Property manipulators could not be described or solved without the abstraction layer in form of the game object wrappers and also use the expression system which in turn is also based on the game objects. I guess maybe you could isolate a simple version of the properties without the manipulator solving.
 
Thanks for the feedback I hadn't spotted your changes to the getFontSymbols method.

Just done a diff against the latest C2C code and trying to work out what needs to be done to incorporate it successfully. From my limited understanding of this I think I would need to incorporate all changes except the following loop structure

PHP:
	for (int iI = 0; iI < GC.getNumPropertyInfos(); iI++)
	{
		aacSymbols[aacSymbols.size() - 1].push_back((wchar) GC.getPropertyInfo((PropertyTypes) iI).getChar());
	}

I presume I need the following statements related to the property chars as placeholders

PHP:
	aacSymbols.push_back(std::vector<wchar>());
	aiMaxNumRows.push_back(3); // There are 3 rows of 25 icons each from the start of property symbols to the start of the generic symbols

Does that sound correct?
 
Thanks for the feedback I hadn't spotted your changes to the getFontSymbols method.

Just done a diff against the latest C2C code and trying to work out what needs to be done to incorporate it successfully. From my limited understanding of this I think I would need to incorporate all changes except the following loop structure

PHP:
	for (int iI = 0; iI < GC.getNumPropertyInfos(); iI++)
	{
		aacSymbols[aacSymbols.size() - 1].push_back((wchar) GC.getPropertyInfo((PropertyTypes) iI).getChar());
	}

I presume I need the following statements related to the property chars as placeholders

PHP:
	aacSymbols.push_back(std::vector<wchar>());
	aiMaxNumRows.push_back(3); // There are 3 rows of 25 icons each from the start of property symbols to the start of the generic symbols

Does that sound correct?
Yes, that should work. Alternatively add the 3 to the previous entry in aiMaxNumRows, so the religions and corporation icons are in a 26 row section instead of a 23 row one.
 
New version updated with fix above incorporated...and the file is out of moderation so is available for download :)

It's good to see that now others are isolating the fixes in C2C for the rest of the Civ 4 mod community. I know that before AIAndy fixed this everyone thought that there was no way to add more than 75 or so resources, and AFAIK no major mods other than C2C have incorporated this fix. It'll be interesting to see what other large mods do with this component.
 
Are all the bonus images out by 5 rows, e.g. aluminium->handcuffs, coal->flame? Have you added/removed any images to the font file? Do you have the copy from CF or did you get the original file I uploaded to AtomicGamer?

The code that reads the images is contained in 2 methods CvGameTextMgr::getFontSymbols & CvGameTextMgr::assignFontIds. Could you double-check these methods and make sure all the numeric constants were copied across successfully?
 
Those gametextmgr.cpp functions were not merged correctly as you said. Because my source code is so heavily modified, I just searched for TGA_..... That gamefont part you mentioned is not commented. Accidents happen with large amounts of code. :) THanks.

Edit: That's all it was, now it works fine.
 
I have a minor issue with the effects window under Improvements, Mine.

The resources do not appear correct (See image)

Everything else appears to be woring correctly.
 

Attachments

  • Discovering.jpg
    Discovering.jpg
    30.6 KB · Views: 139
I have a minor issue with the effects window under Improvements, Mine.

The resources do not appear correct (See image)

Everything else appears to be woring correctly.


// modified Sephi
// Symbol loading adjusted to WoC.

// set bonus symbols
int bonusBaseID = iSavePosition + 125;
//++iCurSymbolID;


IF you used his CvGameTextMgr changes fully try changing 125 to 0 and see if that will fix the error you have this seems to work when using the BUG Mod 4.4 bull type dll sdk

// modified Sephi
// Symbol loading adjusted to WoC.

// set bonus symbols
int bonusBaseID = iSavePosition + 0;
//++iCurSymbolID;


and one other thing make sure your fonts are set up right something like i did here
and with luck it should work for you

these fonts are from a mod i playing around with



i use your Grand Inquisitions 255E CvGameTextMgr to show you how i added his changes in
 
// modified Sephi
// Symbol loading adjusted to WoC.

// set bonus symbols
int bonusBaseID = iSavePosition + 125;
//++iCurSymbolID;


IF you used his CvGameTextMgr changes fully try changing 125 to 0 and see if that will fix the error you have this seems to work when using the BUG Mod 4.4 bull type dll sdk

// modified Sephi
// Symbol loading adjusted to WoC.

// set bonus symbols
int bonusBaseID = iSavePosition + 0;
//++iCurSymbolID;


and one other thing make sure your fonts are set up right something like i did here
and with luck it should work for you

these fonts are from a mod i playing around with



i use your Grand Inquisitions 255E CvGameTextMgr to show you how i added his changes in

Changing the value from 125 to 0 made many other icons to appear incorrect. So, I changed it back.
 
This screenshot looks to be taken from the [Civ|Sev]opedia entry for the Mine, is that correct?

Do you see the correct icon in the city screen when you have one of the missing resources hooked up?
 
This screenshot looks to be taken from the [Civ|Sev]opedia entry for the Mine, is that correct?

Do you see the correct icon in the city screen when you have one of the missing resources hooked up?


Correct. BUG4.4 > Sevopedia > Improvements > Mine > Effects

Yes, the proper icons appear correctly when hovering the mouse over any one of the resources in the city screen.
 
Are you using a modified GameFont_75 & GameFont tga files of the ones that I posted in the mod? Also could you confirm that the FontButtonIndex value from the BonusArtInfo for one of the missing resources is correct.

Have you modified the CvDLLWidgetData->parseActionHelp code where it is retrieving the icon. This is the code that I have:

PHP:
					{
						iLast = 0;

						FAssert((0 < GC.getNumBonusInfos()) && "GC.getNumBonusInfos() is not greater than zero but an array is being allocated in CvDLLWidgetData::parseActionHelp");
						for (iI = 0; iI < GC.getNumBonusInfos(); iI++)
						{
							if (GET_TEAM(pHeadSelectedUnit->getTeam()).isHasTech((TechTypes)(GC.getBonusInfo((BonusTypes) iI).getTechReveal())))
							{
								if (GC.getImprovementInfo(eImprovement).getImprovementBonusDiscoverRand(iI) > 0)
								{
									szFirstBuffer.Format(L"%s%s", NEWLINE, gDLL->getText("TXT_KEY_ACTION_CHANCE_DISCOVER").c_str());
									szTempBuffer.Format(L"%c", GC.getBonusInfo((BonusTypes) iI).getChar());
									setListHelp(szBuffer, szFirstBuffer, szTempBuffer, L", ", (GC.getImprovementInfo(eImprovement).getImprovementBonusDiscoverRand(iI) != iLast));
									iLast = GC.getImprovementInfo(eImprovement).getImprovementBonusDiscoverRand(iI);
								}
							}
						}
					}

Searching for TXT_KEY_ACTION_CHANCE_DISCOVER in the source should jump you to it.
 
Back
Top Bottom