I never knew that as simple as downloading a game, compile and run it is that complicated. It took me quite a while to find a workable game and finally I found one that does compile but there are some errors that I don’t understand and ignored it. The game 0 A.D. is a mod from the game, Age of Empires.
First I build solution, making sure that my program doesn’t create any errors. After it is successful, I start debugging my files and a program error came up. I tried to understand what is going on but because of my lack of experience in debugging and there is over hundreds of files for this game, I gave up. So I suppress it and the game actually compiled! It really made me so relieved.
Before everything gets on its way to compile…
I searched a lot of games through google typing keywords like “OpenGL C++ rpg game” but this doesn’t work because it’s too specific. Then I went on to search for broader terms like “C++ source code game” which starts to give me what I am looking for. I start to look at different C++ games like “Secret Maryo Chronicles” or “Battle of Wesnoth” and I think around five more games that I have downloaded. I always encounter a website to download these games, sourceforge which I think is the best website for source codes of games. I opened the files and start to look for “INSTALL” text so I can potentially get it working on Visual Studio. However, there were so many files and folders that I do not know where to start and the .txt files doesn’t’ really help much. I had to text warp every time I open such files, read the instructions but it does not tell me how to open it in Visual Studio. There were .cpp files, .h files and .dll that I have some experience how these files were linked in Visual Studio, but I cannot find the main file that I can run in Visual Studio. I thought I was looking for .vcproj files and I was trying my hardest to look for it.
Enough for files, I finally encounter something that tells me how to open a source code and getting it running on Visual Studio! I have to congratulate myself.
Not only this game but there were other games that told me to download a software “TortoiseSVN” so I can export the trunk file for the game. After 30 minutes of download, I finally got the file and it asked me to open a .sln file using Visual Studio. Now I start to get it, I’m not looking for .vcproj but a .sln file to open in Visual Studio! Then I try it out but building the solution and debug to run the game.
I got the game to run but because the graphic resolution is too high with lots of function and buildings, it ran very slow. I had to close of the effects like shadows in order to smoothly run the game.
Through the process, I found other interesting process that is similar in each game. Open source games usually have a website and inside it have instructions that teach you how to get source code and configure it to Visual Studio! Many games will require you to install dependencies, which are independent files that you need to install to the computer so files will not go missing when you run the game in Visual Studio. To get the source code, there are two ways to download. One is tarballs and another is repository. Both require extraction so that is when Tortoise comes for the source code. Last is finding the .sln which is inside one of the folders somewhere that is indicated in the game website. If you can’t find the information from the website, I found the forum to be the second place to look at where sometimes it tells you information if you have any errors encountered. Sometimes additional work need to be done after as well.
The website will sometimes tell you to update files because maybe the game is made years before and new features need to be added to the file so it can run successfully in the new Visual Studio, if they didn’t indicate anything and it doesn’t run, it might also be a good idea to downgrade the software from Visual Studio 2010 to something earlier. Anyways, one of the easiest way to run a game successfully in my opinion is to find one that doesn’t require you to download dependencies or any other software like directX or SDL libraries (except the tarball and repository one that you MUST have) because they already have it with them which makes it potentially easier to run the game. No wonder why game companies need to hire programmers to do such stuff. This experience gave me some insights on how to download games and make it work which I think is useful for me in the future.