Release Notes for Version 3.0

From C4 Engine Wiki
Jump to navigation Jump to search

Release date: July 29, 2013

WARNING: In version 3.0, all shaders are permanently changed to a new layout when a world is opened. See Shader Editor below. Just in case something goes wrong, please be sure to make a backup of your Data folder before running version 3.0.

Core Engine

  • The Visual Studio projects now use shared property sheets to specify build settings.
  • The ToolCode directory has been removed, and all source files that were in that directory have been moved to the PluginCode directory.
  • The VisualStudio2012 directory now contains a file named C4.natvis that provides some simple C4 data structure visualizers for use with the Visual Studio debugger. To use it, copy the file to your Documents\Visual Studio 2012\Visualizers directory.

Graphics Manager

  • A large number of internal changes have been made to the low-level rendering system. On desktop platforms, the engine now runs with a core OpenGL profile, and OpenGL 3.2 or higher is required.
  • The engine can now render screen-space ambient occlusion (SSAO) as a post-processing effect.

Interface Manager

  • The Rate window has been renamed to the Time window, and the associated rate command has been changed to the time command. The new Time window contains a lot more information about the time spent rendering each frame, and it displays enhanced timing graphs.
  • Push button widgets have a new setting that allows you to assign the Enter key or Escape key to a button, and the widget will automatically be activated when the assigned key is pressed.
  • Mouse wheel events now store the wheel delta in a new field of the MouseEventData structure instead of using the mouse position field. The current position of the mouse is now stored in the mouse position field as it is with all other mouse events.
  • In edit text widgets, the standard behavior of Shift-Home and Shift-End is now supported.
  • The edit text widget supports a new flag that causes the contents of the text box to be cleared when the user begins typing in it (or makes any edit).
  • The IntegerSetting, PowerTwoSetting, and FloatSetting constructors take two new optional parameters that specify special labels to be displayed in place of their actual values whenever the setting's current value is equal to the minimum or maximum allowable value.

Effect Manager

  • Four new volumetric light shaft effects have been added to the core engine: box, cylinder, truncated pyramid, and truncated cone. They represent the extrusion of a rectangle and an ellipse with either parallel sides or tapered sides, and they are rendered by calculating the precise distance that light travels through the shaft at each point. The shaft effects have finite volume in the scene, but their interiors are rendered as if they were extruded to infinity along the shaft direction. See Light Shafts for more information.
  • Star field particle systems have a new setting that causes only stars that appear above the horizon to be rendered. Star fields are also rendered with higher performance compared to previous versions.
  • The Effect class has two new functions called Wake() and Sleep() that enable and disable calls to the Move() function. Effects are now asleep by default so that time isn't wasted calling Move() functions that don't do anything. To make sure that the Move() function is called for custom effects, call the Wake() function from inside the Preprocess() function.

World Manager

  • Version 3.0 includes a new high-level visibility system that constitutes the largest architectural upgrade in the history of the C4 Engine. Each world now contains a number of DAGs (directed acyclic graphs) that are independent of the of the node-subnode relationships in the transform tree. There are separate DAGs for geometries, effects, triggers, fields, etc., and they include cell hierarchies that enable fast visibility, collision, and proximity searching. The most important aspect of the new visibility system is that each node can now exist in multiple zones simultaneously within the DAG that it belongs to. It's now the usual case that nodes should simply be placed in the infinite zone, and the engine automatically determines inside which subzones the node needs to be visible. When a node is completely covered by one or more subzones, then the engine knows that it does not need to be visible in the enclosing zone. Nodes can still be explicitly placed inside subzones to exert some control over where they are visible, and this also makes the visibility system backwards compatible with existing worlds from previous versions of the engine.
  • Each node has a new setting that lets you control the maximum subzone depth in which it is eligible for visibility, where the depth is measured in terms of the zone hierarchy in the transform tree. This can be useful for level optimization by providing some control over which zones large objects are visible in. By default, the maximum subzone depth is unlimited.
  • Nodes can also be forced to be visible in its owning zone and all subzones up to a maximum subzone depth. By setting the forced subzone depth to zero, a node is forced to be visible in its owning zone in the transform tree, and it can still be visible in subzones if the maximum subzone depth is greater than zero. This setting is useful, as an example, for making sure that nodes composing the outer walls of a building are visible both inside and outside without requiring that the node actually extend outside the inside zone's boundary. This setting is also useful for forcing light sources (especially infinite lights) to be rooted in multiple zones without having to use large portals that serve no other purpose.
  • The Node::EnterZone() and Node::ExitZone() functions have been removed from the engine. The notion that a node belongs to one zone at a time no longer applies under the new visibility system, and nodes no longer get reparented to the zones that contain them as they move around a level.
  • The World::FindZone() function has been removed from the engine. It is no longer necessary to determine what zone contains a particular location in order to place new nodes in the world. New nodes should ordinarily be added to the root infinite zone of the world now, and the engine will automatically insert them into the zone-based visibility structures.
  • There is a new World::AddNewNode() function that can be used to add a node to the root infinite zone of the world and preprocess it.
  • A new node flag has been added that allows subnodes to be animated as part of a model even if the node itself does not have animation applied to it.
  • An array of default property types can now be specified in model registrations. When a new model is placed in the World Editor, properties of these types are automatically attached to the model node. See the ModelRegistration class.
  • Paint spaces have a new setting that enables mipmap generation for their paint textures.
  • A perspective mask can now be set for light nodes so that they can be disabled in reflections, refractions, etc.
  • There are two new modifiers that enable and disable interactivity in an instanced world.
  • A node type setting has been added to the Delete Nodes modifier. This allows all nodes of a specific type, or nodes of a specific type with a specific name, to be deleted from an instanced world. The addition of this setting makes the Remove Lights and Remove Sources modifiers redundant, so those modifiers have been removed from the engine. Any existing uses of those modifiers will automatically be converted to Delete Nodes modifiers with the corresponding node type.
  • A new modifier called Set Perspective Mask has been added, and it can specify the perspective mask for a specific type of node and/or nodes with a specific name in an instanced world.
  • The structure buffer is now rendered for images generated by camera widgets in panel effects. This allows shaders dependent on the scene depth to render correctly, and it enables post-processing effects like SSAO in camera widgets.
  • The dome zone type has been removed from the engine. Any existing dome zones will be converted to the smallest enclosing cylinder zone instead.
  • A new geometry flag has been added that allows a geometry node inside an instanced world to use a paint space inside the instancing world. A built-in %Paint connector has been added to instance nodes to facilitate this feature. If the "Use paint space in instancing world" box is checked for a geometry and the geometry is not directly connected to a paint space, then it associates itself with the paint space connected through the %Paint connector of an instance node preceding it in the node hierarchy.
  • In the context of the model animation system, the term "Track" has been replaced by the term "Sequence". This was done to distinguish the terminology from the the "Track" used by movies and audio resources.
  • A direct portal that is not connected to any target zone is now automatically connected to the zone enclosing the zone in which the portal has been placed.
  • Direct portals have a new flag that prevents sound from flowing through them.

Controller System

  • A new virtual function named InstanceExtractable() has been added to the Controller. A subclass should override this function and return true if the particular type of controller contains state that needs to be preserved across a saved and restored game. If such a controller appears in an instanced world, then this causes the nodes to be extracted so that they are saved and restored with the world instead of reloaded from the original instanced world. In the core engine, the RigidBodyController, MovementController, and RotationController classes override the InstanceExtractable() function and return true. Everything else returns false.

Physics Manager

  • A new function called PurgeContacts has been added to the RigidBodyController class. It simply purges all outgoing and incoming edges in the contact graph.
  • A new function called PurgeGeometryContacts has been added to the PhysicsController class. It purges all existing contacts between a particular geometry node and all rigid bodies in the world.
  • A new space type called a Physics Space has been added, and it can be used to define a global bounding box for the physics simulation. A new member function of the RigidBodyController class named HandlePhysicsSpaceExit() is called whenever a rigid body goes outside the physics space. This is useful for detecting when an object flies off a level for some reason so that something can be done about it (usually just deleting the object). A physics space is enabled by connecting the physics node to the physics space using the built-in %Physics connector.
  • A new controller flag named kControllerPhysicsSimulation has been added, and it should be set by any controller that acts as the main interface between the engine and a physics library. This identifies the controller to the World Manager as the sole physics controller in a world and causes it to get special treatment.
  • A new controller called the Oscillation Controller has been added to the core engine. It works like the movement controller, but it continuously oscillates the position of its target node between a start and finish location.

Tools

World Editor

  • The World Editor contains a new Landscaping page. This is a work in progress and is not fully functional at this time.
  • Star fields are now rendered in the World Editor.
  • When using the mouse wheel to zoom in orthographic viewports or the scene graph viewport, the zoom is now centered on the cursor position. This change has also been made in the Shader Editor, Script Editor, and Panel Editor.
  • Double-clicking on a connector now selects the node it is connected to, if any.
  • A new button labelled "Create Opposing" has been added to the Portals page. For each selected direct portal, call the zone in which the portal resides Zone A and the zone to which the portal is connected Zone B. The Create Opposing button creates a new direct portal in Zone B that is connected to Zone A. The new portal is coincident with the original portal and has the same set of vertices, but faces the opposite direction.

Shader Editor

  • The separate tabs for ambient and light shaders have been eliminated, and there is now a single shader graph containing output nodes for both the ambient and lighting passes. Separate passes for existing shaders are automatically merged, and any redundancies due to common calculations in both passes are automatically unified.
  • Four new interpolant processes called Full Tangent-Space Light Vector, Full Tangent-Space View Vector, Full Object-Space Light Vector, and Full Object-Space View Vector have been added to the Shader Editor. These provide access to the unnormalized vectors corresponding to the differences between the interpolated vertex position and either the light position or camera position. The Magnitude 3D process can be applied to these in order to determine the exact distance between the point being shaded and the light position or camera position.
  • Four new mathematical processes that perform comparisons have been added to the Shader Editor. A result of 0.0 or 1.0 can now be generated based on the comparisons equal, not equal, less than, greater than, less than or equal, and greater than or equal.
  • When a shader process is selected, all input and output routes are now highlighted.

Script Editor

  • When a script method is selected, all input and output fibers are now highlighted.
  • Two new built-in script methods named "Set Color Value" and "Set Vector Value" have been added. These methods allow you to specify the values for the individual components of a color, vector, or point variable.

Texture Tool

  • Textures can now be generated in a two-channel red-green format or a one-channel red format. When sampled in a shader, these formats are read as RG01 and R001, respectively, meaning that the alpha channel is always 1.0 and the missing color channels are always 0.0.
  • Cube maps can now be imported from the following four possible layouts. The appropriate layout is automatically selected based on the dimensions of the input image.
  1. The previously supported native layout in a vertical strip having height exactly six times its width.
  2. A horizontal strip having width exactly six times its height.
  3. A horizontal cross layout having a width to height ratio of 4:3.
  4. A vertical cross layout having a width to height ratio of 3:4.