views:

799

answers:

20

So I am starting college very soon as an EE major, but I want to find out if programming is something I would be interesting in studying during college as well. I had an internship this summer that exposed me to a bit of it, but I am still at a very elementary stage.

My question for this community is, would making a game be a bad idea as a way to gain some exposer to programming? I like video games, and I would love to try to make one but I am not entirely sure how much work goes into a game. I would ideally like to make a very dumbed down version of something such as super smash bros (2d, 2 person fighting game with simple boards) but I am not sure how much work something like this is and if I would need to build things like a Physics engine, or if there are pre-equisting open source "game platforms" I would be better off using.

Basically, I want a project but not one that would be too massive or too difficult, and would like to know if a game would fit this description. Also, suggestions of simpler types of games (such as Tower Defense or something) would be appreciated if you think they might be a better idea.

+24  A: 

A game isn't necessarily a bad idea - it's definitely a good idea to start out with something that you are interested in, however you shouldn't underestimate how much effort it will be to make even a relatively simple game.

Can I suggest a Tetris clone as a good first game to make? Tetris is relatively simple, however at the time time it covers a lot of the core concepts (basic programming, the game loop, basic graphics etc...)

Kragen
Agreed - for a beginning programmer, even a simple game can be overwhelming - especially anything having to do with graphics. However, start *VERY* small and work your way up. Start with tic-tac-toe and move your way up.
Wade Williams
I'd say Tetris for a novice would still be too much to start with. Do something really beginner level in your language of choice first. I'd say C# or python so you can leverage XNA or pygame.
Andy_Vulhop
I started programming with a simple 2D 'mario-like' game, after that I did tic-tac-toe and little quiz about movies, learning something (porgramming) by doing something you like (game) is alway the best method to learn. +1
Dominique
Also, the benefits of doing a game is that you tend to already know exactly what it can do. Tic-Tac-Toe is much more strait forward than trying to do say, an address book. Every address book is not the same, while Tic Tac Toe (Asteroids, Tetris, or Gorillas are also good) has a pre-defined end point and feature set.
Rangoric
After I did some simple console-based games I moved onto Tetris - definitely a good one to try. But learn the language first (i.e. write a number of console apps).
Skilldrick
I'd start even easier. I'd try to make my own version of Pong for example. This should be easier than Tetris but still challenging in my opinion.
Octavian Damiean
+14  A: 

It is easy to underestimate the amount of work for a game, especially when you deal with graphics. I would suggest aim for doing either a card game or a board game where the graphics is pretty static.

One thing is for sure, doing a game lets you try out many different fields but you need to be careful cause you could get easily stuck so its best to keep things as simple as possible in the beginning. Don't try to over engineer the design.

It is nicer to have done a simple game that works then being forced to abandon it because it got too complex.

Anders K.
+1 For the advice of a simple game that works than a complex one that doesn't. Note that there are many game libraries out there that even simplify it further to you (it depends on the language. I learned to program by looking then modifying then creating scripts for RPGMaker XP)
Chubas
+1  A: 

Making a game is probably a bit too advanced for your absolute first development project, although it is a worthy goal to work towards and trying to make something after learning the fundamentals of the language you are learning is probably reasonable.

Keep in mind though that this is an extremely common pitfall - Modern games are incredibly labour-intensive and complicated to develop, and even what you may consider a "simple" game is an extremely complex problem for a beginner programmer. As soon as you start considering things like physics engines, you're probably getting a bit too deep for your own good.

Consider something extremely simple to start with - Tower defense is actually a pretty good example - you don't have extremely complicated input, physics, or anything like that to deal with, and you can still come out with a fun game and incorporate some ideas that haven't been tried before.

Ryan Brunner
+1  A: 

Programming a game will give you thorough exposure to many important concepts and techniques in programming - you'll deal with graphics, sound, timing, managing data structures, complex algorithms, usability, a fair deal of math, possibly networking, file I/O, for some games you might consider a database.

However, programming games is harder than it looks, and even a small game requires a lot of effort. Even Tower Defence isn't trivial - after all, you'll have to implement a pathfinding AI.

For a beginner, I'd consider finishing a simple game in a month quite an achievement.

It's also quite hard to get the overall program structure right the first time; you're probably looking at one to three complete rewrites before it really works well.

tdammers
A: 

I think that regardless of whether it's a game or an application that you make for your mate, unless you have a something to focus on, it can be difficult to stay interested.

Personally, I like having little puzzles like this in order to fully understand a new language/tool/etc and think it's a good starting place.

All I would say, is to pick a game that someone else is able to help you with, in case you get to a point whereby you're stuck and need a little assistance.

Brett Rigby
+3  A: 

If you want to make a game you have to take into account the fact that you need to fix the graphics somehow; this is what has kept me from making games since my graphics skills are woefully inadequate...

I would also recommend some kind of text based adventure game (like in the old days):

Walk south

: You find a box

lift box

: You find a cake under the box

eat cake

: A monster appears, it wants the cake

hit monster with box

etc.

You can really get creative and wacky doing something like this.

Just remember: Have fun!

Streamcap
You can find special programming languages for these at ifarchive.org. The most popular language is Inform, although TADS is also heavily used. There are point-and-click systems like Adrift, but although they're very convenient for simple games they won't teach you much useful about programming.
David Thornley
A: 

You could always practice your basics, sorting, searching, data structures, etc. May I also suggest a simple command line game. Maybe a logic sort of game, easy enough to have fun with but also to keep your programming skills fresh.

wfoster
A: 

It's probably not the easiest way to go, but you'll definitely learn a lot. If you're set on game programming, I'd recommend Riemer Grootjan's XNA tutorial for several reasons.

First, I think a managed language like C# would be less frustrating for a beginner to learn. OpenGL or unmanaged C++ is going to be too tough to start with.

Second, his tutorial builds upon itself and starts fairly simple. If you've at least read a basic C# book and learned about classes, objects, and methods you can probably follow along. I was already fluent in C# but new to 3D programming and found his tutorial a really useful resource.

Good luck!

bporter
if I was focusing on a 2d game would this still be recommended?? From what I am reading here the graphics are a huge amount of the work, so I was considering sticking to very simple 2d graphics at first
Maxwell
Graphics are a huge amount of work - but XNA and C# do a lot of the work for you. He goes through sprites (2D graphics) first before getting into more complex 3D graphics - so it hopefully shouldn't be too overwhelming.
bporter
"simple 2d graphics" - simple is a relative term.
sheepsimulator
A: 

It depends on what kind of programming you want to get into. If you want to get into game development, then simple games are the absolute best place to start. If you want to do line of business apps for credit agencies or build websites, then it's less useful, but still good if it holds your interest.

For your absolute first game, I'd suggest a "Guess the Number" game. Make the user imagine a number 1-10, and give the computer 4 guesses, and the user will tell it higher or lower. Your code would always pick the middle of the available range (so, if user picks 2, computer guesses 5, then 3, then 2).

That would get you the most simple concepts without graphics getting in the way at all. From there, pick a game dev. framework (XNA if you want to learn C#, PyGame for python, etc) and start with their tutorials. I haven't done anything with pygame, but I know XNA has a lot of starter kits to show how to do a lot of different simple games.

Andy_Vulhop
Also, did you know there's a stack exchange in beta for game dev?http://gamedev.stackexchange.com/
Andy_Vulhop
+4  A: 

Programming games is always good idea. Why? well you're interested in playing them so that will help you to put some effort in learning. Programming is not a simple thing and requires a good motivator. But you have to start from something "simple", I can add pac-man to the list. For this one you don't even need to use fancy graphics just ascii characters and as somebody said you can learn all the basic constructions for any programming laguage: loops, repetitions, decision, etc.

All that said I have to add, you need to put a lot of hours and desire to learn to become a good programmer.

Mike
+1 Pacman would be a great start. Each ghost is a state machine, could be represented by an object, etc.
Daniel Earwicker
This site is an excellent read for anyone wishing to write a Pacman game: http://home.comcast.net/~jpittman2/pacman/pacmandossier.html
houser2112
A: 

Making a game is a good idea, but (as many of the other responses say) can be very very difficult.

I'd also add that the sort of programming you need to do for a game can often have very little to do with non-games programming - it's not such a big deal for an application to not run at 60 frames per second, but it's a massive problem for a game, and thus you find yourself making little optimisations just to get it running faster.

It can be fun though - I took games programming at university, and I wish I'd kept up my skills since then.

Stephen Orr
+2  A: 

Building a game right off the bat is going to be difficult, especially if it's a 2D platformer.

What you could do, if you are dead set on making a game, is start to learn about the components of a game. Essentially, every game has two major components:

1) Game Engine - Handles user input, sound, rendering output, etc etc 2) Game Logic - The game itself; encompasses enemies, players, game rules, AI, etc etc

I quickly discovered in my endeavours that I rather enjoy working on game logic, but absolutely dread working on a game engine. As such, I use the XNA framework to minimize the amount of boilerplate code I have to write.

If I were you, I would start off simple... learn the different pieces that you need to put together to build a game (AI, polling for input / the game loop, computer graphics, adding sound, etc etc) then try putting them together.

Tetris is a good place to start because it introduces you to a lot of the things you need (sound, input, graphics) without the need for AI. Tic Tac Toe is a good game for learning the concept of minimax (maximize benefit while minimizing cost) and Pac Man is great for learning pathfinding algorithms.

baultista
+1  A: 

When I first started in IT my manager had me write a "Windows Calculator" app which had all the functionality of the windows calculator standard mode.

That was a challenge back then, and meant I didn't have to deal with the graphics much, just simple drag n drop of buttons onto a windows forms.

He also set another guy the task of writing a simple file explorer ala Windows Explorer which was also a challenge to a junior dev and good to learn from.

Either way I would work upto something like a game, learn the languages instructions / features first

e.g.

  • If Statements
  • Switch Statements
  • Loops
  • Reverse Loops
  • Recursion
  • Classes
  • Abstract Classes
  • Interfaces
  • Objects
  • Structs
  • Enumerations
  • Delegates & Events
  • Templates / Generics
  • Memory Allocations and usage

Once you've learnt these instructions / features and are comfortable with applying logic through these instructions then move upto a game.

I also forgot to mention that you should also dedicate some time to learning your way around the development environment, often the development environment will help you to learn and will point you in the right direction if an error occurs.

Most languages support some form of most of the instructions / features listed above, all you'd need to learn is the individual languages syntax.

As someone else said have fun with it, set yourself mini challenges and focus on smaller chunks of functionality and then build them up to the bigger application / game.

Peter
+1  A: 

Not a stupid way to learn at all. ;) Although, as others before me, I would suggest starting off with a more simple game such as Tetris or even a Breakout clone.

Then once you grasp some of the basic game concepts, upgrading to a Smash Bros. clone. :)

I would suggest using C# with XNA. Or if you're into Python, Python with Pygame. Here's a good beginner book, Invent your own games with Python. It's aimed for a younger audience but will work great for newbies too. :)

townsean
The book is free online. :D ...I recently purchased a copy to introduce my younger sister to programming.
townsean
+1  A: 

If you're an EE student, you have probably studied some programming. However, to write a game you need a lot of domain expertise in the game, and domain expertise in writing games.

Writing a game is a good way to learn programming, because you have to put together a lot of concepts and programming constructs to get a game.

I would recommend that you start by modifying an existing game and then eventually write your own game. I suggest that you download the source for Invasion and get it running on your machine. Then fiddle with it to see how the various constructs work. The nice thing about this game is that the file count is very low so browsing code is pretty easy. Also, you don't have to worry about understanding the "game platform" because there is none. I used Invasion when I was working on a system to insert dynamic advertising into video games. (That project eventually morphed into http://www.google.com/ads/games/index.html).

Jay Godse
+1  A: 

I must agree with the commenter who recommended tic-tac-toe. For your first couple projects you would be wise to stay out of graphics entirely. You can always go back and add graphics later once you master the basics. But to start you should focus on simply being able to maintain the game state and basic input and output. Personally I got my start in programming with a game of connect-four which I made in JavaScript.

The benefit to using JavaScript to start off with is you don't need many programming tools to get started in it. And it's relatively easy to create an OK looking page to present your game in. The downside is that it is not a very structured language.

After connect-four I moved on to chess. The benefit to programming a chess engine is that there are a number of free graphical programs (such as winboard) that can integrate with your game to give you a nice interface. However, you don't need to learn graphical programming to get it working.

eoldre
+1  A: 

Game development will definitely introduce you to a lot of code, that's for sure. The hardest part of game development for me is the attention to detail to prevent bugs. If the game is free-form enough like a Smash Bros style game, then there's a lot of fluidity that may cause errors or bugs that you haven't prepared for. A more structured game style like a Tower Defense or board game would make things easier for you. By easier, I mean less gnashing of teeth and cursing the gods.

On my blog, I'm about to (give me a week or so) post a complete walkthrough to a Tower Defense game I've been writing. It'll walk you through the entire design process, talking about the decisions I had to make, the challenges I had to overcome, the inevitable refactoring that comes with the territory of game development, and all the code of the finished product. All of my blog is in C# and .Net, which as an EE you may not use as much as python, C/C++, or assembly. You'll also find other projects like a Minesweeper clone and a Circle Library that may help in your own game development. On my site there's a chat widget to talk to me, stop by anytime and I'll gladly help you out 1 on 1.

Corey Ogburn
+2  A: 

Out of all the projects I've worked on (commercial/non-commercial), making games has used pretty much every feature in the core language I've have used.... in a nutshell, HELL YES learning how to make a game is a great way to get into programming, it will take you very far.

The problem is when people suggest you should read up the following topics before doing any kind of programming:

* If Statements
* Switch Statements
* Loops
* Reverse Loops
* Recursion
* Classes
* Abstract Classes
* Interfaces
* Objects
* Structs
* Enumerations
* Delegates & Events
* Templates / Generics
* Memory Allocations and usage

Of course, basic concepts such as 'If statements, Switch, loops' and a little theory on Object Oriented Programming should be undertaken, but other topics are utterly meaningless until you actually have the need for it.

For example, some people would expect you to read everything on 'Delegates'... no matter how much I read up on them I just couldn't understand why they were needed.

One day I couldn't work out how to pass on a method in my code... after researching Google, the answer was to use Delegates, it immediately made sense because it did exactly what I needed it to do, all the explanations made sense because I knew what I needed my code to do.

By all means read up on the advance topics, but don't get disconcerted if you cannot understand a particular concept.... it will come to you :)

Using the above list immerse yourself in these topics first and then start coding, you'll naturally come across the other advance topics:

* Data Types (string, int, double, char)
* If Statements
* Switch Statements
* Loops
* Object Orientated Theory (Classes, Interfaces)

As you progress more into making your game, you'll naturally cover the other topics.

HTH

Dal
Thomas
A: 

First of all I would advice you to consider what language you'd like to program with. My advice is either vb or c# (.NET languages) or java. Because those are relatively easy to use graphics with, and don't require too much low-level knowledge.. About simple games... I would go with just about any board/card game you like (I agree with all others that graphics can be VERY challenging so don't go too far with that..). I really think you should start with something that interest you, and I also think that estimating how much time and effort it would take is very hard, but I can almost certainly tell you that you (and most programmers, inculding myself) will under estimate it (-:. And one last thing - programming a game as far as best practices and programming skill is concerned are at least as challenging as writing any other computer program. At least. So yes, starting with a game is a good idea.

Hope this was helpful to you. Best of luck!

Oren A
A: 

From my personal experience: Definitely. I found my way into KDE development by reading into the sources of other KDE games, and hacking together a Bejeweled clone (which became KDiamond).

But then again, making a game requires you to already have some profound skills in the programming language you want to use. You will have to work with a big number of different libraries: e. g. graphics, sound, input handling, file access (for savegames and configuration), possibly even networking.

And I have to agree that you should not underestimate the work that is necessary to create a game. For example, in Palapeli, a jigsaw puzzle game which I am also working on, only a fourth of the code is really dealing with moving the pieces around. About the half is boring and complicated image processing algorithms which create the jigsaw pieces with 3D impressions and shadows and stuff. The last fourth is the user interface (menus, toolbars, configuration dialogs) and file management.

Stefan Majewsky