Modding Civ4BeyondSword.exe

Deliverator

Graphical Hackificator
Joined
Feb 12, 2008
Messages
4,806
Location
London, UK
I discovered something interesting while trying to mod the Greek helmet in the loading popup:

Spoiler :

Scanning the game files I found that this is one of the things that is hard-coded into Civ4BeyondSword.exe.

What I've found is that if you open Civ4BeyondSword.exe using Notepad++ and then edit this piece of text:
Code:
../Resource/Temp/popup_civ4.tga
to this:
Code:
./Mods/Dune Wars/Images/pln.tga

... followed by saving the file as, for example, Civ4BeyondSword_DW.exe then you can start the game using the altered executable. The amended image path is then used:

Spoiler :

This only works if you keep the path length exactly the same number of characters, otherwise the executable is corrupted. What would be really good is if a way could be found to replace these with TXT_KEYs but I have I feeling you'd need to do some hardcore disassembling to achieve that.

Not sure whether this is any use to anybody, but I thought I'd share it anyway.
 
Legal issues asside, how could you release an altered executable that could be used? Doesn't the folder structure and name need to be the same anyway?
 
Cool! Legally, I don't see how modding this string is any different than modding all the other strings in the game, which we do all the time. It would be easy to add the executable into the distribution zipfile, but people would have to unpack it at the BTS directory level instead of inside the mods directory level. To make this executable visible to beginning users who can't make their own shortcuts, there would be a little extra work.
 
Installer can handle all of that. Plus the huge benifit would be we'd no longer need to ensure BtS is patched to 3.19. Do you know how to change the icon and loading picture that is used?
 
Installer can handle all of that.

That's what I thought. You could write the custom exe to the BTS directory and then just remove it on uninstall. Shortcuts could be created that use the custom exe so no one would really notice.

Do you know how to change the icon and loading picture that is used?

I'm not sure what you mean exactly.
 
When you load up BtS there is a loading picture with the AP in the background, I'd like to change this. Also I realize the shortcuts are easy to give a special icon to, but I think it would be a similar process to change the icon used by the executable itself; since we'd be creating a new one, might as well make it look different.

Of course what would be really slick is if we could edit how the Executable loads the files, so that it loads the mod directly itself, and then we could make the mod="ModName" shortcut command load up mods within the mod, and make a new mods folder in the mod iself, but I doubt that's possible at this point.
 
I hate to rain on everyone's parade, but this has a LOT of negative ramifications.

1.) Since the exe is in the main BTS folder instead in the mod folder, this modification will affect the game outside of the mod. What happens when you reference a file in the exe and the art file gets deleted in the mod folder? Does it crash?

2.) Multiplayer. Won't this cause issues with standard BTS multiplayer, since it locks assets?

3.) BTS 3.19. This could falsely trick the game into thinking it's already patched, and so the edited python and XML files for the patch won't get installed.
 
I hate to rain on everyone's parade, but this has a LOT of negative ramifications.

1.) Since the exe is in the main BTS folder instead in the mod folder, this modification will affect the game outside of the mod. What happens when you reference a file in the exe and the art file gets deleted in the mod folder? Does it crash?

2.) Multiplayer. Won't this cause issues with standard BTS multiplayer, since it locks assets?

3.) BTS 3.19. This could falsely trick the game into thinking it's already patched, and so the edited python and XML files for the patch won't get installed.

My understanding was that you wouldn't be editing the current exe- you'd be creating a new one with that minor change. So the main game would still look at Civ4BeyondSword.exe- your mod, however, would use the new exe. So that shouldn't affect the patching process, or multiplayer (assuming everyone playing the mod was using the new exe and everyone not playing the mod wasn't)- but I don't play multiplayer so I don't know.
 
When you load up BtS there is a loading picture with the AP in the background, I'd like to change this.

This seems to be Assets/res/CivIV-INIT.bmp, but I can't seem to get an altered version to pick up.
 
When you load up BtS there is a loading picture with the AP in the background, I'd like to change this.

This is additionally referenced in Art\ArtDefines_Interface, MAINMENU_SLIDESHOW_LOAD_BTS, but unfortunatly, this seems to be loaded from the exe before the mod is loaded, so it uses the entry in unmodded BtS and the entry in the mod doesn't have an effect.
Tried it already myself, but didn't work.
But maybe i've tried it wrong :dunno:.
 
yea, I've did the same thing Deliverator, and The J, it doesn't work.

I think its the same deal with the civ4_title icon (the one on the in-game menu) but I might have messed that up myself.
 
This is additionally referenced in Art\ArtDefines_Interface, MAINMENU_SLIDESHOW_LOAD_BTS, but unfortunatly, this seems to be loaded from the exe before the mod is loaded, so it uses the entry in unmodded BtS and the entry in the mod doesn't have an effect.
Tried it already myself, but didn't work.
But maybe i've tried it wrong :dunno:.

However, you can overwrite the picture in your mod. Main menu editing can be done via XML.
 
oh, yea I misread you The J. All you have to do is put the picture in the same folder as the bts one and with the same name and it works like deanej said.
 
All you have to do is put the picture in the same folder as the bts one and with the same name and it works like deanej said.

Are you sure? We're talking about this one, the first thing you see as BTS starts up:



Even if you alter the file BTS/Assets/res/CivIV-INIT.bmp directly it doesn't effect it. If you look closely the loading popup is much more grainy than the bmp anyway, so probably the image data is included in the exe file somehow. It doesn't look like there is anyway to mod it.
 
Are you sure? We're talking about this one, the first thing you see as BTS starts up:



Even if you alter the file BTS/Assets/res/CivIV-INIT.bmp directly it doesn't effect it. If you look closely the loading popup is much more grainy than the bmp anyway, so probably the image data is included in the exe file somehow. It doesn't look like there is anyway to mod it.

Oh, THAT one. I thought you meant the one when loading a save/starting a game.
 
The stuff in Resource/Temp is not picked up from the mod Resource folder as reported by asioasioasio here. Looking at the exe it is clear why, since the path is hard-coded as ../Resource/Temp/popup_civ4.tga (that is ".." for back one directory from the BTS folder). If BlueMarble have a way around this I'd like to know how they do it.
 
That's a bummer. BlueMarble replaces some of the original theme resources. For example, ../Resource/Temp/popup_disk.tga is the galaxy I mentioned above. It is not a mod, and it installs into the CustomAssets folder and the main Civ4 Resource folder.
 
Are you sure? We're talking about this one, the first thing you see as BTS starts up:



Even if you alter the file BTS/Assets/res/CivIV-INIT.bmp directly it doesn't effect it. If you look closely the loading popup is much more grainy than the bmp anyway, so probably the image data is included in the exe file somehow. It doesn't look like there is anyway to mod it.

Wow, you guys are talking about that? I changed mine MONTHS ago...

Brief Tutorial Here.
 
Top Bottom