How to build and contribute to the Community Patch DLL

i've never tried compiling with vs 2013 - i expect it should be possible, but the real problem is linking, as the sdk supplies only static vs 2010 builds of some components.

it is possible to use the vs 2013 IDE, but you need to select the vs 2010 toolset (check the project settings).
 
It works with Visual Studio 2010.

I also built the Community Patch mod file successfully using Mod Buddy (it generates a .civ5mod file in the Packages subfolder). Now, I tried to build the mod file of the Community Balance Patch but it failed. I have some errors with Art Resources missing i.e.

Code:
Could not copy the file "Art\Improvements\Eki\eki_built.fxsxml"

I've looked in the folder and it is not there. Why am I missing those resources (I've done a git pull)?
 
It works with Visual Studio 2010.

I also built the Community Patch mod file successfully using Mod Buddy (it generates a .civ5mod file in the Packages subfolder). Now, I tried to build the mod file of the Community Balance Patch but it failed. I have some errors with Art Resources missing i.e.

Code:
Could not copy the file "Art\Improvements\Eki\eki_built.fxsxml"

I've looked in the folder and it is not there. Why am I missing those resources (I've done a git pull)?

That file was still in the github exclusion list. I've now fixed that. Latest push should have it.

G
 
I still can't run the game! I grabbed the git, built the DLL, transplanted it into the mod, removed the LUA folder, enabled just CP and CBP, don't have EUI, and enabling the mods either softlocks my computer or gets halted by the JIT debugger.

The only warnings from compilation were not code related, they were about compile options that caused it to ignore other compile options, and it didn't find vc90.pdb in the place it expected to.
 
You need to build the packages.

First, go the root of the git and compile the Community Patch and Community Balance Patch project using Modbuddy (not the C++ projects). It will give you an output Packages folder. Those files will be Community Balance Patch (v 13).civ5mod and Community Patch (v 66).civ5mod.

You can then open them and extract them in the mods folder of Civ 5 using 7zip.

I also get the warning you get but it still works. I can even attach the debugger to the CIV 5 process when I tried to do my monopoly idea.
 
I still can't run the game! I grabbed the git, built the DLL, transplanted it into the mod, removed the LUA folder, enabled just CP and CBP, don't have EUI, and enabling the mods either softlocks my computer or gets halted by the JIT debugger.

The only warnings from compilation were not code related, they were about compile options that caused it to ignore other compile options, and it didn't find vc90.pdb in the place it expected to.

If there are 29 warnings, that's normal. Those exist even in a 'vanilla' compile.

G
 
Right, so I figured I should build the CPP from the git project too, which I had not before. But it still doesn't work.
It doesn't build a civ5mod though, it builds a mod folder. The strange thing is, sometimes when I access those mods, I find a second folder in MODS\ with the version number for CP and CBP right beside the Mods\Community Patch and Mods\Community Balance Patch I myself put there. And sometimes that doesn't happen.

Either way it softlocks when loading the mod.
Humourous note, if you put the Object File library that gets built along with the dll into the mod folder, just put it there, don't actually build it into the mod, Civ V itself crashes while loading its main screen.

----
Oh also, I set the linker to switch /LTCG because the notices at the bottom say it is doing that anyway when it finds it can't proceed, so that's slashing the link-time in half. Obviously that isn't helping me, but seems like it could be profitable for the vcxproj on git to be set to that. The claims that ltcg isn't compatible with a precompiled header are apparently not valid - not that it's a matter of choice since, as the linker says, it is doing LTCG anyway.
 
Right, so I figured I should build the CPP from the git project too, which I had not before. But it still doesn't work.
It doesn't build a civ5mod though, it builds a mod folder. The strange thing is, sometimes when I access those mods, I find a second folder in MODS\ with the version number for CP and CBP right beside the Mods\Community Patch and Mods\Community Balance Patch I myself put there. And sometimes that doesn't happen.

Either way it softlocks when loading the mod.
Humourous note, if you put the Object File library that gets built along with the dll into the mod folder, just put it there, don't actually build it into the mod, Civ V itself crashes while loading its main screen.

----
Oh also, I set the linker to switch /LTCG because the notices at the bottom say it is doing that anyway when it finds it can't proceed, so that's slashing the link-time in half. Obviously that isn't helping me, but seems like it could be profitable for the vcxproj on git to be set to that. The claims that ltcg isn't compatible with a precompiled header are apparently not valid - not that it's a matter of choice since, as the linker says, it is doing LTCG anyway.

You have to load the DLL into a Modbuddy mod and then compile - that's how you get it into the civ MODS folder, otherwise, it'll just compile the DLL to a 'mod' folder in your VS directory.

G
 
That's what I meant by transplant.

I compiled the dll
I moved the dll from Community-Patch-DLL\Mod into the CP folder.
I modified the CP project to reference the dll I put there
I built the CP
I built the CBP
I cut and paste the CP & CBP from Community-Patch-DLL\Build into the MODS\ folder
I'm trying to load just the CP , without eui.
Softlock

whoward suggested that his dll base doesn't work for me because of linking, and that it's too insane a search to perform for the problem. But I'm looking around for what could possibly be incompatible, and can't find anything. The project is being built with v90 , it's targeted to my platform, it is not assuming large memory awareness (even though I have such), ..... what? Why the softlock? (sometimes it's a softlock, sometimes vs JIT debugger catches it, although sometimes I can't access the debugger anyway because my interface is boinked)

I'm going to link my minidump to this post if it's an acceptable file type.
edit: ok I don't have a minidump, just a crash dump file.

No access to virtual address? That's a thinker. I don't have UAC, what is it trying to get? There's a steamcommunity thread which says it could be graphics drivers. ok. I reinstalled mine between then and now, I will repeat and see what happens.
 

Attachments

  • civilizationv_403694_crash_2015_6_13T2_27_8C0.mdmp
    103.2 KB · Views: 62
That's what I meant by transplant.
I cut and paste the CP & CBP from Community-Patch-DLL\Build into the MODS\ folder


You shouldn't be doing this. If you are doing everything correctly, Modbuddy will be automatically moving a compiled mod into your MODS folder.

G
 
What you did is just compiling the C++ code. You also need to compile the modbuddy projects so you get the Packages folder. Once you get the Packages folder, it's really straight forward unzip in the mods folder of Civ 5.
 

Attachments

  • instructions1.png
    instructions1.png
    16.1 KB · Views: 90
  • instructions2.png
    instructions2.png
    5.6 KB · Views: 73
You shouldn't be doing this. If you are doing everything correctly, Modbuddy will be automatically moving a compiled mod into your MODS folder.

G

Oh that's what those doubles are.
I was ignoring the packages folder, didn't notice it.

But either way, the built folder, the .civ5mod file, or the one placed in the mods folder for me, none of them work. :nuke:
 
You actually need to make the folders for Community Patch and Community Balance Patch in the MODS folder and extract the .civ5mod into those two folders.
 

Attachments

  • instructions3.png
    instructions3.png
    34.7 KB · Views: 92
You actually need to make the folders for Community Patch and Community Balance Patch in the MODS folder and extract the .civ5mod into those two folders.

I took the civ5mod file and put it in the \MODS folder. Civ V figured out what that was and showed me the Community Patch in the mods menu. Before that, I had already been taking the assembled mod folder from Community-Patch-Dll\Build , and I also tried just loading the mod placed directly into \MODS by the action of building the modbuddy project, once I discovered that was occurring. This all results in the same crash.
I don't know what this latest post of yours means differently from the thing you said to do last time. Manually making a folder with the right name and then putting the Art, res, modinfo, etc files in there? That's the only sense I get from what you wrote but we both know that's not relevant, so I'm at a loss what you're instructing me to do.

Attempting to proceed from the mods menu to enable the Community Patch somehow makes some process attempt to read/write a virtual address to which it does not have access and it crashes inelegantly.

edit: while this is going on I am of course removing the previous nonworking files and cleaning up the moddatabase cache.
 
I took the civ5mod file and put it in the \MODS folder. Civ V figured out what that was and showed me the Community Patch in the mods menu. Before that, I had already been taking the assembled mod folder from Community-Patch-Dll\Build , and I also tried just loading the mod placed directly into \MODS by the action of building the modbuddy project, once I discovered that was occurring. This all results in the same crash.
I don't know what this latest post of yours means differently from the thing you said to do last time. Manually making a folder with the right name and then putting the Art, res, modinfo, etc files in there? That's the only sense I get from what you wrote but we both know that's not relevant, so I'm at a loss what you're instructing me to do.

Attempting to proceed from the mods menu to enable the Community Patch somehow makes some process attempt to read/write a virtual address to which it does not have access and it crashes inelegantly.

edit: while this is going on I am of course removing the previous nonworking files and cleaning up the moddatabase cache.

What's your goal here? If you are trying to make a mod using the CP DLL, you have to go through modbuddy to do so. Compile it in VS, then drag+drop into Modbuddy, create the mod, etc., and then enable it in civ.

g
 
What's your goal here? If you are trying to make a mod using the CP DLL, you have to go through modbuddy to do so. Compile it in VS, then drag+drop into Modbuddy, create the mod, etc., and then enable it in civ.

g

That is what I did!
What I'd like is

1) to be sure I didn't derp some step in managing the files, so that then
2) I can concentrate on discovering why the project in its current state does not work on my system (if it doesn't) and
3) brainstorm what configuration in the compilation would make it work.

4) It seems I also should say I'd like to stay in your good will, since I"m detecting some exhaustion and resentment. Please help me figure this out, and I can incorporate my fiddly components to the CP in a snap.


The built version distributed "factory-ready" does not work. I thought I could fix that by controlling how the files were linked or making sure there wasn't any code that excludes my environment, which there isn't as far as I can tell. The project metadata doesn't specify .NET or any environment, the code is just C++, there's no clr managed code for me to even worry about, I don't have UAC, the program is built for x86, so... I can't figure out what my incompatibility is.

---
I was wondering something though. This mod specifies to getDLLPath in the mod file. I built a mod with a custom DLL that did not have that Action and it loaded my modified DLL - I added a trade route with a social policy. Do you know for sure this step does something?


edit: hmm, I had nonstandard paging file settings. I've tried out giving control back to the system, now I've manually maxed it at 9 GB, let's see what happens.
 
Changing my paging file settings made it crash promptly rather than softly. This is interesting.
I'm going to remove the SetDLLPath action and try it. It's not like it's dividing by zero.
 
Top Bottom