Release Notes for Version 2.7

From C4 Engine Wiki
Jump to navigation Jump to search

Release date: September 30, 2011

IMPORTANT: The model animation format has changed in this version of the engine, and all animation resources (with the .anm extension) must be converted to the new format before they can be used. To convert your animations, run version 2.7 of the engine, open the command console, and type convert. This will automatically convert all of the animation resources in your entire Data folder. Be sure to backup your data before running the conversion utility in case something goes wrong.

Core Engine

Graphics

  • A new material format has been introduced so that materials can be loaded from resources by the engine. The new resource format uses the .mtl extension, and the previous format that used the .mat extension is now obsolete. A material can be loaded from a resource by calling the MaterialObject::Get() function.
  • The concept of substances has been added to the engine. A substance represents the composition of an object, such as wood or metal, and it can be used in a game to provide different effects when interacting with objects made of different substances. Any material object or physics shape can have a substance type assigned to it, and this type can be retrieved alongside the data for a collision. An application can register any number of substances with the engine by creating Substance objects, and then these appear in the World Editor.
  • The motion blur postprocessing effect has been modified so that the blur is lessened for small velocities. This makes the image sharper when the camera is moving slowly, and it prevents sudden blurring when the camera starts moving from a stationary position.

Physics

  • The accuracy of collision detection with generic meshes (including terrain) has been improved significantly.
  • Physics shapes can now have a negative density. This can be useful for removing volume from a hollow or open object. Shapes with negative densities never participate in collision detection.

Effects

  • The particle system functionality previously all contained in the ParticleSystem class has been split into several subclasses named PointParticleSystem, InfinitePointParticleSystem, LineParticleSystem, QuadParticleSystem, PolyboardParticleSystem, FireParticleSystem, and BlobParticleSystem. Any subclass that previously inherited directly from the ParticleSystem class needs to be changed so that it inherits from one of these new subclasses (and care should be taken to call base-class functions such as Preprocess() for these subclasses instead of ParticleSystem). The particle style has been removed from the constructors because it is no longer needed.
  • A new type of particle system supporting animated texture coordinates has been added through the TexcoordPointParticleSystem. This particle system uses the extended particle structure TexcoordParticle to hold a scale and offset for each particle that is applied to the texture coordinates.
  • A new voxel-based blob particle system has been added to the engine. Particles in a blob system are individual ellipsoids that merge together when they are in contact with each other to form larger complex blobs, and they are rendered as fully-lit triangle meshes. The triangle meshes are generated by a finely-tuned fixed-polarity marching cubes implementation that uses the Job Manager and island determination to distribute its work across all available processor cores.
  • A new flag called kMarkingClipRange has been added to marking effects. Setting this flag lets you specify the range of depths, with respect to the center and normal direction of the marking, to which the marking is clipped independently from the marking's radius.
  • The separate marking effect nodes created for a single surface marking can now be grouped into a new MarkingList container. This makes it possible to iterate over the pieces of a single surface marking, to delete an entire surface marking, and to be notified when all pieces of a single surface marking have been destroyed.
  • The obsolete fluid geometry and fluid controller classes have been removed from the engine.

World Manager

  • Referenced worlds containing other referenced worlds are now supported four levels deep.
  • Two new built-in modifiers have been added to the engine, and they are called "Remove Lights" and "Remove Sources". These prevent light nodes and source nodes from being copied into the referenced world instances to which the modifiers are applied.

Animation System

  • An animation is now bound to a model's nodes when the animation is used, as opposed to when it is imported. This means that the arrangement of nodes within a model can change without it being necessary to re-import any animations that have already been imported for the model. This feature only works with animations that are imported with version 2.7 or later. (The extra information needed to implement this feature is not added when animations are converted from an earlier version.)
  • Animation resources can now contain cue tracks, and the FrameAnimator class can be observed for cue events. A cue event is simply a 32-bit identifier that gets reported to the observer when a playing animation passes a cue's time value. The game code can handle cue events to do things like play sounds, apply damage, or trigger separate actions.

Job Manager

  • A job can now determine which worker thread it is running in by calling the Job::GetThreadIndex() function.
  • The Job Manager has a new Batch class that can hold many jobs that need to finish as a group. The JobMgr::JobMgr::FinishBatch() function efficiently blocks the calling thread until all of the jobs in a batch have completed their work.
  • The SetReservedProcessorCount() function has been added to the Job Manager. It can be called before the Job Manager is initialized to reduce the number of worker threads created for processing jobs.

Scripts

  • Character literals can now be used in Expression methods. A character literal is a sequence of one to four characters enclosed in single quotes.

Math Library

  • New faster versions of the Floor() and Ceil() functions have been implemented. There are also new functions called PositiveFloor(), NegativeFloor(), PositiveCeil(), and NegativeCeil() that are faster if the input value is known to be positive or negative (but both work properly with an input of zero as well). The functions FloorCeil(), PositiveFloorCeil(), and NegativeFloorCeil() functions calculate both the floor and ceiling of the input in about half the time of calling floor and ceiling functions separately.
  • The CosSin() function has been moved out of the Math namespace and into the enclosing C4 namespace.

Plugins

Browser Plugin

  • The Browser Plugin has been updated to work with Awesomium version 1.6.2. The plugin will no longer work with earlier versions of Awesomium.

Tools

Model Viewer

  • The Model Viewer now displays a cue track below the animation slider. A cue can be inserted, deleted, and edited for the frame at which the animation is currently stopped. Cues can be dragged to change their locations. After cues have been inserted or changed, the animation resource can be saved with the cue track by selecting "Save animation" from the Model menu or typing Ctrl-S (Cmd-S on the Mac).

Collada Importer

  • The Collada Importer can now import splines, and they are turned into path nodes in C4. Only Bézier splines are supported at this time.