Welcome, Guest. Please Login or Register.  • Help
SMF Underground
+ SHMUP-DEV » SHMUP DEV FORUMS » Assistance
|-+ C++ Startup Thread

Pages: [1]   Go Down
0 Members and 1 Guest are viewing this topic. Topic Tools  
Read February 07, 2007, 08:32:47 PM #0
Matt McFarland

C++ Startup Thread

So, you want to make a game with C++?

Let's find out how...

1. Compiler - Where and which?
2. Libraries - Where and Which?
3. IDE - Where and Which?
4. Tutorials - Where and Which?


<a href="http://www.mattmcfarland.com/flash/myFlashSig.swf" target="_blank">http://www.mattmcfarland.com/flash/myFlashSig.swf</a>
Offline  
Read February 07, 2007, 11:35:08 PM #1
Olick

Re: C++ Startup Thread

*ahem* I'm new so you might not be able to trust me.

1. Compiler - I use the MinGW32 compiler, which I understand is a port of compilers used on Unix. This is the default compiler of my favorite IDE.

2. Libraries- So far I've only experimented with the default SDL libraries (http://www.libsdl.org) and the SDL_Image library. I would be very interested in knowing what other graphical Libraries are useful as well, but SDL gives me good low level control which I like.

3. IDE - I go with Bloodshed's Dev C++ (http://www.bloodshed.net/devcpp.html). Its free and its nice.

4. Tutorials. For game programming, in SDL, I reference (in addition to the SDL documentation) the tutorials at LazyFoo (http://www.lazyfoo.net/).

I'm pretty interested in other Libraries people use to aid them.
Offline  
Read February 08, 2007, 12:22:54 AM #2
geekman

Re: C++ Startup Thread

1. Compiler - Where and which?

For branded, fully functional Compiler+IDE, you have Borland's Turbo C++ Explorer Edition and Microsoft's Visual C++ Express Edition. Both are free and can be used in commercialized projects. They are the "real thing" as what you will get from the paid version, except for some professional features (for TC++, you can't create new or customized components, which can be circumvented by spending some time to derive your own class from the source components)(for VC++, I'm not sure, but for what I can see, they have significantly less components available, only the basic things are included in the Express Edition)

2. Libraries - Where and Which?

Programming APIs or Graphical APIs? I assume Graphical API. I choose DirectX since it's the most widely used in the Windows world. I have no plan to move to other OS, so DirectX should be good enough for me.

3. IDE - Where and Which?

See (1)

4. Tutorials - Where and Which?

Just found a good one recently at http://www.toymaker.info/index.html. Also, GameDev is a good place to find some nice tutorials. Last but not least, MSDN is a place you would frequent if you are working with MS's VC++ and DirectX.
Offline  
Read February 08, 2007, 12:31:50 AM #3
relsoft

Re: C++ Startup Thread

Compiler: MingW
Libs: OpenGL,SDL,GLFW for games; TinyPTC for sofware rendering.
IDE: DevCPP ( I hate make, to my guts)
Tutorials: I usually read books (even if I don't understand it at first, but I usually get the hang of it eventually). Then gamedev.net and freebasic.net(yeah we do discuss C++ there) if I get stuck. :*)


Hello
Offline  
Read February 08, 2007, 03:16:42 AM #4
jbadams

Re: C++ Startup Thread

(for VC++, I'm not sure, but for what I can see, they have significantly less components available, only the basic things are included in the Express Edition)
Actually it has almost everything except for the advanced features.  Contrary to a common belief floating around, you've even got an optimising compiler included.  Things you're missing include the 64bit compiler, the IDE resource editor (you can use the one in the C# IDE however  Wink) and the ability to extend the IDE.  As a beginner to intermediate programmer you're unlikely to miss any of the features from the commercial versions.


SDL is an excellent library for beginners, and can still be quite useful for those of us with a bit more experience depending on the project in question.  You're also able to use SDL in conjunction with either OpenGL or DirectX (although how to do this with DirectX is less well documented) as you get more advanced and wish to have more control over graphical operations.
Offline  
Read June 07, 2007, 02:44:42 AM #5
pixelizr

Re: C++ Startup Thread

There is one thing you have to note before considering using the VC8 Express IDE (or any version of VC8 and above for that matter). All executables compiled under VC8 will have a dependency on the Microsoft C++ runtime assemblies (msvcr8). I estimate that 50 percent of potential users will not have this installed, and on top of that, your program would spit out a cryptic error if the runtime assemblies are not found (something along the lines of "a component is missing and you have to reinstall the application"). And furthermore on top of that, resolving the dependency is no longer a matter of copying the DLL in the same directory; there are a few additional steps that must be taken.

Of course, you could always instruct your users to download the runtime from Microsoft's site.

In my case, I use MinGW and Eclipse CDT for compiling C++ programs, and the Allegro libraries for game development. A full set of compilable examples are available from Allegro's website.
« Last Edit: June 07, 2007, 02:47:39 AM by pixelizr »
Offline  
Read June 22, 2007, 10:19:50 AM #6
Crimson Knight

Re: C++ Startup Thread

1. Compiler - Where and which?
MinGW(see 4).
2. Libraries - Where and Which?
Allegro.
3. IDE - Where and Which?
Dev C++(see 4).
4. Tutorials - Where and Which?
IMO, the best tutorial out there isn't free, the book "Beginning C++ Game Programming" by Michael Dawson(?). This book was great for helping me learn a good deal of C++. As long as you're not a complete newbie to programming, you can learn a decent amount of C++ in 2 months, maybe less depending on your drive to finish the book. The two above programs I also recommend you getting from this book(or the CD rather), as I got the runaround with Bloodshed Dev's site.
Offline  
Read June 22, 2007, 11:08:09 AM #7
Korenn

Re: C++ Startup Thread

1. Compiler - Where and which?
MS Visual Studio 2005, I own a legal copy. I got used to it, so I can live with the microsoft label. Where? order online for too much money, or get one funded by one of MS's education programs (that's how I got mine)

2. Libraries - Where and Which?
Latest Direct x SDK, straight from the MS site. Works wonders with VS 2005 (unsurprisingly)
physics engine (can't recall name atm), awesome free 3d physics engine. Not very useful for shmups, but is very nice to have for certain games.
tools like zlib, ogg vorbis libs - free stuff I can't seem to do without.
- google them if you don't know them

3. IDE - Where and Which?
VS 2005 IDE. Comes with the compiler, works fine. nicely integrated with Direct X

4. Tutorials - Where and Which?
I have a bunch of books I used ages and ages past, like "the absolute beginner's guide to c", "games programming in c", "advanced c++", etc. After knowing the basics, I just google everything I need to know (that's how I got here  Cheesy)
« Last Edit: June 22, 2007, 11:18:05 AM by Korenn »
Offline  
Read July 15, 2007, 05:08:32 AM #8
Helje

Re: C++ Startup Thread

I may be in the minority here, but:

1. Compiler - GCC 4.0 via Xcode

2. Libraries - SDL 1.2 with OpenGL, SDL_image, SDL_ttf

3. IDE - Xcode Developer Tools; free and wonderfully simple

4. Tutorials - Lazy Foo' Productions SDL Tutorials, GameDev.net, iDevGames, and shmup-dev.com Wink
Offline  
Read August 06, 2007, 07:21:48 PM #9
Richard Kain

Re: C++ Startup Thread

These are four very important subjects to address when working with C++. But as far as tutorials, I've always found certain aspects of C++ code sorely lacking.

1. Object Orientation - dividing up a C++ project into manageable files does not come easy. Writing a program as one big, long file is far too confusing. Dividing your project into different objects, which in turn are defined in different files, is the obvious solution. But hardly any tutorials really go in-depth on this, and the ones that do don't do a good job of explaining how to use it in a practical fashion.

2. Basic Game Structure - one of the most bare-bones subjects, but hardly anyone ever touches on it. How do you divide your game up efficiently into obvious "states?" Most basic arcade games have a very obvious default progression. You start at a title screen, possibly watch a little intro animation (that you should be able to skip) and then go into the title menu. From the options there you go into the level, progress through the levels, and eventually win the game. Winning animation sequence, enter your initials, roll credits, cut back to title screen. But I never see tutorials on how to build your game to take advantage of this "state" structure. Everyone is too focused on the little details, and glosses over something so clearly useful.
Offline  
Read August 07, 2007, 07:49:57 AM #10
motorherp

Re: C++ Startup Thread

Surely object orientation makes project file management easy since like you say, each object has its own .h and .cpp file.  By sticking to this rule it becomes very clear cut what code should go where, and where to look when you're after a particular bit of code you've already written.  Try to stick include headers in the cpp rather than the h file where ever possible to reduce link times and the possibility of circular includes.  For example say class A requires a pointer to class B in its decleration (h file), but you only use the class B pointer in class A's definition (cpp file).  In class A's h file you dont need to include class B's file but instead can just declare class B there for the sake of the pointer.  Then you put the class B file include in class A's cpp file where you actualy want to use and manipulate the contents of the Class B pointer.  Eg:

ClassB h file

class B
{
   float m_someData;
   void SomeFunction();
}



Class B cpp file

inlcude "ClassB.h";

void B::SomeFunction()
{
   m_someData += 1.0f;
}



ClassA h file

class A
{
   class B*  m_pB;      // by putting class first you inform the compiler of the existance of class B without having to include (as long as you only use pointers and you cant manipulate that pointer in the h, only declare it)
   void SomeFunction();
}



ClassA cpp file

#include "ClassA.h"
#include "ClassB.h"    // ClassB.h must now be included since we want to manipulate the class B pointer

void A::SomeFunction()
{
   m_pB->m_someData += 1.0f;
}


Anyway, perhaps if you explained exactly what it is you're struggling with as far as file management goes I might be able to hep further since at the moment I'm not sure exactly why you're having problems with it.  Alternatively if you're not sure how to structure your code then try to download some free source somewhere (make sure its from someone reliable since you want good code) and study how that works.  Infact if you want I could always send you some source from one of my projects if you want to study it.

With regards to point 2, this kind of game flow management is usualy best handled as a finite state machine.  Read this for some starting ideas -> http://en.wikipedia.org/wiki/Finite_state_machine


Offline  
Read August 14, 2007, 03:16:45 PM #11
Richard Kain

Re: C++ Startup Thread

Surely object orientation makes project file management easy since like you say, each object has its own .h and .cpp file.  By sticking to this rule it becomes very clear cut what code should go where, and where to look when you're after a particular bit of code you've already written.

With regards to point 2, this kind of game flow management is usualy best handled as a finite state machine.  Read this for some starting ideas -> http://en.wikipedia.org/wiki/Finite_state_machine


Now you see, this is what I was talking about. All of the C++ tutorials that I find completely ignore simply, useful information like this. They might touch on the basic concept, but then they just go right on to the next topic without addressing practical application. Thank you motorherp. That is an excellent description of how to properly handle object-oriented file division in C++. It simplifies the process as much as possible, but still offers practical pointers and guidelines for keeping your code clean and efficient. That's a good tutorial.

As to the finite state machines, I've already read up on those. I was thinking more along the lines of a very basic C++ structure for a barebones game-oriented finite state machine. Perhaps a reusable state-management object. Naturally, that is the lazy way out, hoping to have everything handed to you. (and by "you," I of course mean "me") But a man can dream.

Again, I really appreciate the pointers, motorherp. Very useful, and I fully intend to practice further C++ coding using your suggestions. Perhaps I will actually be able to construct what I've been describing. A basic game-management framework that focuses specifically on low-level game functions.
Offline  
Read October 27, 2011, 07:12:58 PM #12
Lupin

Re: C++ Startup Thread

Its been a while since this thread began.  Has anyone changed to different IDE, Compilers, etc.?  Celebrating the up coming anniversary of this thread, any updates to your answers? 
Offline  
Read October 29, 2011, 11:42:44 PM #13
kdmiller3

Re: C++ Startup Thread

Let's start a fresh new topic instead of reviving a four-year-old thread.  (They call this "necromancy" over at gamedev.net Smiley)
Offline  
Pages: [1]   Go Up
Jump to:  

Page created in 0.141 seconds with 18 queries.