Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Programming Technology Entertainment Games

Crash Course in Game Programming? 142

Lullabye_Muse asks: "I want to write a game program for an independent research class I am taking at my High School. I have until June to deliver a final product or a good demo. I'm somewhat new to programming and will be doing work at home, and at school (Linux and Windows, so cross platform OSS is best). What is the best language to learn to code games in, and do you have suggestions for any useful sites, on game programming?"
This discussion has been archived. No new comments can be posted.

Crash Course in Game Programming?

Comments Filter:
  • New To Games? (Score:5, Insightful)

    by johnkoer ( 163434 ) <(moc.oohay) (ta) (reoknhoj)> on Friday January 28, 2005 @12:16PM (#11504836) Homepage Journal
    Since you said you are new to programming, you might want to consider taking on an OSS game that is already out there and modifying it to suit your purpose. It will help you learn a lot of the basics of programming, but it will also give a great starting point.

    If you are dead set on writing an entire game yourself, best of luck to you. Even for an experienced programmer, throwing together a game (or even a demo) in three - four months is a feat.
    • Re:New To Games? (Score:2, Informative)

      by abradsn ( 542213 )
      I agree. And to add to this comment, if you are still dead set on writing a game, use the highest level langauge you can find. Since you are new to programming, you will want to use Visual Basic, or C#. They are the easiest to learn in the shortest amount of time. Keep in mind that a computer programming course in college is a few months long. You will be hard pressed as it is just to learn the programming skills necessary to write a game. The best advice on a short project is to let performance fly t
      • I agree with the parent about C# -- if you're looking for helpful links, one you might be interested in is RealmForge [xeonxstudios.com].
        They're also on Sourceforge [sourceforge.net].

        It's an open-source development framework for .Net/Mono. Written in C#, uses the open-source Axiom engine, and it's LGPL (can be used for commercial games without open-sourcing everything). 95% of games are written in XML with the built-in editor.

        Keep in mind the engine is still in development, and isn't quite ready for prime-time yet, but as a contributor t

        • Re:New To Games? (Score:2, Informative)

          by iocat ( 572367 )
          No offense, but I say screw that -- get a GBA emulator and development environment at GBA dev [gbadev.org], and you can work cross-platform with all F/OSS on some hardware that has lots of easy graphic capabilities and input methods built in. Plus there are tons of well commented demo apps that will get you up and started in a flash. PCs are too complex for a first project -- GBAs are more limited and easier to get your head around.
          • Failing that, try Dark BASIC [thegamecreators.com] -- a game orientated BASIC you can pick up at CompUSA. It is extremely high level but still lets you access all the 3D features of DirectX. It's about $50 and probably Windows only. There is TONS of well commented source for you to play around with too.
    • Re:New To Games? (Score:4, Insightful)

      by _pruegel_ ( 581143 ) on Friday January 28, 2005 @01:28PM (#11505819)
      I disagree. I believe modifying most OSS games out there requires more knowledge and most importantly more time and effort than writing a simple game from ground up. Those games might have huge code bases and usually there is little documentation especially for starters.
      The author of this "Ask Slashdot" did not mention "First Person Shooter" or even 3D at all. And there are games which are very simple but still fun. Games like Pong, Mine Sweeper, Snake and many more can each be done in a couple of hours. There are even programming languages made for simple game development although I would prefer a "real" language like Java or Python. I once wrote a small game to learn Tcl/Tk and that was fun and I did it in less then a day.
      • Re:New To Games? (Score:3, Informative)

        by JohnFluxx ( 413620 )
        I second the disagreement.

        For my degree project I took freecraft and made it 3D and make it client-server. Looked nice.
        But I spent most of my time fighting the code. Not because it was particulary bad or anything, but because I had to convert it all over to C++ compatible from C (there are incompatibilities. I hit every one I'm sure), fight the Makefile's (at the time they had their own custom make system), fight event-loops (freecraft and the graphical engine), and so on.

        It turned out looking pretty n
  • I don't know much, but I know that you'd be best off using a pre-existing game engine so that you could keep development short. Sounds like a fun project. What kind of game are you making?
    • Thats a good question, it depends if you are trying to demonstrate some kind of algorithm, user interface etc.. what it is will affect the best way to do it.
      The poster doesnt say hes doing a comp sci course so the other thing I would say is spend some time learning software development principles such as proper design, commenting, documentation, versioning and such things. These things are helpful even when you are the only developer.
  • talk to this guy [slashdot.org], seems to think he's the greatest game designer of all time.talk to
  • by Anonymous Coward
    to code a game in is the one you already know. Don't bother trying to learn some new fancy languange if you know BASIC right now. Concentrate on the results. You can create a good looking, fun game with BASIC. It just won't be powerful enough to make the next Doom or Half Life.
    • this is dead on!

      in, like, 7th grade i wrote a fantastic game based on "galaga" in quick basic 7.1 in a matter of weeks! basic is great for crappy little games!

      with visual studio .net, you can prolly pretty easily toss together a very visually pleasing directx-based game in 3-4 months. heck, you could do it in a week or so if you knew what you were doin. maybe two or three if you only have a little background in programming.

  • SDL Graphics library (Score:5, Informative)

    by (trb001) ( 224998 ) on Friday January 28, 2005 @12:18PM (#11504863) Homepage
    Languages aside, SDL (Simple Directmedia Layer) [libsdl.org] is a great library for graphics/sound/network programming. Simple, easy to learn, cross platform. For a class project, it should do the trick.

    I'd suggest C++ for programming languages, but that's probably just because it's what I've used for years.

    --trb
    • you suggest C++ with good reason, next to Assembler; IMHO it's one of the best languages for game programming. Granted game programming language pluses are speed and granular level control, at the sacrifice of user friendliness.

      Then again if you're programming for a deadline project, maybe a simpler project coded in a higher up language, If you're a C++ programmer and using Windows, think C#, all the syntax none of the headaches though a bit slower since you're compiling to IL. If you're in a *nix envi
  • Easy (Score:3, Informative)

    by Apreche ( 239272 ) on Friday January 28, 2005 @12:18PM (#11504867) Homepage Journal
    Since you are doing this in high school, and want it cross platform, it obviously doesn't have to be a high performance 3D super game of awesome. So make it in java.

    The design pattern for most simple java games is model view controller. You create an object oriented game model with map, player, item classes etc. Then you create a view, or the gui that looks at this game model and translates the data into graphics or text on the screen. Then the controller portion interprets player input and modifies the game model accordingly.

    This is a very good pattern to follow for games, especially for research projects. This is because the game itself usually isn't the research, but some underlying CS principle or algorithm. And this makes very simple cross platform games to which you can attach or embed your real research very easily.

    You can also follow this same approach with python, or ruby or even C++. Python might even be a better choice since it might beat java in performance and is used quite often in the game industry.
    • i agree completely. i teach the ap comp sci class at my school, and though we're preparing for the ap exam, we're spending the second semester really digging into the 2D api, sockets and threads. i want them to code some cool things, really use java's oop features, so by the time they take the ap exam, it'll be child's play. the guy before me who taught it last year (he's since left for a new HS) was a hardwrae guy, taught the cisco/A+ classes, and was about a day ahead of the class. one of my students w
  • Get Python + Pygame (Score:5, Informative)

    by fredrikj ( 629833 ) * on Friday January 28, 2005 @12:19PM (#11504885) Homepage
    You should definitely get Python [python.org] and Pygame [pygame.org]. Python is both easy to learn and more powerful than most languages. Better yet, there are plenty of example games [pygame.org] to study. If you want to do 3D, also get PyOpenGL [sourceforge.net], and get the started with the NeHe tutorials [gamedev.net] (Python code available).

    The downside with Python is that it can be slow (a fact that can be remedied to some degree, but not entirely, by also installing Psyco [sourceforge.net]). Fortunately, the slowness doesn't matter (unless your aim is to compete with the next id Software engine). I've written a simple engine for a 2D platformer in Python myself, and even with a game logic and collision detection, 90% of the processor time is spent blitting the graphics to the screen. Since Pygame (written in C) does the rendering, using C++ for your game code won't provide any big advantage.

    Good luck!
    • by fredrikj ( 629833 ) *
      To clarify, the 10% of processor time I got for my game code was enough to do what I wanted. If you use OpenGL, which uses the graphics processor for rendering, you'll instead get 90% of the processor time. That way there will be a bigger relative advantage for C++, but it'll also be even more likely that you'll get enough time to do what you want in Python.
    • If you are going to do 3D game programming, I would also suggest you look at PyOgre. Ogre [ogre3d.org] is a powerful open source graphics engine written in C++. You can download the python bindings for it here [idleengineer.net]. Download it and check out the demos that come with it (the demos are placed in you python directory in a folder called ogredemo).

      Linux bindings are not ready yet, but they shouldn't be too far off into the future. You should check the the API Reference and Manual for most starting information, and use the o
    • by neura ( 675378 )

      If you want to do something simple and don't know how to program at all, this is definitely the way to go.

      Python is not only easy to learn, it's a great starting language. (enforces proper formatting, doesn't use crazy things like ; line endings ;)

      Python.org Beginner's Guide [python.org]
      Dive Into Python [diveintopython.org] (free on-line book, well written IMO)
      and of course the http://pygame.org/ [pygame.org] which the parent poster already said.

      I would NOT suggest using PyOpenGL if you're new to programming, it's an unnecessary layer of compl

    • Which method did you use for the blitting? I found that calling pygame.display.update() with only the dirty areas of the screen was quite fast (I was hitting >2000 fps in a Pong game [ucr.edu] I wrote with some friends). However, if you're dealing with scrolling backgrounds, there isn't really a way around blitting the whole screen often.

      I didn't find Psyco very helpful, mostly because it didn't play nicely with the profile module.

      Anyway, overall, I'd rate Python+pygame very highly. It's really easy to us

      • I needed scrolling, so I had to blit the whole screen. Got around ~150 fps in 320x200, which was good enough.

        If you want scrolling graphics with a higher resolution though, OpenGL is pretty much the only option.
    • And game programming in Python is really easy using Alice [alice.org].
  • by Grygonos ( 848602 ) on Friday January 28, 2005 @12:20PM (#11504895)
    If you're new to programming, and actually want to code this yourself, it's going to need to be a simply game with little to no graphics. Implementing a OpenGL game is NO trivial task. A game I did in Java was the simple squares game where the object is to arrange the pieces like so .. 1 2 3 4 5 6 7 8 * So I wrote a Java app that would mix up the squares like so 4 7 2 * 1 8 6 5 3 and allow you to move the pieces around via the *blank* square. This still wasn't trivial, especially for someone new to Java, much less programming in general. Not trying to disparrage your efforts, but being new to coding is probably your biggest disadvantage.
  • by madaxe42 ( 690151 ) on Friday January 28, 2005 @12:20PM (#11504900) Homepage
    We used to program games in Basic, on BBC Micros! First game I ever wrote was a donkey kong clone, and a poor one at that - about 1500 lines of code, max.

    Also, back in my day, we had to burn our feet as fuel, we were so poor. And we had no monitors. And we only had one keyed morse-code based keyboards. Bah!
    • We used to program games in Basic, on BBC Micros! First game I ever wrote was a donkey kong clone, and a poor one at that - about 1500 lines of code, max.

      You were lucky! We had to program in 6502 machine code, using a non-relocatable assembler, in under 32K, and save onto tape!

      (Although, this was peanuts compared to the trials faced by Jeremy Smith and Peter Irvin, programmers of the best ever BBC game, Exile [clara.net]...)

      (I don't want to know about punchcards....)

    • And we only had one keyed morse-code based keyboards.

      There's one of those connected to my Macintosh.
    • We used to program games in Basic, on BBC Micros!
      One of my first "real" programs I wrote in middle school was a doofy little Trek-themed side-scrolling shooter on a TI/99-4a. 16K of RAM + the extended BASIC cartridge, baby! (I say Trek themed... the player's ship was a vaguely Enterprise-shaped blob, if you used your imagination. There's a limit to what you can do with a couple of 8x8 pixel sprites.
  • Try blender (Score:5, Informative)

    by orasio ( 188021 ) on Friday January 28, 2005 @12:22PM (#11504923) Homepage
    http://www.blender3d.org/ [blender3d.org]
    http://www.blender3d.org/cms/Game_Blender.365.0.ht ml [blender3d.org]

    It's a 3d design package, that gives you a game engine, so you could have the graphics part solved, and can worry just about the actual game. I believe you can program for it with python.
    It works on MSWindows, GNU/Linux, and other platforms, and it can generate .EXE or web 3d games viewable with its own (small) plugin.
  • PyGame [pygame.org] is a great starting point. I use C++ myself.
  • by Anonymous Coward
    I'm interested into become a multibillionaire. I've already brought a few grand to my high school project but I'm willing to learn more as to how to become a billionaire. I'm very economically gifted because I read the cover of Adam Smith's "The Wealth of Nations" by accident. Could you please give me a few good sites and perhaps hints?
  • 2D or 3D? (Or text or something?) Are you looking to learn basic programming, etc., as would be necessary for a 2D or text game, or are you looking to learn all that plus a 3D api? The answer is different for the two cases.
  • If you're starting from scratch, so to speak, consider using perl or python to create a text based game, I'm biased towards adventure\rpg type text games, but you could also make a more arcadish style game using ascii characters.

    It may not seem as sexy as creating an awesome 3d something or other - but you'll have learned a lot if you can make a game that allows for some of the following:
    1. users can create a character, which they can save and load
    2. the game keeps an inventory of objects
    3. users can in
  • 5 months isn't a terribly long time to learn how to program a game. Java is definately the cross platform language to use. Not the fastest in the world, but you're probably not going to be using pixel shaders 2.0 in your first game anyways. But using Java with eclipse or netBeans is probably the best way to go.
  • by Prien715 ( 251944 ) <agnosticpope@gmail. c o m> on Friday January 28, 2005 @12:31PM (#11505035) Journal
    My suggestion would be Java, simply because the graphics libraries are pretty decent and it's not hard to write a decent GUI. Additionally, it's cross-platform and would probably help you in the real world later.

    But the real question is, how much experience do you have currently? I started programming in HS by doing games on those little calculators (TI-81 to 85 completely self-taught) and enjoyed the experience so much I decided to do CS in college (graduated last year). If I were in your shoes, you may want to think small. Many of the early video games were text-based, many made by one person. Nowadays due to complication, you need teams. So it may not be a bad idea to write something simple and textbased in whatever language. Text-based doesn't need to mean uncomplicated or compromised gameplay; chess, othello, hearts, and dungeon-crawlers were all very popular and I still know people who prefer these over newer games.
    • No offense to the parent poster, but coding a few text-based games like othello, hearts, etc. is not going to get you a job in the industry (unless your othello uses some advanced algorithm that always wins and you can demonstrate why).

      I would suggest the original poster hang out game development websites (use google, search for gamedev, others) and try to learn all he can there first. Subscribe to Game Developer's Magazine.
      • I'm somewhat new to programming - from OP

        He is not going to be able to code a FPS as a high school student with beginner or intermediate level programming skills. The games suggested by the grandparent probably would not be sufficient by themselves for an independant study, but a package of 6 - 10 of these small games written in a very clean, creative, or 3D interface would probably be received well. Especially if the package was written very modular where plugins and addition games were easily integra
  • Andre Lamothe (Score:2, Interesting)

    by vasqzr ( 619165 )

    Buy a couple of his books. You can find them dirt cheap at discount book stores or eBay.

    If you want to go cross-platform, pick up his Java book. You could be writing primitive games in a week.

  • Game sites (Score:5, Informative)

    by magic ( 19621 ) on Friday January 28, 2005 @12:32PM (#11505051) Homepage
    Check out the community sites garagegames.com, flipcode.org, and gamedev.org to meet other people in similar situations. The forums are really good for getting quick answers to beginner questions.

    -m
    • Re:Game sites (Score:5, Informative)

      by vasqzr ( 619165 ) <vasqzr@@@netscape...net> on Friday January 28, 2005 @12:58PM (#11505392)

      Don't forget http://www.gamasutra.com/ [gamasutra.com] and the PCGPE, even if it's older than dirt.
    • To piggyback, Torque uses a modified version of C scripting, which might be an overly tall order for a few months' project. I might recommend getting a book called Game Programming for Teens [amazon.com] and make whatever simple game you want. It uses Blitz Basic which is simple and straightforward. A nice place to start.

      If however you wanted to abandon the cross-platform requirement, use a 3D-capable presentations program like Liquid Media [skunklabs.cc], which also handles variables and J# scripting, with built-in collision detect

    • If you want to do 3D graphics,, nehe.gamedev.net is a fun place to start. I wouldn't reccomend trying to do a huge first person shooter, but you might want to do a 3D graphics demo. If you use an existing 3ds loader library, and 3DS models from somewhere like www.3dcafe.com, you can have a simple 3D first person walk around world with lighting and textures fairly easily. Things like optimisations so your world can be bigger than your RAM, shadows, collision detection, animated enemy models, AI for enemie
  • SDL, C and Pygame (Score:5, Informative)

    by Electrum ( 94638 ) <david@acz.org> on Friday January 28, 2005 @12:32PM (#11505053) Homepage
    Without a doubt, Simple Directmedia Layer (SDL) [libsdl.org] is the best platform for writing cross platform games. It provides a very clean abstraction layer to the high performance APIs (DirectX, etc.) available on each platform. Many people who code only for Windows use it since the API is a lot nicer than the COM based DirectX API. A number of commercial games have been ported to Linux using SDL.

    For serious game programming, you need to learn C or C++. I would guess that 99% of all commercial games for the PC are written in mostly C or C++. This doesn't mean you need to write all of your code in a low level language. Even the original Quake used an interpreted language (QuakeC) for the game logic. But almost no language other than C or C++ will provide the speed or memory usage necessary for most commercial games.

    If you'd rather concentrate on writing your game rather than learning C, try Python [python.org] with Pygame [pygame.org]. Pygame is a Python binding to SDL. It is fairly fast since all the low level graphics stuff is done using SDL. Certain things will be slower in Python (collision detection, physics, etc.) but most code isn't speed critical anyway. Some things will be harder in Python since it's easier to manipulate bytes and bits in C.

    Also check out PyOpenGL [sourceforge.net] if you want to learn OpenGL. It can be used in conjunction with Pygame. I used this when I was learning OpenGL and it's quite nice. The API is almost exactly like the C based API, but it is easier to use. At least one of the popular OpenGL tutorials has been ported to PyOpenGL.
  • Personally, I started with LogoWriter [iprolink.ch] (though not in French, as depicted on this page).

    Then again, I'm old now, so maybe it's not the best example. ;)
  • You have to take into account the game content. So if you want a graphical game you will need an artist; if it's 3d you will also need a modeler. If the game you want is simple enough, you can do everything yourself, but be aware of your time constraints. Chose a language you are familiar with and keep in mind that, depending on your (class) requirements, you can find (search sourceforge) a lot of useful third-party libraries that you can build upon.
  • Flash (Score:1, Interesting)

    by Anonymous Coward
    The easiest and most rapid way is with Flash. Loads of major stuff (importing sprites/moving sprites/collision detection) is taken care of. The langiage (actionscript) is very similar to Javascript. There are millions of easy tutorials/samples online to teach you the basics. Plus swf's are cross platform.

    It's not the most powerful tool for making games, but its definitely one of the most rapid.
    • Re:Flash (Score:5, Interesting)

      by pezpunk ( 205653 ) on Friday January 28, 2005 @01:36PM (#11505936) Homepage
      it's funny, but you'll probably get flamed or modded to oblivion just for posting about the only reasonable solution to his conundrum. i seriously doubt this kid is going to learn the Java API and throw together something on the scale most of these people are talking about in the 3 months or so of after-school time he has to work with.

      Flash is a great medium for 2D games. the graphics are drag and drop, and the actionscripting is a perfect introduction to handling the logic associated with managing a game.

      but, this being slashdot, anything mentioning Flash in a positive light will probably get modded downward and derided by the community.
        1. Flash costs money.
        2. Most people here seemed to be approaching it from the "programming" angle, and not the "create something useful" angle.

        I don't think Flash is the right place to start if he really wants to learn how to program games. If he wants to design a game, then Flash is an excellent place to start.

        To be honest, the first thing you need to learn when writing a game is how to program first. I created a simple Asteriods game ages ago (in Java 1.0, in about a month :P), but it was before I und

    • Re:Flash (Score:2, Interesting)

      by Loacher ( 816765 )
      I third your opinion.

      Flash is easy if you have no experience, and there are lots of popular flash games. One of my favourite is curveball (just google it), not to mention yeti games.

      I made my first flash game some time ago, and it is still a challenge to play. Took me only a couple of weeks, based mostly on the excelent tutorials at kirupa (google it).

      And in my limited experience, actionscript is a great gateway language. At first, I found it really easy to do very simple stuff using the Flash GUI.

      Soon
  • Many games provide you with the tools to build new levels and even modify the game out of recognition. I've done a fair amount of work-related coding and mapping using the Unreal engines and it's pretty easy to pick up, with a lot of resources online. Unrealwiki [beyondunreal.com] and UDN [epicgames.com] are good places to start. You don't even need to buy the game, as they have released a free cut down version [epicgames.com] for exactly your kind of project. This has the advantage of not having tons of someone elses code in it so it's easier to get start
    • > using the Unreal engines

      Note: do NOT turn a map of your high school filled with your favorite teachers into an Unreal shoot-em-up. You will end up spending your suspension time in mandatory therapy.

  • by jjshoe ( 410772 )
    Everyone seems to suggest it would be hard to just jump in. I guess this all depends on your knowledge of programming and logic in general.

    I do agree with starting simple. Let's think tic tac toe. The gui would consist of a frame with nine buttons. Each button would call the same method passing in a variable for which player the turn currently belongs to. The gui would then be re-packed to screen with the button now holding an x or o depending on who clicked.

    How do you keep track of the logic and actualy
  • Game Blender (Score:2, Insightful)

    by manjunaths ( 83313 )
    If you are new to programming then don't program, as simple as that. Or in this case program as little as possible. So use Game blender http://www.blender.org/ [blender.org] download the blender game demos, and check them out. You can get up to speed in days, also the logic is scripted in python, which is easy to learn. You can get lots of help on the web, on IRC, irc.freenode.net, #gameblender and finally you can get lots of premade scripts/blender files for things like fps (first person shooter) motion etc.,
    Keep it sim
  • Good Links (Score:2, Informative)

    by bios10h ( 323061 )
    Disclaimer: it is my website. I'm not plugging my website's links collection; I just think it might be useful to starting developers. I have a pretty collection of websites useful for game programmers.

    Click here [bios10h.net] and under 'Game Development'...

    I highly recommend FlipCode [flipcode.com] and GameDev.net [gamedev.net] for game-programming-related content. They have tons of stuff for beginners.

    With the information you provided, it is pretty hard to direct you to *the* website you need because we don't know if you wanna do 3D or 2D, Ogl
  • by _xeno_ ( 155264 ) on Friday January 28, 2005 @01:03PM (#11505479) Homepage Journal

    You need to ask yourself one thing before starting to learn to program: Do you want to program games, or just make games? The two are different.

    A lot of gamers wind up deciding "hey, I want to program video games!" at some point, without realizing that what they really want to do is make games. If you don't know anything about programming, then you should start by learning the basics of programming and forget making video games for a while. You need to understand the basics first, before you can start doing anything complicated.

    If you really do decide to make video games, I'd highly suggest making a couple of really simple games first. Something like hangman, where you just take a list of words and make the user enter letters until they "guess" it. This will teach you the basics of keyboard input and graphical display without having to worry too much about speed or game mechanics.

    I'd suggest starting with Java [sun.com] too - maybe grab Eclipse [eclipse.org] as your IDE, or just use a simple text editor [jedit.org]. This solves the "cross-platform" part, and as long as you understand that you won't be creating Quake in it, you shouldn't be too disappointed. (You could, of course, also try using Mozilla [xenoveritas.org].) It's similar enough to C and C++ that you'll should be able to pick up those if later you wind up making a game in C.

    But based on your post, I'd suggest learning more about how to program in general first. Take some classes, if you can. Learn the basics. Learn about basic data structures. This will give you the ground-work you need to create a game, as well as help you determine if programming is really for you.

  • There's been about 100 of high schoolers looking to do their game IS project, and asked questions. The advice is fairly sound.
  • Don't set your sights too high. Try to keep yourself in a position where you can hand your assignment in at any time.

    Tetris is often recommended as a first game because it is fairly simple yet it covers most of the hard parts about writing a game. Once you have it working put in an AI that trys to choose the best/worse piece to fall next.

    Don't overlook modifying a current game. Battle for Wesnoth is open source. It is fairly easy to plug a new AI in, and they could use one. In this way you can say

  • by avi33 ( 116048 ) on Friday January 28, 2005 @01:13PM (#11505625) Homepage
    Before the locals gather their pitchforks to run me out of town, here's why:

    -If you don't know much about programming, even something basic like vectors or graphics libraries could be more than a little daunting. Flash makes graphics dog-dumb easy, leaving you to focus on the logic. A lot of the abstractions (game speed, display parameters, collision detection) can be handled easily, leaving you to learn how to program.

    -You can do some OO programming with Actionscript, so you can start with a simple program, and when you get skilled, learn how to extract that functionality into libraries or classes.

    -You should be able to focus on some simple programming aspects like game physics, or making it fun (which doesn't have much to do with programming).

    -There are a zillion sites out there with bits of code that you can learn from and modify. Granted, lots of it sucks (i.e. it works, but it will not show you how to be a 'good' coder). Offhand, I don't know what to recommend to become a good coder, but at the least, I'd recommend plowing through at least the first 3 chapters of Bruce Eckel's Thinking in C++ [mindview.net] (free online). Once you get through pointers and address references, actionscript will look like child's play. Sure, there are sites out there with sample PyGame/Java/etc. code, but Flash code is easier to cherry pick and drop in.

    -You have to realize that what you're doing is similar to saying "I've never turned a wrench before, but I want to build a car in 4 months." Game programming can be exceptionally difficult on a number of levels.
    • Unfortunately Flash isn't crossplatform, which was a requirement of the poster. To VIEW it is, of course, but I don't know of any way to develop Flash on *nix (if someone wants to point one out though, that would be great).
    • I agree that Flash is your best option, especially if the class is only one semester long. Video games make so many otherwise boring subjects in high school interesting. The math and physics teachers will thank you, because when their students ask why they need to learn those subjects they will just say, "Because then you can take can take a class on video games next semester. Woot!" It's important to lower the bar so the class is accessible to as many students as possible.

      If you don't use Flash you should
    • I was thinking the exact same thing whe I read this post, I recently graduated an animation program and one of the courses was a two semster run of Flash and fairly extensive actionscripting. flashkit.com has some great examples of prebuilt games to learn from quickly, as well as tutorials for non-action scripters to get into the nitty gritty. I seriously think this is the most viable option for the time frame and experience level.
  • Start with something small, like a puzzle game. They aren't sexy, but they are doable in your time frame. The game mechanics for things like tetris or minesweeper are pretty easy to understand, which will allow you to spend more time focusing on other things like the basic inner-workings of a game, how do sound engines work, how to best utilize graphics libraries, etc. Plus with puzzle games your need for hitting 100 frames per second is reduced.

    The biggest mistake I have seen people make is they want t
  • gcc (try Dev-C++ on Windows) + SDL + OpenGL
    It allows you to write once, compile anywhere. Plus SDL is very easy, straightforward.

    If you love torture, rather than the ease of SDL, another cross platform graphics answer is Java + JNI + C++ + OpenGL. I used it for my capstone.
  • General Advice (Score:3, Interesting)

    by American AC in Paris ( 230456 ) * on Friday January 28, 2005 @01:32PM (#11505889) Homepage
    Start small, and don't arrange the furniture before you've built the house.

    Push all the "great ideas" to the back of your head, for now. They'll only get in the way at this point. Lay out a very basic game design and write it down. Do this both in plain English and in pseudocode. Resist the temptation to dive into feature details; don't go on about how different guns will do different things, and how there will be ten different types of enemies, or how you want the explosions to be green and shimmery. For now, make it simple: one guy, one gun, one type of enemy, one behavior. Note that this doesn't mean you shouldn't design for such expansion, though--be thinking about how to go about building your code to allow all sorts of things down the road, just don't get mired down in the minutae.

    Build a basic, working prototype. Get input working; get drawing working; get audio working; get physics working; get collisions working; get interaction working; get menus and user interface working. Use placeholder graphics and sounds for now. Once you've made a good, solid, stable engine, then start working on graphics, audio, backgrounds, et. cetera. A good way to tell if you've reached this point is if you can play your ugly, bare-bones game and enjoy it. If you don't enjoy the game without the flashy stuff, adding finished content will just be like putting lipstick on a pig.

    Finally, stick to 2D. You'll learn more about the "game" part of making games if you don't need to wade through all the extra crap you need to know to work in 3D. (It is also much faster and easier to create 2D content than it is to create 3D content, but again--that comes after you've got a solid engine in place...)

    • This is great advice. The parent has actually written a pretty fun game and knows what he is talking about.

      Having written some simple games myself, I have found it very helpful to just get something very simple working first. Then I add things step by step. I have seen too many projects get bogged down in simply creating large amounts of artwork and no coding ever happens.

      As a poor example of this method, I have written a pac man game tutorial. It is one the web at http://www.angelfire.com/games4/an [angelfire.com]

  • What do you mean by "game"? If you need to write a full screen OpenGL FPS, then your needs are going to be different than if you're writing a civ-style game, and different still if it's a windowed solitaire game.

    For some reason, a lot of people think a game needs to be direct rendered full screen. You task will be a lot simpler if you get out of that mold.

    Here's an idea that is sure to get me a lot of flamage: look at Qt. First, it's a very well documented library. Second, it comes with lots of examples,
  • Others have recommended all sorts of gaming platforms, but I think one of the most important things you're going to have to learn is project management and time budgetting.

    You have a fixed deadline of June. You probably have some ideas about what kind of game you want to do. Create a design document. (Gamasutra has had articles about that. Links anyone?) Don't spend a lot of time on it--you don't have to justify this to the suits. You can start rough and refine it later as you get a better idea of where yo

  • I also suggest you setup a subversion server and begin using that.

    Also don't think you're special. You'll have to design, implement, and test like the rest of us.

    I suggest you think of a design *quickly*, and keep it as simple and straightforward as possible. I doubt the teacher is going to grade you on your innovation. If you actually finish this in time, I am pretty sure you will get high marks. Implement this into something that works. Once you get a working core, then add small features one at a time,
  • And give you lots of free time to boot... Introducing

    Duke Nukem Forever

    Now you have lots of free time, be sure and point your instructor to the official websites and forums to see how this is coming along.

  • DarkBasic [thegamecreators.com] is an excellent language to begin with. There are a LOT of examples to work from, and it is aimed at beginners.
  • by cr0sh ( 43134 ) on Friday January 28, 2005 @02:11PM (#11506428) Homepage
    I would say try your hand at writing javascript games - no, I am serious! Amazingly enough, if you have a recent browser which can support javascript and CSS (ie, DHTML) - you have everything needed to create a basic game. Drop the game "page(s)" on a webserver and add in some CGI processing, and you have a way to save/load information as well (game save points, scores, levels, etc).

    Javascript, CSS, and DHTML are each well documented on the internet, and there are numerous books to get you started, as well.

    Finally, before you cry out "but Javascript won't let me create a cool game!" - take a look at this:

    Illumia RPG [illumia-rpg.com]

    and especially this:

    TRIGLAV RPG [smokymonkeys.com]

    • Javascript Lemmings always impresses everyone who sees it. (Pacman in Microsoft Excel always impressed me no end too.)

      You should have been modded higher. Javascript and HTML is really simple. Some of the suggestions for complex OO languages are not good with the limited time available.
    • Here is another javascript game to see: HylZee [armyofanubis.net]

      The benefits of javascript are:

      • If you understand how HTML works, then you know how to build a GUI.
      • feedback on simple programming errors is quick, because there is no compiling step
      • graphics are easy, because you don't need an additional toolchain to build them
      • javascript has some very logical properties, rules for it are well defined, although they don't fully match the usual object oriented programming

      Downsides:

      • Understanding where your objects are in t
  • GameMaker [gamemaker.nl] is a free/shareware development kit that has syntax very simular to C++.

    It is windoze only and has its limits, however it is a great starting point to learn about how games work.
    It is mainly 2D based programming, but since the release of 6.0, Mark Overmars (its creator) added quite a bit of 3D functionality.
    There is even a tutorial for making your own basic FPS, but from what I've seen on the forums, some people have figured out how to do some really cool stuff with it.
  • Go with Dark Basic

    http://darkbasic.thegamecreators.com/

    its a horrible programming language really but for a begining its great because there is a lot of pre made stuff in it so if you wanna be able to knock somthing up quickly its excelent

    i managed to put together a simple 2D racing game in about a month soon after i started programming
  • Programming a game takes more than just knowing how to program. There are a lot of concepts involved. Maybe try outlining the aspects of simple game programming, and then from this outline try to write some code demonstrating an implementation. If you can, from this, end up with a working version of "Breakout", I would say you have learned quite a bit in four months. If you don't get that far, you still have an interesting paper with something to show for your work.

    If you go the classic VGA route, you
  • As others have mentioned, you're unlikely to write Quake3 at this point in your programming career. But there are some things you probably can tackle.
    • Start simple -- do a 2D game, either a simple arcade game or a conversion of a board game.
    • Build it incrementally -- game programming actually spans many areas, so don't get frustrated if your first creation isn't a graphical wonder with advanced sound and cutting-edge AI.
    • Since you're new to programming and want to do cross-platform, choose your enviro
  • by Yaztromo ( 655250 ) on Friday January 28, 2005 @03:12PM (#11507236) Homepage Journal

    Ignore everything you've read here about graphics and sound libraries, existing game code, existing game libraries, and (for now), choice of languages. If you've never done any programming before and intend to use this as a vehicle to start programming, read this first. Clear your mind, and ignore the details for now.

    More important than anything else you can ask right now is to find out what you're trying to achieve. Saying "I want to write a game" isn't specific enough, as humanity has invented tens of thousands of games over the years using all sorts of different mechanisms (cards, dice, boards, pieces, pots, beans, joysticks, vector graphics, role playing, puzzles...). So first, figure out what you want to write.

    Next, take the game you want to write, and stick it on a mental shelf. Everyone would love to write Grand Theft Auto: San Andreas as their first game, but it isn't going to happen.

    My first piece of advice: don't try to create a new game for your first project. Take something you already know, and know well, and implement it first. Try to pick something that has finite states that are easily describable, and then work from there. Preferably something that has mechanical rules and won;t require too much "artificial intelligence" on the part of the computer (ie: you may know Chess really well, and it has a finite number of pieces, the logic required to decide how to have the computer move is exceedingly complex. Companies like IBM have spent millions trying to perfect such algorithms).

    Two classes of games which are typically excellent candidates for first projects are card and dice games. Both are fairly easy to program, as they involve numbers, and have a finite number of possibilities (ie: 52 cards, 6 sides per die). When selecting a game to implement, find something you enjoy, but preferably something that again, won't require an M.Sc. in Artificial Intelligence. Blackjack is an excellent candidate (many Universities use this as a first year programming assignment anyhow, so you'd be getting a leg-up on others if you plan on persuing Computer Science in higher education), as the compter can act as the dealer, and has very specific rules it always follows (requiring no AI at all). Don't worry about how many times the game has already been done -- your goal is to learn programming, and not to create the next Halo 2.

    Once you've selected a good candidate game, you need to code the game mechanics before you code anything else. So again -- forget everything anyone here has told you about graphics and sound libraries, or even languages. You won't need these until later.

    Continuing with Blackjack as an example, here are some of the things you need ot think about first:

    • How will the computer store the information about a card (and again, don't think about the graphics for the card at this point -- right now you need a way for the computer to be able to tell the difference between a 3 and a Queen, a Diamond and a Club)?
    • How will you group cards together? (For the hands, the cards remaining in the desk, etc.)?
    • How will you perform actions on the cards such as shuffling?
    • What are the win states? What are the lose states? What are the draw states (if any)?
    • What are the rules the computer has to play by?
    • What options should the user have at each junction (ie: draw, hold, split, double)? When is each approperiate?

    If you can get all of this down in code, you'll be off to an excellent start. From here, you can graft whatever user interface you want atop the "game engine" you've just created. And you'll find you'lll learn a lot about the basics of programming (variables, arrays, functions, objects, random numbers, sorting, comparisons, etc.)

    You'll probably want to be able to test things out as you go along, which will require a minimal user interface. To start, you'll probably want to use just text to represent everything (ie: "10 Hearts", "A Spades", etc.).

    • by Ramses0 ( 63476 ) on Friday January 28, 2005 @05:44PM (#11509157)
      I have to agree. I'm currently making Dominoes as an online board game. I've been programming professionally for ~5 years now, have 4 years of college, 2 years of High School, and 4-5 years of self-study in programming. Programming a complete working version of anything can be difficult, so keep it simple. As an example of what you might end up facing, here's a dump of my latest directory structure:

      domino.php --- 1k
      dominoes.php --- 3k
      dominoesBoard.php --- 10k
      dominoesGame.php --- 13k
      dominoesGui.php --- 18k
      dominoesHand.php --- 2k
      opHandler.php --- 3k
      rules.php --- 2k
      test_domino.php --- 1k
      test_dominoes.php --- 1k
      test_dominoesBoard.php --- 9k
      test_dominoesGame.php --- 10k
      test_dominoesHand.php --- 10k

      WRITE YOUR TESTS! Notice almost 50% of my code is tests (and I feel that it's not enough, I currently got ahead of myself and need to catch up on my tests before I feel comfortable adding more functionality).

      I would do a lot of thinking about what the parent poster said, specifically: Start Simple. Think About Your Win/Lose Conditions.

      I'd like to add the note: Write Tests. To continue the blackjack example, what happens when a user has an "A, J" in their hand? (blackjack). How can you test that? Write a test for it. What happens when they have "J, K, Q" in their hand? (bust) How can you test for that? Write a test for it. What happens when they run out of money? What happens when they try to bet too much money? A negative amount of money? Write tests and repeat as necessary.

      A whirlwind tour of my dominoes layout (this is to back-up the parent poster about the game libraries, and mechanics, etc):

      • domino - a single domino
      • dominoesHand - hand containing many dominoes
      • dominoesBoard - all the dominoes that have been played
      • dominoesGame - all the win conditions, lose conditions, points, drawing, etc (game logic)
      • dominoesGui - mostly HTML, and a lot of drawing functions
      • dominoes.php - what the user ends up interacting with (mostly passes off to dominoesGame)
      • test_* - a bunch of tests that load up the other files, use them, and print out "pass/fail" for each situation


      For the GUI code, it's mostly HTML text to display stuff to the user, which is why it's so big. But even then, recognize that the bulk of the work is in stuff that the user doesn't even see (Board, Game) ... good luck! Ask questions to your teachers, and WRITE YOUR TESTS! :^)

      --Robert
      • I have to agree. I'm currently making Dominoes as an online board game.

        Good information all around. I just wanted to pipe up that Dominoes is another excellent starter game system to implement. There are so many different games you can play with Dominoes, and for the most part the logic is pretty simple (a simple greedy algorithm should make for a half-decent computer opponent. Perhaps not the perfect opponent, but more than enough for a beginning programmer).

        So if cards and dice don't do it for you

      • Great advice! The real test is if the HS senior is mature enough to listen to such sage advice. Most the young guys I know that THOUGHT they wanted to program games, really just wanted to play them. Turns out that creating a truly new game is hard work! They really don't have a concept of the enourmous amount of work it takes to create the next Halo2.
    • Excellent post.
      Though I would disagree and say to create a new game for the project. The person has 6 months a card game for somebody motivated I don't think would take more than 3 or 4 months. Even if the project is to learn the basics of programming, I think that learning game design portion (presumably the area they want to work in the future) is important too.
      I would actually suggest looking at RPG type game. They scale very well in complexity, and are very flexible in design aspects. You can start
    • I would agree completely. Blackjack was the first game I ever wrote. I did it on the TI-82 graphing calculator during my HS Chemistry class. It sucked, but I was learned the basics about programming and how difficult it really can be. Especially putting in the cheat codes so my lab partner would always be at a statistical disadvantage. :)
      • I would agree completely. Blackjack was the first game I ever wrote. I did it on the TI-82 graphing calculator during my HS Chemistry class. It sucked, but I was learned the basics about programming and how difficult it really can be. Especially putting in the cheat codes so my lab partner would always be at a statistical disadvantage. :)

        You know, I think blackjack must be the most common "first game" there is. The first game I ever wrote was a text-based blackjack in BASIC on some weird NCSS mainframe (a

    • That post is probably the best advice I've seen here.

      The most important question I think is

      "what is your true goal?"

      Possible answer include:
      a- something new and original
      b- something really usable
      c- something pretty
      d- a combination of a/b/c?

      Is the goal just to create any game? Being for a class and depending on your TA or professor, I would expect the engine to be more important than the look. (if it were commercial, it would probably be the reverse, ymmv.)

      One important detail is how it should look, dep
  • If your goal is to get a game into reality, Virtools is one good way to do that. You can still code with letters and words if you want to, but the main way you create a game in Virtools is defining behaviors, graphically linking code building blocks together. You'll have to learn how to use it, and I think you'll need a license for a student copy (think it was in the neighborhood of $99-$125 for a student license), but it can be worth it.

    Hardcore coders sometimes scoff at Virtools because they see it as so
  • The dynamic duo is pretty tough to beat. Considering the vast amount of available standard modules for Python, and the linkage to OpenGL and SDL provided by PyGame, you can quickly hack out some serious gaming goodness.

    Also, Python is arguably a good language to learn programming basics with, and it is also a highly effective tool for advanced programming users also.

    Even though Python is not characteristically known for its raw speed performance, this is dramatically offset by the processing power of mode


  • Many games out there like Unreal, Warcraft 3, have great tools for creating fun games. The scripting languages that come with these games are legitimate programming languages that let you focus on gameplay and not on implementing basic engine components.

    Creating a games engine is not creating a game. Using a toolset lets you create a game, while skipping creating the engine.
  • There are a couple of books introducing Managed DirectX and the programming language C#. You can achieve results fairly quickly and your programs will not crash on you as easily as if you used C++. The runtime environment will prevent you from accessing memory outside of array bounds and similar mistakes (In C++, this could mean hours and hours of debugging). And there are no pointers in C# which can easily confuse a programmer and lead to mistakes. It is all type-safe references.

    The .NET runtime environme
    • While I will say that C# is a good language to pick up, I would strongly recommend that a beginning software developer avoid DirectX in any flavor like it was an airborn Ebola virus.

      Microsoft keeps changing its mind regarding what goes into DirectX, and older interface keep going obsolete with each new version of DirectX. More simply put, if you are not actively involved full-time in a professional setting and using DirectX as a part of your everyday development environment, don't use it.

      For myself, I've
  • I would reccomend Java, because not only is it a platform that has a few good books on creating Java games, but you will learn a 'in-demand' language that would actually be a future job skill. If you don't go with Java I would try C++.

  • As a high school programming teacher, I'd highly recommend you first work on a trial program. For someone new to programming, a 3-4 month project is complex. Write a smaller, non-trivial program first, allowing yourself to get a feel for the language, structures, techniques, etc. (note: this post presupposes "somewhat new to programming" + "high school" = "start from the beginning." If you're more experienced, good job with the modesty and no offense intended.)

    Some of my kids want to jump right in
  • by TeeJS ( 618313 )
    I think Blender [blender3d.org] is an excellent choice here. It's free, cross platform and very easy to get started in. Combinde with Pythin and the info available at GameBlender.org [gameblender.org] it should be very easy to get a awesome project out quickly. My 11 year old daugher got going with the 3D modeling in an afternoon after watching the online video tutorials.

"...a most excellent barbarian ... Genghis Kahn!" -- _Bill And Ted's Excellent Adventure_

Working...