Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411423 Posts in 69363 Topics- by 58416 Members - Latest Member: JamesAGreen

April 19, 2024, 02:28:19 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Diary of a would-be indie dev (Part 1)
Pages: [1]
Print
Author Topic: Diary of a would-be indie dev (Part 1)  (Read 8405 times)
Gravious
Level 2
**


"Swedish meatballs"


View Profile WWW
« on: September 20, 2007, 04:20:53 PM »

This is part 1 of an ongoing series of articles.

Part 1 - "Choosing a language, additional libraries and development environments."
Part 2 - "The Wall."
Part 3 - "Design and distillation."

Part 1 - "Choosing a language, additional libraries and development environments."

Hi, my name is Leigh.  I've already posted a hello on 'The Obligatory Introduce Yourself Thread' - Its a riveting read and contains a spiffy picture of me as well!  At the bottom of the post i talk about wanting to be a game programmer and starting to write my own game so for no other reason than to punish you all, I've decided to document this effort and make it available for all to read.

From time to time, probably on a weekly basis, I'll drop by and write up a chunk of whats been going on since the last time i was here, I'm not sure what kind of detail I'm going to go into but I'll start from the beginning and provide links to anything interesting I've learned or used.  Its important to note though that while I'm a complete C++ and game programming novice (read - never ever done it before,) i am a commercial PHP programmer and already have a pretty good grasp of many of the fundamentals of programming in general.

Before i even started coding, there were a bunch of decisions i had to make; 

  • Which language should i use?
  • How does that language lend itself to game development?
  • Do i want to develop with cross-platform independence in mind?
  • What tools are available for my chosen language?

Realistically, I'd made my mind up already.  Being mocked by certain friends that PHP wasn't a real language (when clearly, it is  Angry) meant the only acceptable choice was C++.   My reasoning was infallible, real games were made in C++, hell, Windows was written in C++ (maybe my logic was faltering now..) but generally, its accepted C++ is man enough for pretty much anything.

I've found there are many considerations even when you've chosen your language.  C++ is 28 years old, nearly as old as me, certainly at the time it was created there were barely displays able to represent graphical output let alone machines powerful enough to have games made and run in the language, it is infact a very generalised solution that specialises in very little and requires any number and combination of external libraries to extend its abilities, making it suitable for game development.

My next choice was which API should i use with C++?

This choice seems to be subjective, certainly there are proponents for all of the available choices and most if not all allow the full development of games with varying degrees of difficulty.  From my research, the main contenders are;


Commercial development treats DirectX as the norm for Windows games, it is an all-in-one solution that provides advanced 2D and 3D graphic capabilities, sound, networking and input handling and thanks to it being the standard, has plenty of in-depth documentation.  I decided that i was going to be hardcore and dive straight into C++ with DirectX and shortly after trying for a while, i gave up and re-evaluated my options.  DirectX is a pig for beginners.

The other commercially recognised API is OpenGL, this is however useless by itself and needs to be used with another API, SDL seems the best fit for starters, but OpenGL is again quite complex and not recommended for first-timers.  It's worth noting that OpenGL unlike DirectX is cross-platform and has been ported to many platforms.  Careful adherence to code standards and a mind for the differences in target platforms will make porting your code to another operating system or computer platform entirely possible.

One of the interesting possibilities with OpenGL (and i guess DirectX,) is that you can build a game engine that uses polygons and textures but on a 2d plane, this has the advantage of flexibility, reducing possible restraints of a tile-based 2d engine and allowing for treatment of the graphics with shaders and lighting techniques available to 3D games.

I've included Allegro though ultimately i chose not to use it, as like SDL, it is a complete set of libraries that will enable full development of any type of game you might want to make.  Allegro has plenty of documentation and is as learner friendly as you'll get with C++.

I chose SDL as it is cross-platform, free and at least in Windows, it works as an abstraction layer for DirectX7 (which means it'll work on a wide range of hardware with acceleration,) it has plenty of decent tutorials and documentation is easy to understand.  A nice bonus is that when you get more knowledgeable in programming, you can use SDL as the companion API for OpenGL.

With my language and its API decided upon, the next step was setting up a programming environment.

I actually work in a production environment thats far more complex as it turns out, than C++.  It really is a case of 'What you don't know seems bloody complex.' But in fact, its not.

First things first, C++ is a compiled language.  You type your code into a text editor (which could even be Notepad or vi if you liked,) and its then compiled into an executable file that can be run.  Most of the time, your going to want an IDE, an Integrated Development Environment because while you can use Notepad or vi and compile your source code on the command line, its hard for beginners and pointless because there are any number of IDEs that do all the hard work for you.

In work, i use Eclipse, more specifically, PHPeclipse, a plugin for Eclipse that provides a tailored environment for PHP.  Eclipse is AWESOME and i really wanted to use it for C++, but though there is a C++ plugin called Eclipse CDT, it lacks many of the smaller touches of genius present in the PHP plugin, and is as it turns out, a pig to configure properly.

Other options include;


There are of course others, but these were the ones I've looked at.  I ruled out all but Visual C++ 2005 Express Edition because there are slight differences in the implementation of the different C++ standards, and while Microsoft's policy of 'Embrace and extend' has resulted in the majority of alterations to the C++ standard, it has an environment that 'just works' and also has massive online documentation and support.

It is important to mention that there are considerable limitations to the Express Edition of Visual C++, they are listed HERE, though based on my currently limited knowledge and from talking to others, i do not believe this precludes complete game development.

From my experiences in handling a massive codebase (18mb of source code over 1557 PHP files) with up to 10 people working on the same thing at the same time, i've become a big fan of version control software.  From what i have gathered in various forums, so are many game developers.  We use SVN at work and we interface with it through a windows shell app called TortoiseSVN, its perfectly suited to C++ development and i haven't considered anything else though as usual, there are a full set of alternatives.

Subversion allows you to save 'snapshots' of your code at any point in time, comment on that snapshot, revert to earlier snapshots and browse previous versions of your code.  This is great for when you've broken something and can't fix it, just revert to a previous state.  Think of it like Windows System Restore feature, but for your code.

From the programming side of things, thats basically it, you can start up with that, and thats where I'll pick up in my next installment.

For clarity, i present the relevant links below for the environment i have setup;


For those who want to actually try coding, here is a decent C++/SDL tutorial site that has help for Visual C++ 2003 (which is pretty much the same as 2005)

I welcome comments, i may not be able to answer questions if they are too technical (just yet!) and in what i suspect will become a tradition, please accept this picture of an amusing cat as a token of my love;


« Last Edit: October 07, 2007, 05:49:05 AM by Gravious » Logged

One day I'll think about doing something to stop procrastinating.
PoV
Level 5
*****


Click on the eye and something might happen..maybe


View Profile WWW
« Reply #1 on: September 20, 2007, 04:29:22 PM »

I accept your feline force field.  May what it stands for bring you luck and good fortune in your development efforts.

I'm not sure if you want comments or not, but I'll use this to find out.
Logged

Mike Kasprzak | Sykhronics Entertainment - Smiles (HD), PuffBOMB, towlr, Ludum Dare - Blog
BMcC
Senior Editor, Hero,
Level 10
*****

Bee Mixsy


View Profile WWW
« Reply #2 on: September 20, 2007, 04:29:48 PM »

Very cool.  This could become quite a valuable resource as it develops...  Stick to it, man!

Good luck.  Smiley
Logged

Gravious
Level 2
**


"Swedish meatballs"


View Profile WWW
« Reply #3 on: September 20, 2007, 04:52:06 PM »

I'm not sure if you want comments or not, but I'll use this to find out.

I'm going to put each entry in its own topic with an index at the top of each one, I'd love comments, so please do let me know what you think!
Logged

One day I'll think about doing something to stop procrastinating.
Alec
Level 10
*****



View Profile WWW
« Reply #4 on: September 20, 2007, 04:57:43 PM »

If you keep this up the whole way, it would become an awesome guide for people starting out. Sweet! Smiley
Logged

Derek
Bastich
Administrator
Level 10
******



View Profile WWW
« Reply #5 on: September 20, 2007, 08:30:11 PM »

Very much looking forward to this! Grin
Logged
Robotacon
Pixelhead
Level 3
******


Story mode


View Profile
« Reply #6 on: September 21, 2007, 03:51:22 AM »

Cool, you've got the exact same setup that I use!
looking forward to a progress report.
Logged
Headmade
Level 0
***



View Profile
« Reply #7 on: September 21, 2007, 12:04:07 PM »

This is really great. I hope you keep this up (though I doubt you will keep up the neckbreaking pace of one post per week for long), because this could eventually become a great resource for newcomers.

You really explained your choices very well exept one point. Why did you pick Visual C++ over the others?
Logged
Guert
Level 10
*****



View Profile WWW
« Reply #8 on: September 21, 2007, 04:06:43 PM »

I also support you! This has the potential of becoming a great must read! Good idea!
Logged

Gravious
Level 2
**


"Swedish meatballs"


View Profile WWW
« Reply #9 on: September 22, 2007, 10:33:04 AM »

You really explained your choices very well exept one point. Why did you pick Visual C++ over the others?

I think ultimately, it came down to Visual C++ being easier to get up and running while having the weight of Microsoft behind it.

To be honest, when I've become more comfortable with the whole process, i may switch to Eclipse CDT as i prefer the Eclipse GUI.  This will of course be documented Smiley
Logged

One day I'll think about doing something to stop procrastinating.
Ryan
Level 1
*



View Profile
« Reply #10 on: September 24, 2007, 02:48:36 PM »

Awesome idea man! I actually started to do this myself when I began about a year or two ago, thinking how much it'd help others, but I ended up not having the patience to document everything. I commend you and wish you the best of luck!

Like others have said, this will be a great resource for newbies once it's finished. Keep it up! Smiley
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic