SpaceSim

•May 2, 2008 • Leave a Comment

This is probably my first full 3D game impleneted in C++ and OpenGL which is a coursework for the first semester in my MSc degree in Games Programming at the University of Hull, the specifications for the coursework was to make a game with a cubic spacestation with corridors guarded by defense guns and different types of barriers; Being Egyptian I prefered to give the space station an ancient egyptian flavour to stand out from the typical metalic like traditional stations that you see in every space game, and the result is what you see below in the screenshots.

I implemented a 3D model loader for loading Milkshape 3D ASCII files including textures and alpha maps and to store them in vertex arrays for OpenGL rendering, which gave me great flexibililty in the level design and texturing where I can model rooms and corridors with complex architecture, unlike my colleagues where most of them read the space station from custom configuration text files making it hard to add or remove guns, doors, forcefields, or even texture each room differently. However this imposed a challenge for collision detection as I had no data structure where I store the level data, but I managed to develop an algorithm to perform collision detection between bounding shapes (boxes, spheres, rays) and vertex triangle of the level data (spatially partitioned for efficiency and speed).

You can also notice vertex and pixel shader effects on the fighter shield and the forcefield twirling effect, all implemented in GLSL.

If you have any questions about the techniques or the algorithms used I’ll be more than happy to provide sample source code here on the portfolio (just drop a comment).

Physics simulation

•May 1, 2008 • Leave a Comment

This project is to demonstrate realtime techniques for collision detection and response while maintaining accurately simulated physics calculations including friction, drag, gravity, and conservation of momentum which are used heavily in the field of core game engine implementations.

Also this coursework is making use of the fact that the future development in processors architecture is by increasing the number of processing cores on a single chip or even multiprocessor architectures, so programming multi-threaded application becomes inevitable with all its issues of shared data and maintaining data integrety.

In these screenshots you can see bouncing balls interacting with the environment (Box) and colliding with each other and with a piece of cloth modeled using the spring dashpoint theory in realtime.

The project consists of two applications, a server where all the computations and physics algorithms run, and a client application that connects to the server to receive updated positions of the objects. Multi-client, reliability packets for congestion, and network fault tollerance are supported.

 

Da Pacman Controller

•May 1, 2008 • Leave a Comment

For this assignment the coursework was to design and implement an AI controller for the famous pacman character to be able to win against no/all ghosts eating all dots and maximuizing its score.

Implemented here is a simple finite state machine (FSM) with states like Explore, Flee, Hunt, and Feed which runs over several traditional graph search algorithms like Breadth first and the infamous A*. It was a real challenge and mostly fun to code this assignment apart from everybody thinking you are crazy cursing and shouting at your pacman to run away or hunt the ghosts :)

Note: Full source code will be available once I submit the assignment for piracy reasons :P

Battlefield Effects

•May 1, 2008 • Leave a Comment

These screenshots are from an assignment for the module named Advanced Rendering and AI for games where we were supposed to implement photo-realistic battlefield game effects using GLSL as a shader language using ATI Render monkey suite.

Effects implemented are per-pixel lighting, bump mapping, normal mapping, environment mapping, multi-texturing, particle systems and billboarding techniques.

I am not very keen on learning graphics effects and rendering but discovering how to write programs that run on the GPU using a fairly high level language like GLSL was very instructive and could help in many disciplines taking the massive parallel power that graphics cards provide nowadays.