1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

The great mystery of GameFont symbols: adding Religions to BUG/K-Mod

Discussion in 'Civ4 - Creation & Customization' started by tantanmen, Aug 23, 2020.

  1. tantanmen

    tantanmen Chieftain

    Joined:
    Sep 25, 2019
    Messages:
    62
    Hello hello! So I was attempting to merge JARM (Just Another Religions Mod) with K-Mod and ran into some problems...

    Background Info (a not so brief history):
    Spoiler :

    The main problem encountered with this merge is that as religion symbols are added to the GameFont files, these symbols can become offset (depending on how they are read) and consequently mismatched in-game (especially in the city billboards).

    Xyth posted on this topic in the K-Mod thread:
    As can be inferred, 35 pairs of symbols (18 religions + 17 corporations) seemed to be the magic number for Xyth.

    I wanted to add more religions to the JARM module, so I decided to create more space for symbol entries in the gamefont files by 'unplugging' corporations from the game. I followed the steps to remove corporations (by deleting xml entries) as suggested in a thread similar to this one. I also deleted the CIV4CorporationInfo.xml file (there was a thread for this, but I can't seem to find it).

    Then I added religions to the GameFont files (with corresponding xml entries) until I arrived at the 'magic number' of 35:

    GameFont.tga.jpg GameFont_75.tga.jpg

    Here is the result:
    Mouseover 01 - everything ok.JPG Mouseover 02 - everything ok.JPG Leader screen - missing symbols, text overlay.JPG For some bizarre reason - the coin symbol for financial trait appears.JPG Text overlay, font issues.JPG Missing religion (prayer) symbol for religion screen (snip).jpg

    Almost there, but not quite (the main problems, as indicated by the titles of the screenshot attachments, are missing symbols and text overlay). To clarify, this is only a problem in the 'pedia. Otherwise everything else looks good and all 35 religions match up in-game. Religions appear correctly in city billboards.

    So it is simply a matter of resolving the issue concerning the pedia – does anyone have a suggestion on how to accomplish this?

    I should also mention that recently I read this thread started by Leoreth: Extending GameFont files, some of which I understood most of which I did not understand.

    Nightinggale generously provided a GameFont Display utility, but unfortunately I have no experience with python…

    Finally, keldath also posted on this topic, which has made me consider switching to WoC Lite:
    If I could, I would like to continue adding, maybe just a couple/few more religions :D



    Does anyone have experience implementing WoC Lite with K-Mod? Would I be able to merge the JARM module with WoC Lite?

    If it would work, I'd like to make the jump to WoC Lite, but I confess I don't understand how to implement (merge?) dll sdk files :think:

    Could someone please advise me how to proceed?

    Many thanks in advance :thumbsup:
     
    Last edited: Oct 17, 2020 at 6:17 PM
  2. tantanmen

    tantanmen Chieftain

    Joined:
    Sep 25, 2019
    Messages:
    62
    UPDATE:

    @keldath, I was finally able to strip down this mod to 122mb. I’m hoping, like you suggested, that I just need to merge cpp files, or run a (re)compile. Right now I can only do xml, so I still need to learn how to add components. I looked at the Fractured States mod, but the only thing I understand is the <iTGAIndex> in the xml - this part I can do no problem. If you have some time to take a look, I could use the help :)

    And @f1rpo, as our resident genius for all things post-KMod, I would also like to request your advice. I would be really grateful if you can provide any input. I *think* my basic question/conundrum is: within K-Mod, can WoC-Lite be combined with JARM (Just Another Religion Mod)?

    My abilities are quite limited, and over the past two-three years I’ve taken this project as far as I can on my own. There’s been a fair amount of stumbling around, but at least I’ve learned some things :crazyeye:

    Again, thank you both very much. Any guidance would be greatly appreciated :thumbsup:
     
  3. f1rpo

    f1rpo plastics

    Joined:
    May 22, 2014
    Messages:
    800
    Location:
    Germany
    I've never once edited the GameFont files, so I'm afraid I know less about this subject than you and anybody else whom you've mentioned. I also don't know how the TGA indexing from WoC (if that's where it's from) works. To make some contribution, here are my Git commits from merging the GameFont Display (GFD) into AdvCiv. But I've no idea if GFD could help you with your actual problem.
    Spoiler :
    Commit 1: Copying CvScreenEnums.py from BtS. CvScreensInterface.py was already in AdvCiv.
    Commit 2: Applying the GFD changes to CvScreensInterface.py and CvScreenEnums.py, Since BUG replaces CvEventManager.py with BugEventManager.py, the keyboard shortcut (Ctrl+Shift+F1) needs to be implemented (only) in BugEventManager.py. I've got some non-KMod code in there. Apart from the import statement, this would hopefully be all you need (with tabs instead of spaces):
    Code:
    if eventType == self.EventKeyDown:
        if not InputUtil.isModifier(key):
            # GFD start
            if int(key) == int(InputTypes.KB_F1) and self.bShift and self.bCtrl and not self.bAlt:
                GameFontDisplay.GameFontDisplay().interfaceScreen()
                return 1
            # GFD end
    (For the record, this isn't the proper way to add keyboard shortcuts to BUG.)
    • Commit 3 (just the change to GameFontDisplay.py; the rest is unrelated): Adding non-BtS symbols to GFD. (In this case, the symbols from the BULL GameFont file.)
     
  4. tantanmen

    tantanmen Chieftain

    Joined:
    Sep 25, 2019
    Messages:
    62
    Hello f1rpo,

    Thanks for taking the time to read through this :) and I'm sorry if I roped you in a little. From my computer semi-illiterate perspective, I tend to think of programmers as all-knowing, all-out polymaths ;)

    It's helpful to see how you merged GFD with AdvCiv. Even if it doesn't help me with my problem, I'm sure this documentation will benefit others.

    But I think there may be light at the end of the tunnel (did I dig this tunnel?): @keldath has been very generous in helping me dig myself out and develop this project.

    If I can prattle on a bit more about it, this is part of a larger flavor mod that I have been merging with K-Mod; K-Mod mainly because I have the most familiarity with it, it seems to offer perfect stability, and (for karadoc anyways) is in an end-state.

    I've played a good amount of AdvCiv and Doto and love the direction you and keldath are taking. In the future I would like to merge my flavor mod to yours, but I want to wait until I stabilize it on my end (I still get crashes to desktop :blush: )

    So thank you again for your time and goodwill and please keep up the awesomeness of AdvCiv :thumbsup:
     
    Last edited: Oct 18, 2020 at 7:07 PM
  5. Leoreth

    Leoreth 心の怪盗団 Moderator

    Joined:
    Aug 23, 2009
    Messages:
    34,386
    Gender:
    Male
    Location:
    Leblanc
    I am not surprised you were confused by the thread I started on this topic, I did not exactly come away with better understanding of it either.

    Xyth is definitely right that some "magic number" of boxes works in the file and you sometimes have to add more empty boxes than you need. You can also always extend the image to the right, this is usually safer than trying to introduce new rows.

    I also recommend always using BUG FontUtils, in case you aren't already.

    I can share "my" GameFonts files that I managed to successfully extend to some extent later (mostly through trial and error than real understanding of what works). Maybe that is already enough for your purposes.
     

Share This Page