Last Update: 2009-04-25
Note: a section on all license-related questions is available here.
0) What is this FAQ for? (added 2003-11-06)
This FAQ is for general questions related to the CtP2 Source Code Project as a whole and general questions regarding the source code. If you have a such question but it's not listed here, feel free to post it. If you have specific question about the code itself, what is or isn't in it, if we can implement specific features, etc, please start a new thread about it (or use an existing one).
This is the third version of the FAQ. You can still find the first version here and the second version here. Note that this FAQ extends over several posts, don't stop reading after the end of this post
1) What is the CtP2 Source Code Project?
The CtP2 Source Code Project revolves around the CtP2 source code (see below), which Activision released on 28 October 2003 (see History). The purpose of this project is for the CtP2 community on Apolyton to try and get the source code running (on different platforms), to understand and document it and to use it to make improvements to the game. So far the focus has been be on bug fixes and minor improvements, but as time progresses it will hopefully be possible to make more ambitious changes. Where the project will end is impossible to say at this point, but one (rather ambitious) view that some people have is that a full-fledged fan-made sequel to CtP2 will come out of this.
1a) Why document the code?
Of course, the CtP2 source code is an extremely complex piece of work. It is expected to be extremely difficult to understand, and there will be an infinite number of ways to change it once we do. There are close to 1 million lines of code -- too much for a single person to work through on his/her own. That's why this Source Code Project exists: if everyone involving in the code works together to document it (what can be found where, and how everything works), this will make it much easier for everyone to understand and modify the code. There has been considerable progress in documenting the code already, but much remains to be done.
1b) What about changing the code?
Once changes are made to the code, there is a huge risk that everyone will try to make different changes and have very different views on what the improved game should be like and which changes should and shouldn't be made. As with the mods, there may eventually be many different versions of the game. This Source Code Project serves to develop a more or less 'official' Apolyton version of the (improved) game, which will make those changes to the game which the CtP community as a whole feels are most needed -- in the same way that the Apolyton Pack does this for the mods (in both CtP1 and CtP2). Hopefully this will also serve to more or less control the number of different versions of the game that come out, as things could get really ugly for players if there are 400 different versions of the game. By combining our views and ideas as much as possible into a single vision, we can hopefully create one version of the game that encompasses many people's opinions on what the game should be like and (more or less) satisfies their tastes.
2) What is this forum for?
This forum is to achieve the goals outlined above. It is to document the code, to figure out how it works and how to get it running, and to discuss changes to the game that could be made to it and how to implement them. Mostly this forum is to support the CtP2 Source Code Project, but if you have any issues related to the CtP2 source code that somehow don't fall under the scope of the CtP2 Source Code Project, this is probably the best place to discuss those as well.
3) What is the CtP2 source code?
The source code for any software product is like its recipe. If you buy for example a cake in the shop, you normally just eat it. Similarly, if you buy a game, you just play it. CtP2 (and CtP1 as well) has always been somewhat of an exception to this, as you could always modify a lot about the game (and increasingly this is true for other PC games as well). One could say that CtP is a not a finished cake but just a set of ready-made 'sub-products' that you can put together and mix yourself, in whatever way you like best. The source code takes this one step further: instead of just ready-made 'prefab' subcomponents, you get the raw ingredients and the recipe, and can make the cake from scratch all by yourself. This of course also allows you to change anything about the recipe you don't like, replacing or adding ingredients as you please.
For CtP2 this means that we can do anything with the game we want, there are no boundaries whatsoever to what we can change (contrary to the mods). If we wanted to, we could turn this game into a Real-Time Strategy game, or even a First Person Shooter (though in that case we'd have to change so much code it'd probably be better to start from scratch ). The only boundaries to what we can do with the source code are our own capabilities to understand and change the code (since most of us aren't professional game designers and there are a few caveats to the release of this source code, some things may simply prove to be too difficult to be worthwhile).
4) Where can I get the source code? And how can I view it?
The code can be downloaded right here from Apolyton, get it here. It's an 8 MB file. It's an executable: double-click and it will extract the files. But before it does so, it will first show you a user agreement: this is the screen where you usually just click 'I agree' and continue. However, in this case I highly recommend you read it carefully! At least parts of it are not your standard legal disclaimer but were written specifically for this source code and detail what you are and aren't allowed to do with it. Anyway, after you agreed to the End User License Agreement (EULA) about 2650 files and 200 folders are extracted to the folder you specified. Most of these files can be viewed them by opening them in any text editor (e.g. Notepad or Word).
Update (2003-11-06): A zip version of the source code is now also available for download: http://apolyton.net/csd.php?http://c...ctp2source.zip Note that if you want to link/redistribute this zip file elsewhere, you must ensure that anyone must agree to the EULA before being able to gain access to the files.
5) How can turn I this code into a working game?
If you just want to have a look at the source code, to see what the code for a professional game looks like, the above file is all you need. If you want to help understand and document the code, you probably won't need much else either. However, if you actually want to be able to compile the game (make it into a executable file that actually works) and modify and test it, you'll need more than that. For one thing, you'll need a compiler, a software program that can transform the code into a working game. For another, you'll need to download about 270 MB worth of DirectX SDK (= Software Development Kit) files from the Microsoft website, as detailed in the readme. The discussion about the details of how to make the file running without errors can be found here. If downloading 270 MB worth of files is a bit much for you, you can also find a workaround for that in that thread.
Update (2004-04-06): Several people have independantly successfully compiled the code, and most of the problems you might encounter in doing so yourself should be addressed in the thread mentioned above. For a brief description of the steps needed to get the code compiling, see the attachment to this post.
6) Why did Activision release the source code? / How about making a no-CD patch?
You may wonder why Activision would release the source code: surely, if anyone can compile the game and edit it as they see fit, can't they just remove the copyright protection and play the game without paying for it? The answer is that they covered this option: the data and media files are not included in the source code file, so you still need to buy a copy of the CD to be able to use the code. Also, in the EULA (user agreement) is set up in such a way that changing the game so that the original game is no longer needed to be able play is strictly forbidden (this means no no-cd patches). Basically, we may edit the game as we see fit, as long as resulting updates/new products still requires the CtP2 CD to play. Releasing the source code was a very generous act of Activision which most software companies would never even consider
7) Do I still need to own a copy of CtP2 to be able to play it/use the source code?
As you can read above, yes, you still need a copy of the game to be able to play it, or you'll miss the data and media files. If you're only interested in understanding how the game works, you can do without the original product, but in that case you need to realized that you can never actually test what will happen if you change certain things about the code, which is often a great help in trying to understand complex products.
8) This all still sounds too good to be true. What's the catch?
Yes, unfortunately there is a catch. This is that Activision had to remove all the comments from the code. These comments don't affect the way the code runs, but they greatly facilitate in understanding how it works. The reason for removing these comments is that some of them may have made references that could in some way embarrass Activision or (ex-)Activision employees, or worse: get them into legal or other problems. Because going through millions of lines of code and removing such undesirable comments by hand would have taking a huge amount of resources (and time), it was decided to simply delete all comments (though 'all' is a big word as we've already found a whole bunch of interesting comments in various places in the code, so some remnants are still left). The work of this project has begun to replace these comments with new comments of our own, but our work falls far short of what existed originally.
9) What leftovers from CtP1 are still present in the source code? Are the space layer, Fuzzy AI or the UI still there?
Much of that is still unclear at this point, but it was made very clear by Activision that most of the CtP1 features that were actually cut, completely removed from the game. The exception here may be the Fuzzy AI: there still seem to be a lot of references to CtP1-related AI stuff that was no longer supposed to be there in CtP2. How much exactly is left is unclear at this point.
10) Is it now possible to make a Linux/Mac/other port of CtP2?
Again, it's still too early to tell, but yes, in theory that should be possible. How much work it is, in other words, is it practical enough to actually do it, remains to be seen. However, things are looking good in this department, as the CtP2 code is based on CtP1 code, which was ported to numerous other platforms (even obscure and no longer existing ones such as BeOS). It will require rewriting significant parts of the code (mostly for the I/O) though, so don't count on seeing ports appear in the next few weeks. How long that will take will also depends on how much manpower will be available and how much demand for certain ports exists.
Update (2003-11-06): An early start with a Linux port has been made, as you can read here.
Update (2004-04-06): The linux port has been reported to successfully compile (see this post), and there is even a report that someone has managed to get the game working far enough to play a few turns under linux.
Update (2005-09-25): The linux porting efforts continue. The linux port being developed by the source code project now also works well enough to be able to play a few turns under linux.
Update (2009-04-25): The Linux port is now reportedly fully playable.
11) Can I use other compilers than Visual Studio 6 to compile the code? (last updated 2005-09-25)
To get the original code compiling with a different compiler is not easy, and if you wish to simply use the code as released by Activision, then it is necessary to use Visual Studio 6.
Nevertheless, the mainstream version of the code being produced by the source code project now compiles with Visual Studio .NET, and we have also developed a partially functional version compiling with gcc under linux, which may lead to a version which compiles with gcc under Windows.
12) How can I help out with the project? (last updated 2005-09-25)
If you want to help out with the project, we're eternally grateful as we can use all the help we can get. Most notably programmers are always in demand, but playtesters, artists, webmasters, etc could all come in handy as well. You can sign up here. If you're a programmer, for the time being you can just pick your favourite part of the code and start documenting/fixing it. Updated source files for the project are stored in a subversion repository, and updates to the repository are mentioned here. Non-programmers are just advised to read the forum and keep up-to-date. They can also help out by playtesting (see here), translating (see here) and working on the new user manual (see here). A better organisation for the project will hopefully be set up in the future.
13) How can I see what has been done so far? (last updated 2005-09-25)
"Official" changes to the source code are described in this thread, but to download the latest versions of the source code you must obtain access to the project's subversion repository.
If you just want to play with the updated version of the game, playtest versions of the executable are posted in this thread. Bear in mind that, while it should be fairly playable, it`s intended for playtesting only: there may be serious bugs in it and it might theoretically break your game (or worse). It is strongly recommended you backup any data before installing. Use at your own risk.
14) When will you be releasing a 'stable' (non-playtest) version? (last updated 2006-08-27)
We don't know. This issue has been discussed here, here and here. For the moment most people are satisfied with the playtest versions of the game that the project regularly makes available.
15) What is the project's subversion repository? (added 2005-09-25)
Subversion is a version control system which allows a group of developers to work on the source code simultaneously whilst minimising the chances of their changes conflicting with one another, and helping to alert them when such conflicts occur. The subversion repository is the place where the developers send their changes and from which they receive the changes made by others. For more information about subversion - the software that makes this possible - see http://subversion.tigris.org/. For more information about how to use this software in this project, see this post.
16) How can I get access to the project's subversion repository? (last updated 2006-08-27)
You'll need to email DarkDust, who manages the repository, confiming that you agree to the EULA for the source code, and providing a username and password. For details see this thread.
Note: a section on all license-related questions is available here.
0) What is this FAQ for? (added 2003-11-06)
This FAQ is for general questions related to the CtP2 Source Code Project as a whole and general questions regarding the source code. If you have a such question but it's not listed here, feel free to post it. If you have specific question about the code itself, what is or isn't in it, if we can implement specific features, etc, please start a new thread about it (or use an existing one).
This is the third version of the FAQ. You can still find the first version here and the second version here. Note that this FAQ extends over several posts, don't stop reading after the end of this post
1) What is the CtP2 Source Code Project?
The CtP2 Source Code Project revolves around the CtP2 source code (see below), which Activision released on 28 October 2003 (see History). The purpose of this project is for the CtP2 community on Apolyton to try and get the source code running (on different platforms), to understand and document it and to use it to make improvements to the game. So far the focus has been be on bug fixes and minor improvements, but as time progresses it will hopefully be possible to make more ambitious changes. Where the project will end is impossible to say at this point, but one (rather ambitious) view that some people have is that a full-fledged fan-made sequel to CtP2 will come out of this.
1a) Why document the code?
Of course, the CtP2 source code is an extremely complex piece of work. It is expected to be extremely difficult to understand, and there will be an infinite number of ways to change it once we do. There are close to 1 million lines of code -- too much for a single person to work through on his/her own. That's why this Source Code Project exists: if everyone involving in the code works together to document it (what can be found where, and how everything works), this will make it much easier for everyone to understand and modify the code. There has been considerable progress in documenting the code already, but much remains to be done.
1b) What about changing the code?
Once changes are made to the code, there is a huge risk that everyone will try to make different changes and have very different views on what the improved game should be like and which changes should and shouldn't be made. As with the mods, there may eventually be many different versions of the game. This Source Code Project serves to develop a more or less 'official' Apolyton version of the (improved) game, which will make those changes to the game which the CtP community as a whole feels are most needed -- in the same way that the Apolyton Pack does this for the mods (in both CtP1 and CtP2). Hopefully this will also serve to more or less control the number of different versions of the game that come out, as things could get really ugly for players if there are 400 different versions of the game. By combining our views and ideas as much as possible into a single vision, we can hopefully create one version of the game that encompasses many people's opinions on what the game should be like and (more or less) satisfies their tastes.
2) What is this forum for?
This forum is to achieve the goals outlined above. It is to document the code, to figure out how it works and how to get it running, and to discuss changes to the game that could be made to it and how to implement them. Mostly this forum is to support the CtP2 Source Code Project, but if you have any issues related to the CtP2 source code that somehow don't fall under the scope of the CtP2 Source Code Project, this is probably the best place to discuss those as well.
3) What is the CtP2 source code?
The source code for any software product is like its recipe. If you buy for example a cake in the shop, you normally just eat it. Similarly, if you buy a game, you just play it. CtP2 (and CtP1 as well) has always been somewhat of an exception to this, as you could always modify a lot about the game (and increasingly this is true for other PC games as well). One could say that CtP is a not a finished cake but just a set of ready-made 'sub-products' that you can put together and mix yourself, in whatever way you like best. The source code takes this one step further: instead of just ready-made 'prefab' subcomponents, you get the raw ingredients and the recipe, and can make the cake from scratch all by yourself. This of course also allows you to change anything about the recipe you don't like, replacing or adding ingredients as you please.
For CtP2 this means that we can do anything with the game we want, there are no boundaries whatsoever to what we can change (contrary to the mods). If we wanted to, we could turn this game into a Real-Time Strategy game, or even a First Person Shooter (though in that case we'd have to change so much code it'd probably be better to start from scratch ). The only boundaries to what we can do with the source code are our own capabilities to understand and change the code (since most of us aren't professional game designers and there are a few caveats to the release of this source code, some things may simply prove to be too difficult to be worthwhile).
4) Where can I get the source code? And how can I view it?
The code can be downloaded right here from Apolyton, get it here. It's an 8 MB file. It's an executable: double-click and it will extract the files. But before it does so, it will first show you a user agreement: this is the screen where you usually just click 'I agree' and continue. However, in this case I highly recommend you read it carefully! At least parts of it are not your standard legal disclaimer but were written specifically for this source code and detail what you are and aren't allowed to do with it. Anyway, after you agreed to the End User License Agreement (EULA) about 2650 files and 200 folders are extracted to the folder you specified. Most of these files can be viewed them by opening them in any text editor (e.g. Notepad or Word).
Update (2003-11-06): A zip version of the source code is now also available for download: http://apolyton.net/csd.php?http://c...ctp2source.zip Note that if you want to link/redistribute this zip file elsewhere, you must ensure that anyone must agree to the EULA before being able to gain access to the files.
5) How can turn I this code into a working game?
If you just want to have a look at the source code, to see what the code for a professional game looks like, the above file is all you need. If you want to help understand and document the code, you probably won't need much else either. However, if you actually want to be able to compile the game (make it into a executable file that actually works) and modify and test it, you'll need more than that. For one thing, you'll need a compiler, a software program that can transform the code into a working game. For another, you'll need to download about 270 MB worth of DirectX SDK (= Software Development Kit) files from the Microsoft website, as detailed in the readme. The discussion about the details of how to make the file running without errors can be found here. If downloading 270 MB worth of files is a bit much for you, you can also find a workaround for that in that thread.
Update (2004-04-06): Several people have independantly successfully compiled the code, and most of the problems you might encounter in doing so yourself should be addressed in the thread mentioned above. For a brief description of the steps needed to get the code compiling, see the attachment to this post.
6) Why did Activision release the source code? / How about making a no-CD patch?
You may wonder why Activision would release the source code: surely, if anyone can compile the game and edit it as they see fit, can't they just remove the copyright protection and play the game without paying for it? The answer is that they covered this option: the data and media files are not included in the source code file, so you still need to buy a copy of the CD to be able to use the code. Also, in the EULA (user agreement) is set up in such a way that changing the game so that the original game is no longer needed to be able play is strictly forbidden (this means no no-cd patches). Basically, we may edit the game as we see fit, as long as resulting updates/new products still requires the CtP2 CD to play. Releasing the source code was a very generous act of Activision which most software companies would never even consider
7) Do I still need to own a copy of CtP2 to be able to play it/use the source code?
As you can read above, yes, you still need a copy of the game to be able to play it, or you'll miss the data and media files. If you're only interested in understanding how the game works, you can do without the original product, but in that case you need to realized that you can never actually test what will happen if you change certain things about the code, which is often a great help in trying to understand complex products.
8) This all still sounds too good to be true. What's the catch?
Yes, unfortunately there is a catch. This is that Activision had to remove all the comments from the code. These comments don't affect the way the code runs, but they greatly facilitate in understanding how it works. The reason for removing these comments is that some of them may have made references that could in some way embarrass Activision or (ex-)Activision employees, or worse: get them into legal or other problems. Because going through millions of lines of code and removing such undesirable comments by hand would have taking a huge amount of resources (and time), it was decided to simply delete all comments (though 'all' is a big word as we've already found a whole bunch of interesting comments in various places in the code, so some remnants are still left). The work of this project has begun to replace these comments with new comments of our own, but our work falls far short of what existed originally.
9) What leftovers from CtP1 are still present in the source code? Are the space layer, Fuzzy AI or the UI still there?
Much of that is still unclear at this point, but it was made very clear by Activision that most of the CtP1 features that were actually cut, completely removed from the game. The exception here may be the Fuzzy AI: there still seem to be a lot of references to CtP1-related AI stuff that was no longer supposed to be there in CtP2. How much exactly is left is unclear at this point.
10) Is it now possible to make a Linux/Mac/other port of CtP2?
Again, it's still too early to tell, but yes, in theory that should be possible. How much work it is, in other words, is it practical enough to actually do it, remains to be seen. However, things are looking good in this department, as the CtP2 code is based on CtP1 code, which was ported to numerous other platforms (even obscure and no longer existing ones such as BeOS). It will require rewriting significant parts of the code (mostly for the I/O) though, so don't count on seeing ports appear in the next few weeks. How long that will take will also depends on how much manpower will be available and how much demand for certain ports exists.
Update (2003-11-06): An early start with a Linux port has been made, as you can read here.
Update (2004-04-06): The linux port has been reported to successfully compile (see this post), and there is even a report that someone has managed to get the game working far enough to play a few turns under linux.
Update (2005-09-25): The linux porting efforts continue. The linux port being developed by the source code project now also works well enough to be able to play a few turns under linux.
Update (2009-04-25): The Linux port is now reportedly fully playable.
11) Can I use other compilers than Visual Studio 6 to compile the code? (last updated 2005-09-25)
To get the original code compiling with a different compiler is not easy, and if you wish to simply use the code as released by Activision, then it is necessary to use Visual Studio 6.
Nevertheless, the mainstream version of the code being produced by the source code project now compiles with Visual Studio .NET, and we have also developed a partially functional version compiling with gcc under linux, which may lead to a version which compiles with gcc under Windows.
12) How can I help out with the project? (last updated 2005-09-25)
If you want to help out with the project, we're eternally grateful as we can use all the help we can get. Most notably programmers are always in demand, but playtesters, artists, webmasters, etc could all come in handy as well. You can sign up here. If you're a programmer, for the time being you can just pick your favourite part of the code and start documenting/fixing it. Updated source files for the project are stored in a subversion repository, and updates to the repository are mentioned here. Non-programmers are just advised to read the forum and keep up-to-date. They can also help out by playtesting (see here), translating (see here) and working on the new user manual (see here). A better organisation for the project will hopefully be set up in the future.
13) How can I see what has been done so far? (last updated 2005-09-25)
"Official" changes to the source code are described in this thread, but to download the latest versions of the source code you must obtain access to the project's subversion repository.
If you just want to play with the updated version of the game, playtest versions of the executable are posted in this thread. Bear in mind that, while it should be fairly playable, it`s intended for playtesting only: there may be serious bugs in it and it might theoretically break your game (or worse). It is strongly recommended you backup any data before installing. Use at your own risk.
14) When will you be releasing a 'stable' (non-playtest) version? (last updated 2006-08-27)
We don't know. This issue has been discussed here, here and here. For the moment most people are satisfied with the playtest versions of the game that the project regularly makes available.
15) What is the project's subversion repository? (added 2005-09-25)
Subversion is a version control system which allows a group of developers to work on the source code simultaneously whilst minimising the chances of their changes conflicting with one another, and helping to alert them when such conflicts occur. The subversion repository is the place where the developers send their changes and from which they receive the changes made by others. For more information about subversion - the software that makes this possible - see http://subversion.tigris.org/. For more information about how to use this software in this project, see this post.
16) How can I get access to the project's subversion repository? (last updated 2006-08-27)
You'll need to email DarkDust, who manages the repository, confiming that you agree to the EULA for the source code, and providing a username and password. For details see this thread.
Comment