Ogre3D networked game

I’ve implemented networking to a game called “Solarbound” which was my 3rd year group project. The main framework was adopted but recoding was done to trim down and optimise the framework for use with this coursework. A lot of unnecessary features and code were removed so that it would be easier to adapt the framework to introduce a multiplayer network game mode into the framework.

The features of this game include simple enemy AI, collision detection, simple score and health system for players.

The game is based on a client-server protocol. There are two executable files generated by the framework called server.exe and client.exe which are the server and client modules of the game respectively. The server.exe file functions as the host for the game. This file must be run before trying to connect clients. A very simple GUI has been implemented for the server with options to start the server, spawn enemies and also activate and deactivate Dead Reckoning (DR) algorithm. There is also an option to activate and deactivate the simulation of packet loss to further observe the effects of DR. A very simple “God Mode” is also implemented to the server module to enable the user to freely observe the game world in real-time.

The client.exe file connects the player to the server and has options for the user to input individual player names and also to input manually the server’s Internet Protocol (IP). The client also has the option to turn on and off to observe the effects of lag or packet loss artificially simulated by the server. At the moment there is only support of a maximum of 3 players due to the models available.

The overall game play is simple with players competing to outlast and outscore other players by gunning down as many enemies as they can before dying. The players can also shoot each other and each hit will reduce the player’s life by one. The game will be over when the player’s life reaches zero.

There is only one single type of enemy and which implements a simple type of AI. The enemies will spawn at random points in the map and remain static until a player gets into their “detection zone”. They will then start to manoeuvre towards the player and try to ram into the player and self-destruct.

One interesting thing to note is that OGRE3D doesn’t like multiple instances being run. So if you run the client and server on the same computer the application will speed up drastically.

Below are some screenshots from the application. Click on each thumbnail to enlarge the picture.

The executables can be found here

The source code can be found here


OpenGL Terrain Demo

This is an OpenGL demo I made featuring procedural terrains! I’ve also added fancy water effects with reflection and animation to further spice things up 🙂

The demo only uses two procedural generation method which are : Midpoint displacement and faultline algorithm.

I’ve embedded the video but as would suggest running the EXE to fully appreciate the demo 🙂

[local /wp-content/uploads/2010/05/glterrain.wmv terrain]

The executables for this demo can be found here
The source code for the demo can be found here


Bezier Curves

I’ve created a demo framework to demonstrate the Bézier curve in 3D space. The demo graphically plots a Bézier curve with control points which the user can manipulate by selecting and moving them around thus changing the appearance and shape of the curve. I’ve also included an animated object with simple physics. The demo is written using OpenGL API, some WinAPI and C++ language.

The following are the features of the demo:

  • Sky Box – A simple skybox encapsulates the world to give a better sense of direction and motion when in 1st person camera mode.
  • Terrain – A simple terrain is also added to further enchance the appearance of the demo
  • Lighting – There are three directional light source which the user can move around.
  • 3D Model – 3D model with specular lighting.
  • Physics – Simple physics implemented for the movement of the model along the curve. This can be turned on and off.
  • Menu system – Simple Windows console menu system that consists of instructions and also several options available for the demo.

The Bézier curve is drawn using the de Casteljau algorithm as well as using parametric calculation.

Below is a video of the application in action. I would suggest downloading the executables and running them to get a better view 😉

[local /wp-content/uploads/2010/05/b1.wmv bezierdemo]

You can grab the code here
You can grab the executables here *Note : unzip the DATA folder in the same folder as the EXE


It’s a bug’s life…

I’ve toyed around with Milkshape3D and created a simple animated model of a dragonfly. It is intended that this dragonfly have a rather cartoon-ish appearance. The model is divided into several moving sub sections. These sub sections are later then used for animation. Sections in my dragonfly model include the head, main body (which also acts as the whole backbone), tail, legs and wings.

Instead of just making simple flying animation, I have decided to give this model a little more life and personality. The animation has 100 frames used in total. It shows the bug scratching its head, bounces up and down a little while twisting its body and finally tries to take off.

Below is a screenshot taken from inside Milkshape3D (click to enlarge):

Here’s the embedded video, enjoy! (Windows Media Player browser plugin required)


OpenGL and Homer Simpson

What else could be more brilliant than a mix of OpenGL goodness and Homer Simpson! The demo is fully written in OpenGL (and a bit of WinAPI) in the C++ language.

It features our fully animated hero, Homer Simpson weilding a gun. The environment features a 3D world with heightmapped terrain enclosed in a skybox. Features of the demo includes:

1) Homer Simpson MD3 animation model – static, jumping and walking animations

2) Static MS3D cow models

3) MS3D windmill model, edited and also rotated (animated) real time using OpenGL function, glRotate

4) Particle system (billboard) simulating fire

5) A semi- transparent, multicolour pyramid generated solely on basic OpenGL routines

6) Simple shadows

Some screenshots below but running the EXE itself would be very much better 😉

As you the source and executables can be downloaded :here (Source) and here (exe)