Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Crash Course in Game Programming?

Cliff posted more than 9 years ago | from the a-pointer-in-the-right-direction dept.

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?"

cancel ×

142 comments

Sorry! There are no comments related to the filter you selected.

New To Games? (4, Insightful)

johnkoer (163434) | more than 9 years ago | (#11504836)

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? (2, Informative)

abradsn (542213) | more than 9 years ago | (#11505240)

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 to the wind. If you see two solutions and one performs well but takes more time to code, just do it the other way and save that time. For example, instead of using a binary tree, just iterate over every element in the array. If some has just read this part of the comment and skipped the rest of the comment, please re-read the rest of the comment. Thanks.

Re:New To Games? (1)

HanClinto (621615) | more than 9 years ago | (#11506490)

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 to the project, I can say that I'm anxiously working towards making this tool a reality.

--Clint

Re:New To Games? (4, Insightful)

_pruegel_ (581143) | more than 9 years ago | (#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? (2, Informative)

JohnFluxx (413620) | more than 9 years ago | (#11507059)

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 nice, but I got poor marks (relatively - it was 68% when a 1st is 70%. But I was getting 75+% in everything else, so...). I attribute the poor marks partly to be unable to really explain where my time and code was. "Well I spent a week adding this c++ library to the makefile...".

As a side point, I never bothered to release my code. It required so many libraries that it was a nightmare to set up to compile.

Re:New To Games? (1)

Eideewt (603267) | more than 9 years ago | (#11509769)

I third the disagreement. A simple game is a quick project, although inexperience will slow things a lot. I'm doing the exact same thing (writing a game for an independant research class). My game took a while to get running, but I didn't work very hard. I spent most of my time screwing around. And creating art, of course. Lower artistic standards will speed things. If you're actually devoted to the project, it's not an especially long process. I did mine in VB (since I had been fiddling with it lately when I started), but I think I may port to C++ with the Allegro game library some weekend. VB works just fine, but I don't recommend using its built in drawing functions. You'll get a mite laggy unless you use API calls or another speedy set of graphics functions. Anyway, the point I'm rambling towards is that the best way to learn is to jump right in, you can use any language, although I'd recommend C or VB for their easy access to quick blitting routines (via the API or an external library), and that you shouldn't worry about rewriting everything. That's part of learning the best way to do things. Since you want cross-platform code, I'd recommend using Java with something like the LWJGL, or C/C++ with Allegro. The latter is better documented.

Use a pre-existing game engine (1)

toygeek (473120) | more than 9 years ago | (#11504837)

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?

Re:Use a pre-existing game engine (1)

eyeye (653962) | more than 9 years ago | (#11505486)

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 'The Man' (1)

Nodar (821035) | more than 9 years ago | (#11504858)

talk to this guy [slashdot.org] , seems to think he's the greatest game designer of all time.talk to

Re:Talk to 'The Man' (0)

Anonymous Coward | more than 9 years ago | (#11504894)

And if you cannot get CrazyJim1 to tell all, perhaps Derek Smart will be able to help ;)

The best language... (1, Insightful)

Anonymous Coward | more than 9 years ago | (#11504862)

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.

Re:The best language... (1)

biryokumaru (822262) | more than 9 years ago | (#11505850)

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 (4, Informative)

(trb001) (224998) | more than 9 years ago | (#11504863)

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

Re:SDL Graphics library (2, Interesting)

tekiegreg (674773) | more than 9 years ago | (#11506315)

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 environment I'd consider a simple Java game with the same considerations (similar to C++, none of the headaches and slower). Choose appropriately.

Re:SDL Graphics library (1)

Impotent_Emperor (681409) | more than 9 years ago | (#11508563)

Will C++ be fast enough?

I went through the examples in Programming Linux Games [amazon.com] and tried compiling my own tests as C++ programs, but they were always slower than the examples in C. (It's been a while since I did this so I may not remember all the details.)

It may have just been that I wasn't doing something correctly even though I tried to copy the example code as closely as possible.

Re:SDL Graphics library (1)

Kentsusai (837912) | more than 9 years ago | (#11509698)

SDL is great! Has audio, networking, sound, openGL. Cross platform! Easy to code. Saves you a lot of work :-)

I have just started developing a game using SDL.

Btw, given your short amount of time, you may want to consider open sourcing it! If you do, put up a concept and you may attract some programmers! That way you will not be the only person working on the project! :-)

Here's a link for the API docs - http://www.libsdl.org/cgi/docwiki.cgi/SDL_20API
C ouple of tutorials to get ya going - http://www.libsdl.org/tutorials.php

Easy (3, Informative)

Apreche (239272) | more than 9 years ago | (#11504867)

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.

Do a mod (0)

Anonymous Coward | more than 9 years ago | (#11504882)

Best bet at this point would be to do a mod to an existing game. Unreal Tournament 2004 offers a pretty well documented scripting language and all the tools are included or easily downloaded.

Get Python + Pygame (5, Informative)

fredrikj (629833) | more than 9 years ago | (#11504885)

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!

Re:Get Python + Pygame (2, Informative)

fredrikj (629833) | more than 9 years ago | (#11504976)

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.

Get Python + PyOgre (2, Informative)

Clay_Culver (583328) | more than 9 years ago | (#11505525)

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 ogre Wiki and forums for most questions you have.

vote for python + pygame (2, Informative)

neura (675378) | more than 9 years ago | (#11507616)

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 complexity for very simple projects. Use it after you know how to program and have created at least a few simple things already. :)

Anyway, just wanted to give my vote for Python.

Re:Get Python + Pygame (1)

yarbo (626329) | more than 9 years ago | (#11508560)

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 use, and depending on what you need, the performance is usually adequate.

Re:Get Python + Pygame (1)

fredrikj (629833) | more than 9 years ago | (#11509152)

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.

It's going to need to be simple.... (5, Insightful)

Grygonos (848602) | more than 9 years ago | (#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.

Back in my day (3, Funny)

madaxe42 (690151) | more than 9 years ago | (#11504900)

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!

Re:Back in my day (1)

Dioscorea (821163) | more than 9 years ago | (#11505260)

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....)

Re:Back in my day (1)

Tumbleweed (3706) | more than 9 years ago | (#11506291)

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

You had a tape drive?! Lucky bastard!

Re:Back in my day (1)

Lendrick (314723) | more than 9 years ago | (#11506667)

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

There's one of those connected to my Macintosh.

Re:Back in my day (1)

Tassach (137772) | more than 9 years ago | (#11508727)

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 (4, Informative)

orasio (188021) | more than 9 years ago | (#11504923)

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.

Python + Pygame (1)

mrseigen (518390) | more than 9 years ago | (#11504935)

PyGame [pygame.org] is a great starting point. I use C++ myself.

Dear Slashdot (1, Funny)

Anonymous Coward | more than 9 years ago | (#11504945)

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? (1)

addaon (41825) | more than 9 years ago | (#11504979)

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.

consider using python or perl... (1)

machinecraig (657304) | more than 9 years ago | (#11504997)

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 interact with certain things in the environment
4. the game tracks and displays high scores

I would encourage you to google 'perl games' or 'python games' to see the kinds of things that can be done.
Good luck! Sounds like you'll have some (fun) late nights ahead!

Project Management is important too (1)

warcormc (854208) | more than 9 years ago | (#11505000)

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.

My Suggestion as a Game Programmer in HS (4, Interesting)

Prien715 (251944) | more than 9 years ago | (#11505035)

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.

Re:My Suggestion as a Game Programmer in HS (1)

Trixter (9555) | more than 9 years ago | (#11505288)

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.

Re:My Suggestion as a Game Programmer in HS (1)

Plac3bo (651890) | more than 9 years ago | (#11505953)

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 integrated.

Andre Lamothe (2, Interesting)

vasqzr (619165) | more than 9 years ago | (#11505037)


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 (4, Informative)

magic (19621) | more than 9 years ago | (#11505051)

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 (5, Informative)

vasqzr (619165) | more than 9 years ago | (#11505392)


Don't forget http://www.gamasutra.com/ [gamasutra.com] and the PCGPE, even if it's older than dirt.

Re:Game sites (1)

ash*embers (725483) | more than 9 years ago | (#11505829)

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 detection and lighting.

In any case, you will need to focus first on getting your greaphical content in order and planning out how you want your game to play and look like.

BEST OF LUCK!!! I'm pulling for you!

SDL, C and Pygame (4, Informative)

Electrum (94638) | more than 9 years ago | (#11505053)

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.

Re:SDL, C and Pygame (0)

Anonymous Coward | more than 9 years ago | (#11505218)

QuakeC was not an interpreted language; it was more like Java in that it was compiled to byte code (I think it was for some RISC processor) and then that CPU was emulated.

Here's what I used for some of my first games... (1)

Xaroth (67516) | more than 9 years ago | (#11505068)

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. ;)

Think it through before you start working on it (1)

adderofaspyre (800203) | more than 9 years ago | (#11505102)

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 (1, Interesting)

Anonymous Coward | more than 9 years ago | (#11505150)

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 (4, Interesting)

pezpunk (205653) | more than 9 years ago | (#11505936)

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.

Re:Flash (1)

_xeno_ (155264) | more than 9 years ago | (#11508576)

  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 understood the concept of a linked list, so all the "objects" in the game world wound up being in a large array. Once the array hit its limit, no more objects would spawn.

I later "invented" a linked list (something I'm mildly proud of, figuring out a common data structure without being taught it first :)) and rewrote the game so that you could have infinite objects in it. (Well, so you could have as many until you ran out of heap space, but you know what I mean...)

Flash abstracts a lot of the actual programming side away in a "scripting" language. I'd highly suggest what Yaztromo said [slashdot.org] , and start with something very simple that will teach actual programming skills. With the skills learned doing that, he should have a much more solid foundation to build something more complicated. I think it'll teach how to program something far better than just some quick Flash thing would.

Of course, it'll be less fun, but it'll be a better experience, and teach skills directly applicable to programming in college.

Re:Flash (2, Interesting)

Loacher (816765) | more than 9 years ago | (#11506574)

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 that was not enough, so I started playing with actionscript in 'expert' mode. I even managed to create a few nice data structures there. But then I wanted to dynamically load stuff, so I learnt about URL variables, XML, etc...

Then I wanted to keep scores, so I learnt PHP and SQL. And to integrate my little flash experiments into a website, so I learnt HTML and CSS, which led to a little JavaScript.

At that time, my flash projects were so bloated and slow, that I grew frustrated, and started learning other languages, like java, perl, python, and just starting now, C++.

Give Flash a try, it does have its legitimate uses.

Unreal Engine (1)

DrJAKing (94556) | more than 9 years ago | (#11505238)

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 started.

Good luck, I'm sure you'll have a lot of fun.

Re:Unreal Engine (1)

hoggoth (414195) | more than 9 years ago | (#11505602)

> 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.

BlitzMax (0)

Anonymous Coward | more than 9 years ago | (#11505273)

BlitzMax [blitzmax.com] is cross-platform (Windows, OS X and Linux) and ideal for fast development.

Re:BlitzMax (1)

neura (675378) | more than 9 years ago | (#11506326)

Except BlitzMax is not available YET on any platforms other than OSX. (specifically the one platform the OP does NOT need :)

Well (1)

jjshoe (410772) | more than 9 years ago | (#11505309)

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 find a winner? Everytime a play is called you store it in a two dimensional array of size 3x3. Your array would consist of type int using 1 for player one and two for two ofcourse. After every move logic would be called to check the array for three of either type in a row(this can be optimized later to only check for pieces made by the current player).

Seem too simple? It might, i doubt it if you're new to programing. Check with your instructor. Don't forget if you find that you get this done in record time there are ways to expand this. Think network play with peer to peer, client server network play with checking for cheating, and if you want to get really complicated try to implement 3d tic tac toe(think three boards stacked, you can win going across multiple boards verticle and diagnal).

feel free to shoot me an email at jjshoe gmail

Game Blender (2, Insightful)

manjunaths (83313) | more than 9 years ago | (#11505349)

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 simple, it should be one level or two atmost.
Even things like shooting arrows at moving targets are fun, the arc of the arrow etc., teach you physics and for the player it takes time to learn, so they get hooked.
Have a goal, the user at the end needs to do something like rescue a princess or find treasure.
No OpenGL, SDL and C++. Period. That is simply impractical. You'll end up coding the engine and won't have time for art or game play planning.
If you really want to do something like that look at CrystalCore http://crystal.sourceforge.net/tikiwiki/tiki-index .php?page=Crystal+Core [sourceforge.net] (#CrystalSpace on irc.freenode.net) or nebula device. But good luck on that.

soya (0)

Anonymous Coward | more than 9 years ago | (#11505383)

Hi,

If you want to make some good looking 3d game i might sugest soya. It is a library for python wich is quite easy to learn.

http://home.gna.org/oomadness/en/soya/index.html [gna.org]

When i tried i was able to some good looking demos in a few hours.

It is not suitable for professional games but is perfect for your situation.

btw it runs on windows macosx and of course Linux.

Nigral

Good Links (2, Informative)

bios10h (323061) | more than 9 years ago | (#11505469)

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 or DX, game genre?

There are also some crappy 'game toolkits' but if you know how to write C++ code, I'd recommend you stay away from these things.

Make sure you *really* want to PROGRAM games... (2, Interesting)

_xeno_ (155264) | more than 9 years ago | (#11505479)

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.

gamedev.net forums (1)

Telastyn (206146) | more than 9 years ago | (#11505568)

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 bite off more than you can chew (1)

bluGill (862) | more than 9 years ago | (#11505580)

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 you helped without having to do all the work.

putting flamesuit on...but how about flash? (4, Interesting)

avi33 (116048) | more than 9 years ago | (#11505625)

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.

Re:putting flamesuit on...but how about flash? (1)

damiangerous (218679) | more than 9 years ago | (#11506068)

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).

Re:putting flamesuit on...but how about flash? (1)

the_greywolf (311406) | more than 9 years ago | (#11506559)

.SWF files are an open format, and a recent issue of Dr. Dobbs' Journal has an article on creating an .swf file from a small C++ program.

whether tools like Flash or Director exist as OSS implementations, i don't know. but i do know that libraries [sourceforge.net] and interfaces [rubyforge.org] exist for creating .swf files. just have to look for them [google.com] .

Re:putting flamesuit on...but how about flash? (2, Informative)

zeasier (708695) | more than 9 years ago | (#11507828)

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 already have many your libraries completed so students don't have to do a lot of work to get results. If you do use Flash try to make it's proprietary shortcomings painfully obvious but don't directly refer to them. That way your students will eventually revolt against Flash and will think they are the first generation to support free and open source software.

Re:putting flamesuit on...but how about flash? (1)

zeasier (708695) | more than 9 years ago | (#11507890)

Doh, your doing independent study. Which means it isn't a course and your not a teacher.

Oh well...

Re:putting flamesuit on...but how about flash? (2, Informative)

dj_cel (744926) | more than 9 years ago | (#11509746)

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.

Speaking from experience (1)

MetalShard (633009) | more than 9 years ago | (#11505627)

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 to build a FPS or a RTS as their first game and they get so bogged down in artwork, tweaking frame rates, AI, etc. that they finally just give up. I almost fell to the same mistake. I thought "turn based strategy game, how hard could that be." It took two years of late night work to get PocketWar [metalshard.com] to the point it's at today, and many times I wish I had started with something simpler.

Almost all games are written in C++ so if you are looking for experience to apply toward the future break down and learn it. As most the post above say, SDL is also a wonderful thing. There are tons of samples on the net that you can use as references.

What I use for cross platform graphics programming (1)

dtfinch (661405) | more than 9 years ago | (#11505797)

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.

There is only one choice... (0)

Anonymous Coward | more than 9 years ago | (#11505885)

C/C++.

You can use other languages, but these two are what 99% of existing open source software is written in, and thus what you're likely going to find libraries to use. I'm assuming your proejct is due in 3 months, you'll want to link against some libraries ;)

I have come to like irrlicht.sourceforge.net for a graphics library if you need 3D, otherwise use SDL if you only need 2D. Both will work in windows or linux. For games on a short fuse, do windows.

General Advice (2, Interesting)

American AC in Paris (230456) | more than 9 years ago | (#11505889)

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...)

What do you mean by "game"? (1)

Brandybuck (704397) | more than 9 years ago | (#11505946)

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, including a tetris clone. Third, you get the QCanvas component, which allows you to do sprite work without a lot of hassle. If you want an interesting research project, then think about writing an isomorphic engine based on QCanvas. Find the old XSpriteWorld++ library that was ported to Qt and you're halfway there.

First have a plan, then a platform (1)

AndroidCat (229562) | more than 9 years ago | (#11506029)

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 you're going. Start blocking out time estimates for various parts and keep track of it. (It's no good to wake up in May and try to bang it off on the fly.) Have a quick "status meeting" with yourself each week to see how you're doing and what needs to get done in the next week. Set project milestones. Keep a project log. (Hand it in with the project, it'll be good for marks.) If there's extra stuff that you're not good at, graphics, sound, etc, perhaps you can trade favours with friends who are? (Get permission, possibly retroactively. ;) Have a Plan B for when your schedule shows that you'll be finished in August.

Technology comes and goes, but good time and management skills will pay off forever. Too many people in the gaming industry never learned those skills except the hard way, and that results in classic mistakes like continuous burn-mode, completely blown schedules and adding people to a late project. Don't spend more time planning than programming, but know where you're going and how late you are. Always wear sunblock.

Good luck and have fun!

Software Best Practices (1)

jgardn (539054) | more than 9 years ago | (#11506152)

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, carefully testing to make sure you haven't broken anything in the process.

Don't forget to document and comment your code as well. Otherwise, you will get lost and won't be able to find your way back.

And remember, have fun throughout the process, and keep yourself interested. Once you lose interest and stop having fun nothing is going to get done.

I know what you can name it ! (1)

DangerSteel (749051) | more than 9 years ago | (#11506176)

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 (1)

Sparr0 (451780) | more than 9 years ago | (#11506238)

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.

director or java (1)

zerkon (838861) | more than 9 years ago | (#11506422)

java is a bit more platform independent, but director/shockwave is fairly easy for even those with limited or no programming ability, I wrote a primative stickdeath clone for a college project in about a week.

I know I will probably be modded down... (3, Informative)

cr0sh (43134) | more than 9 years ago | (#11506428)

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]

GameMaker (1)

rubberbando (784342) | more than 9 years ago | (#11506533)

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.

Dark Basic (1)

Cassius105 (623098) | more than 9 years ago | (#11506585)

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

Make mods (1)

Squiggle (8721) | more than 9 years ago | (#11506589)

I think you need to ask yourself whether you are more interested in making games or programming.

If it is making games then I suggest you take an existing game that has a well developed mod community and a simple to use tool. I would check out Neverwinter Nights if you are into fantasy RPGs.

If you are interested in programming then make the simplest game you can think of. I'm talking Tic Tac Toe simple. Perhaps a remake of some early Atari/arcade stuff or something like text-based adventure game. The game in this instance is just an excuse to write code.

The main thing is to start the project with something so simple it might not even seem worth doing. Get it done. Then make it more complex.

Don't try a full game (1)

dmomo (256005) | more than 9 years ago | (#11506772)

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 can learn quite a lot about programming and hardware.

1) Video Card Access

Maybe start with a graphic demo by changing your video mode and plotting points to the screen. Maybe write a "line drawing" routine. Perhaps make some of this move by redrawing. You can learn about various buffering/paging techniques while you're at it.

2) Reading from input devices.

Now control the screen contents with a joystick, keyboard or mouse. In fact, do them all. There are plenty of libraries out there, but you might want to learn how to do this at a low level.

3) Programming a Timer

Control your cycles so it runs the same on all machines capable of running the program.

4) Collision Detection

Demonstrate how the computer "knows" when objects touch other objects. Maybe just make a shape that bounces around the screen, or two shapes that bounce off each other.

5) Screen Scrolling

6) AI

No matter how far you get, everything you learn will be useful information.

Start simple (1)

dsouth (241949) | more than 9 years ago | (#11506865)

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 environment carefully. Python and Java are probably good choices, and both will probably serve you well in a college CS program. Java also offers the possibility of targeting things like web delivery or cellphones if you want to keep growing your project.
  • Set achievable milestones -- things that seem impossibly large can be done quicker than you'd think by breaking them into smaller, independently testable units.
On the good side, building a simple game can be a pretty good first project. Simple games are fairly common as 1-2 week assignments in CS courses, so you should be able to tackle one over 5 months. Here's one of my favorites from Stanford, though it may be a little advanced for a first project.: Tetris in Java [stanford.edu]

Good luck and have fun.

How To Make "The Game of the Year" (1)

Quadfreak0 (624555) | more than 9 years ago | (#11507029)

Its actually very simple and you dont need to know Code! Who needs C++ when you can take advantage of the gaming industry's number one method of selling games... Hype.
Step 1: Buy out the rights to whatever game it is you're making; or be vague and buy out the rights to 'High School Game Development Project' - This will wipe out any competition you might have.(I.e. EA)
Step 2: Buy out URl's such as Planet[insert game name].com, then hire a 'fan' to make a .net version that obviously wouldnt have any corp ties.
Step 3: Release a rendered video and laybel it a "working Demo". And if anyone questions it Sue them.
Step 4: Have an 'Exculisve' interview with an online gaming site; GameSpot, IGN, etc.
Step 5: Always use 'When its Done' as your release date. (I.e. http://www.3drealms.com/duke4/)
Step 6: when people question your relase date thow up some screen shots.
Step 6.5: If they suspect too much claim your source code was stolen; this will give you atleast a years worth of spare time.(HL2)
Step 6.5.5: If that doesnt work claim that you're development team is planning to take the game in a diffrent direction to better compete with the current market (I.e. Starcraft Ghost)
Step 6.5.5.X: If none of that works, claim the development team has left the project and turned it over to another group of developers; even if you alone are the development team (I.e. Counter Strike:CZ)
Step 7: announce that you're holding closed beta, and plan on an open beta within the year. Create a beta forum and fill it with fake beta tester post. allow public posting and start a flame war about nerfing this and that(most Trolls dont need to play games to start a flame war)
Step 8: When your teachers or critics/reporters investigate your progress and claim you have not done anything; Sue them. (I.e. Phantom)
Step 9: When you have something of an interactive App, send it to the major gaming sites and magazines as a beta. Provide them a pack of Cds and an installer that takes forever to load, show opening CG and then crash the game. Demand a good review based on what they've seen and demand GOTY or you'll sue. when they question the bugs remind them its just a beta and they will be fixed on release, and give them the exclusive scoop that you've Gone Gold.
Step 10: If/When you do release a retail package pretend that the cross platform versions(mac/linux) are on their way, along with the patches to the many crashes/bugs/crappy servers; at which time you also promote your up-and-comming expansion pack and sequal! (I.e. Blizzard & WoW)

DESIGN IT IN FLASH, totaly cross compatible. (0)

Anonymous Coward | more than 9 years ago | (#11507201)

I can't tell you how many games we've prototyped in flash (almost a complete version) and then ported to java for speed improvements, I would realy suggest making the game in flash, go to
www.gotoandplay.it, it has enough info for you to create a game even if you never realy programmed before.

shameless plug, my game: www.flashcrap.com/ufo2.html

anything . . . (1)

turbopunk (806995) | more than 9 years ago | (#11507218)

you can pretty much do it in anything you're comfortable with. you say you don't have much programming experience, so, ye lords, take the language you are the most confortable with.

i'm written little crap games in lots of languages. you're NOT trying to write ut2k4 in 4 months here.

in college, i had to write a simple, graphical game in pascal for !insert term of choice!'s sake. i've written simular ones in c, c++, java, ada, etc.

remember, a lot of the old, classic games where done by people in high school just tinkering arround /* insert prime example of richard "lord british" garriott here */.

the only real advice i'd give is to plan ahead and start slow. when nolan bushnell was creating pong, the version released was an early alpha verion. of course, they had so much fun playing it, they realised they were done there . . .

Ignore everything else you've read here. (5, Informative)

Yaztromo (655250) | more than 9 years ago | (#11507236)

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.). Once you get the underlying game mechanics working the way you like, you'll be able to replace the user interface with something different (a better text interface, a graphical interface, a web interface, etc.) You'll have some good programming experience by the time you get to this point, making the segue into GUI, graphics, and sound programming much easier.

Language and environment is goinng to be an important selection here, and I'd like to join the ranks suggesting Java as a good starter language for this sort of project. Indeed, I'd suggest whatever language you end up selecting, use something that is Object Oriented (meaning if you don't go with Java, go with something like Python or Object REXX, or if you have the inclination, Smalltalk (Squeak)). Object Oriented environments provide an excellent match for the type of game you're most likely to code first, especially if it's a card or dice game.

Whatever path you wind up choosing -- best of luck!

Yaz.

Re:Ignore everything else you've read here. (0)

Anonymous Coward | more than 9 years ago | (#11508368)

Hey, that's pretty good advice. I'm a Java/C# programmer who is thinking about learning Smalltalk. Anyway, I'm thinking about trying a blackjack game as my first Smalltalk project, thanks to your advice :).

Re:Ignore everything else you've read here. (3, Interesting)

Ramses0 (63476) | more than 9 years ago | (#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

Re:Ignore everything else you've read here. (1)

Yaztromo (655250) | more than 9 years ago | (#11509475)

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 for one reason or another, try dominoes.

Yaz.

Virtools (1)

Databass (254179) | more than 9 years ago | (#11508224)

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 somehow less noble to use a middleware tool instead of re-inventing the wheel themselves every time. But you still have to know the logic behind every behavior you define, there's no "Create Game" button you can use. The bonus to Virtools is speed. Our lead programmer can make a small game where you fly a jetpack, swing around on vines through trees, or drive a pretty good rendition of a Halo jeep in about an hour. All through definining a few springs, key controls, and a few other behaviors, and a play space.

Got four months? Here's what we made and had commercially ready in four months thanks in part to Virtools:

http://www.adultswim.com/games/powerplay/sweetmayh em/index.html [adultswim.com]

Granted, we started that project knowing how to use it. But even with the learning curve you should be able to produce something playable and even pretty good. I'm recommending it because it works for us.

Oh by the way if you want to check it out it's at:

http://www.virtools.com/index.asp [virtools.com]

Python and PyGame (1)

The_Dougster (308194) | more than 9 years ago | (#11508696)

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 modern CPU's. Most 2GHz and better processors will run Python well enough that performance simply is not an issue.

PyGame gives you quite a lot of functionality. It effectively provides your main() loop, handles keyboard and mouse events, blits graphics to your canvas, plays music, and a lot more. If you also use the Numeric package then you can do vector processing with pretty decent performance.

I'm using Python and PyGame for my project Space Commander [sourceforge.net] and I'm pretty happy with it so far.

Steal it (1)

Meagermanx (768421) | more than 9 years ago | (#11509047)

See, you take one of them OSS Linux games, like one with the funny looking penguins, and you mess with the opening comment and replace the creator's name with yours. Then you mess with the credits and opening screen so that you name it 'My School Project Penguin Game' or something, instead of 'Super Tux Racer,' or whatever, and call it your own. Problem solved.

create a mod, or a map, not a game (1)

truffle (37924) | more than 9 years ago | (#11509079)


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.

Fortran (1)

602 (652745) | more than 9 years ago | (#11509283)

Fortran. Definitely Fortran. Any version will do, but Fortran77 is especially good.

programming practices and advice (1)

mantle_etching (837091) | more than 9 years ago | (#11509311)

Java is probably your best bet for your requirements. If you go with Java and Netbeans you've got a cross-platform IDE as well (I use it [NB3.6] as my Java IDE [it may be a bit of a memory hog, but I don't know much about Eclipse to recommend it]). Other posts mention the benefits so I won't get all preachy about Java other than to say if you google something like "java game programming" you can find a wealth of examples and articles.

What most everyone is saying here (and what I just hinted at) is do not re-invent the wheel! Most programmers borrow or adapt source code to their liking and this is all acceptable as long as it falls in the realm of public domain or doesn't have some license issue.

Good luck! Keep it simple and don't get too ambitious. Your deadline will find you a lot sooner than you think.

a good starting point, open source too! (0)

Anonymous Coward | more than 9 years ago | (#11509795)

just get the torque engine from www.garagegames.com

Tribes 2 (probably my favorite fps ever) was developed on it, it comes with a good networking package, a great scripting package, and a demo fps game to start you off (with source, so you can see what and how they have done it). It is really a great package. no, i do not work for them, but i have used their sdk, and for ~100 USD, its awesome, you can also demo it.

plus, along with the 100 USD license, you get royalty free rights up to 250,000 USD in sales! (you dont have to pay them any fees for your successful game until it gets >quarter-million successful - at which time you are happy to pay royalty fees).

oh, it has a good physics, texture, and terrain engine too, and takes export models from 3dsmax, blender(open source), and others (i use blender - go OSS!)

check it out! cross platform goodness with networking in a box!
Load More Comments
Slashdot Login

Need an Account?

Forgot your password?

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>