Skip to main content
gamedev.net
🔒 Locked

[java] Java Game Programming "Workshop"

Started by Son of Cain 37 replies 8.6k views
Original Post
Son of Cain
Son of Cain
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
steeg
steeg
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 :)
SageofAges
SageofAges
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.
steeg
steeg
oh yeah, good point....show them tribal trouble to get rid of the skeptics that think java and games don't belong together lol...
CaptainJester
CaptainJester
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][
dtaylorjr
dtaylorjr
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.
Shiny
Shiny
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
Si Hao
Si Hao
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 :)
OrangyTang
OrangyTang
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.
Son of Cain
Son of Cain
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
Raghar
Raghar
Quote:
Original post by Son of Cain
Hi fellows,

I have one full week- and about 3 hours a night - to talk about java game programming.


They would have only one week. So they would forget everything in three weeks.

Quote:
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?


You could start with the three famous sentences.
"When I thought what should I teach you in this course I originally thought about teaching some theory as is common on universities. However one person from game development industry requested this course should force you into creating some code, thus expect a lot of typing in this course. Because he is nuts, I'd grant his request, so you are in a BIG shit."
Then you could use these common questions like: Have you used javac.exe (I mean command line compiler)? Have you used multithreading. Do you know how to start new thread? Can you read, and use documentation?

Quote:
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?


You shouldn't expect working code from them after few nights.
AI doesn't need to use scripts. It could use for example command code, or feel matrices.
Of course you can talk about strong AI and how current computers allows AI that is smarter than some humans, and why in finished releases is used reduced set AI instead, and a lot of other theoretical talk. It will not however give them more than a theoretical background, and it's rather little time into October to research this topic correctly. (Note it would be few semesters worth of teaching material anyway.)

Nights? There would also be problems how fresh they would be at nights.
Try to make these courses enjoyable. I sometimes, when trying to finish work, tend forget to make these things enjoyable and funny so beware. Of course it shouldn't happen in just an one week course.

Try to don't screw this course too much.

BTW don't forget to mention the artistic aspect of the game development, and force them to read some books, or watch few animes. ^_^
Son of Cain
Son of Cain
Hi,

I should have mentioned earlier, but game programming is so rare a subject around here that I'm afraid my audience will be quite excited to see what I'll be talking about. I'm sure they're expecting a lot out of me, even though this is just an one week course for complete newbies - in game programming, that is.

If I were in their place, I would expect someone to tell me what the reality is - that means, tell them how cruel it is to write a game ;)

They might be expecting a magic formula, but we all know one does not exist. But if I keep talking about theory, I could raise some doubts regarding my ability to code :p

That's why I came here for insight... how to successfuly show them the light? :D

Son Of Cain
a.k.a javabeats at yahoo.ca
Greig Hamilton
Greig Hamilton
If I were to have taken a course like that back when I was studying I would have wanted the following.
1) To see what games could be made in Java eg Tribal Trouble or similar, a few screen shots of different games would be enough.
2) To find out the basics of how to make the game, handling input, painting to the screen, game logic.
3) To actually see a complete game at the end of the week. Something really simple, Pong or Space invaders. If it is purely lectures then to be lead through the code (you'd need to write a simple game). Or if a combo of lectures and labs then to have the princples explained to me and to create the code in the labs (almost copy and paste since there is not much time in the course).

To keep them interested in making games after the course they need to see the potential and also feel like they have made something, their first real game.

Just my opinions though.
Shabadoo
Shabadoo
I lectured Java for a semester last year and created a 5 part assignment in which the students had to create a simplified version of Space Invaders. If you are interested I can mail you the basecode, tutorial pages, and solutions to take a look at. The assignment was targetted at students who were learning about the Collection and UI classes so you might be able to condense some of the steps for your students.

Cheers,
Brett
Son of Cain
Son of Cain
If it's ok with you, I would indeed like to see it.

You can write me here.

Thanks,
Son Of Cain
a.k.a javabeats at yahoo.ca
Raghar
Raghar
Quote:
Original post by Son of CainThat's why I came here for insight... how to successfuly show them the light? :D


Tie them up and tickle them into submision. ~_^ If that fails you'd be forced to do actual work.

Considering the Brazil school system is simillar (at least in products) to school system I seen recently, products would be horrible anyway.

These few hours are not enough to teach them a proper coding behavior, so it would highly likely result in a rather theorethical approach.

Well post your draft so we can scream in terror.
paulecoyote
paulecoyote
Set them a good text, or perhaps use it as a basis for your workship.

I think David Brackeen - Developing Games in Java would be an awesome text to use.

I have it myself, it has stuff at the start for even the greenest Java dev, each chapter aims to create / improve on a game, and it goes through to creating a home-rolled software renderer.
Anything posted is personal opinion which does not in anyway reflect or represent my employer. Any code and opinion is expressed “as is” and used at your own risk – it does not constitute a legal relationship of any kind.
Son of Cain
Son of Cain
Quote:
Original post by RagharWell post your draft so we can scream in terror.


Ok... [grin]

My plan is the following... Use a 2D game with Java2D or LWJGL, coding it in three steps - one at each night - while explaining fundamental theory or the concepts involved, sharing resources such as links for articles for later review and further information.

What to cover? Well, for the first night, I would be satisfied if they understood the basic game loop, how to count frames and skip them as necessary. For the second night, entities: create them, clone and spawn them, update() and render() them. At this stage, they will have something that resembles a game. For the third night, the addition of path-finding as an AI example, and perhaps a draft of a FSM in order to provide a more "complex" example of AI.

For each "topic" covered, a compreensive list of resources would follow, for further reading and further information. That's how they'll actually _learn_ something, anyway... [grin]

I guess that's the best way to use my six or so hours, to give them a quickstart on game programming, a final product to improve as a means of practicing, and a few resources to continue their quest, if they so wish to. I just got to know that the two other nights of the week (Monday and Friday) will be used for other events within the academic week. So I have even less time..

Son Of Cain
a.k.a javabeats at yahoo.ca
CaptainJester
CaptainJester
Be sure to provide them with the artwork for the game. You might want to explain that creating art can be as time consuming as coding.

Another thought is for you to have already coded what they are doing at each step. At the start of the next day, some people may not have finished and will need to have a working code base to start the nest lesson on.
"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][
Raghar
Raghar
Don't forget on multithreading. Majority of games should be multithreaded, if only for smooth user input on slow computers. (BTW flight simulators would like to have input at 1+ KHz). Considering the granularity of windoze XP pro is 2 ms, it's rather hard to obtain task without specialized input device/or modified windoze XP pro SP2 kernel.

In the first lesson you might concentrate on Input output devices, theirs capturing, polling and other tasks. What you'd do in second lesson is unknown, but because they'd be bored to death, you might do something flashy.

In third lesson you might talk about smart AI, and why experienced AI programmer is programmer/researcher that knows when don't use it. I don't think they should need pathfinding that much, FSM and ISM, need driven AI, and behavioral AI are of greater importance.

And you might place somewhere also some theory about game types (RPG and so on), and the basic styles.

Also about game types like
Something for something
Something for nothing (this game is quite funny) and so on.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.