Unreal II UCC

From Oldunreal-Wiki
Revision as of 13:22, 8 April 2012 by Hellkeeper (talk | contribs)
Jump to navigation Jump to search

UCC, the Unreal Code Compiler (or UnrealOS Execution Environment) that comes with Unreal II, has some functionality not present in any other Unreal Engine games. This page lists the known functionality of it.

UCC is a raw UnrealScript environment for executing commandlets. These commandlets are essentially small programs, usually written in UnrealScript. They are executed by running UCC from a terminal:

UCC <commandlet> [-option] [parameter=value]

There are a variety of commandlets included in Unreal II, each having different functionality, and some of the functionality differs from other Unreal Engine games.

Commandlets

AnalyzeContentCommandlet

Description

Analyses a map.

Usage:

ucc analyzecontent mapname

Parameters:

  • mapname - Path to a map file. Relative to the location of UCC.

Uses

Unfortunately, this commandlet is mostly broken. If you use it on a regular map, you get a General Protection Fault:

General protection fault!

History: UDXTConvertCommandlet::Main

Exiting due to error

It seems to relate to another commandlet that handles textures. The only time the AnalyzeContent commandlet seems to work is if the level contains only particular types of textures. If you try and analyse CS_Titles.un2, you get some statistics:

>ucc analyzecontent ..\Maps\CS_Titles.un2


Package CS_Titles.un2...


Texture Stats

   30  RGBA textures consuming        2290 KByte in video memory
   57  PAL8 textures consuming         911 KByte in video memory
    8  DXT1 textures consuming        1042 KByte in video memory
    5  DXT3 textures consuming        1600 KByte in video memory
   24  DXT5 textures consuming       14180 KByte in video memory

  124 total textures consuming       20023 KByte in video memory


StaticMesh Stats

    9 static meshes with a total of  35601 triangles
 3955 average triangles per mesh
    2 average sections per mesh


Sound Stats

   28 sounds consuming a total of     2677 KByte in memory
   95 average KByte per sound


Success - 0 error(s), 0 warnings

Maps that the AnalyzeContent commandlet can analyse include CS_Titles, Entry, PA_Acheron, PA_Hell, PA_Janus, PA_Sanctuary, PD_Acheron, PD_Avalon, PD_Hell, PD_NaKoja, PD_Sanctuary and PD_Sulferon. It seems that it's because these cinematic maps have hardly any real walls with textures applied to them.

ArrayTest

Description

Tests all of the features of dynamic arrays currently known. Also good if you're interested in how you can use dynamic arrays.

Usage:

ucc ArrayTest (no parameters)

Uses

This commandlet doesn't have the usual 'Commandlet' suffix, so in order to use it, you have to execute it using the full reference. It always outputs the same text:

>ucc core.arraytest
=======================================
ucc.exe: UnrealOS execution environment
Copyright 2001 Epic Games Inc
=======================================

Executing Class Core.ArrayTest
ArrayTest Transient.ArrayTest0 (Function Core.ArrayTest.RegularTests:0090) Accessed array 'TestArray' out of bounds (5/2)
ArrayTest Transient.ArrayTest0 (Function Core.ArrayTest.RegularTests:00DF) Accessed array 'TestArray' out of bounds (6/6)
ArrayTest Transient.ArrayTest0 (Function Core.ArrayTest.InsertRemoveTests:00D5) Accessed array 'TestArray' out of bounds (3/3)
ArrayTest Transient.ArrayTest0 (Function Core.ArrayTest.InsertRemoveTests:0105) Attempt to remove elements 0 through 5 in an 5-element array
ArrayTest Transient.ArrayTest0 (Function Core.ArrayTest.InsertRemoveTests:011C) Attempt to remove element 0 in an 0-element array
ArrayTest Transient.ArrayTest0 (Function Core.ArrayTest.InsertRemoveTests:0152) Attempt to remove element 1 in an 0-element array
ArrayTest Transient.ArrayTest0 (Function Core.ArrayTest.NestedTests:000F) Accessed array 'OuterArray' out of bounds (0/0)
ArrayTest Transient.ArrayTest0 (Function Core.ArrayTest.NestedTests:000F) 0.623 Attempt to assign variable through None (line 0)
ArrayTest Transient.ArrayTest0 (Function Core.ArrayTest.NestedTests:002B) Accessed array 'OuterArray' out of bounds (0/0)

This is perfectly normal, if you view the script of this commandlet. It demonstrates a variety of ways to use dynamic arrays in Unreal Engine 2 (none of which are unique to Unreal II, it seems).

AssetCullingCommandlet

Uses

This commandlet doesn't have any help associated with it, but it seems to be automatic. It goes through all of the assets in the game - maps, sounds, static meshes etc. and saves them into directories with a New prefix. You need to create those directories manually first, or else the commandlet crashes. The newly generated assets seem to be smaller - it seems that the commandlet drops any unreferenced assets from the packages, reducing their size. For instance, the combined size of the static meshes decrease by 11 MiB after culling. So it appears to be a way to clean up packages of any unwanted elements, albeit in a somewhat destructive way.

Note that this commandlet is not part of the standard commandlets, therefore you need to specify the whole reference to it in order to run it:

>ucc editor.assetcullingcommandlet

AudioPackageCommandlet

Description

Syntax:

ucc editor.audiopackage sourcedirectory

The source directory is relative to the location of UCC.

Uses

Once again there is no help for this commandlet, and it is a non-standard commandlet. This one is rather useful, however - it's an automated sound package generator. If you specify a directory with .wav files in it, this commandlet will build an .uax file with those Wave file imported. For instance, if you create a directory Unreal2/MySounds, and put files SoundA.wav and SoundB.wav in it, then use this commandlet, you will get a MySounds.uax file generated in the Unreal2/Sounds directory, and it will contain your two files. If you want to place the sounds into different groups, you can place the .wav files in subdirectories, and they will be treated as groups. Here's an example of the output using this:

>ucc editor.audiopackagecommandlet ..\MySounds
Created group package GroupA
Imported ..\MySounds\GroupA\SoundA.wav as Sound MySounds.GroupA.SoundA
Created group package GroupB
Imported ..\MySounds\GroupB\SoundB.wav as Sound MySounds.GroupB.SoundB
Package file ..\Sounds\MySounds.uax saved successfully
Success - 0 error(s), 0 warnings

BatchExportCommandlet

Description

Export objects in bulk.

Usage:

ucc batchexport package.ext classname export_ext path

Parameters:

  • package.ext - Package whose objects you wish to export.
  • classname - Class of object to export.
  • export_ext - File extension to export to.
  • path - Path to export files to, like c:\MyPath.

Uses

This is the usual BatchExport commandlet, you can see more information about it on the Unreal Engine wiki. However, there are changes specific to Unreal II.

  • You can't export levels with it as OBJ or STL (there is no obj exporter, and the stl exporter produces invalid results). You can do that with the T3D exporter, though.
  • You can export LegendMeshes as T3D by passing the .ugx files to this commandlet. However, it's not of much use, since it only produces their names in the generated T3D files. The syntax is this:
>ucc batchexport ..\Meshes\GlmCharactersG.ugx LegendMesh t3d ..\ExportDirectory

ChecksumPackageCommandlet

Uses

This is another non-standard commandlet. It calculates a checksum for the input file. Despite the name, it works on any files, not necessarily Unreal packages. Here's an example:

>ucc editor.checksumpackagecommandlet ..\System\Unreal2.ini
..\System\Unreal2.ini checksum: b47888e6df6c8fd6170a48cb3a699f31

CheckUnicodeCommandlet

Uses

Another non-standard commandlet, this one tries to find any characters in a file, then reports how many of them were found in total. It seems to be able to find characters in many different encodings, and even in binary files. Here's a usage example:

>ucc editor.checkunicode ..\System Unreal2.ini
Checking: ..\System\Unreal2.ini
<...>
Found Character: 10
Found Character: 13
Found Character: 10
0: 79
Total Characters: 79
Total Pages: 1
Success - 0 error(s), 0 warnings

You can also use wildcards in the filename.

CompressCommandlet

Description

Compress an Unreal package for auto-downloading. A file with extension .uz will be created.

Usage:

ucc compress File1 [File2 [File3 ...]]

Parameters:

  • Files - The wildcard or file names to compress.

Uses

This is the standard Compress commandlet, see more about it on the Unreal Engine wiki. Not very useful in Unreal II, since it has no networking support. Interestingly enough, it creates .uz, and not .uz2 files.

ConformCommandlet

Description

Generate conforming binary files.

Usage:

ucc conform existing_file.ext old_file.ext

Parameters:

  • existingfile.ext - Existing binary file to load, conform, and save.
  • oldfile.ext - Old file to make source file binary compatible with.

Uses

Another standard commandlet with not a lot of uses. It could solve some network compatibility problems, but Unreal II has no network support, so they are irrelevant.

ConvertMaterialCommandlet

Uses

A non-standard commandlet. It works very similarly to the AssetCulling commandlet, as it goes over all the assets, and then creates new packages in directories with the New prefix that has to be created beforehand. It also reduces the file size and removes unused parts. It is uncertain what differences there are between the two commandlets. Judging by the name of this commandlet, it should convert some materials, but it is uncertain what they could be.

Example usage:

>ucc editor.convertmaterialcommandlet

DataRipCommandlet

Description

Create a package with Texture, Music and Sound data ripped out.

Usage:

ucc datarip srcpackage.ext dstpackage.ext

Parameters:

  • srcpackage.ext - Source Package
  • dstpackage.ext - Destination Package

Uses

A standard commandlet. Of very limited use. See the Unreal Engine wiki for more details.

DecompressCommandlet

Description

Decompress a file compressed with ucc compress.

Usage:

ucc decompress CompressedFile

Parameters:

  • CompressedFile - The .uz file to decompress.

Uses

Another standard commandlet, does the opposite of UCC Compress. See the Unreal Engine wiki for more details.

DXTConvertCommandlet

Description

Convert DXT3/5 textures to DXT1/RGBA.

Usage:

ucc dxtconvert srcpath destpath

Parameters:

  • srcpath - Path containing source files
  • destpath - Path for destination files

Uses

Can be used for batch converting DXT5 and DXT3 textures to DXT1 textures. Useful for processing large amounts of data.

HelloWorldCommandlet

Sample 'hello world' commandlet.

Usage:

ucc HelloWorld (no parameters)

Parameters:

  • IntParm - An integer parameter
  • StrParm - A string parameter

Uses

An example commandlet. Prints Hello, world!, and, if you supplied any parameters, Command line parameters=<parameters>. Useful as an example when creating custom commandlets (as most of the builtin commandlets are not available through UnrealScript).