CathodeLib is an open source library providing functionality to handle formats from the Cathode game engine, for modding Alien: Isolation. Used to power OpenCAGE!
Available as a NuGet package, or alternatively just include this repo as a submodule in your project!
All parsers inherit from a base CathodeFile class which provides:
- A static
Implementationflag, defining if the parser supportsCREATE,LOAD, and/orSAVEfunctionality for the file. Parsers which support all three have the ability to generate files from scratch. - A
Loadedbool, which is true if the parser has populated its values from a pre-existing file that it has loaded. If false, the parser is creating a new file on save. - A
Filepathstring, which is the filepath that the parser is using to either load or save the file. - A
Savefunction, which will save the file out if the parser has theSAVEflag. This function can optionally be given a new filepath to save the file to. Returns false if saving fails. - Events for
OnLoadBegin,OnLoadSuccess,OnSaveBegin,OnSaveSuccesswhich fire at load/save start and successful completion respectively, with the appropriate filepath as an arg.
Most parsers provide access to the file's content via an Entries parameter, however this can vary per implementation.
Note: in debug mode the parsers will all fail hard, however in release mode all load/save calls are wrapped in try/catch statements.
CATHODE.AlphaLightLevelhandles levelWORLD/ALPHALIGHT_LEVEL.BINfiles- This is a A16B16G16R16F image with a specified resolution, baking alpha light data for the level
CATHODE.AnimationStringshandlesANIM_STRING_DB.BINandANIM_STRING_DB_DEBUG.BINfiles withinANIMATION.PAK- This is a database of hashed animation-related strings, and their associated hashes
CATHODE.AnimClipDBhandlesANIM_CLIP_DB.BINfiles withinANIMATION.PAK- This is a database of animation clips and contexts available by character set
CATHODE.AnimClipDBSechandlesANIM_CLIP_DB_SEC_*.BINfiles withinANIMATION.PAK- This is a secondary database of animation clips and metadata per character set
CATHODE.AnimTreeDBhandlesANIM_TREE_DB.BINfiles withinANIMATION.PAK- This is a database of animation blend trees available by character type
CATHODE.AssaultPositionshandles levelWORLD/STATE_*/ASSAULT_POSITIONSfiles- This contains the spatial grid of assault positions for a level state used by NPCs in combat
CATHODE.BehaviorTreeDBhandles levelWORLD/BEHAVIOR_TREE.DBfiles- This is a database of top-level behaviour trees used by characters
CATHODE.BMLhandles any.BMLfiles- Get/set content as an
XmlDocumentviaBML.Content
- Get/set content as an
CATHODE.CharacterAccessorySetshandles levelWORLD/CHARACTERACCESSORYSETS.BINfiles- This is a collection of metadata for Character entities within the level (e.g. gender, build, assets, etc)
CATHODE.CollisionMapshandles levelWORLD/COLLISION.MAPfiles- This defines
COLLISION_MAPPINGresource data for collision barriers, including zone metadata
- This defines
CATHODE.Collisionshandles levelWORLD/COLLISION.BINfiles- This defines weighted collision data for character hitboxes
CATHODE.Commandshandles levelWORLD/COMMANDS.PAKand/orWORLD/COMMANDS.BINfiles- This consists of
Compositescripts which hold variousEntitytypes for logicFunctionEntity= functions which execute functionality, with parameters and links to childEntityobjectsVariableEntity= variables which can be used externally as parameters on an instancedCompositevia aFunctionEntityProxyEntity= a proxy of aFunctionEntitywithin anotherComposite, useful for acting on events in another compositeOverrideEntity= an override of a parameter value on an entity within an instancedCompositein thisComposite
- A
Utilsmember provides various utilities for working with Commands data via data tables appended to the saved file, as well as composite creation, duplication, de-instancing, and refactoring helpers
- This consists of
CATHODE.Coverhandles levelWORLD/STATE_*/COVERfiles- This contains the cover grid for a level state used by NPCs
CATHODE.CustomCharacterAssetDatahandles theCHR_INFO/CUSTOMCHARACTERASSETDATA.BINfile- This defines the tints and decals that character asset types use
CATHODE.CustomCharacterConstrainedComponentshandles theCHR_INFO/CUSTOMCHARACTERCONSTRAINEDCOMPONENTS.BINfile- This defines the character parameters that character component types use
CATHODE.CustomCharacterInfohandles theCHR_INFO/CUSTOMCHARACTERINFO.BINfile- This defines base character presets, including skeletons and accessories
CATHODE.EnvironmentAnimationshandles levelWORLD/ENVIRONMENT_ANIMATION.DATfiles- This defines environmental animation data, inverse bind poses, and
RENDERABLE_INSTANCEbindings for animated world props
- This defines environmental animation data, inverse bind poses, and
CATHODE.GalaxyDefinitionhandles levelWORLD/GALAXY/GALAXY.DEFINITION_BINfiles- This is a definition file used to define the generation of
GalaxyItems
- This is a definition file used to define the generation of
CATHODE.GalaxyItemshandles levelWORLD/GALAXY/GALAXY.ITEMS_BINfiles- This is a collection of items to form the stars in the galaxy, defined by
GalaxyDefinition
- This is a collection of items to form the stars in the galaxy, defined by
CATHODE.GlobalAnimClipDBhandles the globalANIM_CLIP_DB.BINfile withinANIMATION.PAK- This is the global database of Havok animation clips and spline-compressed tracks
CATHODE.HavokPackfilehandles levelWORLD/COLLISION.HKX,COLLISION.HKX64,PHYSICS.HKX, andPHYSICS.HKX64files (as well as Switch/mobileTAG0tagfiles)- This parses and writes Havok packfiles and tagfiles, supporting static compound shape editing, physics system import/export, and BVH rebuilding
CATHODE.Lightshandles levelWORLD/LIGHTS.BINfiles- This defines compiled lighting data and shadow/light properties for instanced light entities
CATHODE.MaterialMappingshandles levelWORLD/MATERIAL_MAPPINGS.PAKfiles- This defines material remappings, used for modifying materials on instanced entities
CATHODE.Materialshandles levelRENDERABLE/LEVEL_MODELS.MTL&LEVEL_MODELS.CSTfiles- This defines material data, including texture pointers, shader references, and constant buffers
CATHODE.EXPERIMENTAL.MissionSavehandles*.AISfiles- This handles mission save file data (WIP)
CATHODE.Modelshandles levelRENDERABLE/LEVEL_MODELS.PAK&MODELS_LEVEL.BINfiles- This contains model mesh data and submesh headers in CS2 format
CATHODE.MorphTargetshandles levelWORLD/MORPH_TARGET_DB.BINfiles- This defines facial morph target data for character models
CATHODE.Movershandles levelWORLD/MODELS.MVRfiles- This defines instance-specific info for world entities, including transforms, constant buffers, lighting links, and renderables
CATHODE.NavigationMeshhandles levelWORLD/STATE_*/NAV_MESHfiles- This contains the Detour navigation mesh, off-mesh links, and traversal barriers for the level state
CATHODE.OccluderTriangleBVHhandles levelWORLD/OCCLUDER_TRIANGLE_BVH.BINfiles- This defines the bounding volume hierarchy of occluder triangles used for visibility culling
CATHODE.PAK2handlesUI.PAKandANIMATION.PAKfiles- This allows parsing and saving of the PAK2 archive format, containing embedded files
CATHODE.PathBarrierResourceshandles levelWORLD/PATH_BARRIER_RESOURCESfiles- This defines the navigation mesh barrier resources
CATHODE.PhysicsMapshandles levelWORLD/PHYSICS.MAPfiles- This defines
DYNAMIC_PHYSICS_SYSTEMresource data for composite instances with physics systems
- This defines
CATHODE.EXPERIMENTAL.ProgressionSavehandlesPROGRESSION.AISfiles- This handles progression save file data (WIP)
CATHODE.RadiosityCollisionMaphandles levelWORLD/RADIOSITY_COLLISION_MAPPING.BINfiles- This maps radiosity collision instances to level resource indices
CATHODE.RadiosityInstanceMaphandles levelRENDERABLE/RADIOSITY_INSTANCE_MAP.TXTfiles- This contains mappings between lightmap transforms in
RADIOSITY_RUNTIME.BINand resource indices
- This contains mappings between lightmap transforms in
CATHODE.RadiosityRuntimehandles levelRENDERABLE/RADIOSITY_RUNTIME.BINfiles- This contains runtime radiosity probe visibility slices, neighbour tables, lightmap fixups, and directional probe data
CATHODE.RagdollhandlesSKELE/RAGSandSKELE/RAGS64files withinANIMATION.PAK- This parses and writes Havok ragdoll physics rigs (
hkaRagdollInstance) for characters
- This parses and writes Havok ragdoll physics rigs (
CATHODE.RenderableElementshandles levelWORLD/REDS.BINfiles- This defines all renderable elements in a level - a model index with associated material index and count
CATHODE.Resourceshandles levelWORLD/RESOURCES.BINfiles- This defines all available resources within the level
CATHODE.SelectionOverlayParamshandles theSELECTIONOVERLAYPARAMS.BINfile- This defines various properties for the overlay effect applied to highlighted models
CATHODE.Shadershandles levelRENDERABLE/LEVEL_SHADERS_DX11.PAK,LEVEL_SHADERS_DX11_BIN.PAK, &LEVEL_SHADERS_DX11_IDX_REMAP.PAKfiles- This defines all compiled DX11 vertex, pixel, and hull/domain shaders within the level and their ubershader metadata
CATHODE.SkeletonhandlesSKELE/SKandSKELE/SK64files withinANIMATION.PAK- This defines character and prop skeletons (
hkaSkeleton), bone/float hash maps, IK setups, and retargeting targets
- This defines character and prop skeletons (
CATHODE.SkeletonDBhandles theANIM_SYS/SKELE/DB.BINfile withinANIMATION.PAK- This defines the master index of all available skeletons and retargeting mappings
CATHODE.SkeletonMappinghandlesSKELE/MAPSandSKELE/MAPS64files withinANIMATION.PAK- This defines retargeting mappings (
hkaSkeletonMapperpairs and bone index tables) between two skeletons
- This defines retargeting mappings (
CATHODE.SoundBankDatahandles levelWORLD/SOUNDBANKDATA.DATfiles- This defines all soundbanks available to be utilised within the level
CATHODE.SoundDialogueLookupshandles levelWORLD/SOUNDDIALOGUELOOKUPS.DATfiles- This defines a lookup table for dialogue animation/sound hashes within soundbanks
CATHODE.SoundEnvironmentDatahandles levelWORLD/SOUNDENVIRONMENTDATA.DATfiles- This defines all reverb and acoustic environment types used within the level
CATHODE.SoundEventDatahandles levelWORLD/SOUNDEVENTDATA.DATfiles- This defines all sound events available within the level's soundbanks
CATHODE.SoundNodeNetworkhandles levelWORLD/SOUNDNODENETWORK.DATfiles- This defines the layout of the sound node network within the level, used for acoustic propagation
CATHODE.SpottingPositionshandles levelWORLD/STATE_*/SPOTTING_POSITIONSandCRAWL_SPACE_SPOTTING_POSITIONSfiles- This contains the spatial grid of standing and crawl-space spotting positions per level state used by NPCs
CATHODE.TextDBhandles*.TXTfiles withinTEXTdirectories- This defines a database of localised strings and subtitles, saved per language
CATHODE.Textureshandles levelRENDERABLE/LEVEL_TEXTURES.ALL.PAK&WORLD/LEVEL_TEXTURE_HEADERS.ALL.BINfiles- This contains all textures used within the level with header and mipmap metadata
Beyond individual file parsers, CathodeLib provides high-level classes for loading, instancing, baking, porting, and merging entire levels:
Level&Global: Centralised containers for loading and saving all files associated with a level (DATA/ENV/*) and global archives (GLOBAL_TEXTURES.ALL.PAKandANIMATION.PAK), automatically keeping cross-file indices (models, materials, textures, shaders, and resources) synchronised on save.Animation&EnvironmentRigs: Loads, resolves cross-references across, and saves all formats insideDATA/GLOBAL/ANIMATION.PAK(pairing 32-bit and 64-bit skeletons, mappings, and ragdolls, plus spline encoding/decoding and retargeting), as well as multi-mesh environmental prop rigs (EnvironmentRigs).Instancing& Level Bakers: Evaluates a level'sCommandscomposite hierarchy into resolvedInstancedCompositeandInstancedEntitytrees (handling parameter inheritance, links, aliases, zones, and world transforms) and rebuilds the level's compiled runtime files:- Navigation & AI Baking (
CathodeLib.NavMesh):NavMeshBaker,CoverBaker, andJobPositionBakergenerate per-stateNAV_MESH,COVER,SPOTTING_POSITIONS,CRAWL_SPACE_SPOTTING_POSITIONS, andASSAULT_POSITIONSfiles using an embedded port of Recast/Detour (DotRecast). - Radiosity & AlphaLight Baking (
CathodeLib.Radiosity&CathodeLib.Alphalight):RadiosityBakerraytraces level geometry and lights (via an embeddedNanoRTBVH raytracer) to bake lightmap atlases, volume probes, visibility slices,RADIOSITY_RUNTIME.BIN,RADIOSITY_INSTANCE_MAP.TXT, andRADIOSITY_COLLISION_MAPPING.BIN.AlphalightBakerbakesALPHALIGHT_LEVEL.BIN. - Sound Network Generation (
CathodeLib.Sound):SoundNodeNetworkGeneratorbuildsSOUNDNODENETWORK.DATpropagation graphs across zones and portals. - Ubershader Permutation Service (
CATHODE.Ubershaders):ShaderPermutationServiceandUberShaderRecompilergenerate and compile shader permutations when material or lighting feature flags change.
- Navigation & AI Baking (
CompositePorter&LevelMerger:CompositePorterdeep-copies composites from oneLevelinto another, bringing along all referenced nested composites, models, materials, textures, shaders, environment animations, and Havok collision/physics shapes.LevelMergermerges multiple modified copies of a level against a base level into a single unified level, tracking any conflicting edits.
PatchManager&Utilities: Helpers for applying executable and configuration patches across game platforms (PatchManager), loading levels (Utilities.LoadLevel), and working withShortGuidhashes (ShortGuidUtils).
CathodeLib is in no way related to (or endorsed by) Creative Assembly or SEGA.