Wednesday, December 19, 2007

Introduction to the Reference Application Framework

The Reference Application Framework (RefApp or simply framework) is built upon a few assumptions:

1. There should be a clear separation between visualization logic, AI/game logic and physics simulations.
2. RefApp should be unit testing friendly
3. Most of the general use-cases should be covered
4. Source code availability

Now let's elaborate a bit on these.

Separation of Concerns

A lot of useful information has already been written on the subject. Here's what applies to game development.

Generally, mixing 3D/AI/physics code is considered bad practice. Refactoring purists call this "code that smells". One should not have visual objects that serve as 3D models, game logic entities, physics bodies in real applications (note that it is fine for demos). The framework addresses this need by introducing several base classes for different aspects of the game:
Actor (called ActorNew for now, because it conflicts with Visual3D.Actor class) and Avatar.

Actor is a base class for game logic entities (called actors). Actors are used for describing the gameplay rules and relationships, and are driven by the AI simulations.

Every actor that has to be visualized has a corresponding
Avatar. Avatar is actor's visual representation in the 3D world.

Unit Testing
Unit testing is a procedure used to validate that individual units of source code are working properly. A unit is the smallest testable part of an application. In procedural programming a unit may be an individual program, function, procedure, etc., while in object-oriented programming, the smallest unit is a method; which may belong to a base/super class, abstract class or derived/child class. (http://en.wikipedia.org/wiki/Unit_Testing).
In RefApp context unit testing means that it is possible to validate gameplay logic using unit tests. Unit tests do not need a visual representation to be available, and it is facilitated by decoupling Actors from Avatars.

Use Case Coverage

The RefApp Framework is being worked on with general use cases in mind. Currently they include:
  1. Creation of a new World Application, Initialization, World Settings
  2. Main Menu setup, Scene initialization, basic Gui
  3. Configuring a terrain-based scene, terrain settings, splatting and layout
  4. Creating your Actors and Avatars, setting up your Game and Physics simulation, setting up Animations
  5. Dragging and dropping your avatars, controlling player avatar with keyboard and mouse, key mapping schemes
  6. General AI and pathfinding
The more use cases the framework covers, the more information will be made available for you via our blog.

Source Code Availability

We at Realmware understand the need for you to be able to quickly start working on your games and applications, thus we decided to make the RefApp code completely free. It will be made available either as part of the distribution package, or as a standalone download.

No comments: