[java] Java Game Programming "Workshop"

Started by
37 comments, last by Swattkidd 17 years, 5 months ago
Hi fellows, I've a rather unusual task for the second week of October: the university where I teach has asked me to ministrate a one-week course of game programming, using Java. This is due to the academic special week for the Information's Science course, where I teach basic OOP using Java as well. I have one full week- and about 3 hours a night - to talk about java game programming. No need to mention that I'm quite happy with the opportunity to both use java in a context I haven't been able to work with them before, and also bust some myths regarding java's capacity in handling games. However, I'm afraid my audience will be composed - mostly - by fresh java programmers, with no more than one, at best two years of experience using the language. That gives me freedom to use about any aspect of the language without worries of their technical aptitude, however, when it comes down to game programming, they're complete rookies: they never had any prior experience with it. So, it's quite obvious I have to teach them the basics, but I came here for help in order to gather some opinions: what do you think I should talk about at the course? Should I keep it more theoretical with a few practical examples, or should I require more code from them? I suppose I won't be able to skip a bit of theory and common knowledge, but would it reasonable to expect from them - after the first nights - a bit of working code for a game loop using Java2D? And if I should dive deeper, should I touch subjects such as AI and scripting for people that barely started into games? Well, put yourselves in the skin of my students, and give me your thoughts, gentleman. And thanks in advance for any insight :D Son Of Cain
a.k.a javabeats at yahoo.ca
Advertisement
If I were taking a course like this, I would like to have a finished game at the end, nothing fancy, maybe some kind of space invaders, which would actually be a good example on how to manage objects on the screen, apply collision detection, basically teaching how to set up a simple game skeleton.

I think 1/2 years of experience with java is more than enough...I made an arkanoid clone for my second programming course's final project having seen only basic swing stuff in that class.

I also think adding a bit of general graphics theory not really related to java would be interesting, just a quick view of the techniques games use to optimize their performances, method used to decide which entities are visible, etc... specially in the 3D environment....This is probably pushing it a little bit, but you have a whole week :)
I'd suggest first 'wowing' them with some examples of what java can do; ie tribal trouble, worm online, and there's a source port of quake 3 around somewhere. Then after you've gotten their attention, you could go over some technology available like lwjgl, jogle, jode, and then move on the engines like jme, and xith.

After that, yeah, I'd concentrate on a simple type of game, like asteroids or something.
oh yeah, good point....show them tribal trouble to get rid of the skeptics that think java and games don't belong together lol...
Try to figure out what you can teach them in 4 days, that they can spend the 4th night's homework and all the 5th day's class coding a game. Tell them on the first day to start thinking of an idea or give them a list of option sif they can't come up with one on their own. So by the end of the fifth day they can have a working game.

For requirements, just make sure they have certain elements, such as, player(of course), enemies, obsticles, score, enemy or player shooting and at least 1 level.

Cover at least 1 topic each day that is required to be in the final game they produce. Main game loop, buffer strategy, sprites and animation, particle effects, collision detection, simple AI, etc...

Also hand out a list of items they can investigate on their own, as well as websites they can look at for more information.

3D, physics, more advanced AI, etc..

Websites:
javagaming.org, gamedev.net, jmonkeyengine.net, Xith3D, Amit's, flipcode archives, Gamasutra, LWJGL, JOGL

ps. Don't forget to wow them with the Java 4K contest. http://javaunlimited.net/games/

Also tell them that should learn from whatever they can find, even if it is not in Java.
"None of us learn in a vacuum; we all stand on the shoulders of giants such as Wirth and Knuth and thousands of others. Lend your shoulders to building the future!" - Michael Abrash[JavaGaming.org][The Java Tutorial][Slick][LWJGL][LWJGL Tutorials for NeHe][LWJGL Wiki][jMonkey Engine]
This is what I would do if I were teaching the class:
Since it is only for 1 week, focus on making a simple game using an easy to use Scene Graph Engine (Java Monkey Engine or Java 3d).

1. first talk about the history of video games
2. talk about 2d graphics (pixels, monitor refresh rates, etc., sprites)
3. then talk about 3d graphics (vectors, triangles, textures, models, 2d viewport, etc.)
4. then introduce a Scene graph concept. (a tree like structure of Nodes (each Node can contain other Nodes or Geometry)
5. Provide the source code to a simple sample 2d game composed of many Quads using Java Monkey Engine, or Java 3d. (be sure to spend one class to walkthrough the source code)
6. Since 1 week, is barely enough time to do any programming, I would make the assignment be an extension to the sample game. Perhaps adding another alien ship, or another level, or something to the game that you provided.
I agree with dtaylorjr: Assuming even a decent proficiency with Java, one week is not really enough time to follow a good development process -- plus, some of the concepts that you may cover (and this is difficult, because when we say 'Game programming using Java' -- we don't know whether or not the students know anything about game development at all) will likely be wholly unfamiliar to the students (i.e., Plays lots of games ! = Has any idea of how they are actually composed). Therefore, ask yourself whether you want your students to know the fundamentals of a game (main loop, logic, AI etc), or whether you want them to learn more complex things like 3D graphics theory.

I guarantee that if your class has no experience with the Math we use in 3D and 3D systems in general that one lecture on how to use it and what it is used for will be insufficient without significant self-study exercises being completed.

Either way, one week is a terribly short time to do this in -- but that's not to say you can't accomplish a great deal, just cherry-pick the issues you think are important and don't forget to mention the less important stuff -- so people can go find out about it themselves :)

~Shiny.
------------'C makes it easy to shoot yourself in the foot. C++ makes it harder, but when you do, it blows away your whole leg.' -Bjarne Stroustrup
You can start off by introducing some simple concepts like collision detection, rendering, etc. Follow with a simple example (Space Invaders can be a good example) to demo the concepts you had covered.

Last, talk about advance topics like AI, 3D rendering, etc and how they can enhance the game you demoed. Then provide them with resources where they can look up more on topics regarding games development, like gamedev.net :)
Quote:Original post by dtaylorjr
Since it is only for 1 week, focus on making a simple game using an easy to use Scene Graph Engine (Java Monkey Engine or Java 3d).

For a week long course? Hell no. You'd waste your time trying to get it setup and compiling on everyones machine, and with creating content. For a short project like this it's got to be basic sprites via Java2D. JFrame + BufferStrategy == nice and traditional game loop thats easy to understand and use.

You might consider writing a simple framework to help them get started easy - nothing complicated, just something that creates a windowed/fullscreen display with a BufferStrategy, and allows them to attach an input handler. This way you can get started with drawing stuff and making it move right away.
Hi,

Thanks everybody for the great help :D

The people attending to the course will certainly have no experience in game programming at all.. The best I can expect from them is enough knowledge to get along some Java2D code, so I initially thought about limiting the course's scope to a basic game loop and entities management. The extensions to such a simple project would be covered in theory, with plenty of links for resources so that they can learn the rest on their own.

And given the suggestions.. I guess it's indeed the best way to go.

Thanks again for the feedback!
a.k.a javabeats at yahoo.ca

This topic is closed to new replies.

Advertisement