Roll Call! (Post here to let others know you show up from time to time)

How many people do you think regularly visit the Civ4Col Mod forum?


  • Total voters
    25
If you pay too much attention to theory without gaining actual coding experience, you will end up with mortar without bricks to place it on and it will just dry up without being used and will be lost. You somehow need to balance the two approaches to maximize skill gain.

Excellent example!

There exists two kinds of programming languages: interpreted and compiled. Interpreted means the computer can read the source code and act on it. This includes all script languages. Compiled languages are unreadable by the computer at runtime. Instead they need a compiler to translate the human readable code into machine code. C++ needs to be compiled.

Oh right. I knew that. It did not occur to me that the gibberish was compiled code. Thanks!

Compiling is a one way translation. The source code is written in .cpp and .h (and outside vanilla .hpp is also used). I'm not going to explain it all right now. Follow the guide here https://sourceforge.net/p/colonizationmodcollection/wiki/GIT/
If I understand correctly, the source code and the compiled code both exist within the assets folder of the Vanilla game. Correct? If so, I'm not seeing the .cpp or .h source code files you're referring to. Where can they be found (vanilla)?


I wrote how to download and compile M:C as well as how to use git to get the newest version of the mod. Some info applies to all mods and some are specific to the custom setup used by M:C.

Awesome. I look forward on diving into M:C. All the source code is available too? I'm really looking forward to examining some C++! :D
 
If I understand correctly, the source code and the compiled code both exist within the assets folder of the Vanilla game. Correct? If so, I'm not seeing the .cpp or .h source code files you're referring to. Where can they be found (vanilla)?
The source code is not used during runtime and as such is usually kept outside of Assets (though usually nothing wrong would happen from adding it). Vanilla places the files next to Assets in a dir called CvGameCoreDLL. Do note that there are two dirs called boost and python. I recommend against looking inside those because they are libraries and not game specific code and actually fairly hard to read. We shouldn't mod libraries anyway.


Awesome. I look forward on diving into M:C. All the source code is available too? I'm really looking forward to examining some C++! :D
We use git to provide updates to each other as well as keep track of changes. This means we do not have "secret" files, which are kept outside the git server (except sounds, which are in the release only). I even added project files, makefile etc, which should make it possible to compile out of the box if you have the compiler installed. Sadly it isn't the easiest compiler to install because it has to be the same as was used to compile the game exe, meaning we are stuck with a 2003 compiler. I don't think that's a real problem though if you just follow the step by step approach on the wiki. It just means getting it to work without the wiki is far from trivial and some of the guides available on the forum are of somewhat questionable quality (yet another reason why I started writing my own).
 
Still here, although currently not modding or gaming ... :smoke:

But well, if there is a new (or improved) Colonization mod around, I will definitely give a try. :thumbsup:
 
Still here, although currently not modding or gaming ... :smoke:

But well, if there is a new (or improved) Colonization mod around, I will definitely give a try. :thumbsup:

Haha, maybe new big mods will come some day! I'm hoping to do some cool stuff. Gotta see if I can though.
 
The source code is not used during runtime and as such is usually kept outside of Assets (though usually nothing wrong would happen from adding it). Vanilla places the files next to Assets in a dir called CvGameCoreDLL. Do note that there are two dirs called boost and python. I recommend against looking inside those because they are libraries and not game specific code and actually fairly hard to read. We shouldn't mod libraries anyway.

I can not find these files you're referencing for the life of me. I've even searched the entire directory for .cpp and .h files and nothing comes up. Is it possible that in my Steam version of Vanilla that I don't have the source code?


We use git to provide updates to each other as well as keep track of changes. This means we do not have "secret" files, which are kept outside the git server (except sounds, which are in the release only). I even added project files, makefile etc, which should make it possible to compile out of the box if you have the compiler installed. Sadly it isn't the easiest compiler to install because it has to be the same as was used to compile the game exe, meaning we are stuck with a 2003 compiler.

So couple of things. I downloaded MC from the civ forums download directory, and when I load the mod, it says MC is loaded, but the start screen looks like Vanilla, and so does the game. Not seeing any difference from Vanilla despite the mod loading and the files being in the mod. Any reason for that?

And then secondly, when I search the MC (or TAC) mod for .cpp files, I see nothing. When I search RaR I see tons of .cpp and can open and look at the C++. Why can I see the .cpp files in Religion and Revolution, and not MC or TAC? What I'd like to do, is play around with C++ code in the .cpp as I'm learning to program. I like to tinker. I want to edit some C++ code and quickly see some effects in game by restarting the game and loading the mod. Is that possible? Or do I have to run everything through the compiler first and then reload the mod? Help me out pleasssseee Nightinggale! :D And thanks for being so informative thus far! :)
 
Is it possible that in my Steam version of Vanilla that I don't have the source code?
That's quite possible. Steam is downright hostile to modders, intentionally crashing the game if a debugger is used etc.

So couple of things. I downloaded MC from the civ forums download directory, and when I load the mod, it says MC is loaded, but the start screen looks like Vanilla, and so does the game. Not seeing any difference from Vanilla despite the mod loading and the files being in the mod. Any reason for that?
Gamespy closed and because internet games no longer worked, they released an updated version. This version did allow internet play again, but it broke a bunch of stuff. Due to a significant backlash for that one, they released the old version as a beta. To enable that one, go to your steam library (in the app, not the actual files). Right click on colonization and select properties. The rightmost tab is called Betas. Click that one. Select a beta (presumably the only one) from that menu and you should be able to load mods.

What you get for using the old version is mod support, Direct IP connection in multiplayer and.... can't remember the rest. It was something used by that monthly game challenge or whatever it was called here on the forum. It's amazing that they manage to break that much just to add a way to find somebody to play with without knowing their IP.

And then secondly, when I search the MC (or TAC) mod for .cpp files, I see nothing. When I search RaR I see tons of .cpp and can open and look at the C++. Why can I see the .cpp files in Religion and Revolution, and not MC or TAC? What I'd like to do, is play around with C++ code in the .cpp as I'm learning to program. I like to tinker. I want to edit some C++ code and quickly see some effects in game by restarting the game and loading the mod. Is that possible? Or do I have to run everything through the compiler first and then reload the mod? Help me out pleasssseee Nightinggale! :D And thanks for being so informative thus far! :)
I can't remember how each mod release the source code. What I do know is that if you follow the guide from the wiki to use git to download M:C, you will get the source code. Also (as the only mod) I added a perl script to set up paths. After running it once, you should be able to start the game from MSVC with shift+F5. F5 will start with a debugger attached, which steam doesn't like.

For the best modder support (including debugger), get either the disc version or the one from GOG. It's not like the steam version can't be used, it just lacks some features.
 
That's quite possible. Steam is downright hostile to modders, intentionally crashing the game if a debugger is used etc.
I have the other major mods on my machine and they all load correctly. Just not Medieval Conquests. I'll look into the suggestion yo

I can't remember how each mod release the source code. What I do know is that if you follow the guide from the wiki to use git to download M:C, you will get the source code. Also (as the only mod) I added a perl script to set up paths. After running it once, you should be able to start the game from MSVC with shift+F5. F5 will start with a debugger attached, which steam doesn't like.
I keep getting the error you mentioned in your guide. The repository is not found.
I've tried:
http://sourceforge.net/p/colonizationmodcollection/Medieval_Conquest/
https://sourceforge.net/p/colonizationmodcollection/Medieval_Conquest/
http://sourceforge.net/p/colonizationmodcollection/Medieval_Conquest/ci/master/tree/
https://sourceforge.net/p/colonizationmodcollection/Medieval_Conquest/ci/master/tree/
and even the link you put in the guide:
git://git.code.sf.net/p/colonizationmodcollection/Medieval_Conquest

None of them are finding the repository. And I am signed into SourceForge. Any reason why this is happening?


For the best modder support (including debugger), get either the disc version or the one from GOG. It's not like the steam version can't be used, it just lacks some features.
Starting to see that. :/ I would just uninstall steam and Colonization and then reinstall with a different setup eh?
So once I get source code in C++, Is there a guide or something that will direct me how to compile the source code files into the DLL file(s) the game requires? You mentioned you have to use the 2003 compiler, but didn't mention a download link or a link guide on how to set that up. I'm guessing it is 1. edit the source code, 2. place all .cpp files into the compiler, 3. run compiler, 4. place compiled file(s) in my mod directory, 5. restart Civilization Colonization, 6. load my mod with newly compiled .dll file, 7. see the changes in game. Am I right? And then how does the debugger work? Thanks Nightinggale!
 
I keep getting the error you mentioned in your guide. The repository is not found.
I've tried:
http://sourceforge.net/p/colonizationmodcollection/Medieval_Conquest/
https://sourceforge.net/p/colonizationmodcollection/Medieval_Conquest/
http://sourceforge.net/p/colonizationmodcollection/Medieval_Conquest/ci/master/tree/
https://sourceforge.net/p/colonizationmodcollection/Medieval_Conquest/ci/master/tree/
and even the link you put in the guide:
git://git.code.sf.net/p/colonizationmodcollection/Medieval_Conquest

None of them are finding the repository. And I am signed into SourceForge. Any reason why this is happening?
The first 4 are for browsers, not git, which would explain why they fail. The two links you can use (without signing up in git) are
https://git.code.sf.net/p/colonizationmodcollection/Medieval_Conquest
git://git.code.sf.net/p/colonizationmodcollection/Medieval_Conquest

Using the git protocol for git is the fastest approach, but there is a https backup because sometimes the git protocol is blocked by firewalls.

Git won't clone into anything inside program files. Try to clone into My Documents, preferably "My Documents/My Games/Sid Meier's Civilization IV Colonization/Mods" (you might need to create the mods folder).

Starting to see that. :/ I would just uninstall steam and Colonization and then reinstall with a different setup eh?
Right now just focus on getting git to work and be able to compile. Your current problems are not due to using the steam version.

So once I get source code in C++, Is there a guide or something that will direct me how to compile the source code files into the DLL file(s) the game requires? You mentioned you have to use the 2003 compiler, but didn't mention a download link or a link guide on how to set that up. I'm guessing it is 1. edit the source code, 2. place all .cpp files into the compiler, 3. run compiler, 4. place compiled file(s) in my mod directory, 5. restart Civilization Colonization, 6. load my mod with newly compiled .dll file, 7. see the changes in game. Am I right? And then how does the debugger work? Thanks Nightinggale!
If you follow the guide, the last line is a link to a new wiki page. That page ends with a link as well. There is a total of 4 pages, each with one topic required for compiling (setting up git, using git, compiler setup and compile once everything is set up)
 
Your first link in the comment above is the one which worked for me. I just download MC via SmartGit to a Medieval_Conquests folder in mygames. Looked like all the files were there. I tried to load the mod but got a 1000 loadxml errors which I had to ctrl alt delete to get out of.
 
Maybe I misunderstand. It won't work right away eh? I have to follow the rest of the guide to compile the download?
 
The DLL file is not included in git, since it would add 4 MB each time it's changed. While it may not sound like a lot, 500 changes later it is and will use up a lot more disk space and bandwidth than we like. It used to be added, but I removed it because git gives me the ability to rewrite history and saved hundreds of MB.

If you run M:C without the DLL, it will use the vanilla DLL file, which won't match the xml files, which in turn will result in a whole lot of errors.
 
So that means I need to compile the dll from the source files downloaded with SmartGit? I'm hung up on your second guide page. The top image is broken and the link is broken. I did look up Atlassian and read a couple of tutorials on what Github is. So now I have a better idea about what Git does and why it is used. Apparently version control via GitHub or SVN is well-known by all developers and I ought to know it if I want to be a programmer myself eh? I find the second page of your guide difficult to understand.
 
My SmartGit screen for example shows a list of folders in a tab called Repositories, while in your screenshot the list in Directories. Also in your screenshot, branches are named, and I don't see branches next to my folders. Nor do I see how to make branches if I need to.
 
Oh dear. The only off site image I used links to a dead site. It's supposed to look something like this:
Spoiler :
git-history.png

Yeah it's a good idea to get to know svn and git. Source version control is widely used for development of plain text, be it programming, xml, plain text or something else. Modders use it because everybody else does. Just sending files around will be a mess and overwriting changes from other people will be common as well as "you did that a month ago? I just spent all day doing it because you didn't give me that file"
 
Oh dear. The only off site image I used links to a dead site. It's supposed to look something like this:
Spoiler :
git-history.png

Lol. It happens.

Yeah it's a good idea to get to know svn and git. Source version control is widely used for development of plain text, be it programming, xml, plain text or something else. Modders use it because everybody else does. Just sending files around will be a mess and overwriting changes from other people will be common as well as "you did that a month ago? I just spent all day doing it because you didn't give me that file"

Yeah I got that impression. I see how it is very valuable to have a coordinated and organized backup/edit/update system. Makes a lot of sense.

I'm downloaded Visual Studio 2010 Express now from the link in your guide, third page. Am I supposed to download the Civ4 SDK as well? They're both in the same linked page. I don't have Civ 4 installed on this machine.
 
My SmartGit screen for example shows a list of folders in a tab called Repositories, while in your screenshot the list in Directories. Also in your screenshot, branches are named, and I don't see branches next to my folders. Nor do I see how to make branches if I need to.
Looks like I need to rewrite that part to make it more clear. I didn't write it incorrectly because repositories and directories are not the same thing and both are present. When it's not written crystal clear, it likely is confusing. However I'm more concerned with you lacking names. Try to switch to the develop branch and if you can do that without showing the branch names, then something is really wrong.

And while we are pointing out flaws on the guide, the screenshots are of an old smartGIT version, like 2-3 versions ago. It actually took me quite a while to make those and as long as it "sort of look the same", I won't redo them.

I'm downloaded Visual Studio 2010 Express now from the link in your guide, third page. Am I supposed to download the Civ4 SDK as well? They're both in the same linked page. I don't have Civ 4 installed on this machine.
I'm not completely sure. I assume not, but if you lack vanilla, you could lack boost and python from vanilla. I didn't include those because I assumed everybody would have them. I have never personally downloaded the SDK meaning I don't actually know what's in that file.
 
However I'm more concerned with you lacking names. Try to switch to the develop branch and if you can do that without showing the branch names, then something is really wrong.
.
As you can see in my screengrab. I don't see the names. :/
 
By the way. Is there any reason the 694MB download of Visual Studio from the link is taking hours when normal large downloads take under 20 minutes?
Sourceforge used to be great. Now it's slower than average. However it's still free and the limit on disk space is "be reasonable", meaning we can upload several gigabytes if it makes sense.

As you can see in my screengrab. I don't see the names. :/
Ahh, that. The name of the submodule is there, it's just not a branch. It's the hash for a specific revision. Click on it and select a branch in the bottom left. The sub modules are actually aliases to other git servers (all on SF). You need to set the branch for all 3 of them. I would have liked the ability to set all branches based on what you pick for the "parent" repository, but that doesn't seem to be possible :sad:
 
Sourceforge used to be great. Now it's slower than average. However it's still free and the limit on disk space is "be reasonable", meaning we can upload several gigabytes if it makes sense.
Makes sense if it's free. How does SF pay for itself (how can afford to host all that data for other people without charging)?

Ahh, that. The name of the submodule is there, it's just not a branch. It's the hash for a specific revision. Click on it and select a branch in the bottom left. The sub modules are actually aliases to other git servers (all on SF). You need to set the branch for all 3 of them. I would have liked the ability to set all branches based on what you pick for the "parent" repository, but that doesn't seem to be possible :sad:

What do you mean click on "it"? The submodule? I don't know what you mean when you say the submodule, nor when you say hash. Am I missing some files? Or am I clear to proceed with the 3rd page of the guide?
 
Back
Top Bottom