Release Notes for Build 144
Release date: November 9, 2007
- The Resource Manager has been redesigned and now supports pack files and a virtual directory hierarchy. All resources are still stored inside the Data folder, but the subfolders that previously separated resources by type no longer exist. Resources can now be organized in an arbitrary manner inside the Data folder. However, the top-level contents of the Data folder have special meanings.
- All of the top-level subfolders of the Data folder behave as if their contents belonged to a single virtual folder at the root of the resource namespace. These top-level subfolders exist only for external organization and do not participate in the unique identification of any resources. As an example, suppose that there existed two subfolders
Data/Interiors/
andData/Exteriors/
. A resource namedWood.tex
could be stored in either subfolder, but it would still be identified only as "Wood" by the Resource Manager. The name of the top-level subfolder is not part of the resource's path. However, if theWood.tex
resource was placed in an additional subfolder such asData/Exteriors/Forest/
, then the name of the resource would be"Forest/Wood"
. All folder names beneath the top-level subfolders of the Data directory are part of the resource name.
- The resources that ship with C4 have been divided into the following subfolders:
- A C4 folder containing the resources used by the core engine and required by all applications built with C4.
- A Demo folder containing the resources used exclusively by the demo game.
- A Tools folder containing the resources used exclusively by the tool plugins.
- A Tutorial folder containing the resources associated with the tutorials and sample worlds.
- Pack files, having the extension
.pak
, can also be stored at the top level of the Data directory. A pack file is created by using a new tool plugin, the Resource Packer, to pack the contents of a top-level subfolder into a single file. The console commandpack
<name> is used to create a pack file, where <name> is the name of a top-level subfolder. For example, the command pack Demo will create the fileDemo.pak
containing all of the resources used exclusively by the demo game. Once a pack file has been created, the folder from which it was made can be deleted, and the Resource Manager will fetch resources from the pack file instead. (Pack files actually override ordinary folders.)
- Some additional miscellaneous notes about the Resource Manager:
- Folders and pack files are the only items allowed at the top level of the Data directory. Other types of files in that location will be ignored.
- Resource path names inside pack files are case sensitive.
- QuickTime movies cannot be accessed inside pack files.
- Because concealment is a benefit provided by pack files, there will not be an unpacking tool that would allow users to easily extract resources from a
Demo.pak
file.
- It is no longer necessary to use the
ModuleResource
class template when defining a resource type in a game module or plugin module. New resource types should now just inherit from the Resource class template. However, the resource descriptor is now declared in the subclass.
- The
Packable::GetPackSize()
andPackable::GetPackTypeCount()
functions have been removed from the engine. All overrides of these functions in custom class types should be deleted. These sizes are now calculated automatically by calling thePackable::Pack()
andPackable::PackType()
functions with a nonwritable data object.
- Added a new flag to the script controller that lets you limit concurrent runs of a script to unique activators. That is, with this flag set, only one instance of the script will run for each node that is activating the trigger for the script.
- The C4 Sound Manager has been upgraded on the Mac to use the CoreAudio framework. This should provide greater compatibility with future hardware and OS releases as well as yield better performance.
- Added a new
HashTable
class to the engine utilities.
- The
PrimitiveGeometry
class now inherits fromConstructable
so that custom primitives can be defined by an application.
- A new setting has been added to the Texture Import dialog that allows you to select the channel from which height data is read when calculating normal maps, horizon maps, and ambient occlusion maps. The command line equivalent is
-height
<n>, where n is an integer between 0 and 3 representing the red, green, blue, or alpha channel, in that order.
- Since world resources don't all have to be in the same location any more, the demo game now reads the strings in the
Data/Demo/game/Worlds.str
file to obtain the list of playable worlds displayed in the New Game and Host Game dialogs. The corresponding.txt
file in the Import directory can be edited and re-imported (with theistring
command) to add or remove worlds from the list.
- A new command, Save and Play World, has been added to the World menu in the World Editor. This saves the world being edited, closes the World Editor, and loads the world in the game.