Installing and using the SDK

I don't know if anyone else has done this, but I finally got VS2005 to compile the SDK.

Because of some surprising problems, the solution I had to resort to is a bit odd, and not exactly ideal.

I created a makefile for the project that simply calls cl and link without specifying a path. Then I wrote a batch file to emulate VS2003's vcvars32.bat (because calling it directly caused the rest of my batch file to not be run) and then call nmake on the makefile I created.

Then it was simply a matter of opening the CvGameCoreDLL.vcproj file in VS2005 and changing the Configuration Type from Dynamic Library (.dll) to Makefile and pointing the NMake->Build Command Line to the batch file I created.

I have no idea what modifications you'd have to do to it to get it to use just the 2003 Platform SDK, but I have proved it possible to do. If there's enough interest, I'll try to clean up the makefile and batch file, and then release a zip of all the necessary files. If this is something you'd be interested in, just drop me a PM.

The only downside is that you have to edit the makefile by hand to add any new files (though it only requires adding two lines for each file, one for the compiler list and one for the linker list). The only other drawback is that I currently only have it configured to use the Final Release configuration, but it wouldn't be much trouble to add others.
 
I always knew that it was going to turn out to be something trivially simple like that.

But seriously, well done man :goodjob:
 
trivially simple in concept, but a pain in the butt to actually make. Fortunately, I was able to use a build log to get a list of all the files and use a little find-replace to format them properly.

Also, I discovered that getting nmake and vcvars32.bat to play nicely together was ridiculously difficult, which is why I ended up writing a custom batch file :P

EDIT: Well, I just discovered how to make nmake and vcvars32.bat play more nicely together, but I still haven't been able to get the correct environment variables set within the makefile itself... oh well. It works :)
 
Okay... after tinkering a bit more, I managed to get the makefile to fully configure the build environment, so now you can invoke the makefile directly, and you only need to edit it to add new files to be built. It still needs some cleaning up, but if this is something people are interested in, I can post the modified solution file and the makefile.
 
The first post contains detailed instructions on how to use completely free tools to build the SDK.

Once I publish this makefile, you should, in theory, be able to download a free copy of Microsoft Visual C++ 2005 Express (google is your friend), and then you just need the VC.NET 7.1 Platform SDK toolkit (I think it's linked to on the first post of this thread) in order to build the SDK with an, in my opinion, better IDE.
 
It means that to build the SDK you need to either own Visual Studio 2003 or you need to follow the instructions on the first post of this thread.

I'm working on making it easy to use either Visual Studio 2005 or Visual C++ 2005 Express instead of Visual Studio 2003 or Code::Blocks

I'd suggest that you do some research on C++ if you want to have any hope of even understanding what the SDK is, let alone using it to make any changes.
 
I actually found a couple of things very useful in learning how to use C++ and the SDK. First was Kaels excellent set of tutorials. Second was simply looking at what existing code elements were already doing, and 'reverse engineering' them, and the 3rd was to look at other peoples mods and-again-reverse engineer them. As an example, I wanted Specialists to be able to add yields in a civic dependant fashion. So, I looked at the code for Specialist commerces, then adapted the various elements to account for yields instead.
My point is that it hasn't made me a GREAT programmer or anything, but at least I kinda know what I a doing ;).

Aussie_Lurker.
 
There certainly is something to be said for learning to code via editing an existing program. However, I think it's a difficult place to START. I would suggest googling for a few C++ hello world examples to get a feel for how the language is constructed (variables, functions, etc) then do some reading on C++ classes (not exactly intuitive) and THEN dig in and start scouring the code.
 
I've run into a pretty obnoxious problem. I had been generating the makefile using macro substitution, but I completely forgot about header dependencies, so I will have to manually enter the dependencies, and it will make the makefile a little more hands-on for the developer to maintain.

I'm just going to write a little app to generate the dependencies... I'll post it in the other thread once it's finished.
 
Well, problems solved, makefile completed and posted here.

Let me know if you run into any problems with it
 
the initial release was for Civ 1.61, which is the final version of the vanilla engine. The warlords expansion comes with a warlords-compatible SDK (version 2.00), so in that sense it has been update. However, it can only be used with the warlords executable.
 
Déja said:
the initial release was for Civ 1.61, which is the final version of the vanilla engine. The warlords expansion comes with a warlords-compatible SDK (version 2.00), so in that sense it has been update. However, it can only be used with the warlords executable.


Is the updated SDK only released with the Warlords expansion?
 
Correct. 2.00 is Warlords only (found on the Warlords CD) and 1.61 is the last version that Firaxis plans to release for the vanilla game (which is great for modders because now we don't have to worry about updating our mods for a new patch).
 
I've gota bit of a problem. When I try to instal the Platform SDK it can't find some files. What is it I'm doing wrong?

P.S
I guess this will sound stupid, but I have no clue what I'm supposed to do w/ the LIBs.

Someone. Anyone Please Help.
 
The Platform SDK or the IDE Environment of the programming program?
It is not clear what you can not find. If the correct Platform SDK was downloaded and the download is not corrupt (when various viruses go around the Internet and have to be removed first to have the computer working correctly) then with the August 2005 SDK needed to Mod this game which works both with Win2K and WinXP, then you have to include the PATH to find those files in the IDE of the programming program. Codeblocks you have to follow the directions in the first post about that, and with other IDE, you include the PATH to the SDK in the Environment Settings of the programming program. That means that since you are using this particular Platform SDK the PATH to the files must be first so the program find those files first to build the program. Then if the programming compiler can not find what files it needs to build the program then it looks in the other PATHs listed when the program was installed.
The Include Directory (folder) includes the *.h files needed to be read. The Lib Directory (Library folder) includes the Library files needed by the program, and the Bin (binary Directory) includes the Binary files the programming program needs to find to build the program attempting to be built as in the Civ4GameCore.dll file.
This sometimes mean that if you have a particular OS on your computer, you must install the Platform SDK for your computer OS which Microsoft may make a little complicated but really is not. There should be an install file and you have to follow the instructions included with the readme file to determine what commands to give the program so it installs on your computer correctly.

When I am running Windows 2K I am not installing the SDK for Windows XP. There is a batch file that is included to be ran, and usually it is automatic in a sense, but if you want to make sure, then you have to do some reading about installing the Platform SDK which is included with that. Wherever you put the Platform SDK it does not have to be where the programming program is located. I have mine on a different logical partition (drive letter) and then within the programming program, I include the PATH to where it is located.
If I have the Platform SDK in H:\Microsoft Platform SDK then within that main directory (folder) is where the sub folders are located. There is usually a bit more folders than what you need in the Environment of the programing program IDE. But the three folders will be included : That being \bin folder, and the \include folder and the \lib folder. Those go in certain places so the linker and compiler part of the programming program can find what it needs in those folders.
If you are including the *.h files in the Platform SDK those are in the \include folder of the SDK. If you are buildling (compiling the program) the \lib folder is needed to build the program. If you are programming something different in the SDK of the game vs. using the Platform SDK to do it all with, then the \bin folder is the one needed. There are divisions in any programming program, and you should know what it is you are doing or follow the instructions in the first post and make sure you are doing that correctly.
If not, it will not work.
 
Back
Top Bottom