Java Game Development in a High School Classroom?

Hi, I’m a high school technology teacher. I teach the programming classes (among other things) at my school. Currently, I am teaching one course that is predominantly Java but that might be changing soon. We want to add a Game Development class that they will take after they have already taken the initial Java course.

I have a few questions for you guys?

  1. Do you feel that a group of high school students could complete a polished game in 16 weeks, meeting everyday for about 70 minutes?

  2. The students all want to do 3D games, my principal wants to do 3D, however I feel that producing a “good” game will generally be much harder if we go with 3D. Especially, because we don’t teach 3D modeling at my school so I’d have to teach that as well, however most of my students will have had graphic arts and will have Photoshop experience. Do you agree with that sentiment?

  3. If we did go with 3D, I had an idea where we would study Atari 2600 games (centipede, pitfall, breakout, etc.) and then we can make 3D games that are inspired by these games. I just want to get the student’s minds off trying to recreate Fallout 3 or Call of Duty 4 which as well all know would not be possible. I figure these kinds of games have simple mechanics and graphics and yet still managed to be fun. What do you guys think of this idea?

  4. How is Java 2D game development in general?

  5. Are there any other good sites/communities that I could check out for Java game development?

You’d definitely get 2D games done in that amount of time.

I don’t. They will be expected to learn programming in 3d, game design and 3d modelling on one course. These topics are usually taught indevidually, so I’m skeptical about combining them all at once. I’m also skeptical that your students will be confident programmers; I’ve seen plenty of students that really struggle to program even after a good programming course. I’d recommend getting most students to work on a 2D game, but let those who are clearly interested and ahead build something in 3D.

I think a mix would be best. I can imagine that they would be far more interested in studying high-end recent games then older ones. You could also try to turn it around in that your showing them why they can’t build another Fallout 3 in 16 weeks (because it’s so complex and there is so much to it). I’d recommend looking at, but not building a 3D game.

You can use Java for game development (and there are tonnes of excellent examples around online), but it’s not really aimed at game development. There are some excellent libraries you can use and it’s far better equipped then the majority of languages. But as I said it’s not really aimed at game developed. Java 2D which comes in the Java API is good enough to use, but not fast or powerful enough for games. There are plenty of other game and graphics libraries to pick from such as JMonkey, LWGL, Slick, JOGL and even my own (the first two are probably the best to pick). I know JMonkey is definitely used on some 3D game courses around the world, so there might be some class materials around online that you could look at.

But if your going to be doing 3D then IMHO I would recommend C# with XNA over Java (I’d imagine there are lots of teaching resources for this option too).

This is the only community I know of that does Java game development. You could also checkout GameDev.

(Disclaimer: I actually work for them so this bit is biased); finally I don’t know if it will be at the right level for your students but there is a good educational programming environment used in some schools called Greenfoot. It aims to teach programming to kids by getting them to program games and scenarios. A text book also recently came out which is also intended to help with learning and they have their own site where you can upload your creations at the Greenfoot Gallery.

I kind of disagree Java2D is not fast enough. You can reach a very decent frame rate using the right stuff . It is indeed not as powerful as slick2d I’d go anyway for java 2d. You can do nice games with it, just check the showcase section .
I think a beginner programmer will benefit much more learning a few graphics classes from java2d, and then spending his time really programming, than learning to program 3d stuff .

If the student has no interest in games, either 3d or 2d would be a pain for him and he’ll not do a good job in your classes . If he has, I believe going 2d first is the best way to make him more interested and then later he can go further doing 3d .

Anyway, I think you should convince your students/director that starting with 3d is definetly not a good idea. If you’ll do you’ll probably end up with a lot of half finished (or half beginned…) games at the end of the course and a lot of frustrated/bored students .

I don’t really have an opinion for all the questions, but … 70mins a day for 16 weeks is like 90 hours of development time per student. You can certainly create a 2D game with this. I personally would not go into 3D at that stage, because like you said … there are more prerequisites.

Assuming that this classroom has permanent desktops networked to eachother, you have a unique opportunity to develop a small MMO style game. Many (young) game developers think about writing an MMO, but it is hardly realistic. But at 90 hours per student, a small MMO is actually possible, and it would help the young developers get it out of their system :wink:

If not an MMO, I would suggest you at least write a networked game. It’s the perfect environment to experiment - low latency and plenty of users.

With regards to Java 2D being used in game development … it can be done, but it requires a fairly complete knowledge of the API, how HW acceleration works, etc. I always recommend Slick. It’s a fast OpenGL-based (using LWJGL) 2D game library which is built with Java 2D users in mind. It takes care of most of the boilerplate code and lets you focus on writing the actual game without having to worry about speed/performance hacks.

  1. Yes. I imagine the first few weeks will discuss overall architecture and that the group would work together on this, before splitting into a number of small teams to make similar games based on a common architecture.

  2. The java graphics API only includes 2D functions. It is possible to do 3D using software rendering with the standard java API, but unless one sticks with line drawing (Like David Braben’s Elite), or flat shading, this would not be doable in the time. Required maths for doing 3D includes dot-products and vector-products. Also required is matrix arithmetric. 3D Modelling would be an issue, although simple geometric shapes shouldn’t be too hard. Overall I think a 2D game would be a better bet.

  3. I would think in terms of doing vector graphics type 3D games.

  4. Most 2D games on the web are programmed in Flash. For Java, I’d look at java4k.com, which is where all the java competition entries are held. These games are small due to the 4k limit and most are in 2D.

  5. Don’t know of any other Java Specific communities. There are a number of personal websites with java game programming. E.g. Kev Glass’s Space Invaders 101 (http://www.cokeandcode.com/info/tut2d.html)

Hm seems like everyone’s sort of underestimating just how hard it is to make something polished and overestimating just how good high school students are. Apart from the fact that programming is bloody hard, and Java is bloody hard, game programming is bloody hard, and game design is bloody hard too.

With 90 hours dev time per student you might expect the majority of them to possibly come up with something as complex as Space Invaders if they were working on their own. You did say polished, right? Anything beyond Space Invaders takes more and more effort, and that’s just for people who already know how to program, know how Java works, know how games work, and have some vague idea about the game they want to program. And this discounts the fact that as n00bs they will invariably think of making an MMORPG or other outrageously complicated idea, like, say, anything at all in 3D, and then basically fail at it and you’ll have a hell of a time figuring out how to allocate marks at the end of the projects for what amounts to a buggy lump of shite that just about gets a bit of flat shaded terrain rendered with mouse zooming and a box that’s supposed to be a house in the middle of it.

Having spent most of my life programming (haha, learning to program), most of my career either programming or telling other people how to program, most of my spare time designing and writing games, I feel qualified to tell you that if you attempt to get them to do much more complicated than a 2D game like Space Invaders (working alone) they will fail miserably, and the maximum team size that you should otherwise entertain is about 4 students, who will be able to produce something maybe twice as complex as a single student can manage. So, maybe a scrolly shooter or platformer of some sort.

I fully expect to be burned to a crisp in this thread by the flames of nerd rage but I will don my flame proof pants and I am prepared to hunker down with a series of sharp, poignant and utterly accurate observations about the state of games produced by said flamers before it even happens :slight_smile:

Cas :slight_smile:

ps. Java2D will be fast enough but you need probably to do all the speed research up front for your students, or they will all waste the same time figuring out what’s fast enough and what’s not fast enough, which is highly inefficient. Your research should probably be a lecture on bufferstrategy, bufferedimage and the compatible creation thereof using graphics devices, and also possibly timing loops in their various guises and how this is done these days in Java.

Cas :slight_smile:

@ princec why would anyone flame you? :slight_smile: IMO your spot on!

but then again, I’d say go for it, you ppl should try a 3d MMORPG, failing is part of the learning process ;D

Learning basic 3D Graphics is a full university course, I’ve gone through it. Your principal is unrealistic.

you’ll never be able to do 3D game with a group of learning game programming, let alone Java programming. I’ve gone through that also, as a student. Failed!

Java2D is a good choice. Other programming languages have a similar 2D graphics API, so you gain little by choosing C# or others.

Slick is probably a better choice though, much easier to get going with it as it’s aimed at game programmers, and based on OpenGL, providing a lot faster framerate and with an API very similar to Java2D. You could even claim it’s using a 3D pipeline, to get your principals approval :wink:

Aye, but it’s very demoralising, for students, and also it rather makes the teacher look a bit foolish to the headmaster.

Case study: at the last place we worked, I declared a day to be Games Development Day, and being the head of development, I could do this :slight_smile: My team of seasoned hardcore Java programmers had a day to write a game from scratch and we’d all vote for who made the best game at the end of the day over a few beers. I joined in for fun but I cheated because Chaz drew a few sprites for me :wink: but then I wasn’t allowed to win.

End result: 4 devs entered including myself. 3 games were “finished”, that is, they ran and you could play them to some extent. 2 games were utterly awful, not just because they only had programmer art, but because their designs were just grim and no fun at all to play, or required 6 keys simultaneously to play. Unfortunately the one that was left was mine which didn’t count (tidbit of information - it became Puppytron and then Ultratron not long after).

That’s the best a seasoned team of expensive programmers could come up with in 8 hours or so. Doubtless they’d manage better with a full 2 weeks on it but they would, I think, have gotten a week into each game before they realised how crap their game ideas were, and given up.

Cas :slight_smile:

On second thought…

You could probably start with a simple 2D game in Java2D, e.g. Breakout, to demonstrate basic game logic and loop.

Then you could move to basic 3D, something like a Maze game (finding a object in a maze) using plain OpenGL (no special 3D libraries, models or anything, just plain vertices, quads, math, etc.). See LWJGL.

No more than 3 people in a group. There will always be one guy that does all the work, having any more will just make more people do nothing and learn nothing.

Indeed, that’s why it’s probably best to make each student submit their own game.

In fact they may have trouble thinking up a worthy game idea. Give them a list of reference implementations to choose from and tell them to try and make as best a copy as they can.

Cas :slight_smile:

I concur. Although a pair of students is probably alright.

My suggestion is to start with a few good old zx spectrum classics that don’t take much work and let your students remake them. Java2D is a solid game development api, so don’t worry about it. I’m using Java2D together with Jython for the scripting language for a Starflight roguelike game i’m working, which supports both image icons (not animated) or unicode characters.

http://www.worldofspectrum.org/tbosg/

Thanks for all the replies. You guys confirmed my initial reaction in that 2D is the way to go. Thanks.

I also had another question. For 2d game development is there an advantage to either Netbeans or Eclipse (I’ll probably be using Slick2D, if that makes a difference)? Thanks.

They are both excellent, but IMHO NetBeans is better because I find it to be better laid out and more stable then Eclipse. However Eclipse is FAR more popular.

Java Game Links:
http://www.javagametome.com/
http://jmonkeyengine.com/blog/screenshots/
http://www.lwjgl.org/projects.php

I Also recommend 2D. Because 3D will require the students to learn OpenGL and that is basically a subject in its self.

If you would like to get the students to have a single game made in a group then:

I personally recommend having a finished product (of the game) before teaching the class.
Pass out the tasks among the students, give different “Class” file names to different students. And give the getter and setter method headers.
If a student doesnt complete the task, you can assign a low score, and then use the pre-made Class file for the final student program.

Or else if the student has a working version, rate it on performance/bugs.
So the class has something to show, and keep at the end of it all.

A further recommendation towards teaching team work, would be to make a basic console program at the begining of the year that works on the princible of “chinese wispers”.
A simpple example would be to add a total sum of equations.

Basically get a single student to implement a single equation, that they are given, in a Class file.
The Class should take the result of the previous students output. Make it so you as the teacher input the initial number.
At the end compare what the result should be, to what it is. Then Find the problems (which im sure there will be some).
This should show the students, the importance of implementing there work effectivily.
Aswell as show you the level of competency of each student, so that you can deligate harder tasks to more capable students.

If you would like to get the students to make there own individual games:

Basic GUI Input handling (mouse/keyboard/GUI buttons)

  • Mouse
  • Keyboard
  • GUI Buttons

Game Logic

  • Timers

Graphics

  • drawing with the Graphics2D
  • image loading

Sound
*basic wave sound fx

Some excellent ideas Bobjob, thanks!

Define “polished”. If I may give a couple of case studies, head over to www.funorb.com and check out Transmogrify and Sol Knight.

I wrote the alpha version of Transmogrify in 2.5 hours. I started writing games when I was 8, studied Computer Science at a top university, and had about four years of professional experience before writing it. I was using a games engine I’d worked with for a year, and I already had the dictionary and code to check it efficiently from Lexicominos (also on that site). I then spent two months at 40 hours a week working on polish.

Sol Knight was written by a colleague. The alpha took him 2 hours, starting from a similar position in terms of experience. The polish took, IIRC, about 2.5 months full time.

Of course, neither of us created the graphics (except for the odd bit of special effects in code), music, or sound effects, although we did provide specifications, discuss things with the artists, and glue them all together. The team also included dedicated QAers, which is important if not essential if you want a polished product.

The point is, starting from no experience and no library it will be a challenge to make an alpha of one of these very simple games in the timeframe you’re talking about. Polish is hard work and time consuming and most of it doesn’t really teach you anything about programming.

[quote]2. The students all want to do 3D games, my principal wants to do 3D, however I feel that producing a “good” game will generally be much harder if we go with 3D. Especially, because we don’t teach 3D modeling at my school so I’d have to teach that as well, however most of my students will have had graphic arts and will have Photoshop experience. Do you agree with that sentiment?
[/quote]
There would be no need to teach 3D modelling - find some models on the web and use those - but even without that your students will spend the first three days or so going crazy wondering why they can’t see anything on screen. Eventually one of them will discover that it’s all behind the camera, or past the far clip plane, or they have a degenerate model view matrix which is collapsing the entire scene to a plane.

[quote]3. If we did go with 3D, I had an idea where we would study Atari 2600 games (centipede, pitfall, breakout, etc.) and then we can make 3D games that are inspired by these games. I just want to get the student’s minds off trying to recreate Fallout 3 or Call of Duty 4 which as well all know would not be possible. I figure these kinds of games have simple mechanics and graphics and yet still managed to be fun. What do you guys think of this idea?
[/quote]
I agree with Prince: trying to make a clone of one of these games is as ambitious as you should get.

Recreating a classic arcade game should be easily doable in this time frame, although I don’t think the polish is entirely necessary. Getting the gist of a game is probably the more important thing, if they remake Asteroids with the ship as a square and the asteroids as circles I would consider that a success.

I don’t think the students will want to do 3D once they see how much work it can be, however, if they think they can tackle it you can always encourage them to do the research for it outside of class. It all comes down to how much effort they want to put in their project. I would recommend that you focus on 2D though as that would be easier to grasp and will allow you to cover aspects specific to programming.

I recommend taking a look at http://fivedots.coe.psu.ac.th/~ad/jg/ for more information on java 2d game programming.

On a side note, my high school offered a java programming course, it was only a trimester and most people did not know any programming but using Greenfoot most were able to create a mostly functional game in about 3 weeks for our final project. I don’t really know how much time people worked on it outside of class though.