Posts Tagged ‘opengl’

Finite State Machine Framework

February 15th, 2008 shyam No comments

A simple FSM Framework and example application written in C++, based on ideas presented in “Programming Game AI by Example” by Mat Buckland.

Download: source

Categories: Code Tags: , , , ,

Particle Engine

May 5th, 2005 shyam No comments

Project Goals:

Our goal with this project is to effectively implement a particle engine in a 3 dimensional environment. By a particle engine, we mean a system which will effectively implement realistic weather-type effects through the use of small, continuously moving particles throughout our scene. A system like this takes a lot of “background” programming in order to both manage and manipulate the several different systems we plan to create. More importantly, memory management is a very real issue here as we will be creating hundreds, if not thousands, of particles accross all of the different systems should they all be turned on at the same time. Thus we will start with a basic 3 dimensional environment with the user having camera control of moving fowards, backwards, left, right, rotate left, and rotate right. Once we have this basic “arena” set up, we will texture the environment to make it a more realistic-looking area with a grassland base and appropriately stitched skybox for the atmosphere.

As for the details regarding the actual particle engine, we will start with a top down design, having a particle manager at the top of the hierarchy to create, destroy, and manipulate all of the different systems we will be implementing. This particle manager will have methods for adding and removing systems from the scene as well. In addition, we will be creating a base class with virtual initialization and update functions to be overridden in the classes we define for each specific type of system.

On the smaller scale of particle management, our particle system objects will hold a livelist and deadlist for managing our particles. Whenever a particle moves out of the range of the scene, or where we want the system’s particles to exist in the scene, they will be moved to the deadlist to be re-initialized and used again, versus destroying and re-creating each particle to simulate continual motion, which would be rather memory intensive and slow. Our actual particle object, to be created and re-initialized within each system, will be rather small in the amount of data it will hold, but items such as it’s texture, current location, lifetime of the particle, and x,y,and z velocities to control its motion will be among them.

As for the differing aspects of each individual system, there aren’t many variations other than the “origin” from which each system’s particles will emanate from and the boundaries of each system.

Planned Effects:

  • Rain, Snow, Fire, Smoke, Water (Fountain), Other

Reference List:

Images:

Download: source

Categories: Code Tags: , , , ,

Robot Gems

April 2nd, 2003 shyam No comments

A Sokoban clone written in C++ and OpenGL. In the game, you are a robot. Your goal is to push gems, which are scattered around the map, on to certain designated areas.

I lost the original source a while ago, so only the bin is provided.

Download: bin

Categories: Code Tags: , ,