I'm trying to launch a pitboss server for Civ 5. When I open the SDK and click the dedicated server button, it 'clicks' but nothing else happens (i.e. No server opens up). It's not a true Russia playthrough until you've exiled all the intellectuals to Siberia. Got out my laptop, and like a dumbass booted up my new copy of civilization 6.
With No Cheat Console Available, Turn to Debug Mode & Ingame Editor
Enough people search for Civilization 5 Cheats that I thought sharing a couple possibilities that resemble and even surpass cheating in power might be useful to some players. You see, no cheat codes or command console of that type exists for the game. However, Firaxis did include a debug mode for developers that can be exploited to reveal the entire map and gve your Civilization infinite Happiness. This tool pales in comparison to the mighty Ingame Editor which can modify or place just about anything in the world. In many ways, this is better than any simple cheat code for it can enable you to get through any negative situation your Civilizaton enounters while giving you the ability to cheat your gold, research, production, or military to ridiculously high levels and defeatng other Civs in just about any way you choose. Don't be frightened by the fact that it's a mod. This is a very stable tool that gives you incredible control over the land and Civilizations in Civ 5.
Before You Consider Cheating: Playing at a Low Difficulty
Unless you want to cheat for fun, use cheating tools to set up the world to your liking, or experiment with Civ 5's gameplay, you should first consider simply lowering the difficulty of the game to Settler. It's ridiculously easy to win a game, especially with knowledge of Victory conditions you can learn from my strategy guide.
Unless you want to cheat for fun, use cheating tools to set up the world to your liking, or experiment with Civ 5's gameplay, you should first consider simply lowering the difficulty of the game to Settler. It's ridiculously easy to win a game, especially with knowledge of Victory conditions you can learn from my strategy guide.
Playing at a lower difficulty will give your Civilization bonuses, while imposing penalties on the AI. This is not a game that you will get much satisfaction from cheating to win anyway; there is no ending and the numerous difficulty settings give you a chance to gradually improve and expand your knowledge of Civ 5 game mechancs.
Ingame Editor: Powerful Cheats for Civilization 5
Civfanatics and the Steam Workshop host a powerful Mod for Civilization 5 that enables some great cheating ability. You can do most anything you want with the game's tiles, plant strategic and luxury resources, spawn units in control of any player, research technologies with a single click, and even take over another Civilization. I'll Guide you through the various types of cheating you can do using the Ingame Editor's interface, while I leave to you the creative use of this tool to win games or present yourself new challenges.
Installing the Ingame Editor
You can start cheating by getting Civ 5's ingame editor from one of the following sources. I recommend installing it via the steam workshop, since every legit Civilzation 5 owner has to use it. If you like installing mods yourself, you can go through Civfanatics:
Download from the Steam Workshop. Login, Subscribe to IGE and the Mod will be installed and updated automatically.
Download from Civfanatics, where you'll find manual install instructions, a FAQ, and troubleshooting for the IGE.
You can start cheating by getting Civ 5's ingame editor from one of the following sources. I recommend installing it via the steam workshop, since every legit Civilzation 5 owner has to use it. If you like installing mods yourself, you can go through Civfanatics:
Download from the Steam Workshop. Login, Subscribe to IGE and the Mod will be installed and updated automatically.
Download from Civfanatics, where you'll find manual install instructions, a FAQ, and troubleshooting for the IGE.
Using the IGE Mod to Cheat - Control + I
Once you've got the Mod installed, you're ready to start a game in which you can cheat to your heart's content. Load Civilization 5 and select 'Mods' and ensure that Ingame Editor is checked, then select next. You can now select Single Player and set up the game as you normally would. If the Mod is working properly, click the icon in the top right portion of the Civ 5 game screen or press Control + I.
Once you've got the Mod installed, you're ready to start a game in which you can cheat to your heart's content. Load Civilization 5 and select 'Mods' and ensure that Ingame Editor is checked, then select next. You can now select Single Player and set up the game as you normally would. If the Mod is working properly, click the icon in the top right portion of the Civ 5 game screen or press Control + I.
Things to Note: Leader/City-State Selection and Reloading for Visual Changes
In the top-right portion of the IGE interface, you will see your Leader selected. You can change to any other Leader or City-State by selecting this. This will show you the game world as they see it, show their research tree and social policies, etc.
In the top-right portion of the IGE interface, you will see your Leader selected. You can change to any other Leader or City-State by selecting this. This will show you the game world as they see it, show their research tree and social policies, etc.
When you make some changes to terrain, like placing Natural Wonders in the world, you'll need to save the game, exit to the main menu and reload to get their graphics to show. Any tile bonuses will be in play, but your Fountain of Youth, for example, will be invisible until you do this.
Cheats: Edit Terrain - F1
The first tab in the Ingame Editor allows you to select a terrain hex and start editing. You can choose tile improvements, Natural Wonders, terrain type, and even select whom the tile belongs to by having the right leader selected and going to the far right in the interface, where you'll see 'Free Land' or 'Your Land', along with Explored/Unexplored. The blue lines in the bottom left let you paint rivers and the direction they flow by toggling the lines at the edge of the hex. As you can see, I made a strange circular river in one hex to demonstrate how it would be used.
The first tab in the Ingame Editor allows you to select a terrain hex and start editing. You can choose tile improvements, Natural Wonders, terrain type, and even select whom the tile belongs to by having the right leader selected and going to the far right in the interface, where you'll see 'Free Land' or 'Your Land', along with Explored/Unexplored. The blue lines in the bottom left let you paint rivers and the direction they flow by toggling the lines at the edge of the hex. As you can see, I made a strange circular river in one hex to demonstrate how it would be used.
Cheating Cities: Religion, We Love the King & Wonders - F2
Click to select a city or shift-click to create a new city on a hex belonging to the currently selected player. This is super useful for cheating - it'll let you instantly create any building or Wonder in the city, and also celebrate We Love the King day for 10 or 250 Turns. This second is a little less useful given you could just set the population to whatever size you want, anyway. You are also able to change the religious balance in the city or make it a puppet of the currently selected player.
Click to select a city or shift-click to create a new city on a hex belonging to the currently selected player. This is super useful for cheating - it'll let you instantly create any building or Wonder in the city, and also celebrate We Love the King day for 10 or 250 Turns. This second is a little less useful given you could just set the population to whatever size you want, anyway. You are also able to change the religious balance in the city or make it a puppet of the currently selected player.
Changing Terrain on a Mass Scale - F3
The Paint Terrain option is helpful if you want to change the terrain on a larger scale than the F1 tool. Select a terrain type and drag around with the right mouse button held down to change terrain all over. Press shift and you'll see the six tiles around the selected terran light up. Right click and drag with this to make big changes across the land. The Your Land option is found on the far right, which will let you claim massive sections of land for the selected player, explore it, or return it to an unexplored state.
The Paint Terrain option is helpful if you want to change the terrain on a larger scale than the F1 tool. Select a terrain type and drag around with the right mouse button held down to change terrain all over. Press shift and you'll see the six tiles around the selected terran light up. Right click and drag with this to make big changes across the land. The Your Land option is found on the far right, which will let you claim massive sections of land for the selected player, explore it, or return it to an unexplored state.
Spawning Units and Giving Unit Promotions - F4
Use this tool to create units for the selected player. You can right-click to spawn a unit of any type, from workers, to missionaries, and even Great People. This is extremely powerful, but doesn't seem to let you edit an existing unit, although this hardly matters. You can use this Cheat to play with Unique Units from other Civilizations! Above the list of units, you can see the level box. Pick a number and it will give the unit that many promotions. Some units have a maximum of nine promotions, while a naval unit could have eleven. Either way, pick a number like 15 and you're likely to have a maxxed-out unt.
Use this tool to create units for the selected player. You can right-click to spawn a unit of any type, from workers, to missionaries, and even Great People. This is extremely powerful, but doesn't seem to let you edit an existing unit, although this hardly matters. You can use this Cheat to play with Unique Units from other Civilizations! Above the list of units, you can see the level box. Pick a number and it will give the unit that many promotions. Some units have a maximum of nine promotions, while a naval unit could have eleven. Either way, pick a number like 15 and you're likely to have a maxxed-out unt.
I'd warn you when using this cheat not to spawn too many units on one tile, although you can. I'm sure it could have a negative impact on your game and possibly cause a crash. Just how many giant death robots would you need in one area, anyway?
IGE Quicksave - F5
Pressing F5 with the Ingame Editor open will create a Quicksave named IGE so that you can avoid overwriting a non-cheated game's save.
Pressing F5 with the Ingame Editor open will create a Quicksave named IGE so that you can avoid overwriting a non-cheated game's save.
Edit Civilization Stats - F6
With this IGE tab, you can use cheats that allow you to add gold, culture, or faith points to the currently selected Civ. Golden ages of 10 or 250 turns can be triggered at will, and religions founded. You may take over leadership of another Civilization on this tab by picking Take Seat option.
With this IGE tab, you can use cheats that allow you to add gold, culture, or faith points to the currently selected Civ. Golden ages of 10 or 250 turns can be triggered at will, and religions founded. You may take over leadership of another Civilization on this tab by picking Take Seat option.
This tab is also particularly interesting for allowing you to make peace treaties, form declarations of friendships, embargoes or even trigger complex wars between various Civs and City States.
Research Cheats - F7
This is likely to be one of the most popular uses of the Ingame Editor. Research Cheats let you learn any technology in Civ 5, Gods and Kings, and Brave New World with a single click. Press Shift-Click and it will learn every prerequisite for the selected technology. You can also take Technology away in the same way - it is a toggle, so shift-click again and it will take away a tech and all prerequisites.
This is likely to be one of the most popular uses of the Ingame Editor. Research Cheats let you learn any technology in Civ 5, Gods and Kings, and Brave New World with a single click. Press Shift-Click and it will learn every prerequisite for the selected technology. You can also take Technology away in the same way - it is a toggle, so shift-click again and it will take away a tech and all prerequisites.
To Cheat and get all Technology, shift-click the Future Tech research project. Since it takes every one of the highest level technologies to research it, you will get every Tech at once. To remove all research at once, shift-click Agriculture on the opposite end of the Tech tree.
Social Policy and Ideology Cheats - F8
With the last tab, you may add and remove any social policy in Civ 5. You may also force the selected Civ to adopt an Ideology or remove one. You may even adopt all Ideologies and Ideological Tenets at once if you so choose, although that may have unforseen gameplay consequences.
With the last tab, you may add and remove any social policy in Civ 5. You may also force the selected Civ to adopt an Ideology or remove one. You may even adopt all Ideologies and Ideological Tenets at once if you so choose, although that may have unforseen gameplay consequences.
Debug Mode, World Builder & Civ 5 SDK
Civ 5's Debug Mode - Reveal Full Map & Unlimited Happiness
Open config.ini located in DocumentsMy GamesSid Meier's Civilization 5 and locate the line that says DebugPanel = 0 and change the 0 to a 1 then save the file. To Disable Debug, you'd do the opposite. This will enable debug mode in the game, which seems to be primarily aimed at mod development. After restarting the game with Debug enabled, you can press Control + Z to reveal the entire map. This process will automatically introduce your Civ to all City States and other Civilizations. It also reveals the location of all Natural Wonders, giving a +1 permanent boost to happiness for each. If you do this over and over, you will keep rediscovering the wonders and accumulate massive amounts of happiness that can allow your cities to grow without worry of unhappiness, and also triggering golden ages over and over depending on how heavily you abuse it. For the most part, revealing the map alone is a potent cheat to a player capable of turning that knowledge into a workable strategy.
Open config.ini located in DocumentsMy GamesSid Meier's Civilization 5 and locate the line that says DebugPanel = 0 and change the 0 to a 1 then save the file. To Disable Debug, you'd do the opposite. This will enable debug mode in the game, which seems to be primarily aimed at mod development. After restarting the game with Debug enabled, you can press Control + Z to reveal the entire map. This process will automatically introduce your Civ to all City States and other Civilizations. It also reveals the location of all Natural Wonders, giving a +1 permanent boost to happiness for each. If you do this over and over, you will keep rediscovering the wonders and accumulate massive amounts of happiness that can allow your cities to grow without worry of unhappiness, and also triggering golden ages over and over depending on how heavily you abuse it. For the most part, revealing the map alone is a potent cheat to a player capable of turning that knowledge into a workable strategy.
While Debug Mode is enabled, you can press the Tilde key to bring up an interface that offers different options specfically for debugging the game. It is unlikely that many useful things can be done with it as far as cheats go, but I'd welcome comments on this tool and its capacity for cheating from players who understand its menu options and how to apply them to a current game. If anything, it's probably not worth the effort of deciphering the debug tool given the power of the Ingame Editor.
The Civilization 5 Software Developer's Kit (SDK)
There are many tools provided by Firaxis that will let you modify Civ 5 or create your own maps. To install these tools, login to Steam and go to your Library. Hover over Library at the top of Steam and choose Tools. Scroll down the list until you find Sid Meier's Civilization V SDK, select it and choose Install. You will now have access to all the tools provided by Firaxis, through a link you should find on your desktop. Otherwise, right click it in the tools list and choose Play.
There are many tools provided by Firaxis that will let you modify Civ 5 or create your own maps. To install these tools, login to Steam and go to your Library. Hover over Library at the top of Steam and choose Tools. Scroll down the list until you find Sid Meier's Civilization V SDK, select it and choose Install. You will now have access to all the tools provided by Firaxis, through a link you should find on your desktop. Otherwise, right click it in the tools list and choose Play.
Share Tips and FAQs (20)
Our Sims Forum is the place to go for faster answers to questions and discussions about the game. Use the form below to share your own experiences and provide helpful tips to other readers.
Kyle says...So I got the IGE off the workshop then I went in-game went to mods enabled the mod clicked next it said configuring game data then when back to the screen I then clicked back and made a new game. But while in-game I noticed that there was no Icon to click and pressing ctrl+I did nothing either... Need help
1st September 2014 11:09pm
Dolan says...So enabling the mod is fine: selected it, hit next, the game configured. But when I start a game the IGE does not show up, and ctrl+i doesn't do anything. Am I missing a step somewhere along the way?
You may find a solution for your problem in the official thread for the Mod at Civfanatics
25th March 2014 2:41pm
CGord says...I do not see this noted about playing with debug mode enabled: technologies researched are selected automatically. I do not know if this can be changed.
30th January 2014 11:15am
Ray Ryan says...Let say I want to reveal entire map with debug mode for fun play, building strategic place for my civ. But since the purpose is just for strategic location. How can I unreveal map after pressing ctrl+z?
30th October 2014 2:25am
Sirwn says...how do you add city states in a map?
19th October 2014 3:01pm
Isa Maayev says...I want to cheat, lol
1st April 2016 4:03am
DRichie says...Once I check the mod, there is no 'next' button on the screen, only 'back'
I wish I could be more helpful, but it just works for me and I've not had this question before. Have you tried selecting the mod directly, where you see all its features, then clicking next?
23rd February 2014 6:09am
Brandon says...Can you choose starting location with this?
14th October 2014 4:45pm
Stan says...Guys, how can I add a new civilization to my current game?
29th September 2014 8:06am
jonesy![Sdk Sdk](/uploads/1/2/5/6/125616095/106668851.jpg)
I'll admit it, I'm slow. And dense. Your comment about making the crazy circular river sunk in - et voilà, one now has a city with a moat. Since most melee units suffer an attack penalty crossing a river.... so, thanks for the tip!While IGE certainly allows massive cheating, I've found it to be useful for making tailored challenges for trying out various tactics and strategies.
Yep, I love it for gameplay testing. Glad to help and that moat is a brilliant use of the terrain editor. You could do it with hills too, so that any ranged have to come in close to hit you - but only on the side with a potential enemy, perhaps?
--Carl
24th December 2013 12:03pm
runujhkj says...Could you also surround your whole Civ with mountains and guarantee untouchability with land units?
Yep, although they could embark over ocean tiles and come at you that way. With ranged units, sinking those embarked units would be easy as they generally have reduced defense while in the water. Only certain Civs' units have the Amphibious promotion (like the Denmark Berserker, a Viking unit). Otherwise, it's a promotion that is gained through experience and not likely to be chosen by the AI in most cases.
9th April 2014 8:52pm
Kero K says...I've just tested this on the Civ V Ultimate version and all seems good enough without any crashes. The only problem with it is (actually my own personal preference)the fact that it takes more than half of the screen. other than that its perfecto. Still wondering if the edited map would really be the edited map after a map save or would it generate other random seed +- map.
I read up on that, and it's just that its designed for ~1920x1080 (or even higher) resolution and there's little the author can do about it because it's a limitation of the Civ 5 User Interface. He COULD make it scale to different resolutions better, but it would take a massive amount of work so it's focused on really high-res monitors since those are more common now.
27th March 2014 11:48pm
Zack says...Does a trainer exist that would be able to enable and disable research advancement? Essentially allowing you to control when civ can start the next era.
I am not aware of a Mod that does this specifically. The Ingame Editor would only let you control each civs' tech level and push them back if you needed to. It would take too much micromanagement, unfortunately. If you want Civs to spend more time in each era, try slower game speeds, which will slow the pace of the game and make everything including research take longer to complete.
4th March 2014 8:44pm
Sivfan says...Just got this thing and it has revealed quite a bit of the mechanics of the game. Like natural wonders are a terrain feature and that the system allows for it to have resources, and improvements on it.
I use it to scout the map before I start (start new game, save, open save with ige and reveal map). This method is better than the debug because it shows all resources, even hidden ones. It does not show ruins though.
Can't get this to make rivers though. Am I missing something?
I use it to scout the map before I start (start new game, save, open save with ige and reveal map). This method is better than the debug because it shows all resources, even hidden ones. It does not show ruins though.
Can't get this to make rivers though. Am I missing something?
25th June 2014 10:38pm
dal says...Brilliant fun. I wanted to edit a map though and play from the beginning with all players hidden in certain placements, is this possible?
I believe it can do what you want - you are able to use it as a fully featured map editor. On the IGE page at the steam workshop it says:
How do I export the map? On the civ5 window to save your game there is a button to save as a map rather than a mere savegame.
How do I export the map? On the civ5 window to save your game there is a button to save as a map rather than a mere savegame.
![Civ 5 won Civ 5 won](http://img.youtube.com/vi/IBo9_4FtQiE/0.jpg)
14th March 2014 4:06pm
Carl says...So I've been having a bug where when my units reached a cloud (that should have disappeared due to that area now being explored) they just go underneath the cloud and it doesn't disappear.
Sorry, I've never seen this happen in-game. I know the Ingame Editor can let you flag areas as explored and such. There are caches in this game that can be cleared, which might help your problem. You can do a search for that, and sometimes reloading the game will correct those issues.
All I have seen are invisible Mountains - very annoying.
All I have seen are invisible Mountains - very annoying.
28th April 2014 9:55pm
Carl says...I just used IGE to explore the entire map, great sucess! XD Also, I agree, invisible mountains are a pain the the *****
14th May 2014 11:16am
Brad says...Can this be used for a mac?
I believe so - you have Steam, right? Do a search for it in the Steam Workshop if so.
Edit: I guess it's actually a pain to install Mods on a Mac. I was not aware of this. You have to go beyond manual installation and apparently insert code yourself. Sorry, folks.
Edit: I guess it's actually a pain to install Mods on a Mac. I was not aware of this. You have to go beyond manual installation and apparently insert code yourself. Sorry, folks.
2nd May 2014 2:07pm
Brad says...I don't use Steam, I just have the game installed on a stand alone PC, I don't play online. Sounds like manually inserting codes will be a huge pain..lol guess I have to play the regular way! Oh Well! Thank you for the help though!
8th May 2014 4:55pm
Billah says...I know this comment is a while on, but this mod is compatible with a mac. Although I have civ on steam I couldn't download the mod via the workshop so I downloaded it from the civfanatics page and did it manually instead. It took a bit of work because you have to enable the 'mod' option on the home screen but in the end I got there and it works great! If you want more information I could probably give you a walkthrough if you reply to this comment or anyone else for that matter.
Well thanks, you got me looking at CFC and found this thread: http://forums.civfanatics.com/showthread.php?t=477763
There readers can find instructions for installing Civ 5 Mods on Mac!
There readers can find instructions for installing Civ 5 Mods on Mac!
12th June 2014 3:11pm
Page 1 of 1
Join In
No new entries may be made.These instructions were originally compiled by Refar for Visual Studio 2005, and have since been slightly modified for a newer version of the Makefile. They will also work with Visual Studio 2008 and 2010. They assume the modder is compiling the Beyond the Sword (BTS) DLL.
Once you have the SDK installed, you'll probably want to look at Xienwof's An Idiot's Guide to Editing the DLL to get started with editing the SDK.
Installing the Tools
- Download and install Microsoft Visual C++ Toolkit 2003
- Download the following three library files and put them in this folder: C:Program FilesMicrosoft Visual C++ Toolkit 2003lib
- Download and install Microsoft Visual C++ Express Edition
- Download Makefile.7z from this forum thread and unzip it. You don't need to do anything with it yet.
- Download and install the Microsoft Platform SDK
Preparing the Working Folder
Compiling a Civilization 4 DLL requires you to use the BtS source files as a base. To begin with locate the CvGameCoreDLL folder; it can be found in your main Beyond the Sword folder (if it is not there, you need to re-install your copy of BtS). Copy this folder to a working directory so that you maintain the original BtS source files in their original location, and have a separate development directory to work from. It is highly recommended that you first compile a clean BtS DLL using only the source files in the CvGameCoreDLL folder before editing the source, or merging in source from other mods.
- Remember: make a copy of the CvGameCoreDLL folder to work with (including its subfolders) and put this copy in a location where you want to keep your working files. From now on everything said refers to the working copy of the files. Don't ever modify the original files – you might need them.
- Delete the files CvGameCoreDLL.vcproj and CvGameCoreDLL.rc. If you followed the instructions so far (i.e. are using a clean copy of the SDK files released with a patched version of BTS) these 2 are all you need to delete. If however your sources came with a mod or were edited with other programs before, there might be a few more files to get rid of. These might be: CvGameCoreDLL.vcproj.vspcc, CvGameCoreDLL.ncb, *.sln, and perhaps others. The only files you need are: All *.h files, all *.cpp files, all (2) *.inl files and everything in the both subfolders (You don’t need to touch the subfolders at all).
- Put the makefile from Makefile.7z into your working folder. The Makefile should work for all versions of Civ, including Colonization, with no modifications.
- Open the Makefile in your preferred editor. You can use the freshly installed Visual Studio IDE, or something else if you prefer. Windows Notepad does not work well here.
- At the very top, change the line that begins with TOOLKIT to the path of your Visual C++ Toolkit 2003 directory.
- Change the line that begins with PSDK to the path of your Microsoft Platform SDK.
- Optionally, uncomment the line beginning with 'YOURMOD' to point to your mod's directory. This will automatically copy the DLL to your mod's Assets directory.
- Save the Makefile and exit.
Setting up the Project
Launch the IDE. When setting up the project for the first time, do not open the existing project file in Visual C++ Express Edition. In fact, if you followed so far, there should be no project file right now. When compiling the same project for the second, 3rd,… time, you do not need to repeat all the steps – you can then load the project file you will create when you are through with this instructions.
- Click -File- -New- -Project-. The 'New Project' window will open.
- In the 'Project types' box select –General-. In the 'Templates' box select -Makefile Project-.
- In the 'Name' box type 'CvGameCoreDLL'.
- In the 'Location' box browse to the folder where you copied your CvGameCoreDLL folder to. This folder MUST be the last folder listed in this box. For example, if you copied CvGameCoreDLL to another folder like so: C:MyModsFolderCvGameCoreDLL , then the entry in the 'Location' box must read: C:MyModsFolder
- UNCHECK the box that says 'Create Directory for Solution'.
- Click -OK-. The 'Makefile Application Wizard' will open. Click –Next-. Clear all the boxes. Click –Finish-.
You will see the IDE interface now, showing you a yet empty project. To avoid possible errors in VS 2010, we will first configure the compiler, and then add source files.
- Click -Project- -CvGameCoreDLL Properties-. The 'CvGameCoreDLL Properties Pages' window will open.
- In the left-hand box under 'Configuration Properties' select 'NMake'. Previous versions of the makefile required you to change the configuration properties here. The newer makefile does not require you to do so.
- Select the 'Release' configuration from the 'Configuration:' drop-down-box in the top left corner.
- In the right-hand box under 'General' it says 'Build Command Line'. Click the empty box to the right of it and type nmake Release.
- In the next line down, to the right of where it says 'Rebuild All Command Line', click in the empty box and then click the button in the box at the right. The 'Rebuild All Command Line' window will open. Type nmake Release_clean, and then directly below it on a second line, type nmake Release. Click -OK-.
- In the next line down, to the right of where it says 'Clean Command Line', type nmake Release_clean.
- Select the 'Debug' configuration from the 'Configuration:' drop-down-box in the top left corner, and repeat the 3 steps above for Debug. Note the underscores in the clean command.
Close the configuration windows with –OK-. Now, we'll add the source files to the project.
- Click -Project- -Add Existing Item…-. The 'Add Existing Item – CvGameCoreDLL' window will open. This folder will contain all of the source code files, the Boost-1.32.0 folder, and the Python24 folder. Select everything (use Ctrl-A) and click -Add-. You only want to add: all *.h files, all (2) *.inl files, all *.cpp files and the both subfolders. If you followed the instructions so far (i.e. deleted all unneeded files) CTRL+A will give you exactly this. If you – for whatever reason – kept some of the unneeded files, you need to deselect them manually.
Save your Project. It will create a new CvGameCoreDLL.vcproj file, which you can open later. It will have your settings saved.
You are done now. For a test you should compile the unchanged code under both Configurations (It takes a bit of time depending on your Hardware), to make sure everything does work as expected. You should use Build->Build Solution to do that.
Compiling the Command Prompt
You can also compile the project by invoking nmake from the command prompt. This might be useful if you repeatedly fail to get the configurations right, or if you want to quickly compile a 3rd party project without going through all the configurations steps. (You still need to install all the tools).
Run the Visual Studio IDE. Do not load a project (or do so – it doesn’t matter here). From menu select Tools->Visual Studio Command Prompt. A console window will open. It has all the needed environment variables set properly (as opposed the usual command prompt Windows will give you).
Navigate to the folder where your project is (Using cd …). Type: nmake /f Makefile Final_Release to compile the final Release configuration. You can use another target instead, nmake /f Makefile Clean_Debug for example.
Compiling a Single Source File
Compiling a single file is much faster than building a full project. It does of course give you nothing actually run-able, but might still be useful when searching for code mistakes.
I did not find a way to do it from the IDE interface, but you can compile single files by invoking nmake from the console – as described above - and calling for intermediate targets.
nmake Debug/CvUnit.obj nmake Final_Release/CvUnit.obj for example will compile just CvUnit.cpp in the Debug or Final_Release configuration.
Running the Debugger
After compiling your project in the Debug configuration, you can run the game using the Debug-able CvGameCoreDLL.dll. It is a good deal bigger than your normal DLL and there is also a big CVGameCoreDLL.pdb file coming with it, which will contain information the debugger might need.
Start the IDE; load your project as switch to the debug configuration. Start the Game with the Debug-DLL.
I recommend running Civ4 Windowed; otherwise you might not be able to access the IDE after the game freezes on a breakpoint.
Choose Debug->Attach To Process… from the menu. Choose the Civ4 Process. You might need to re-enable some local Services – for inexplicable reasons on XP debugging with Visual Studio Express does require Terminal Services to be running. In the debugger output window you will see the List of Libraries loaded in the Process. Most of them will say 'No Symbols Loaded'. This is fine. We are going to debug our CvGameCoreDLL.dll, so this is the only one we need symbols for.
Now you can debug. For testing set a Break-point on some function. CvGame::DoHolyCity() works fine – it is called once per turn. When the Game reaches the Breakpoint it will freeze waiting for your debugging action.
Another good test is a break-point at CvUnit::GetExperience(). When the game stops there, you can access the memory of the Unit instance that called the method and change its Experience level. The unit should be promoted on the next turn.
Retrieved from 'http://modiki.civfanatics.com/index.php?title=How_to_Install_the_SDK&oldid=8535'