UPDATE June 30:
linkYesterday I made a post about the new project I started. The next version of WM. I that post I said I would create a thread for the development as well as a thread for game design. Well the design thread is already up now this is the development thread. In this post I will write a tutorial about how you can get your development enviroment set up, for those that wanna play with the code. I will also explain my choice of tools and give a brief description of the code so far.
I'm a profional developer for a living (currently unemployed). I work with .NET, focused on C# for both windows apps as well as web ones. So naturaly C# would be the easiest choice for me. But that would be a problem in that the app would require the instalation of the .NET framework and thats quite a large download. Also I would still have to learn a new Framework, since I would probabily use the XNA framework, and Visual Studio Game Dev studio, both of which I have no experience with. But WM is a game that looks more like an desktop app than a game. Therefore a desktop framework would be more suited for the development of WM2. But Windows forms is not the right choice since the app would look and feel like a bussiness app instead of a game. WPF would be the right choice here but I have no experience with that. All things considered I decided to instad go with c++. There is a popular framework called Qt. The GUI can be styled to look and feel more like a game than an desktop app. It is also portable meaning we can get it working on windows, mac and other systems like linux. That will give me a chance to work on my c++ skills, something that really appeals to me. Qt is complete enough that we would probabily not need much else. I can work with images, be styled to have a nice look and feel, and has a nice dedicated development envirament (IDE). And most importantly its all free.
When I went to the download page for Qt I saw there was an instalation tool that had all the stuff packed together. Problem is, there was already a new version for the IDE and the framework, but the instalation tool had not been updated yet. So I decided to install each component by hand. Here are the instruction of how I did that. Note that I'm on Windows 7, so the downloads and installation procedures might be diferent if you are on a diferent system, especially a non-windows system. Still the components necessary will be the same I think.
First I advise that you create a directory on your main drive (usualy c:). This is importan becouse one of the compiler tools (mingw) has a comand line interface that might be necessary at some point. This tool doesn't work well with spaces on Directory names. So if you install things on "Program Files" you might have trouble running command line stuff with mingw. On my box I created a directory called "c:\QtDev". Here I installed all the development tools. I should really unsintall everything and take notes as I reinstall. But I'm lazy so I'm going to do this by memory. If you follow the instructions and see some diferences in your experience, please note them so I can update the tutorial. If you have trouble post them here I will try and help you get though them.
1 - Create your main directory on c: (in this example we will use c:\QtDev)
2 - Go to
http://sourceforge.net/projects/mingw/files/Installer/mingw-get-inst/3 - There should be a link on top of the page called "Looking for the latest version? Download mingw-get-inst-20111118.exe (591.9 kB) "
4 - Download that or whatever version is available when you read this
5 - Tell the installer to download all the latest version and point it the "C:\QtDev\MinGW" folder
6 - I can't remember but I think that at some point you can tell it to also install a tool called "msys". This a a command line tool for mingw. Its nice to have handy as some Linux oriented libraries might require this tool for compilation.
7 - There is also some choice to what compilers you want to install. All you need is a C/C++ compiler. If you want Fortram or Objective C go ahead and install those. But it won't be used in this project.
8 - If everything went fine you should have the latest GNU C++ Compiler installed on your box
9 - Now we are going to install Qt. Go to
http://qt.nokia.com/downloads10 - Download and install the "Qt libraries 4.8.0 for Windows (minGW 4.4, 354 MB)"
11 - I choose to install the libraries in "C:\QtDev\Qt\4.8.0"
12 - Notice there are no spaces in the name
13 - If it asks if you want to also install a compiler, say no, we already have that
14 - If it asks for the compiler Directory it should be in "C:\QtDev\MinGW\bin"
15 - Now we got C++ and Qt, all we need is a development enviroment
16 - Go to
http://qt.nokia.com/downloads17 - Download and install "Qt Creator 2.4.0 for Windows (53 MB)"
18 - Again we don't want it to install a compiler, becouse this come with an old version of mingw
19 - I choose to install Qt Creator in the "C:\QtDev\Qt\qtcreator-2.4.0" folder
20 - Notice there are no spaces. I think the default sugestion is something like "qtcreator 2.4.0". I replaced the space with a dash.
21 - If the installer wants your compiler folder point it to "C:\QtDev\MinGW\bin"
22 - If it wants you Qt folder point it to "C:\QtDev\Qt\4.8.0\bin"
23 - If it wants a especific exe like "qmake.exe" those should be in one of the folders above
24 - Alright, we got the latest C++, Qt 4.8.0 and Qt Creator 2.4.0, nice job!
25 - For some obscure reason the debugger that comes with mingw doesn't work in Qt Creator. We really need a debugger, or else we will have a hard time hunting bugs. For that reason we will manually install the debugger, called GDB
26 - Go to
ftp://ftp.qt.nokia.com/misc/gdb. Currently the latest version is 7.2. Click that
27 - Download qtcreator-gdb-7.2-mingw-x86.zip
28 - Unpack that somewhere, I did it to "C:\QtDev\qtcreator-gdb"
29 - Now we got everything so its time to setup Qt Creator. Since we installed the compiler and framework manually we need to point the IDE to the right folders
30 - Open Qt Creator. It should on your start menu under "all programs -> Qt Creator by Nokia -> Qt Creator". If its not go the the installation folder and open it directly ("C:\QtDev\Qt\qtcreator-2.4.0\bin\qtcretor.exe")
31 - Go to Tools->Options menu
32 - Select the "Build & Run" tab
33 - Select the "Qt Version" tab. It should say "Manual -> Qt 4.8.0 (4.8.0) c:\qtdev\qt\4.8.0\bin\qmake.exe"
34 - If that is not there click on the "Add..." button and select qmake.exe in the bin folder of your Qt framework directory
35 - Now Qt Creator is pointing to the latest version of Qt we need to set up the compiler and debugger
36 - Select the "Tool Chains" tab
37 - There is some Auto-detected seting as well as a Manual one. If there is no Manual one again click on Add and select Mingw
38 - Select the "Manual - MinGW" seting
39 - Point the "Compiler path" to your MinGW g++ compiler. Here it looks like "C:\QtDev\MinGW\bin\g++.exe"
40 - Point the "Debugger:" to you debugger path (the place where you unziped you debugger). Here it is "C:\QtDev\qtcreator-gdb\gdb-i686-pc-mingw32.exe"
41 - Click the "Apply" button and then "Ok"
42 - Finally everything is done, so now you can open the WM2 project
WM Project setup
1 - Create a folder where you will have all your projects
2 - In my box I use the "C:\QtDev\Projs" folder
3 - Download the project and unpack it to a subfolder or you projects folder
4 - Here I have it on "C:\QtDev\Projs\WM2"
5 - Open that folder and enter the "scr" directory ("C:\QtDev\Projs\WM2\scr"). Thats the folder I keep all the source code.
6 - If the WM2.pro file is not associated to Qt Creator. Double-click the pro file, select a local program and associate it with "C:\QtDev\Qt\qtcreator-2.4.0\bin\qtcreator.exe"
7 - Once Qt Creator is open select "Use Shadow Build"
8 - Set both "build" and "release" to the ./build directory inside the wm2 folder ("C:\QtDev\Projs\WM2\build")
5 - click Finish
6 - Go to the "Projects" tab on the left
8 - Select the "Build Settings" tab
9 - It should say that your "Qt version:" is Qt 4.8.0. If its not change it to the 4.8.0 version
10 - The "Tool Chain" should be "MinGW" if its not click the "Manage" button and select the "Manual" setting we created earlier for MinGW
11 - "Shadow build" should be checked
12 - Build directory should be pointing to the build folder ("C:\QtDev\Projs\WM2\build")
13 - Alright, we are almost done. One last thing needs to be configured before we can compile the program
14 - Under the "Projects" tab select the "Run Settings" tab
15 - Set "Working directory" to the project root directory, the place where you unpacked the WM2 project ("C:\QtDev\Projs\WM2")
16 - That will tell Qt Creator to run the program in that folder. Its important to do so or the program will not find the files it searchs for since we will use a relative path to open all files (scripts, images, xml config files and so on)
17 - Run the application and it should work. To do this click on the Play button on the button left
Download the Project :
Update:
The Attrites demo has been updated so that now I have Revision 1 of the attributes:
wm-v01Wow man this was a long ass tutorial. Took me quite a while to write it. If you have trouble just post it here. Since this is so big I will post another post to talk about the code in this thread soon. Even if its this big it should only take a few minutes to set things up if you discount the time you take to download the files, especially the Qt Framework file since its quite big.