DLL decompilation

Nothing. You really can't achieve a decompile. That's a big reason we don't have access to the EXE. However, we do have the original source codes as far as the dll is provided and it's located in the source folder in the git repository.

EDIT: If you were asking what program we use to compile the dll, VS2019 is what most of us are on most recently. That said, it's not actually necessary to use it aside from the benefits and tools it comes with, many which help with debugging a LOT. Bill managed to build us some tools that compile the dll for us so source files really just need to be edited and saved then trying to start the game thereafter will automatically compile them into a functional DLL.

He has a guide to getting setup to program the dll somewhere around here... maybe @raxo2222 can point the way to it? I think it's on the github so getting started with a git upload is really the first step. He has yet another guide on that somewhere on the forum here that I think is up to date... not sure.
 
Last edited:
Do you know which file controls the soundtrack that's played on era changes? I'd like to make a modmod that causes the soundtrack to be different based on what base culture you have. As a matter of fact I discussed this with Leoreth from RFC-Dawn of Civilization https://forums.civfanatics.com/threads/question-about-the-music-soundtrack.657894/ since it has a system very similar to what I had in mind.
Era infos, civilization infos, leaderhead infos have references to music files.
Audio folder (Assets\XML\Audio) contains sound defines.
 
I meant the files that handle the soundtrack in the DLL.
I've never looked into that before.

But a cursory look into it shows in CvGameInterface.cpp
Code:
int CvGame::getNextSoundtrack(EraTypes eLastEra, int iLastSoundtrack) const
{
    EraTypes eCurEra = GET_PLAYER(getActivePlayer()).getCurrentEra();
    CvEraInfo& kCurrentEra = GC.getEraInfo(eCurEra);
    if (kCurrentEra.getNumSoundtracks() == 0)
    {
        return -1;
    }
    else if (kCurrentEra.getNumSoundtracks() == 1 || (eLastEra != eCurEra && kCurrentEra.isFirstSoundtrackFirst()))
    {
        return kCurrentEra.getSoundtracks(0);
    }
    else 
    {
        return kCurrentEra.getSoundtracks(GC.getASyncRand().get(kCurrentEra.getNumSoundtracks(), "Pick Song ASYNC"));
    }
}

int CvGame::getSoundtrackSpace() const
{
    return std::max(1, GC.getEraInfo(GET_PLAYER(getActivePlayer()).getCurrentEra()).getSoundtrackSpace());
}

bool CvGame::isSoundtrackOverride(CvString& strSoundtrack) const
{
    if (GC.getDefineINT("VICTORY_SOUNDTRACK_AVAILABLE") != 0)
    {
        if (getGameState() == GAMESTATE_EXTENDED || getGameState() == GAMESTATE_OVER)
        {
            if (getWinner() == getActiveTeam())
            {
                strSoundtrack = "AS2D_VICTORY";
            }
            else
            {
                strSoundtrack = "AS2D_DEFEAT";
            }
            return true;
        }
    }
    return false;
}
Looks to be some central coding regarding defining which soundtrack is in use. Looks like the era tags are primarily guiding the soundtrack selection. You could add some tags to Civilization Infos, using the same format as you find in the era tags (in CvInfos.h and CvInfos.cpp) and possibly a game option to switch it to using civilization info tags instead if you wished. I did a 'how to add a tag' tutorial around here somewhere...
 
Does anyone know if there already is the civ 4 decompiled dll for download?
Or what files do I have to modify in the dll to change the max num of players?
 
Does anyone know if there already is the civ 4 decompiled dll for download?
Or what files do I have to modify in the dll to change the max num of players?
See the post above yours on how to get the source files. Search in them for MAX_NUM_PLAYERS and you'll find it's a little more complicated than one player count to set up properly but you CAN change it, recompile and play. However, do understand we have it limited where it is to help avoid later game memory limit crashes.
 
I modified dll so that you can change max players by changing one number. It never made it into the mod though. I think modders got a bit confused and thought I was trying to change max players, but it was for people like you. I will redo maybe.
Edit: The one number you have to change is on the dll, so you need github so that you can make your own dll. It's easy.
 
Top Bottom