Extra symbols in BUG's Gamefont tgas

Xyth

History Rewritten
Joined
Jul 14, 2004
Messages
4,106
Location
Aotearoa
As someone who is guilty of modding far more than playing I'm wondering if someone could tell me where exactly all these extra symbols are used in game, especially the extra rows in the GameFont_75.tga. I ask because at the moment I've altered my Gamefont files and I want to merge the BUG ones with them, preferably without breaking everything horribly in the process as so often tends to happen with these notorious files.

Thanks in advance.
 
They are used all over the place, but hopefully most all of them are referenced using BUG's FontUtil module. If you look in Config/init.xml you'll see a bunch of lines that tell BUG about those new symbols. Here's an excerpt:

Code:
<symbol id="war" from="COMMERCE_GOLD" offset="25"/>
<symbol id="peace"/>
<symbol id="space"/>  <!-- blank symbol the same size as other standard symbols -->
<symbol id="militaryinstructor" name="MILITARY_INSTRUCTOR"/>
<symbol id="land" name="DOMAIN_LAND"/>
<symbol id="sea" name="DOMAIN_SEA"/>
<symbol id="air" name="DOMAIN_AIR"/>

The "id" attribute can be passed to FontUtil.getChar("<id>") to get a single-character Unicode string holding the font symbol which you can add to other strings, e.g.

Code:
gc.getPlayer(0).changeGold(1000)
BugUtil.alert("You just won 1000" + [B]FontUtil.getChar("commerce gold")[/B])

A Python FontSymbols constant is also defined based on the "id" (or "name" if given):

Code:
BugUtil.alert("You should increase your " + FontUtil.getChar([B]FontSymbols.COMMNERCE_RESEARCH_CHAR[/B]) + " spending")

Note that these all end in "_CHAR" just like the built-in ones.

The "from" and "offset" attributes is used to locate the symbol in the TGA. If neither is given, this symbol is assumed to be the very next symbol in the file. This way you can locate one symbol in a list and then define each symbol next to it without saying where it is.

The "from" attribute must be a valid existing symbol ID or FontSymbols constant. The "offset" attribute is a number that is added to the cell number pointed at by "from". If you don't provide it, 1 is used.

You can read more about this the BUG Core XML Reference.
 
I've added a number of religions to my mod and even though the religions I've added merely fill up the 2 rows that are assigned for religions and corporations a new empty row is needed between them and the resources to make the lower part of the file work. This empty row is needed when adding religions to the standard Gamefont_75.tga, its not just an issue with BUG's.

However because BUG has a row of symbols in between the resources and the row of happiness/health/etc symbols this royally screws things up. Resources will display fine but anything below them will display wrong or not at all. This is most noticeable in tooltips.

I consider myself to be very proficient in editing the Gamefont files and normally have minimal issues but, no matter what I try, this one row of added symbols in BUG's completely breaks things when several religions are added.

Can they please be shifted somewhere else in the file? I still can't find where they are used in game, are they even used at all? I'd suggest moving them to the row where you've added the peace symbol and such, cos then most of the changes you've made are in the one place.

The way it is at the moment, BUG is making it incredibly difficult, if not impossible, for modders to add religions.
 
I'm happy to have them moved. I am decidedly not proficient with the font file; could you move them in the latest version on our SVN and I'll swap it in the next release. You can put them onto the end of that row that has the war/peace symbols. Thanks!
 
Here you go. Let me know if you have any issues with it.
 

Attachments

  • New BUG GameFont_75.zip
    79.2 KB · Views: 61
The font files in BUG and BTS are both 513k. The file you posted is 175k. What's different?

Edit: When I open this file in DXTBmp I see that the spaceship icons (the ones you moved) are still where they started and copied where you moved them, but the entire alpha channel is garbled. Top half is all white, bottom half is random noise.

Edit2: When I open the file in IRfanView, I get the same result, but in Paint.NET the file looks fine. What are you using to modify your font files, and are you sure it produces files compatible with BTS?
 
Hmm.

I did them in GIMP (on Mac). It works fine for me and I've been helping with Diplomacy II's gamefont files and no-one has noticed an issue there yet on their PCs. Does it work in game?

The only important bit of the alpha channel in that file is the magenta frame and the cyan dots as far as I'm aware. No software available for Mac other than Photoshop lets me view the alpha channel so I have no clue what it looks like. I locate the magenta and cyan with the colour picker tool.

Could you post a screenshot?
 
It seems to work in-game, but I'll try it out for a real play session later tonight. Here it is in DXTBmp:
 
Hey Xyth, glad to see you are working on this. :goodjob:

Those LHs are giving me a bunch of hell, but what I was thinking of doing was providing regular updated playtests because I like this group of playtesters and you guys have helped me out so much that I think you at least deserve to have updated versions of the mod as I work on it.

For the next playtest I am going to add the new Nehru, Cetshwayo, Dido and Solomon but I also wanted to add BUG to the mod too. I'm not sure if you are working on this for my mod or for a different mod, but I remember you said you'd help me out once you figured it out, so I was just checking in here to see how everything is going?
 
Okay I know what's going on with the 'alpha channel'. Basically while I've been manipulating the magenta frames and cyan indictor I've not touched the contents of the cells and thus they are getting garbled every time I move them around. Thing is though, short of buying Photoshop or Windows PC, there is no way I can do anything about it with available Mac software. I can blank the cells out so that the alpha channel is empty except for the essential border but I cannot put the correct transparent symbol 'underneath' the actual symbol.

The issue is these files do not actually have a proper alpha channel, rather it is an entirely separate layer that just happens to be completely invisible, and thus most image editors do not recognize it or can't display it.

I'm reasonably certain that other than the magenta and cyan frames the content of this invisible layer has no effect whatsoever on how these symbols display in game (at least in Mac BTS). I understand if this is a concern though and if so, I'm afraid you'll need to find someone with Photoshop and/or Windows to make this change.

In the meantime I'll have a go at changing the init.xml and see if I can get the new placing to work.
 
Hmm well the spaceship symbols are not listed in init.xml at all (all other BUG symbols are) and, despite searching quite hard, I've yet to notice them anywhere in game. What screen(s) are they used on?

EDIT: Just noticed the airplane symbol at the bottom of the Gamefont.tga is also not referenced in init.xml, and is another symbol I've never noticed in game.
 
Hmm well the spaceship symbols are not listed in init.xml at all (all other BUG symbols are) and, despite searching quite hard, I've yet to notice them anywhere in game. What screen(s) are they used on?

The screen is still being worked on. It's a new spaceship status screen that is in development, so they aren't listed in init.xml (I thought they were already on the Victory tab, but I guess not yet).

EDIT: Just noticed the airplane symbol at the bottom of the Gamefont.tga is also not referenced in init.xml, and is another symbol I've never noticed in game.

That's used in BULL for cities with airports. At least, the bigger version in the larger font file has it, and it's in the smaller one for consistency.
 
I have a similar question. If I want to add another icon (for the scoreboard) to the TGA, where do I add it? It seems you used up the last spot in the row with the Great General picture. Do I move down to the next column and add it after the attitude icons and the icon with a X through it?
 
Ah, the sad, sad font glyph file. I don't doubt that BUG will add more icons over time. So far we've been pretty disorganized in where we put them, taking up multiple rows. I would actually recommend putting them on the row below the attitude icons if that's possible (I think so). This way you won't need to move your glyphs when BUG adds more.
 
Ah, the sad, sad font glyph file. I don't doubt that BUG will add more icons over time. So far we've been pretty disorganized in where we put them, taking up multiple rows. I would actually recommend putting them on the row below the attitude icons if that's possible (I think so). This way you won't need to move your glyphs when BUG adds more.

Okay. How will I specify in the enums.h where the font symbol is? Be Specific, I've never edited the TGA for anything... I understand how to edit it, but not how to make the dll know where my new symbol is.
 
Top Bottom