back

4 Winner Applet

Short story on that one.

This was a small project I participated in during the last weeks of the spring semester 2004. The original task was to write a "4 Winner" game in Java in a small team. Since I already had my 3D graphics engine in a usable state at that time I decided to use it for the game.

You may either download the program archive or play the game online.
The source code is available with a statement of interests on request.


Some technical background.

The graphics engine based on a rather simple scene graph renderer with the core being the software rasterizer which is capable of rendering polygons with features like..

- "division free" perspective correct texture mapping
- flat shading
- gouraud shading
- texture blending modes DECAL and MODULATE
- backface and small polygon culling
- specular highlights

The graphics data was created in Cinema 4D and exported to a custom format using a custom exporter plugin.
Since everything is written in pure Java (except of the Cinema 4D plugin of course) it does not require any fancy extension plugins or libraries and runs on almost every computer that supports the Java Platform.
The drawback is the low rendering performance.
It is really a pain in the arse writing such stuff in Java if you are used to C++ and Assembly language. I even tried out doing tile based span buffer rendering (like PowerVR chips do in hardware) but I obviously got something wrong with the span sorting and span insertion algorithms and so I stuck with the simple z buffering approach as it turned out to be a little bit faster.
But the tile rendering idea is really nice, especially when it comes to parallel computing, what will become more and more important with future hardware systems like the PlayStation 3.
The scene and texture loader of the engine is able to load data asynchronously in the background while the game is already running. This way user waiting times for the game to load are dramatically reduced, especially with slow connections. For example, textures are streamed from the webserver as they are needed to render the graphics scene and gain detail level during the loading process.