Java Gaming Presentation at My School

Well, tomorrow I’m going to do a presentation to the Math/CS department at my university on Java Game Programming. I’ll be like the first person under the age of 35 to give a talk there hehe. Anyway, many students have suggested that if I’d do a presentation on the subject they’d definitely attend, so I’ve agreed to do it for the school.

I’ve written some basic classes which two basic games implement, and I’m going to show some tips and tricks in the field and also illustrate and teach against common misconceptions that I’ve learned about here on the boards. Then I plan on showing off some of the developments that are easy to show :slight_smile:

Namely I’d like to show:
[]GAGETimer
[
]GTGE and the RPG demo for it
[]AlienFlux
[
]Perhaps a couple of the 4K games because those are just too cool :slight_smile:
[*]And Rimscape of course :wink:

I also want to teach:
[]How to get managed BufferedImages
[
]How to structure a game (render, run, fps synching)
[]How to handle input correctly (keyPresses set flags)
[
]How to manipulate graphics, read them in, and double buffer Applications and Applets

How’s that looking? These concepts will be illustrated as I walk through the simple classes I’ve created and will hand out. Then I’ll show a few of the games and finish up with questions as I already know I’ll get a lot of those :slight_smile:

If anyone can point out something extra I should be sure to hit I’d very much appreciate it!

Maybe you should throw in a little something about the separation of logic and rendering, and get a bit into the concepts of “network-enabled game design”, since “the kids” of today take online gaming for granted.

/M

Don’t forget to show 'em Dudester and Puppytron too while you’re at it :slight_smile:

And if you really want to impress them, ask Elias for the link to the Tribal Trouble beta.

Cas :slight_smile:

I’d start the presentation by intrioducing Java as choice of technology in the game insdustry. What is the value of the Java platform compared to other well known technologies such as C/C++ with DirectX.

Second, talk about the well known APIs (Java2D, LWJGL, JOGL, Xith3D, JInput) from a high perspective:

  • intended goal(s)
  • strengths
  • weaknesses

then go on with you topics.

I would start out the way “TheAnalogKid” did, with good sides of Java. Then looking at different sectors of game development:
[] Graphics programming
APIs for accessing OpenGL (ie JOGL, LWJGL)
Rendering engines using JOGL/LWJGL to offer scene graphs… and 3D engines with features for advanced gaming i.e. lights, bone animations, shader support etc.
[
] Networking
[] Input (Jinput etc)
[
] Game play (No need for separate scripting language)
[*] etc
You can also demo Megacorps Online if you like. It is a little more demanding on the hardware side though… Perhaps it can be encouraging to see that you can do games with high-end graphical features, yet still keep the platform independence that Java offers and benefit from Internet as a distribution channel (that is more than just downloads) :slight_smile:

I plan on using a small block of time for showing off the API’s, which is one of the big benefits of the Java programming language, but I don’t think I’ll go much farther than that. I’m only able myself to work with Java2D still, and I’ve yet to do anything with networking or anything like JInput so I don’t think I’d be capable of sharing good information on those extensions of this field. What I want to do is give these guys something that they can actually take and say, “I can do that” and have them get on the right track for starters. My audience is of people who are likely to dive into this so I feel that if they’re at the level of “how do I draw stuff to my screen?” then I should probably not overwhelm them with how to program a network game or the benefits of a scene graph API, etc. That’s like saying, “1 + 1 is 2… ok, think you got that? Now, I want you to integrate the volume bounded between this plane and this parabaloid.” After all, I’ve been programming Java games for about a year and a half now and I still have no knowledge of those things :wink:

So in short, I’ll try to open their eyes to what’s available, but I won’t go farther than they can grasp in a one hour talk. I want this to teach what they can do NOW, not in what they can do after a couple years. I want this to be the information I wish I’d had when I started so I didn’t have to make so many mistakes along the way while poor Abuse had to constantly correct me :wink:

Sounds like a plan :slight_smile: Good luck and bring lots of friends with you to the wonderful pointer-less world of Java :wink:

Sounds like a lot to try and jam into just one hour. Good luck.

http://www.gamelizard.com/JavaGameProgrammingPresentation.htm

There’s the page I made to guide it. It lasted for 1.5 hours :slight_smile: Surprisingly only 2 people left and only because they had to! Good success. Doors have been opened for ignorant programmers at my university :wink:

I think I should make that FieldHockey game into a 4k game… if only I had the talent :wink:

keysPressed[e.getKeyCode()] = true;

should be:

keysPressed[e.getKeyCode()&0xff] = true;

otherwise you would need:

boolean keysPressed = new boolean[0x1000]; //silly

instead of:

boolean keysPressed = new boolean[256];

[quote]http://www.gamelizard.com/JavaGameProgrammingPresentation.htm
[/quote]
That’s pretty cool! So should I assume that the games you listed are the ones you think are the prime contenders for the 4K contest? :wink:

[quote]I think I should make that FieldHockey game into a 4k game… if only I had the talent :wink:
[/quote]
Did I miss something? I don’t seem to see a FieldHockey game on that link. Maybe I’m just blind? (Wouldn’t be the first time.)

Thanks oNyx for that tip! I’d never heard that before or had a problem from it. What problems could I be running into without it?

jbanes, the FieldHockey game is one of the two games in the source code I have going along with the tutorial. I guess I should have pointed that out. No fault of yours for not seeing it! :slight_smile:

I suppose I could toss it into webstart one day soon and see what everyone thinks… It’s a much improved clone of a game I played at my old high school.

I found the original here:
http://webassign.net/pas/electric_field_hockey/efh.html

It took me 2 hours to write the game from memory :slight_smile: Then I went and designed some more levels because I wanted some new ones. The ones from the old version can be found (well mostly) in the screenshots on that game. However I still had more fun making new levels for mine :slight_smile:

Compile the source if you’d like. Otherwise expect a webstart version up within a week (when I’m less busy :wink: ).

What problems could I be running into without it?

IndexArrayOutOfBoundsException if the user hits an extended key like ö, ä, ü, menu, win, mac… whatsoever. The &0xff bit just ensures that the index stays <256.

[quote]Thanks oNyx for that tip! I’d never heard that before or had a problem from it. What problems could I be running into without it?
[/quote]
http://java.sun.com/j2se/1.4.2/docs/api/constant-values.html#java.awt.event.KeyEvent.CHAR_UNDEFINED

That link shows all the values behind the constants in KeyEvent. The highest value is 65535. So you can to as oNyx said, or you can increase the size of your array. Of course, that is a lot of memory.

64kb is not a lot of memory. =/

[edit: s/65/64/]

64k!!! Thats like 16 games!

Kev

lol.

Well, it’s senseless to throw so “much” ram at the problem… I mean… using 1/256 of that ram for usual stuff and 255/256 for ugly error avoiding is just… plain silly :slight_smile:

[quote][…]
boolean keysPressed = new boolean[0x1000]; //silly
[…]
[/quote]
See? I even wrote it next to it :wink:

You can do that in 4k games (like I did), but usually you should try to write good code :stuck_out_tongue:

GNARF!

Should be 0x10000 instead… :-X

silly code leads to silly mistakes… silly mistakes leads to shitty programs… shitty programs leads to teeeh darkside… :f

Readable code = good code.

One time optimisation that obfuscates the code and saves you a one time cost of 63.75kb ram != good code.