2012/11/05

miniDooM: Exciting Experiment!

This (long) weekend has been a journey of discovery! Not only have I learned a lot about how the Java graphics pipeline works, I've polished some elements of the program structure and come up with a few techniques I'll probably use in the final code.

And, I've also discovered a pretty nifty screen capture program in Ubuntu. Behold!



Explaining the video in 3, 2, 1...

So that little demo shows a few things I've completed, listed in no particular order:

  • A Doomie helmet image loaded as an sprite. Yes, it moves around using the keyboard.
  • A background static/white noise effect, that, unlike the previous iteration, is hardware accelerated, and thus faster. Although it has a few limitations too, since the previous iteration was calculated on the fly, and this one is pre-generated.
  • Transparency Blending, namely in the "light" effects that follow the helmet around, including some attempts at coloured lighting.
  • Video compression is not my friend. The background static looks sometimes jerky in the video, probably because the video compression merges frames thinking nothing has changed. Noticeable at the start and end of the video, when the Doomie helmet doesn't move.
The really exciting things, though, are happening under the hood. The major being the use of GPU-backed buffers for drawing, which (theoretically) increases rendering speed (Although, again, a lot of benchmarking is needed), and, to my taste, help organize code better (The VolatileImage class used for said buffers has fewer methods/capabilities than the standard BufferedImage class, which I feel helps remind me that they shouldn't be meddled with too much, lest the GPU acceleration is lost).

The whole transparency thing has been tricky, as the standard java.awt drawing mechanisms do not offer an intuitive method to create the "cutout" effect I wanted, but I seem to have found a workaround.

Still, all the code doing the drawing and effects is just test code, not the final rendering classes. The Display/Screen managers still need to be polished a bit more, and both Input and Sound are still non-existent. Plus File I/O management, and probably a few more details.

In any case, actually having something that moves and looks like a weird surrealist game is great.

No comments:

Post a Comment