Monday, December 27, 2010

Forward Progress

It's been a busy few weeks since I updated this blog, but I've been hard at work adding several new features to the engine. These new features have included basic collision detection, a sound system, and simple projective shadows. Right now, I'm in the middle of upgrading the lighting system to accomodate spotlights and multiple light sources (as opposed to one). This is taking longer than I expected, but theoretically it should be done by the end of the year.

In a previous post, I said I would talk more about one of the features I added earlier this year: the contour map tool. This tool (seen below) has two main capabilities. One feature is the ability to create contour maps from scratch, and then, using Bezier curves, allow the user to manipulate a series of concentric rings in order to create mountains, hills, lakes, valleys, or even simple riverbeds.


Eact tiny white ring in the picture above is a "handle" which the user can use to shape the blue contour lines. I can imagine this would get tedious if you wanted to create a multitude of unique mountains or lakes, for example, so in the future I might allow for some procedural mountains to be rendered by this particular tool.

The other feature is the ability to take a pre-existing contour map which has been pre-color-coded and then convert that into a 3-D heightmap (using the "Import File" option above). I haven't fully tested this particular capability of the tool yet, but I plan to in the near future with an area lake map. The goal, of course, is to create more realistic terrain features and hopefully begin to use various real-world features in the first game I hope to release using this particular engine.

Mt. Ararat, anyone? ;-)

Tuesday, December 7, 2010

Character Animation, Part I

Over the past month I've worked hard to complete one of the major features of the engine: keyframe character animation. As of this post, the engine is only supporting a customized format which can be exported from Blender (via a Python script). Here is a recent test I performed on the engine by exporting a spinning cube animation out of Blender:


The fps rate is decent (for a basic six-year old video card) even on animations with hundreds of triangles. At some point, however, I'd like to experiment with pushing all of the individual keyframe renderings into display lists instead of doing all the interpolation on the fly.

A decision was made early on (by me) to go with keyframe animation versus bone animation. Someday I hope to add a much more comprehensive set of animation functions that could handle multiple formats.

One thing to note, however, is that many of the objects in this engine (lights, models, billboards, character animations) are all full class objects with inhertiable properties from the parent class of "jObject". The basic jObject class declaration looks like this:

class jObject
{
     public:

     float mass; // for physics calculations
     j3Dvector location;
     j3Dvector velocity;
     j3Dvector acceleration;
     j3Drotation rotation;
     objectstate state;
};

I have lots of ideas for these properties, but the obvious one is the soon-to-be-implemented feature of collision detection and basic physics calculations. :-)

Tuesday, November 9, 2010

3-D Dialog Boxes

Here is another partially implemented feature in the engine. It involves writing text to a fully rotatable, scalable canvas. An example:


And here is the class signature as it stands today in the engine:

jUI (j3Dvector nstartloc, float nwidth, float nheight, j3Drotation nrotation, jcolor ncolor)

...where nstartloc is the starting location (in 3-D coordinates), nwidth is the width of the canvas, nheight is the height, rotation is the 3-D rotation of the canvas, and jcolor represents the background color. Fonts can then be added in sets with the following signature:

int jUI::AddUISet (char * nfilename, float nsetheight, float nsetwidth, float ncharheight, float ncharwidth, unsigned char nalpha)

...where a unique integer is returned for each font set added. This integer is later referred to during WriteLine operations:

void jUI::WriteLine (char * nstring, int nUIset, float nxloc, float nyloc)

Eventually, it is my hope and plan to develop a more polished look to the canvas itself (i.e. rounded corners, better fonts, etc.) as well as adding options for embedding images. I also want to eventually add the ability to scroll text and offer some basic button functionality. This would help immensely with the creation of HUD displays and dialog boxes.

Theoretically, if I really wanted to go in a different direction with this, I suppose at some point I could open the canvas up so that it would be able to render web pages.

Next time: the contour mapping tool.

Tuesday, November 2, 2010

Introducing the Jasper Game Engine

Welcome! This is the first post of what I hope to be many regarding my 3-D game/game engine project that has been in development during my spare time over the past couple of years. Over the next several months, I hope to illustrate some of the engine's many features, as well as the long-term direction I hope to take with the technology.

So far, the project consists of two tools--a particle system tool and a map/terrain design tool--and the engine itself. On top of the engine platform, I am already planning and developing a game that will hopefully break some new ground in terms of content (stay tuned).

At this current time, the engine already has numerous capabilities that includes particle systems, model rendering, basic keyframe animation, skydomes, gameboard rendering, to terrain rendering. In fact, here's an example of the gameboard rendering (and no, I'm not making another chess game, these are just test pieces):

I'll start going into more depth about each of these features in subsequent posts.