devolution

Author Topic: Whore Master Cathexis Dev (renamed from WMII)  (Read 26003 times)

0 Members and 1 Guest are viewing this topic.

Offline graodeareia

  • Jr. Member
  • **
  • Posts: 60
Whore Master Cathexis Dev (renamed from WMII)
« on: February 01, 2012, 08:40:03 AM »
UPDATE June 30: link
Yesterday 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/downloads
10 - 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/downloads
17 - 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-v01

Wow 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.
« Last Edit: June 30, 2012, 05:56:24 AM by graodeareia »

Offline Seelee_Majere

  • Newbie
  • *
  • Posts: 4
Re: Whore Master II (Dev)
« Reply #1 on: February 01, 2012, 12:16:37 PM »
I don't know if my post is in good place, if not I'm sorry for that and a moderator move my post.
I'm also a C# developer, I like that language. I started with C, then a little C++, then some VB and nowsdays I'm a C# developer.

graodeareia
, is partially right when he said that an application that used C# doesn't look like a game, but I think that if you remove de border then 2 or 3 properties of windows then the look is very very very similar.
Last months I jumped to WpF and I have to say is awesome powerful. It combines the look like of flash with the powerful of C#. I'm very happy with that "layer". I called WpF a layer, because as it use C# or VB in code-behind for me it is like a "graphical layer".

There is a long long long time I do not use C++ so... my experience is now 0.

If graodeareia want I could help with this new project of Whore Master.

See you!!

P.D. Sorry for my english, it's not my first language.

Offline graodeareia

  • Jr. Member
  • **
  • Posts: 60
Re: Whore Master II (Dev)
« Reply #2 on: February 01, 2012, 03:31:55 PM »
@Seelee Try to install the dev enviroment and compile the program. After that take a look at the code and tell me what you think of it. If you want to learn how to get around in Qt Creator or Learn Qt I recomend going to youtube for some tutorials. You might even find some video material in you language. If not, there should at least be some nice writen material in your native language since qt is a very popular framework. Good luck. In regards to the choice of language I fully undestand the benefits of using .NET over C++. But as I said in my post I'm really interested in geting my C++ skills at a good level. So while WPF might be an attractive Framework I will undertake this project using Qt. The last time I wrote any C++ was back in college 5 years ago. So I'm also pretty rusty. Even back then all I did was write a few hundred lines of code and read a couple books without ever putting what I read to pratice. But I've to say that back in college I did some 4 year of pure c. So the ++ part of it wasn't too hard to learn. There are Advanced concepts like templates. But we won't be making many of those, if any. I'd say that the current Girl Attributes program that I shared here is the most complex C++ code I ever wrote. Took me a week to write only a few hundred lines of code. Most of the time I spend reading manuals, tutorial, watching videos and so on. The hardest part was linking the scripting language to the C++. I started actually using the Lua scripting language. Than I decided it was too hard and switched to javascript. Qt has native integration with javascript. I was able to acomplish in a few hours with javascript what I had been trying to do with Lua for 2 days. As for the right place to post things. Its like this, technical stuff here, design and game play stuff on the other thread. So your right to post your question here.
« Last Edit: February 01, 2012, 03:51:58 PM by graodeareia »

Offline Seelee_Majere

  • Newbie
  • *
  • Posts: 4
Re: Whore Master II (Dev)
« Reply #3 on: February 02, 2012, 05:27:10 AM »
Hello, I follow all your instructions and get this error message when compiling.  :'(


:-1: error: fatal error: -fuse-linker-plugin, but liblto_plugin-0.dll not found


P.D. And yes, I get the lastest version of your project.
« Last Edit: February 02, 2012, 06:17:59 AM by Seelee_Majere »

Offline graodeareia

  • Jr. Member
  • **
  • Posts: 60
Re: Whore Master II (Dev)
« Reply #4 on: February 02, 2012, 10:42:43 AM »
I never got that error. What OS are you in? Is it 64 bits? Did you change any setting after you installed minGW?

Try to run the progran attached:
1 - Open the pro file.
2 - Uncheck "Shadow build"
3 - Click Finish
4 - Press the Play Button in the lower left corner of Qt Creator

Tell me what happens.


Offline East

  • Newbie
  • *
  • Posts: 5
Re: Whore Master II (Dev)
« Reply #5 on: February 02, 2012, 04:59:23 PM »
I've been lurking around the forum for a few months now thinking about how i'd love to see WM improved and expanded, and this project looks like the perfect opportunity to step into the ring and start trying to actively contribute!  I have a little coding experience with qbasic and Pascal, but it was about 10 years ago, so I've been focused on relearning my coding and familiarizing myself with c++.  I've also been working on deciphering the SVN source code in order to make myself an overall blueprint of what's doing what and to get a good overall understanding of the current game mechanics before I go mucking around with coding. 


I'm not sure how much help i'd be as of yet, but I wanted to at least introduce myself and show some support.  :)   I think WM has some great potential, and am pretty stoked to be hopefully seeing some serious development again!

Offline Seelee_Majere

  • Newbie
  • *
  • Posts: 4
Re: Whore Master II (Dev)
« Reply #6 on: February 03, 2012, 05:12:54 AM »
I never got that error. What OS are you in? Is it 64 bits? Did you change any setting after you installed minGW?

Try to run the progran attached:
1 - Open the pro file.
2 - Uncheck "Shadow build"
3 - Click Finish
4 - Press the Play Button in the lower left corner of Qt Creator

Tell me what happens.


A nice MS-DOS screen with "Hello world!".

Offline graodeareia

  • Jr. Member
  • **
  • Posts: 60
Re: Whore Master II (Dev)
« Reply #7 on: February 03, 2012, 07:36:52 AM »
East :Tnx for the support! Anyways since you have been looking into the SVN tree I have a project for you if you want. You could help us setup a Version Control for this projects souce code. Qt Creator has some interfaces that you can use to access many types of Version Control systems. I don't know how it work, but you could do the research and post a tutorial here. That way it would be much easier to have multiple people working on the project. We would need to know how to setup the project, how to add and remove files, how check out and check in files all from within the Qt Creators interface.

But the first thing is to do a little rearch and decide which source control system is best of the project. As I said Qt Creator supports many of them, not only subversion. Of course it has to be a free host.

Offline graodeareia

  • Jr. Member
  • **
  • Posts: 60
Re: Whore Master II (Dev)
« Reply #8 on: February 03, 2012, 07:47:54 AM »
Seelee_Majere:

Ok so you can build a Console application. Good. Now lets try a basic gui application and see if that works. The application is attached.

Try to run the progran attached:
1 - Open the pro file.
2 - Uncheck "Shadow build"
3 - Click Finish
4 - Press the Play Button in the lower left corner of Qt Creator

Tell me what happens.
« Last Edit: February 03, 2012, 07:49:41 AM by graodeareia »

Offline Seelee_Majere

  • Newbie
  • *
  • Posts: 4
Re: Whore Master II (Dev)
« Reply #9 on: February 03, 2012, 08:09:21 AM »
Working too... I saw a nice Window with "Hello World!".


P.D. My OS is Windows Xp 32bits.

Offline graodeareia

  • Jr. Member
  • **
  • Posts: 60
Re: Whore Master II (Dev)
« Reply #10 on: February 03, 2012, 08:33:28 AM »
I don't understand, my proj doesn't have much more than whats on the gui sample.
Maybe it has something to do with the new c++ features. I'm using a flag to enable some c++11 features to be available. Add this line to your pro file for the gui application and try to compile:

QMAKE_CXXFLAGS+=-std=c++0x

Offline East

  • Newbie
  • *
  • Posts: 5
Re: Whore Master II (Dev)
« Reply #11 on: February 03, 2012, 04:29:21 PM »
I'm setting up your dev environment via your tutorial as i'm typing this; if I have the same compiler problems as seelee I'll let ya know.  * crossing fingers*

Offline East

  • Newbie
  • *
  • Posts: 5
Re: Whore Master II (Dev)
« Reply #12 on: February 03, 2012, 05:55:59 PM »
Question: When open the .pro in Qt creator, it has selected "Create build Configurations: For each Qt Version One Debug And One Release", I don't want to change that, right?  It appears I should change it because I can't modify "Build" or "Release" unless I select "Manually" or "For One Qt Version one debug And One Release".  I'll set it to "Manually" for the moment, if I should change it just let me know.


*Edit: Just Compiled and had a nice little window pop up called "Girl Attributes (DEBUG)"
« Last Edit: February 03, 2012, 06:07:47 PM by East »

Offline graodeareia

  • Jr. Member
  • **
  • Posts: 60
Re: Whore Master II (Dev)
« Reply #13 on: February 03, 2012, 08:11:24 PM »
Do you have more than one version of Qt installed? If not you can leave in for each option. Since there is only one version, only one build will be generated.

Offline DocClox

  • Dev Team
  • *****
  • Posts: 1867
  • Messing Around With Python
Re: Whore Master II (Dev)
« Reply #14 on: February 04, 2012, 01:17:52 AM »
Very Nice :)

I kind of feel I should be offering some words of advice (or at least some gnomic utterances) at this point, but really it looks like you've got everything covered and under control.

Good luck, and I look forward to seeing the project progress :D