SHARE
TWEET

retribution.h

liquidspark Apr 7th, 2019 126 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Zeus
  2. // Retribution Library
  3. // Written in C programming syntax
  4. // By Sparky
  5. // The Empire of Galactic Vergence
  6. // galaxyverge.com
  7. //
  8. // Out of anger, out of vengeance,
  9. // the hearts of men are reduced to dust,
  10. // for the Wrath of God is withheld
  11. // and nothing can hide from his gaze,
  12. // God alone is Absolutely Good,
  13. // and not a soul can stand before him.
  14. // God is greater than all.
  15. //
  16. // God holds Existence within himself,
  17. // and his standard is Righteousness, His Son,
  18. // therefore, accept Jesus Christ as
  19. // your Righteousness and your Salvation,
  20. // lest you face Retribution,
  21. // for only by this faith
  22. // will a soul survive the coming Wrath of God,
  23. // when all evil is crushed to dust beneath his feet,
  24. // and God makes everything new.
  25. //
  26. // Some people think weapons will bring them peace.
  27. // Peace is good and weapons are evil.
  28. // Good sows good and evil sows evil.
  29. // "A good tree cannot bear bad fruit and a bad tree cannot bear good fruit.
  30. // Each tree is recognized by its fruit.
  31. // The good man brings good things out of the good stored in his heart and the evil man brings evil things out of the evil stored in his heart;
  32. // Out of the overflow of the heart, the mouth speaks.
  33. // By their fruit, you will recognize them.
  34. // Every tree that does not bear good fruit will be cut down and thrown into the fire."
  35. // The Garden of Life, the Garden of Eden, was symbolic in this way for Existence.
  36. // You cannot bring about peace by using weapons.
  37. // You cannot sow good by sowing evil.
  38. // "Woe to the world because of the things that cause people to sin!
  39. // If your right hand causes you to sin, cut it off, because it will be better for you to enter life with one hand than to have your whole body thrown into Hell where 'their worm does not cease and the fire does not go out'."
  40. // "Everyone will be salted with [given perseverence by] fire [purity to God, as Jesus Christ's eyes are fire -- he is focused on purity to God, Righteousness, because he is Righteousness and gives us himself so that whoever accepts him has him as their Righteousness and Salvation and by that faith in him therefore is no longer condemned; therefore, keep his words in you and he will remain in you]."
  41.  
  42. //////////////////////////////////////////
  43. ///////////     About Halo     ///////////
  44. //////////////////////////////////////////
  45. #pragma mark - About Halo
  46. /*
  47.  
  48. Halo
  49.     Halo, the computer game developed by Bungie Studios, Microsoft's "Microsoft Game Studios" and "343 Industries", Gearbox Software, and MacSoft, has the following common, playable game versions. The information here is intended to pertain to these versions of this Halo computer game.
  50.    
  51.     Halo 1 "Halo: Combat Evolved"
  52.         "Halo" for Xbox (Bungie Studios and Microsoft Game Studios)
  53.         "Halo Demo" for PowerPC Mac (MacSoft), "Halo Trial" for PC (Gearbox)
  54.         "Halo PC" 1.0.9.620 for PC (Gearbox / Roger Wolfson), "Halo PC" 1.0.10.621 for PC (Gearbox / Roger Wolfson), "Halo Full" for PowerPC Mac (MacSoft)
  55.         "Halo Custom Edition" 1.0.9.620 for PC (Gearbox / Roger Wolfson), "Halo Custom Edition" 1.0.10.621 for PC (Gearbox / Roger Wolfson)
  56.         "Halo Universal Binary" for PowerPC and Intel Mac (MacSoft), "Halo Mini Demo" for Intel Mac (nil)
  57.     Halo 2
  58.         "Halo 2" for Xbox (Bungie Studios and Microsoft Game Studios)
  59.         "Halo 2 Vista" for PC (Microsoft Game Studios)
  60.  
  61.     Bungie Studios developed Halo 1 and Halo 2 with help from Microsoft. Microsoft obtained the copyrights to the Halo game through this partnership and turned it into a franchise through Microsoft Game Studios after the large sales of Microsoft's Xbox console which featured Halo. Gearbox Software developed the Halo 1 game into "Halo PC", which runs on Windows. Gearbox developed a free demo of Halo PC called "Halo Trial". Gearbox also developed "Halo Custom Edition" or "Halo CE" for PC, which is intended to be used by gamers who want to play additional content on their computers. MacSoft ported Gearbox's Halo PC to run on PowerPC-based Apple Macintosh computers as "Halo for Mac", or "Halo PPC", or "Halo Full" to contrast with "Halo Demo" or "Halo Demo PPC". MacSoft developed Halo Demo for Mac to coincide with Gearbox's Halo Trial for PC. When Apple changed from building computers using the Motorola PowerPC ("PPC") processor to the Intel processor, MacSoft greatly overhauled the source code to their Halo for Mac application and developed a Universal Binary version which would run on PowerPC and Intel Macs, called "Halo Universal Binary" or "Halo UB". Some fans of Halo Demo who had experimented with developing software based upon their analyses of the files from Halo PC, Halo Custom Edition, Halo Trial, Halo Demo, and Halo PPC, gathered through Monoman's web site forum, Mac Gaming Mods (http://www.macgamingmods.com/forum). Using that communication venue, nil and others there developed a modified version of MacSoft's Halo Universal Binary and presented it to the community as Halo Mini Demo, or HaloMD. The reason for developing HaloMD was to replace the version of Halo Demo PPC which was becoming unusable as a result of Apple's change to Intel processors. When GameSpy ceased their free service of hosting master server lobby connections, both the Mac and PC versions of Halo were affected. MacSoft was unable to renew a license to the Halo source code and copyrights from Microsoft. Gearbox Software was no longer interested in Halo. Roger Wolfson, who formerly worked at Bungie Studios, updated the Halo PC game and dedicated server program executables to version 01.00.10.0621 and, with help from some members of the various Halo web site communities, changed to a different master server lobby host. Halo Demo, which was greatly popular among Mac gamers, was no longer a viable game for multiplayer due to the PowerPC-to-Intel change and the loss of GameSpy services. Later, after Bungie stopped working with Microsoft, Microsoft set up a subsidiary group called "343 Industries" or "343i" to develop more games for their Halo franchise. In October or November of 2015, Microsoft suddenly ceased hosting their master server lobby for Halo 2 Vista. Today, most Halo gamers who use Microsoft Windows PC are left with Halo PC 1.0.10.621 and Halo Custom Edition 1.0.10.621, and most of the Apple OS X users are left with the community-developed rendition Halo Mini Demo.
  62.     Gearbox Software developed "the Halo Editing Kit", abbreviated as "HEK", for use with Halo Custom Edition, so that Halo gamers using a PC can design new multiplayer maps with the Halo Editing Kit and then run them with Halo Custom Edition. The Halo Editing Kit consists of three main programs: Tool, Guerilla, and Sapien. Tool is a console program which means that it is used for distinctly linear tasks and does not provide a user interface to display. Tool is used to generate intermediary files called "tags" and to compile tags into finished "map cache files", or "maps", which is the file format used by the Halo game to store playable game levels and related asset archives. Guerilla is used to modify asset-based tags that were converted by Tool, and can also be used to generate all the other tag files that do not contain assets converted by Tool. Sapien, which was notably developed over several years by Matthew Noguchi, is the HEK program used to view and develop a game level's scenario.
  63.     When you install Halo PC, you will need to use a Microsoft software product license key. The license key that comes with your copy of Halo PC is located on an orange sticker above the disc holder inside the disc case. The product key for Halo 2 Vista is also on an orange sticker above its disc holder inside the disc case. MacSoft's Halo PPC also comes with a CD Key which is located on the rear cover of the manual pamphlet included in the box with the installation disc. The format of the CD keys for Halo PC and Halo 2 Vista is capital letters and numbers of the sequence XXXXX-XXXXX-XXXXX-XXXXX-XXXXX, whereas the format for Halo PPC is capital letters and numbers of the sequence XXXX-XXXX-XXXX-XXXX. Product keys are meant to be privately used by the software to identify a player; each product key should only be used by one person's copy of the Halo software. They abstractly represent a proof of purchase and typically should not be shared. The installation software provides an installation ID, but this is typically ignored; the product key is more significant to the player. While MacSoft supported its Universal Binary version of Halo for Mac, they mentioned details about re-using Halo PPC license keys; Halo UB is a separate purchase from MacSoft that comes with its own license key. Halo Mini Demo, which is essentially a community-modified version of Halo UB, does not require a CD Key or a license key of its players.
  64.     Halo Custom Edition's installer requires that you provide a Halo PC license key. Therefore, both Halo PC and Halo CE are considered licensed software, and Halo CE requires that you have a Halo PC product key. However, it is possible to install the Halo Editing Kit without having installed Halo Custom Edition. But Halo Custom Edition is required to play the map files that you have compiled using the Halo Editing Kit. So in essence, the typically installation process is to first install Halo PC, then Halo Custom Edition, and finally the Halo Editing Kit. However, if you do not own a copy of Halo PC and do not have a valid product key for it, you can only install the Halo Editing Kit, and you will not be able to use Halo Custom Edition to play your new map files.
  65.     Halo PC's default installation directory is "C:\Program Files\Microsoft Games\Halo". Halo Custom Edition's default installation directory is "C:\Program Files\Microsoft Games\Halo Custom Edition". The Halo Editing Kit installs into the Halo Custom Edition program's folder. Note that Halo is a 32-bit program, and so the default installation directory on 64-bit computers running 64-bit versions of Windows would be "C:\Program Files (x86)\Microsoft Games\Halo" and "C:\Program Files (x86)\Microsoft Games\Halo Custom Edition". The 32-bit programs usually install into the "Program Files (x86)" directory instead of the "Program Files" directory when the Windows operating system is 64-bit. The Halo Editing Kit installs two working directories within the Halo CE directory: a folder called "tags" and a folder called "data". When you use the Tool program to convert data like images and sounds into tags like .bitmap and .sound, you place the data files into folders within the "data" folder, run the appropriate Tool command, and Tool generates the tags and places them within coinciding subdirectories within the "tags" folder. The HEK programs Tool, Guerilla and Sapien are designed to only operate with the "working tags directory". To avoid issues with programs that are hard-coded to use the default installation directories for the Halo games, it is recommended that you use the default installation directories when installing Halo, Halo Custom Edition, and the Halo Editing Kit.
  66.     Halo for PC and Mac also install saved game information and certain settings files within the Saved Games and Documents folders within the user's directory. These file paths are hard-coded into the game, so you do not get an option to customize their location. Therefore, if a user file is not in its default location, it will be considered non-existent.
  67.     Halo for Xbox uses compression for its files. The Xbox version of the game also uses a different set of shader and model tag types from the Gearbox ports and the MacSoft ports. So for example, the appearance of teleporter entrances varies noticeably between the Xbox version of Halo and PC / Mac versions of Halo. The port of Halo between Xbox and PC / Mac is not exact. Gearbox Software included "optimizations" and MacSoft did its own overhaul with the Halo Universal Binary version. Halo PC and Halo Custom Edition also differ from each other.
  68.     The format and directory structure for Halo Xbox files is unique, since it uses compression and optimizations were seen as very necessary. The format of Halo PC files, notably the map files which contain level data, is practically the same as the format of files for Halo Full for Mac. Halo Demo and Halo Trial have about the same format of files as each other, different from the commercial versions Halo PC and Halo Full PPC, but the Halo Demo and Halo Trial programs have different quirks that can cause malformed or illogical map files to work on one but cause the other to crash. Halo Custom Edition uses a different format for its files, with its map files more heavily reliant upon common resource map references. The common resource map files for the games are bitmaps.map and sounds.map, where bitmaps.map contains common image data and sounds.map contains common audio data. Resource maps are used so that each scenario level stored in a playable .map file does not need to contain large swaths of duplicate data.
  69.     Playable levels are stored within .map files found within the "maps" folder in each Halo installation directory. (Halo PC uses "MAPS" and other capitalized folder names in the Halo installation directory, but using a case-insensitive computer setup means that "MAPS" is the same as "maps"; following the unix and Internet norm, lowercase is preferable and underscores are often necessary in lieu of spaces in subdirectories and file names. It is recommended to always use lowercase and underscores in lieu of spaces when using the Halo Editing Kit. Also note that unix uses the forward-slash "/" directory separator whereas Windows uses the back-slash "\" directory separator.) The .map files that contain playable information are of one general structure, different from the resource map files bitmaps.map and sounds.map. Halo CE and the HEK have a loc.map file which is used by Tool to help determine which tags are considered common; removing the loc.map file from your Halo CE's "maps" folder will result in Tool copying every tag that a compiled .map file references into the .map file during its compilation. Copying resource tags into a playable .map file is known as "internalizing" the tags. When a map has internalized tags, it potentially contains data in duplicate of the bitmaps.map and sounds.map resource map files -- the bitmaps or sounds from the standalone tags in the HEK tags directory are copied into the map file, even though their data could be already present in the resource maps bitmaps.map or sounds.map. When Tool does not find a loc.map, it will attempt to create a new loc.map, but not give it any data. So to switch back to normal map compilation and internalization functionality, the user would need to place their original loc.map file back into their Halo CE "maps" folder. Normal functionality only "internalizes" novel tag data into a map; only content that is not present within the two standard resource maps. Note that ui.map is also a playable level, but is unique in its use as the main menu for the game. Halo only loads one .map file at a time into memory, although it keeps it in memory once it is loaded. Halo PC and Halo Custom Edition initiate file locks on map files, and Halo Custom Edition only loads all the map files it can find in its "maps" folder all at once when it starts, so that while they are running, the .map file is not really modifiable. Halo Mac and Halo Demo do not lock modifications to the map files, and changes made to the file will be visible after a map file is reloaded, such as when choosing "new game" within the game menu while the map level is being played. Making map files work with Halo Demo or Halo Trial requires changing the format of the map file from its Xbox, commercial, or Custom Edition formats, and renaming the file as "bloodgulch.map" to replace the presence of the former "bloodgulch.map" file located in the game's "maps" folder. Halo Demo and Halo Trial look for the single "bloodgulch.map" as the multi-player level and the single "b30.map" as the single-player level. The commercial versions Halo PC and Halo PPC contain more information in their resource maps than the Halo Demo and Halo Trial versions. Resource maps are not normally interchangeable in equivalency between ports, just like the other .map files and user files are not interchangeable in equivalency between ports. The exception to this is that certain Halo PC and Halo Mac files, notably their .map files, are practically or exactly equivalent. This is also the case between Halo Demo and Halo Trial.
  70.     Playable maps contain game level information stored within tags. Essentially, playable map files consist of Halo Editing Kit tags that have been processed by Tool. When Tool processes tag files from the HEK "tags" directory, compiling them into a map cache file using the "build-cache-file" command, Tool adds additional information to the tags and removes the irrelevant file headers from them. Tool seeks out each tag in the tags directory that is referenced in chain starting with the two primary base tags, which are the globals tag located at "globals\globals.globals", and the scenario tag at hand, which is of a custom location within the tags directory which was specified as a parameter using the "build-cache-file" command. Tool organizes the tag data, sets up a tag index, and applies calculated file data internal offsets for each tag in lieu of the directory paths of the referenced tags which are stored as strings within the HEK format of the tags. Since the map file gets loaded directly into Halo's memory, Tool applies calculated offsets. Note that HEK tag files store data in Big Endian, and byte swapping occurs when Tool handles the map data, so that the Big Endian tag data is converted into Little Endian for Halo to read directly into its Little Endian memory space. This is why, for example, a scenario tag's referenced Binary Space Partition's tag class as "sbsp" for .scenario_structure_bsp HEK tags appears reversed as "psbs" in compiled .map files: the four bytes are reversed in order, from s-b-s-p to p-s-b-s, since the HEK tag file data is in Big Endian byte order and the map cache file's converted tag file data is in Little Endian byte order.
  71.     Halo 1 has 83 tag types, or tag classes, that are recognized by the Halo Editing Kit programs. Tags come in different types. For example, vehicle tag types store information about vehicles in the game. Each tag of a certain type provides information for the game to use. When you add a tag to a playable map file, you add information of a specific type to that map, for example, a new kind of vehicle to exist in the game level. The Halo Editing Kit takes all the various tags that are somehow referenced through the main tags, as already mentioned, and compiles them into a playable .map file, and then you can play the level in Halo Custom Edition. Only 78 of the 83 tag classes are directly used with the HEK; the 5 others are somewhat abstract primary or secondary super-classes. Furthermore, not all 78 tag classes are implemented by the Halo game.
  72.     Here is a list of all the Halo 1 tag classes, presented as the four-letter tag class ID, the HEK tag file extension, a name I gave it describing the role of the tag type, and my description for it:
  73.    
  74.     actr / .actor / Actor : The "actor" tag type stores information about basic character behavior for artificial intelligence. It is partnered with "actor variant" (actv) which specifies behavior variations in greater detail.
  75.     actv / .actor_variant / Actor Variant : This is the primary tag type that specifies behavior variations for artificial intelligence.
  76.     ant! / .antenna / Antenna : Bitmap image sequences applied with customized physics to imitate the behavior of an antenna.
  77.     antr / .model_animations / Animations : Animation data organized according to associated tags and their specific animation types.
  78.     bipd / .biped / Biped : This is the obje affiliation for actv tags.
  79.     bitm / .bitmap / Bitmap : One or more compressed images organized by usage.
  80.     boom / .spheroid / Spheroid : An apparently unused tag class. It may have been a simple class used for hitbox detection, for memory use only.
  81.     cdmg / .continuous_damage_effect / Continuous Damage Effect : Referenced by lsnd but apparently unused, this would probably be used with ssce.
  82.     coll / .model_collision_geometry / Collision Model : The collision model can be referenced by subclasses of obje and is stored separately from the visible mod2 or mode tags. It stores health values and associates material damage ratios.
  83.     colo / .color_table / Color Table : Not often modified.
  84.     cont / .contrail / Contrail : A contrail is a referenced bitmap rendered at periodic time intervals at a specified marker used by a tag class such as proj.
  85.     ctrl / .device_control / Control Panel : This is an obje subclass that has details about player-interactive switches for toggling the states of mach tags.
  86.     deca / .decal / Decal : A decal is a decorative bitm tag reference snapped to sbsp tag geometry. It is stored by a levels scnr tag, and therefore more closely binds the scnr tag with its sbsp tags.
  87.     DeLa / .ui_widget_definition / UI Widget Definition : A partner tag class with Soul, both of which are the primary user interface tag classes.
  88.     devc / .input_device_defaults / Input Device Defaults : Not often modified; it stores settings for game pad controllers.
  89.     devi / .device / Device : The tier 2 class for obje subclasses related to machines. Memory use only.
  90.     dobc / .detail_object_collection / Detail Object Collection : Similar to deca, but rendered perpendicularly to the sbsp geometry and uses bitmap sprites for camera-facing rendering.
  91.     effe / .effect / Effect : This is the primary class for particle effects and their associated sounds. It can be used in unorthodox ways, given its support for spawning a variety of tag classes. It supports periodicity and vectors. In complex references, can overwhelm the game's memory table management, resulting in memory leaks and rendering snafus.
  92.     elec / .lightning / Lightning : Similar in behavior to ant!.
  93.     eqip / .equipment / Equipment : This is the obje subclass for an obtainable dumb item in the game and is used so that the player can gather ammunition apart from a full-fledged weap tag. It is also used for power-ups.
  94.     flag / .flag / Flag Cloth : This lets you customize the flag cloth for Capture The Flag game types.
  95.     fog / .fog / Fog : This is associated with a "fog plane" in the sbsp geometry, rather than the generic "fog ambience" used by sky.
  96.     font / .font / Font : Not often modified. This stores information about textual character glyphs used when the game shows text.
  97.     foot / .material_effects / Material Collision Effects : Effe and snd! associations with collision events between obje-related tags (and their coll's) and sbsp collision surfaces. Examples are footstep sounds and footprints, and tire tracks and skid sounds.
  98.     garb / .garbage / Garbage : This is a simple obje subclass like scen, and it is removed from the game's rendering table after a short time.
  99.     glw! / .glow / Particle Glow Effect : Glowing particle effects associated with markers, primarily used to achieve the energy sword weapon's glowing appearance.
  100.     grhi / .grenade_hud_interface / Grenade HUD Interface : The customization for the player's visible grenade heads-up display.
  101.     hmt / .hud_message_text / HUD Messages : Text shown on the player's visible heads-up display. Characters are stored differently than with ustr.
  102.     hudg / .hud_globals / General HUD Settings : This is the primary class for modifying the player's visible heads-up display.
  103.     hud# / .hud_number / HUD Numbers Settings : Number glyphs shown on the player's visible heads-up display, for example, the number glyphs showing the distance to the next waypoint marker on the player's HUD.
  104.     item / .item / Item : The tier 2 class for obje subclasses related to equipment. Memory use only.
  105.     itmc / .item_collection / Respawning Objects Collection : Multiplayer games use this to respawn obje subclasses like weap and eqip.
  106.     jpt! / .damage_effect / Damage Effect : Damage values applied to coll tags within a specified area of effect. Negative values can "heal"; extreme values cause unusual results.
  107.     lens / .lens_flare / Lens Flare : A screen effect often used with ligh, such as the light source in a sky.
  108.     lifi / .device_light_fixture / Light Fixture : This is the obje and devi subclass representing decorative light fixtures that can be toggled on and off and often associate ligh tags that affect the radiosity lighting of the sbsp.
  109.     ligh / .light / Light : A visible light source.
  110.     lsnd / .sound_looping / Looping Sound : Snd! references that can be customized to repeat ad nauseum, such as could be used to simulate ambient noises and music.
  111.     mach / .device_machine / Machine : Stationary objects that can be animated along a path and toggled on and off using a ctrl, such as for elevators and doors.
  112.     matg / .globals / General Game Settings : The main tag class that specifies generic game settings for a map cache file. It is stored separately from scnr because matg has settings normalized for consistency in gameplay mechanics, such as player movement speed.
  113.     metr / .meter / Meter : A special class used to simulate a meter on the heads-up display, such as with the player's shield level visualization.
  114.     mgs2 / .light_volume / Volumetric Light : Applies lit blobs to mod2 or mode markers, such as for the plasma weapon projectiles.
  115.     mod2 / .gbxmodel / Gearbox PC Model : The main visual render model class used with the PC version of the game. Uses uncompressed vertices.
  116.     mode / .model / Xbox Model : The main visual render model class used with the Xbox version of the game. Uses compressed vertices relativized between -1 and 1.
  117.     mply / .multiplayer_scenario_description / Multiplayer Scenario Descriptions : Used to make introductory level information, including a preview bitm and description.
  118.     ngpr / .preferences_network_game / Multiplayer Character Settings : Can store default user profile information, such as player colors. Not often modified, since it would probably only be customized with a new user interface map cache file.
  119.     obje / .object / Object : The tier 1 class that contains over 10 subclasses related to objects managed by the game's memory tables. For memory use only.
  120.     part / .particle / Particle : Used to simulate special particle effects.
  121.     pctl / .particle_system / Particle System : Used with part and pphy.
  122.     phys / .physics / Object Physics : The game supports phys associated with vehi; this is what can be used to customize vehicle physics.
  123.     plac / .placeholder / Object Placeholder : Unused. An obje subclass probably for development purposes.
  124.     pphy / .point_physics / Particle Point Physics : Specifies physics simulation information for part and pctl.
  125.     proj / .projectile / Projectile : An obje subclass used to represent a projectile fired from a weap.
  126.     rain / .weather_particle_system / Weather : A viewer-facing camera overlay rendered particle effect that can be used to simulate raindrops in rainy weather or bubbles and dirt underwater.
  127.     sbsp / .scenario_structure_bsp / Scenario Environment Structure : The terrain for a level, including its visible and physical geometry, portal and lightmap groupings, and fog and lsnd references. Groupings such as the sky use indices from the scnr.
  128.     scen / .scenery / Scenery : The simplest obje subclass that can be used to represent stationary objects such as rocks and trees. If animated, the current animation frame will not synchronize in a multiplayer game.
  129.     scex / .shader_transparent_chicago_extended / Extended Transparent Shader : A PC version of a complex transparent shader.
  130.     schi / .shader_transparent_chicago / Transparent Shader : A PC version of a simple transparent shader.
  131.     scnr / .scenario / Scenario Environment Configuration : This is the primary tag class for a playable level, and it associates all the other tag classes that would most often be customized in a multiplayer map cache file.
  132.     senv / .shader_environment / Environment Shader : This shader class is used with sbsp.
  133.     sgla / .shader_transparent_glass / Transparent Glass Shader : This shader class is used to render highly-transparent faces, such as with glass.
  134.     shdr / .shader / Generic Shader : This is the superclass for shader classes. For memory use only.
  135.     sky / .sky / Sky : Stores information about the light source(s) and simple fog along with the reference to the visible model and optional animations used with a rendered sky.
  136.     smet / .shader_transparent_meter / Transparent Meter Shader : Special shader used with non-HUD meters, such as those on the warthog's driver panel and the plasma weapons' heat and charge meters on their first-person models.
  137.     snd! / .sound / Sound : Customize a compressed audio file's playback.
  138.     snde / .sound_environment / Ambient Effect : A special audio effect for DirectSound audio playback which uses echo effects to simulate physical space ambience.
  139.     soso / .shader_model / Model Shader : Used for simple model appearances, such as with scen.
  140.     sotr / .shader_transparent_generic / Generic Transparent Shader : A special Xbox shader class which is more advanced than its scex PC counterpart.
  141.     Soul / .ui_widget_collection / UI Widget Collection : Used with DeLa to customize the elements of a player-interactive user interface.
  142.     spla / .shader_transparent_plasma / Transparent Plasma Shader : A special model shader used for plasma-like rendering effects.
  143.     ssce / .sound_scenery / Sound-Emitting Scenery : The same thing as scen, but just separated for purposes of keeping things organized; you would normally reference an lsnd as an attachment, although you could do the same with a scen tag.
  144.     str# / .string_list / String References : Not usually modified. Some base tags use this as a kind of tagc of strings.
  145.     swat / .shader_transparent_water / Transparent Water Shader : A special shader associated with the "water" material which is used to transparently render waves and ripples as if it were used for the surface of a volume of water.
  146.     tagc / .tag_collection / Tag Collection : A base tag class not usually modified. This usually is and/or contains tags that often have their tag path name strings hardcoded in the game.
  147.     trak / .camera_track / Camera Track : Indicates how the 3D camera view should behave, such as its constraints and relative velocity when revolving around a point.
  148.     udlg / .dialogue / Unit Dialogue : A list of snd! references used at actv voice trigger moments.
  149.     unhi / .unit_hud_interface / Unit HUD Interface : A complex primary tag for customizing the basic heads-up display in the game. Supports overriding through wphi.
  150.     unit / .unit / Unit : A tier 2 obje subclass used to group unit classes, such as bipd and vehi. For memory use only, despite the odd possible reference to it in Guerilla, such as in the actv tag class -- but unit is unsupported.
  151.     ustr / .unicode_string_list / Unicode String References : Groupings of textual strings encoded differently from hmt . Used frequently.
  152.     vcky / .virtual_keyboard / Virtual Keyboard : Not often modified. Associates a font with a keyboard character.
  153.     vehi / .vehicle / Vehicle : An obje subclass that is used to represent a player-controllable vehicle. Uniquely synchronized in multiplayer games.
  154.     weap / .weapon / Weapon : An obje subclass that is used to represent weapons that can be picked-up off a collision plane and wielded. Represent themselves as ammunition when the player is already wielding that weapon.
  155.     wind / .wind / Wind : Some basic values that are used to simulate wind as it would interact with flag and cont.
  156.     wphi / .weapon_hud_interface / Weapon HUD Interface : An override of unhi that is assigned while wielding a weap.
  157.    
  158.     The .device, .item, .object, .shader and .unit tags are the five abstract tag super-classes that are primary or secondary of these 83 mentioned tag classes; the actual usable tag classes are only 78 and are tertiary tag classes. Primary, secondary, and tertiary refer to the tag hierarchy within a map cache file. Primary and secondary tag super-classes describe the general categories of certain tertiary tag classes. Primary means the most general categorization and secondary is a more specific categorization, both describing the tertiary specific tag class. For example, both vehicles of the vehi tag class and bipeds of the bipd tag class are of the primary obje object tag class and the secondary unit tag class. So this essentially means that the game engine interprets these two specific tertiary tag classes as objects, and more specifically, units, and they both include object and unit sections of information within their details. As another example, weapons are objects, but instead of being units, they are items. So the primary abstract tag class for a weap tag is obje and the secondary abstract tag class is item. When a tag only contains one abstract class, it is listed as the secondary class, since there is no more-generic primary tag class applicable; so for example, a soso shader model is a tertiary class with a single abstract class of shdr shader, and there is no other abstract class for soso, and so shdr is the secondary abstract super-class for soso shader model tag types. Obje is not always a primary tag class: for example, with scen scenery, it is the only abstract class, and so is listed as a secondary tag super-class for scenery tag types. It helps to visualize it in this way: 3 columns, numbered from left to right as 3 (tertiary), 2 (secondary) and 1 (primary), the first containing the actual tag class in question and the other two columns containing optional secondary and primary tag super-classes by which the tag class in question can be categorized. For example:
  159.    
  160.     tertiary main class / secondary abstract class / primary abstract class
  161.     bitm / - / -
  162.     matg / - / -
  163.     soso / shdr / - (soso Shader Model is a kind of shdr Generic Shader)
  164.     scen / obje / - (scen Scenery, such as rocks and trees, is a kind of obje Object)
  165.     bipd / unit / obje (bipd Biped, such as the player character, is a kind of unit Unit, and also more generically a kind of obje Object)
  166.    
  167.     Here is an actual 832-byte segment from the tag index within the a10.map playable map file:
  168.    
  169.     mtibˇˇˇˇˇˇˇˇ∫.‚óÓE@‡:X@
  170.     ososrdhsˇˇˇˇª/‚«ÓE@º;X@
  171.     mtibˇˇˇˇˇˇˇˇº0‚ÒÓE@t=X@
  172.     ososrdhsˇˇˇˇΩ1‚ÔE@P>X@
  173.     ososrdhsˇˇˇˇæ2‚NÔE@@X@
  174.     ososrdhsˇˇˇˇø3‚vÔE@¿AX@
  175.     ihcsrdhsˇˇˇˇ¿4‚£ÔE@xCX@
  176.     mtibˇˇˇˇˇˇˇˇ¡5‚ÕÔE@úEX@
  177.     rtnaˇˇˇˇˇˇˇˇ¬6‚˜ÔE@xFX@
  178.     hgilˇˇˇˇˇˇˇˇ√7‚E@`LX@
  179.     snelˇˇˇˇˇˇˇˇƒ8‚;E@¿MX@
  180.     mtibˇˇˇˇˇˇˇˇ≈9‚hE@0OX@
  181.     necsejboˇˇˇˇ∆:‚ùE@\QX@
  182.     2domˇˇˇˇˇˇˇˇ«;‚ E@¿SX@
  183.     ososrdhsˇˇˇˇ»<‚˝E@¿WX@
  184.     mtibˇˇˇˇˇˇˇˇ…=‚3ÒE@xYX@
  185.     mtibˇˇˇˇˇˇˇˇ >‚ÉÒE@ÑZX@
  186.     mtibˇˇˇˇˇˇˇˇÀ?‚ŸÒE@ê[X@
  187.     ihcsrdhsˇˇˇˇÃ@‚ÚE@l\X@
  188.     mtibˇˇˇˇˇˇˇˇÕA‚7ÚE@¥]X@
  189.     hgilˇˇˇˇˇˇˇˇŒB‚XÚE@ê^X@
  190.     snelˇˇˇˇˇˇˇˇœC‚ÚE@_X@
  191.     dpibtinuejbo–D‚®ÚE@`aX@
  192.     2domˇˇˇˇˇˇˇˇ—E‚√ÚE@LjX@
  193.     ososrdhsˇˇˇˇ“F‚fiÚE@<äX@
  194.     mtibˇˇˇˇˇˇˇˇ”G‚ÛE@ÙãX@
  195.  
  196.     You can see how the four-letter tag classes of each indexed tag, presented here as one entry per line, shows the tag classes reversed, having been byte-swapped from the HEK tag files in Big Endian to the Little Endian map cache file format suitable for reading into game memory. The first four bytes are the tertiary column, the second are the secondary column and the third are the primary column. The first entry, "mtib" is a bitm Bitmap tag entry which contains no super-classes. The second entry is "ososrdhs", which is soso Shader Model of the super-class shdr Generic Shader and no other abstract class, so there is nothing listed for the primary abstract tag class. Moving down, you can see that "necsejbo" means that scen Scenery tag classes have a single abstract class, therefore given as the secondary super-class, which is obje Object. Towards the end of the example, you see "dpibtinuejbo" or obje - unit - bipd, where the primary abstract class is obje Object, the secondary, more specific abstract class is unit Unit, and the actual tag class, the tertiary class, is bipd Biped.
  197.    
  198.     13 tag classes have obje (object) abstract super-classes. They are listed here according to their internal indices:
  199.    
  200.     -1 / obje / .object / Object
  201.     0 / bipd / .biped / Biped
  202.     1 / vehi / .vehicle / Vehicle
  203.     2 / weap / .weapon / Weapon
  204.     3 / eqip / .equipment / Equipment
  205.     4 / garb / .garbage / Garbage
  206.     5 / proj / .projectile / Projectile
  207.     6 / scen / .scenery / Scenery
  208.     7 / mach / .device_machine / Machine
  209.     8 / ctrl / .device_control / Control Panel
  210.     9 / lifi / .device_light_fixture / Light Fixture
  211.     10 / plac / .placeholder / Object Placeholder
  212.     11 / ssce / .sound_scenery / Sound-Emitting Scenery
  213.    
  214.     10 tag classes have shdr (shader) abstract super-classes. They are listed here according to their internal indices:
  215.    
  216.     -1 / shdr / .shader / Generic Shader
  217.     3 / senv / .shader_environment / Environment Shader
  218.     4 / soso / .shader_model / Model Shader
  219.     5 / sotr / .shader_transparent_generic / Generic Transparent Shader
  220.     6 / schi / .shader_transparent_chicago / Transparent Shader
  221.     7 / scex / .shader_transparent_chicago_extended / Extended Transparent Shader
  222.     8 / swat / .shader_transparent_water / Transparent Water Shader
  223.     9 / sgla / .shader_transparent_glass / Transparent Glass Shader
  224.     10 / smet / .shader_transparent_meter / Transparent Meter Shader
  225.     11 / spla / .shader_transparent_plasma / Transparent Plasma Shader
  226.    
  227.     There are 4 types of devi (device) tags, but they are not apparently indexed. They are listed here:
  228.    
  229.     devi / .device / Device
  230.     ctrl / .device_control / Control Panel
  231.     lifi / .device_light_fixture / Light Fixture
  232.     mach / .device_machine / Machine
  233.    
  234.     There are 4 types of item (item) tags, but they are not apparently indexed. They are listed here:
  235.    
  236.     item / .item / Item
  237.     eqip / .equipment / Equipment
  238.     garb / .garbage / Garbage
  239.     weap / .weapon / Weapon
  240.    
  241.     There are 3 types of unit (unit) tags, but they are not apparently indexed. They are listed here:
  242.    
  243.     unit / .unit / Unit
  244.     bipd / .biped / Biped
  245.     vehi / .vehicle / Vehicle
  246.  
  247. */
  248.  
  249. //////////////////////////////////////////
  250. ///////////    Comments    ///////////////
  251. //////////////////////////////////////////
  252. #pragma mark - Comments
  253. /*
  254.  (1)
  255.  Halo 1 uses the following tag types, a.k.a. tag classes,
  256.  (2)
  257.  and each tag type has an expected version number in its header.
  258.  
  259.  2   actr / .actor / Actor
  260.  1   actv / .actor_variant / Actor Variant
  261.  1   ant! / .antenna / Antenna
  262.  4   antr / .model_animations / Animations
  263.  3   bipd / .biped / Biped
  264.  7   bitm / .bitmap / Bitmap
  265.  1   boom / .spheroid / Spheroid
  266.  1   cdmg / .continuous_damage_effect / Continuous Damage Effect
  267.  10   coll / .model_collision_geometry / Collision Model
  268.  1   colo / .color_table / Color Table
  269.  3   cont / .contrail / Contrail
  270.  1   ctrl / .device_control / Control Panel
  271.  1   deca / .decal / Decal
  272.  1   DeLa / .ui_widget_definition / UI Widget Definition
  273.  1   devc / .input_device_defaults / Input Device Defaults
  274.  1   devi / .device / Device
  275.  1   dobc / .detail_object_collection / Detail Object Collection
  276.  4   effe / .effect / Effect
  277.  1   elec / .lightning / Lightning
  278.  2   eqip / .equipment / Equipment
  279.  1   flag / .flag / Flag Cloth
  280.  1   fog  / .fog / Fog
  281.  1   font / .font / Font
  282.  1   foot / .material_effects / Material Collision Effects
  283.  1   garb / .garbage / Garbage
  284.  1   glw! / .glow /Particle Glow Effect
  285.  1   grhi / .grenade_hud_interface / Grenade HUD Interface
  286.  1   hmt  / .hud_message_text / HUD Messages
  287.  1   hudg / .hud_globals / General HUD Settings
  288.  1   hud# / .hud_number / HUD Numbers Settings
  289.  2   item / .item / Item
  290.  0   itmc / .item_collection / Respawning Objects Collection
  291.  6   jpt! / .damage_effect / Damage Effect
  292.  2   lens / .lens_flare / Lens Flare
  293.  1   lifi / .device_light_fixture / Light Fixture
  294.  3   ligh / .light / Light
  295.  3   lsnd / .sound_looping / Looping Sound
  296.  1   mach / .device_machine / Machine
  297.  3   matg / .globals / General Game Settings
  298.  1   metr / .meter / Meter
  299.  1   mgs2 / .light_volume / Volumetric Light
  300.  5   mod2 / .gbxmodel / Gearbox PC Model
  301.  4   mode / .model / Xbox Model
  302.  1   mply / .multiplayer_scenario_description / Multiplayer Descriptions
  303.  2   ngpr / .preferences_network_game / Multiplayer Character Settings
  304.  1   obje / .object / Object
  305.  2   part / .particle / Particle
  306.  4   pctl / .particle_system / Particle System
  307.  4   phys / .physics / Object Physics
  308.  2   plac / .placeholder / Object Placeholder
  309.  1   pphy / .point_physics / Particle Point Physics
  310.  5   proj / .projectile / Projectile
  311.  1   rain / .weather_particle_system / Weather
  312.  5   sbsp / .scenario_structure_bsp / Scenario Environment Structure
  313.  1   scen / .scenery / Scenery
  314.  1   scex / .shader_transparent_chicago_extended / Extended Transparent Shader
  315.  1   schi / .shader_transparent_chicago / Transparent Shader
  316.  2   scnr / .scenario / Scenario Environment Configuration
  317.  2   senv / .shader_environment / Environment Shader
  318.  1   sgla / .shader_transparent_glass / Transparent Glass Shader
  319.  1   shdr / .shader / Generic Shader
  320.  1   sky  / .sky / Sky
  321.  1   smet / .shader_transparent_meter / Transparent Meter Shader
  322.  4   snd! / .sound / Sound
  323.  1   snde / .sound_environment / Ambient Effect
  324.  2   soso / .shader_model / Model Shader
  325.  1   sotr / .shader_transparent_generic / Generic Transparent Shader
  326.  1   Soul / .ui_widget_collection / UI Widget Collection
  327.  1   spla / .shader_transparent_plasma / Transparent Plasma Shader
  328.  1   ssce / .sound_scenery / Sound-Emitting Scenery
  329.  1   str# / .string_list / String References
  330.  2   swat / .shader_transparent_water / Transparent Water Shader
  331.  1   tagc / .tag_collection / Tag Collection
  332.  2   trak / .camera_track / Camera Track
  333.  1   udlg / .dialogue / Unit Dialogue
  334.  1   unhi / .unit_hud_interface / Unit HUD Interface
  335.  2   unit / .unit / Unit
  336.  1   ustr / .unicode_string_list / Unicode String References
  337.  2   vcky / .virtual_keyboard / Virtual Keyboard
  338.  1   vehi / .vehicle / Vehicle
  339.  2   weap / .weapon / Weapon
  340.  1   wind / .wind / Wind
  341.  2   wphi / .weapon_hud_interface / Weapon HUD Interface
  342.  
  343.  (3)
  344.  Nominclature of variables in tag format structs includes:
  345.  
  346.  _bf                     Bit Field, used for 0 and 1 bitmask values represented as off and on checkbox options stored in 8-bit, 16-bit and 32-bit unsigned integers
  347.  _list                Enumerated values represented as (popup list) menu options stored in 16-bit and 32-bit unsigned integers
  348.  _rad                 Angle value represented in radians and stored within a 32-bit floating-point number
  349.  _calc                  The value is recalculated regardless of what value was previous stored in its place.
  350.  _sel                   Chunk selector represented as a popup menu in Guerilla, refers to the index number of a cell of a specific representation
  351.  unknown_1, unknown_2, etc.   Values whose purposes appear undocumented and have not yet been fully realized by myself
  352.  d1_, d2_, etc.         Prefixes for dependencies which are references to other tags using full "tag path name strings" (tpns) in character pointer format (char *)
  353.  _frac                A float value that is restricted by the Halo Editing Kit program Guerilla to be limited to a value between and including 0.0 and 1.0
  354.  r1c_, r2c_, and similar      Reflexives, in other words, array-type representations of grouped information, using a scheme of "board" as index and "cells" as groupings
  355.  
  356.  Nominclature in other structs includes:
  357.  
  358.  o_                  A value that is used as an offset relative to 0x0 in the file or memory in which it is found
  359.  omem_                Same, but specifically referring to the counterpart data stored in memory
  360.  ofile_               Same, but specifically referring to the counterpart data stored as a file
  361.  a_, amem_, afile_       Address of data in this file, address of counterpart memory, address of counterpart file (basically, it's a pointer) -- however, in practice, if a value is an extended chain of pointers and their usefulness is unknown, it is generalized as a uint_32 at some point
  362.  s_                  A value that is used to represent the size (number of bytes) of some data
  363.  ct_                     Tag in compiled tag format as stored in a .map file
  364.  ctms_                Compiled Tag Meta Set, meaning an array of tags in compiled format of a single class; this is represented in struct form as a pointer to an array of tags of a single class
  365.  _ISOCELL_                An isolated cell that is located in a remote part of the memory but is referenced through pointers by some kind of table
  366.  
  367.  If I get a value from the Phasor document, I will typically use a novel variable name and comment its Phasor variable name next to it.
  368.  
  369.  I include static address offsets when appropriate.
  370.  
  371.  The related format for comments is: // address, Phasor_variable_name (related line of Phasor document)
  372.  
  373.  (4)
  374.  The default Guerilla exits, probably intentionally, when attempting to use the "File -> New..." menu item to make a new tag document of the following tag types:
  375.  
  376.  device
  377.  item
  378.  object
  379.  shader
  380.  unit
  381.  
  382.  The reason for this is because these are tier 1 and tier 2 tag classes, and usable tags are only of tier 3, which are the other 78 tag classes.
  383.  
  384.  Kornman's hacked version of Guerilla was used to reverse-engineer these 5 non-tertiary-tier tag classes. The default Guerilla program has no qualms opening these five tag types generated using Kornman's hacked version of Guerilla.
  385.  
  386.  (5)
  387.  Transcript of discovery on Thursday, November 19, 2015 regarding storing data between memory addresses 0x40440000 and 0x41B40000:
  388.  
  389.  03:04:28 <Sparky> I just discovered something cool
  390.  
  391.  03:07:16 <Sparky> the game loads the sbsp data for the current map at address 0x41B40000, loading the data in reverse order (so the first byte is at 0x41B3FFFF); each map file has a 32-bit memory address stored in it that shows where the start of the sbsp data will be in memory (I think maybe Modzy discovered this years ago on MGM, I vaguely remember something about him asking about some address here) and that offset is at 0x800 in the map file.
  392.  
  393.  03:24:48 <Sparky> do you realize what this means?
  394.  
  395.  03:25:04 <Sparky> it means I discovered why Halo has mod map size limitations
  396.  
  397.  03:25:09 <Sparky> :D
  398.  
  399.  03:25:17 <Sparky> which is one step closer to overcoming the issue
  400.  
  401.  03:27:09 <Sparky> basically, the game loads tag data starting at offset 0x40440000, and so when you have more tags referenced by the base scnr or matg tags, you have more tags loaded there. Add the tag index and tag data that is being referenced to the memory address 0x40440000, and that's the limit on the front end of allocated memory.
  402.  
  403.  03:27:55 <Sparky> now take the sbsp data size and approach that resulting address from the opposite side, and see what the difference is
  404.  
  405.  03:29:29 <Sparky> so basically you have a memory block allocated between 0x40440000 and 0x41B40000, and you have to cram the tag index and referenced tag data in the start of it, and the sbsp data at the end of it, and see how much space is left in between the two, in the middle
  406.  
  407.  03:32:45 <Sparky> for example, a10.map, the first level of the halo campaign, has something like 5 MB of padding between the tag data and the sbsp data
  408.  
  409.  03:33:01 <Sparky> something like 0x4F3E28 (5193256) bytes
  410.  
  411.  03:34:54 <Sparky> so you would see that by loading up a10.map and viewing the Halo memory at address 0x41300800, the start of the sbsp data copied to memory, and then look at address 0x40E0C9D8, about the end of the tag data loaded into memory, and there's 5193256 bytes in between
  412.  
  413.  03:36:01 <Sparky> that means that when Halo calculated the value for file offset 0x800, it added approximately 5 MB of padding between the calculated referenced tags size and the sbsp data size
  414.  
  415.  03:36:09 <Sparky> so essentially, it did...
  416.  
  417.  03:37:37 <Sparky> 0x40440000 + size of data of referenced tags in scnr / matg + ca. 5193256 bytes = sbsp data address to write in at offset 0x800 in the map file
  418.  
  419.  03:45:19 <nil_> I *think* modzy and 002 know about that
  420.  
  421.  03:46:24 <nil_> and if I recall scenario editors wrongly used the data in that gap
  422.  
  423.  03:46:50 <Sparky> the gap is only present in game memory
  424.  
  425.  03:46:57 <Sparky> those are memory addresses
  426.  
  427.  03:47:13 <Sparky> do you understand what I'm saying?
  428.  
  429.  03:48:14 <Sparky> the tag index from the map file includes all the actually-referenced tags in the map file (which is why there's not really a map file size limit so much as a referenced tags size limit) and that starts at 0x40440000
  430.  
  431.  03:48:50 <Sparky> so add the size of the index and referenced tags to that, and that's the start of the padding section
  432.  
  433.  03:49:24 <Sparky> now start at offset 0x41B40000 and work backwards
  434.  
  435.  03:49:40 <Sparky> all the way to the start of the padding section
  436.  
  437.  03:49:50 <Sparky> that's all the available space for the sbsp data
  438.  
  439.  03:50:06 <Sparky> so the game juggles the tag data sizes and the sbsp data size differently
  440.  
  441.  03:50:56 <Sparky> whatever is left in between the two sections is just residual sbsp data that was previously loaded
  442.  
  443.  03:51:10 <Sparky> or null characters if it wasn't all used
  444.  
  445.  03:52:11 <Sparky> that means the actual limitation would probably be sbsp data size + referenced tag data size must be <= (0x41B40000 - 0x40440000)
  446.  
  447.  03:52:57 <Sparky> that's 24117248 bytes
  448.  
  449.  03:53:18 <Sparky> 24,117,248 bytes (0x1700000)
  450.  
  451.  03:54:41 <Sparky> so the game only has 0x1700000 bytes of space (about 24 MB) to load all the referenced tags' data, its tag index, and the sbsp data
  452.  
  453.  Also, Tool reports 24 MB as being the total available "tag space" during build-cache-file.
  454.  
  455.  
  456.  (6)
  457.  For padding values, I had comments and I will be instead using something like "pad_<offset>_<bytesize>".
  458.  
  459.  It was discussed here -- http://stackoverflow.com/questions/37771041/how-to-use-flexible-array-members-in-nested-c-structs -- and determined that for tpns and other variable-length strings and variable-length data, I should use char ** in the struct to point to an array of null-terminated C-strings, etc., where NULL would be the last entry of the pointer array.
  460.  
  461.  It was also deteremined that, since structs are for static data sizes, and due to variable-length strings and other variable-length data, these structs are not ideal, I should do another rendition of these tag file format structs, etc., into objects and classes, using properties for example (something like what 002 did).
  462.  
  463.  My hopes for reading data as structs seem to be in fruitless.
  464.  
  465.  (7)
  466.  Special thanks to 002 for mentioning that the 32-bit "random number" values are typically CRC-32 checksums of the relevant subsequent data, with all the bits (not bytes, but bits) flipped. For example, the tag header contains a CRC-32 of the tag data following the header. It's big endian.
  467.  
  468.  (8)
  469.  There are about 5380 metadata values in the tag class definitions, including padding and headers (about 5300 without headers), before padding (potentially some extra processed data) analysis.
  470.  
  471.  (9)
  472.  Stock tags have different signature ID's (for representation boards and reference boards) than the current Guerilla version.
  473.  
  474.  */
  475.  
  476. /////////////////////////////////////////////////////////
  477. //////////////      Table of Contents      //////////////
  478. //////////////  (instead of pragma marks)  //////////////
  479. /////////////////////////////////////////////////////////
  480. #pragma mark - Table of Contents
  481. /*
  482.  
  483.  I    HEK tag file format structs           943
  484.  II   Function declarations                 20785
  485.  III      Utility functions                 20819
  486.  
  487.  
  488.  
  489.  
  490.  */
  491.  
  492. ///////////////////////////////////////////////////
  493. ///////////////     Credits     ///////////////////
  494. ///////////////////////////////////////////////////
  495. #pragma mark - Credits
  496. /*
  497.  
  498.  -------------
  499.  byte-swapping functions
  500.  special thanks to: http://stackoverflow.com/a/2637138
  501.  and http://cboard.cprogramming.com/c-programming/121572-how-swap-endianness-float.html
  502.  and http://www.cocoawithlove.com/2008/04/using-pointers-to-recast-in-c-is-bad.html
  503.  -------------
  504.  
  505.  
  506.  */
  507.  
  508. #pragma mark - Includes and Defines
  509.  
  510. #define apxs 0
  511.  
  512.  
  513. #include <stdint.h>
  514. #include <stdbool.h>
  515. #include <stdio.h>
  516.  
  517. #include <sys/stat.h>
  518.  
  519. #if apxs
  520.     #include <apache2/httpd.h>
  521.     #include <apache2/http_core.h>
  522.     #include <apache2/http_protocol.h>
  523.     #include <apache2/http_request.h>
  524.  
  525.     #include <apr-1/apr_strings.h>
  526.     #include <apr-1/apr_network_io.h>
  527.     #include <apr-1/apr_md5.h>
  528.     #include <apr-1/apr_sha1.h>
  529.     #include <apr-1/apr_hash.h>
  530.     #include <apr-1/apr_base64.h>
  531.     #include <apr-1/apr_dbd.h>
  532.     #include <apr-1/apr_file_info.h>
  533.     #include <apr-1/apr_file_io.h>
  534.     #include <apr-1/apr_network_io.h>
  535.     #include <apr-1/apr_tables.h>
  536.     #include <apache2/util_script.h>
  537. #endif
  538.  
  539. #ifndef PI
  540.     #define PI 3.1415926535897932384626433832795f   // optionally use an "#undef PI" statement at the end of this file
  541. #endif
  542.  
  543. #pragma mark - Enumerators
  544.  
  545. typedef enum
  546. {
  547.     DATATYPE_UNKNOWN,                          // undefined
  548.     HEK_FILE_ACTR,                   // Halo Editing Kit format tag files, complete with header
  549.     HEK_FILE_ACTV,
  550.     HEK_FILE_ANT,
  551.     HEK_FILE_ANTR,
  552.     HEK_FILE_BIPD,
  553.     HEK_FILE_BITM,
  554.     HEK_FILE_BOOM,
  555.     HEK_FILE_CDMG,
  556.     HEK_FILE_COLL,
  557.     HEK_FILE_COLO,
  558.     HEK_FILE_CONT,
  559.     HEK_FILE_CTRL,
  560.     HEK_FILE_DECA,
  561.     HEK_FILE_DELA,
  562.     HEK_FILE_DEVC,
  563.     HEK_FILE_DEVI,
  564.     HEK_FILE_DOBC,
  565.     HEK_FILE_EFFE,
  566.     HEK_FILE_ELEC,
  567.     HEK_FILE_EQIP,
  568.     HEK_FILE_FLAG,
  569.     HEK_FILE_FOG,
  570.     HEK_FILE_FONT,
  571.     HEK_FILE_FOOT,
  572.     HEK_FILE_GARB,
  573.     HEK_FILE_GLW,
  574.     HEK_FILE_GRHI,
  575.     HEK_FILE_HMT,
  576.     HEK_FILE_HUDG,
  577.     HEK_FILE_HUDN,
  578.     HEK_FILE_ITEM,
  579.     HEK_FILE_ITMC,
  580.     HEK_FILE_JPT,
  581.     HEK_FILE_LENS,
  582.     HEK_FILE_LIFI,
  583.     HEK_FILE_LIGH,
  584.     HEK_FILE_LSND,
  585.     HEK_FILE_MACH,
  586.     HEK_FILE_MATG,
  587.     HEK_FILE_METR,
  588.     HEK_FILE_MGS2,
  589.     HEK_FILE_MOD2,
  590.     HEK_FILE_MODE,
  591.     HEK_FILE_MPLY,
  592.     HEK_FILE_NGPR,
  593.     HEK_FILE_OBJE,
  594.     HEK_FILE_PART,
  595.     HEK_FILE_PCTL,
  596.     HEK_FILE_PHYS,
  597.     HEK_FILE_PLAC,
  598.     HEK_FILE_PPHY,
  599.     HEK_FILE_PROJ,
  600.     HEK_FILE_RAIN,
  601.     HEK_FILE_SBSP,
  602.     HEK_FILE_SCEN,
  603.     HEK_FILE_SCEX,
  604.     HEK_FILE_SCHI,
  605.     HEK_FILE_SCNR,
  606.     HEK_FILE_SENV,
  607.     HEK_FILE_SGLA,
  608.     HEK_FILE_SHDR,
  609.     HEK_FILE_SKY,
  610.     HEK_FILE_SMET,
  611.     HEK_FILE_SND,
  612.     HEK_FILE_SNDE,
  613.     HEK_FILE_SOSO,
  614.     HEK_FILE_SOTR,
  615.     HEK_FILE_SOUL,
  616.     HEK_FILE_SPLA,
  617.     HEK_FILE_SSCE,
  618.     HEK_FILE_STRN,
  619.     HEK_FILE_SWAT,
  620.     HEK_FILE_TAGC,
  621.     HEK_FILE_TRAK,
  622.     HEK_FILE_UDLG,
  623.     HEK_FILE_UNHI,
  624.     HEK_FILE_UNIT,
  625.     HEK_FILE_USTR,
  626.     HEK_FILE_VCKY,
  627.     HEK_FILE_VEHI,
  628.     HEK_FILE_WEAP,
  629.     HEK_FILE_WIND,
  630.     HEK_FILE_WPHI,
  631.     MAP_TAG_ACTR,                       // tag file data as it is when stored within a compiled map cache file
  632.     MAP_TAG_ACTV,
  633.     MAP_TAG_ANT,
  634.     MAP_TAG_ANTR,
  635.     MAP_TAG_BIPD,
  636.     MAP_TAG_BITM,
  637.     MAP_TAG_BOOM,
  638.     MAP_TAG_CDMG,
  639.     MAP_TAG_COLL,
  640.     MAP_TAG_COLO,
  641.     MAP_TAG_CONT,
  642.     MAP_TAG_CTRL,
  643.     MAP_TAG_DECA,
  644.     MAP_TAG_DELA,
  645.     MAP_TAG_DEVC,
  646.     MAP_TAG_DEVI,
  647.     MAP_TAG_DOBC,
  648.     MAP_TAG_EFFE,
  649.     MAP_TAG_ELEC,
  650.     MAP_TAG_EQIP,
  651.     MAP_TAG_FLAG,
  652.     MAP_TAG_FOG,
  653.     MAP_TAG_FONT,
  654.     MAP_TAG_FOOT,
  655.     MAP_TAG_GARB,
  656.     MAP_TAG_GLW,
  657.     MAP_TAG_GRHI,
  658.     MAP_TAG_HMT,
  659.     MAP_TAG_HUDG,
  660.     MAP_TAG_HUDN,
  661.     MAP_TAG_ITEM,
  662.     MAP_TAG_ITMC,
  663.     MAP_TAG_JPT,
  664.     MAP_TAG_LENS,
  665.     MAP_TAG_LIFI,
  666.     MAP_TAG_LIGH,
  667.     MAP_TAG_LSND,
  668.     MAP_TAG_MACH,
  669.     MAP_TAG_MATG,
  670.     MAP_TAG_METR,
  671.     MAP_TAG_MGS2,
  672.     MAP_TAG_MOD2,
  673.     MAP_TAG_MODE,
  674.     MAP_TAG_MPLY,
  675.     MAP_TAG_NGPR,
  676.     MAP_TAG_OBJE,
  677.     MAP_TAG_PART,
  678.     MAP_TAG_PCTL,
  679.     MAP_TAG_PHYS,
  680.     MAP_TAG_PLAC,
  681.     MAP_TAG_PPHY,
  682.     MAP_TAG_PROJ,
  683.     MAP_TAG_RAIN,
  684.     MAP_TAG_SBSP,
  685.     MAP_TAG_SCEN,
  686.     MAP_TAG_SCEX,
  687.     MAP_TAG_SCHI,
  688.     MAP_TAG_SCNR,
  689.     MAP_TAG_SENV,
  690.     MAP_TAG_SGLA,
  691.     MAP_TAG_SHDR,
  692.     MAP_TAG_SKY,
  693.     MAP_TAG_SMET,
  694.     MAP_TAG_SND,
  695.     MAP_TAG_SNDE,
  696.     MAP_TAG_SOSO,
  697.     MAP_TAG_SOTR,
  698.     MAP_TAG_SOUL,
  699.     MAP_TAG_SPLA,
  700.     MAP_TAG_SSCE,
  701.     MAP_TAG_STRN,
  702.     MAP_TAG_SWAT,
  703.     MAP_TAG_TAGC,
  704.     MAP_TAG_TRAK,
  705.     MAP_TAG_UDLG,
  706.     MAP_TAG_UNHI,
  707.     MAP_TAG_UNIT,
  708.     MAP_TAG_USTR,
  709.     MAP_TAG_VCKY,
  710.     MAP_TAG_VEHI,
  711.     MAP_TAG_WEAP,
  712.     MAP_TAG_WIND,
  713.     MAP_TAG_WPHI,
  714.     MAP_CACHE_FILE_PC,                // Halo PC map file (also Halo Full / Halo Mini Demo / Halo UB)
  715.     MAP_CACHE_FILE_DEMOTRIAL,        // Halo Demo or Halo Trial map file
  716.     MAP_CACHE_FILE_CE,                // Halo Custom Edition map file
  717.     SAVEGAME_PC,                           // Halo PC savegame (.sav)
  718.     SAVEGAME_CE,                           // Halo Custom Edition savegame (.sav)
  719.     GAMETYPE_PLAYLIST_PC,              // Halo PC blam.lst gametype file
  720.     GAMETYPE_PLAYLIST_CE,              // Halo Custom Edition blam.lst gametype file
  721.     MAP_RESOURCE_FILE_BITMAPS_PC,     // bitmaps.map for Halo PC
  722.     MAP_RESOURCE_FILE_SOUNDS_PC,      // sounds.map for Halo PC
  723.     MAP_RESOURCE_FILE_BITMAPS_CE,     // bitmaps.map for Halo Custom Edition
  724.     MAP_RESOURCE_FILE_SOUNDS_CE,      // sounds.map for Halo Custom Edition
  725.     MAP_RESOURCE_FILE_LOC_CE,           // loc.map for Halo Custom Edition
  726.     MEMORY_PC,
  727.     MEMORY_PC_TABLE_SERVER,
  728.     MEMORY_PC_TABLE_CELL_SERVER,
  729.     MEMORY_PC_TABLE_NETWORK_CONNECTIONS,
  730.     MEMORY_PC_TABLE_CELL_NETWORK_CONNECTIONS,
  731.     MEMORY_PC_ISOCELL_NETWORK_CONNECTION_DETAILS,
  732.     MEMORY_PC_TABLE_PLAYERS,            // memory table data
  733.     MEMORY_PC_TABLE_CELL_PLAYERS,
  734.     MEMORY_CE,
  735. } option_datatype;
  736.  
  737. typedef enum
  738. {
  739.     ENDIANNESS_UNKNOWN,
  740.     ENDIANNESS_LITTLE,
  741.     ENDIANNESS_BIG
  742. } option_endianness;
  743.  
  744. typedef enum
  745. {
  746.     // the type of program and platform
  747.     MAC_UNKNOWN,
  748.     MAC_GENERIC,
  749.     MAC_HALO_DEMO_PPC,
  750.     MAC_HALO_MINI_DEMO_PPC,
  751.     MAC_HALO_MINI_DEMO_INTEL,
  752.     MAC_HALO_PPC,
  753.     MAC_HALO_UB_PPC,
  754.     MAC_HALO_UB_INTEL,
  755.     MAC_WINE,
  756.     PC_UNKNOWN,
  757.     PC_GENERIC,
  758.     PC_HALO_TRIAL,
  759.     PC_HALO_109,
  760.     PC_HALO_110,
  761.     PC_HALO_DEDICATED_109,
  762.     PC_HALO_DEDICATED_110,
  763.     PC_HALO_CE_109,
  764.     PC_HALO_CE_110,
  765.     PC_HALO_CE_DEDICATED_109,
  766.     PC_HALO_CE_DEDICATED_110,
  767.     PC_HALO_2,  // not going beyond this for now
  768.     XBOX_HALO
  769. } option_platform;
  770.  
  771. enum tag_class_types
  772. {
  773.     actr = 1,
  774.     actv,
  775.     ant,
  776.     antr,
  777.     bipd,
  778.     bitm,
  779.     boom,
  780.     cdmg,
  781.     coll,
  782.     colo,
  783.     cont,
  784.     ctrl,
  785.     deca,
  786.     DeLa,
  787.     devc,
  788.     devi,
  789.     dobc,
  790.     effe,
  791.     elec,
  792.     eqip,
  793.     flag,
  794.     fog,
  795.     font,
  796.     foot,
  797.     garb,
  798.     glw,
  799.     grhi,
  800.     hmt,
  801.     hudg,
  802.     hudn,
  803.     item,
  804.     itmc,
  805.     jpt,
  806.     lens,
  807.     lifi,
  808.     ligh,
  809.     lsnd,
  810.     mach,
  811.     matg,
  812.     metr,
  813.     mgs2,
  814.     mod2,
  815.     mode,
  816.     mply,
  817.     ngpr,
  818.     obje,
  819.     part,
  820.     pctl,
  821.     phys,
  822.     plac,
  823.     pphy,
  824.     proj,
  825.     rain,
  826.     sbsp,
  827.     scen,
  828.     scex,
  829.     schi,
  830.     scnr,
  831.     senv,
  832.     sgla,
  833.     shdr,
  834.     sky,
  835.     smet,
  836.     snd,
  837.     snde,
  838.     soso,
  839.     sotr,
  840.     Soul,
  841.     spla,
  842.     ssce,
  843.     strn,
  844.     swat,
  845.     tagc,
  846.     trak,
  847.     udlg,
  848.     unhi,
  849.     unit,
  850.     ustr,
  851.     vcky,
  852.     vehi,
  853.     weap,
  854.     wind,
  855.     wphi
  856. };
  857.  
  858. char * tag_class_names[] =
  859. {
  860.     "UNDEFINED",
  861.     "actr / .actor / Actor",
  862.     "actv / .actor_variant / Actor Variant",
  863.     "ant! / .antenna / Antenna",
  864.     "antr / .model_animations / Animations",
  865.     "bipd / .biped / Biped",
  866.     "bitm / .bitmap / Bitmap",
  867.     "boom / .spheroid / Spheroid",
  868.     "cdmg / .continuous_damage_effect / Continuous Damage Effect",
  869.     "coll / .model_collision_geometry / Collision Model",
  870.     "colo / .color_table / Color Table",
  871.     "cont / .contrail / Contrail",
  872.     "ctrl / .device_control / Control Panel",
  873.     "deca / .decal / Decal",
  874.     "DeLa / .ui_widget_definition / UI Widget Definition",
  875.     "devc / .input_device_defaults / Input Device Defaults",
  876.     "devi / .device / Device",
  877.     "dobc / .detail_object_collection / Detail Object Collection",
  878.     "effe / .effect / Effect",
  879.     "elec / .lightning / Lightning",
  880.     "eqip / .equipment / Equipment",
  881.     "flag / .flag / Flag Cloth",
  882.     "fog  / .fog / Fog",
  883.     "font / .font / Font",
  884.     "foot / .material_effects / Material Collision Effects",
  885.     "garb / .garbage / Garbage",
  886.     "glw! / .glow /Particle Glow Effect",
  887.     "grhi / .grenade_hud_interface / Grenade HUD Interface",
  888.     "hmt  / .hud_message_text / HUD Messages",
  889.     "hudg / .hud_globals / General HUD Settings",
  890.     "hud# / .hud_number / HUD Numbers Settings",
  891.     "item / .item / Item",
  892.     "itmc / .item_collection / Respawning Objects Collection",
  893.     "jpt! / .damage_effect / Damage Effect",
  894.     "lens / .lens_flare / Lens Flare",
  895.     "lifi / .device_light_fixture / Light Fixture",
  896.     "ligh / .light / Light",
  897.     "lsnd / .sound_looping / Looping Sound",
  898.     "mach / .device_machine / Machine",
  899.     "matg / .globals / General Game Settings",
  900.     "metr / .meter / Meter",
  901.     "mgs2 / .light_volume / Volumetric Light",
  902.     "mod2 / .gbxmodel / Gearbox PC Model",
  903.     "mode / .model / Xbox Model",
  904.     "mply / .multiplayer_scenario_description / Multiplayer Descriptions",
  905.     "ngpr / .preferences_network_game / Multiplayer Character Settings",
  906.     "obje / .object / Object",
  907.     "part / .particle / Particle",
  908.     "pctl / .particle_system / Particle System",
  909.     "phys / .physics / Object Physics",
  910.     "plac / .placeholder / Object Placeholder",
  911.     "pphy / .point_physics / Particle Point Physics",
  912.     "proj / .projectile / Projectile",
  913.     "rain / .weather_particle_system / Weather",
  914.     "sbsp / .scenario_structure_bsp / Scenario Environment Structure",
  915.     "scen / .scenery / Scenery",
  916.     "scex / .shader_transparent_chicago_extended / Extended Transparent Shader",
  917.     "schi / .shader_transparent_chicago / Transparent Shader",
  918.     "scnr / .scenario / Scenario Environment Configuration",
  919.     "senv / .shader_environment / Environment Shader",
  920.     "sgla / .shader_transparent_glass / Transparent Glass Shader",
  921.     "shdr / .shader / Generic Shader",
  922.     "sky  / .sky / Sky",
  923.     "smet / .shader_transparent_meter / Transparent Meter Shader",
  924.     "snd! / .sound / Sound",
  925.     "snde / .sound_environment / Ambient Effect",
  926.     "soso / .shader_model / Model Shader",
  927.     "sotr / .shader_transparent_generic / Generic Transparent Shader",
  928.     "Soul / .ui_widget_collection / UI Widget Collection",
  929.     "spla / .shader_transparent_plasma / Transparent Plasma Shader",
  930.     "ssce / .sound_scenery / Sound-Emitting Scenery",
  931.     "str# / .string_list / String References",
  932.     "swat / .shader_transparent_water / Transparent Water Shader",
  933.     "tagc / .tag_collection / Tag Collection",
  934.     "trak / .camera_track / Camera Track",
  935.     "udlg / .dialogue / Unit Dialogue",
  936.     "unhi / .unit_hud_interface / Unit HUD Interface",
  937.     "unit / .unit / Unit",
  938.     "ustr / .unicode_string_list / Unicode String References",
  939.     "vcky / .virtual_keyboard / Virtual Keyboard",
  940.     "vehi / .vehicle / Vehicle",
  941.     "weap / .weapon / Weapon",
  942.     "wind / .wind / Wind",
  943.     "wphi / .weapon_hud_interface / Weapon HUD Interface"
  944. };
  945.  
  946. #pragma mark - HEK tag file format structs
  947. //   I. HEK tag file format structs
  948.  
  949. #pragma mark -- header
  950. typedef struct
  951. {
  952.     uint8_t     pad_0[36];          // 0, 36    zeros overwritten; data not ignored
  953.     char        tagtype[4];         // 36, 4    "actr", "actv", etc.(1); causes "invalid header" error
  954.     uint32_t    crc32;              // 40, 4    checksum of tag data following header, big endian, recalculated when saved
  955.     uint32_t    header_size;        // 44, 4    64 overwritten (purpose of this data is guessed)
  956.     uint8_t     pad_48[8];          // 48, 8    zeros overwritten; data not ignored
  957.     uint16_t    tag_version;        // 56, 2    varies(2); causes errors if incorrect including "_ tag was an old version"
  958.     uint16_t    engine_version;     // 58, 2    255; overwritten (purpose of this data is guessed)
  959.     char        engine[4];          // 60, 4    "blam"; causes "invalid header" error
  960. } type_header;
  961.  
  962. #pragma mark -- actr
  963.  
  964. typedef struct
  965. {
  966.     uint32_t flags_bf;  // toff 64  32-bit 0xFFFFFFFF
  967.     uint32_t more_flags_bf; // toff 68 32-bit 0x0000007F
  968.     uint8_t pad_72[12]; // 72, 12
  969.     uint16_t actor_type_list;
  970.     uint8_t pad_86[2];  // 86, 2
  971.     float perception_maximum_vision_distance;
  972.     float perception_central_vision_angle_rad;
  973.     float perception_maximum_vision_angle_rad;
  974.     uint8_t pad_100[4]; // 100, 4
  975.     float perception_peripheral_vision_angle_rad;
  976.     float perception_peripheral_distance;
  977.     uint8_t pad_112[4]; // 112, 4
  978.     float perception_standing_gun_offset_i;
  979.     float perception_standing_gun_offset_j;
  980.     float perception_standing_gun_offset_k;
  981.     float perception_crouching_gun_offset_i;
  982.     float perception_crouching_gun_offset_j;
  983.     float perception_crouching_gun_offset_k;
  984.     float perception_hearing_distance;
  985.     float perception_notice_projectile_chance;
  986.     float perception_notice_vehicle_chance;
  987.     uint8_t pad_152[8]; // 152, 8
  988.     float perception_combat_perception_time;
  989.     float perception_guard_perception_time;
  990.     float perception_non_combat_perception_time;
  991.     // 172 -- 3 calculated float values, 0 until compiled, compiled defaults:
  992.     float unknown_1;   // 0.0555556
  993.     float unknown_2;   // 0.0238095
  994.     float unknown_3;   // 0.0166667 or 0
  995.     uint8_t pad_184[8];// 184, 8
  996.     float movement_dive_into_cover_chance;
  997.     float movement_emerge_from_cover_chance;
  998.     float movement_dive_from_grenade_chance;
  999.     float movement_path_finding_radius;
  1000.     float movement_glass_ignorance_chance;
  1001.     float movement_stationary_movement_distance;
  1002.     float movement_free_flying_sidestep;
  1003.     float movement_begin_moving_angle_rad;
  1004.     uint8_t pad_224[4]; // 224, 4
  1005.     float looking_maximum_aiming_deviation_yaw_rad;
  1006.     float looking_maximum_aiming_deviation_pitch_rad;
  1007.     float looking_maximum_looking_deviation_yaw_rad;
  1008.     float looking_maximum_looking_deviation_pitch_rad;
  1009.     float looking_non_combat_look_delta_left_rad;
  1010.     float looking_non_combat_look_delta_right_rad;
  1011.     float looking_combat_look_delta_left_rad;
  1012.     float looking_combat_look_delta_right_rad;
  1013.     float looking_idle_aiming_range_yaw_rad;
  1014.     float looking_idle_aiming_range_pitch_rad;
  1015.     float looking_idle_looking_range_yaw_rad;
  1016.     float looking_idle_looking_range_pitch_rad;
  1017.     float looking_event_look_time_modifier_from;
  1018.     float looking_event_look_time_modifier_to;
  1019.     float looking_non_combat_idle_facing_from;
  1020.     float looking_non_combat_idle_facing_to;
  1021.     float looking_non_combat_idle_aiming_from;
  1022.     float looking_non_combat_idle_aiming_to;
  1023.     float looking_non_combat_idle_looking_from;
  1024.     float looking_non_combat_idle_looking_to;
  1025.     float looking_guard_idle_facing_from;
  1026.     float looking_guard_idle_facing_to;
  1027.     float looking_guard_idle_aiming_from;
  1028.     float looking_guard_idle_aiming_to;
  1029.     float looking_guard_idle_looking_from;
  1030.     float looking_guard_idle_looking_to;
  1031.     float looking_combat_idle_facing_from;
  1032.     float looking_combat_idle_facing_to;
  1033.     float looking_combat_idle_aiming_from;
  1034.     float looking_combat_idle_aiming_to;
  1035.     float looking_combat_idle_looking_from;
  1036.     float looking_combat_idle_looking_to;
  1037.     uint8_t pad_356[8]; // 356, 8
  1038.     // calculated values, 0 until compiled: 3 unknown values of the same data (0xb33bbd2e) followed by 1 float value of 0.5
  1039.     uint32_t unknown_4;
  1040.     uint32_t unknown_5;
  1041.     uint32_t unknown_6;
  1042.     float unknown_7;
  1043.    
  1044.     // dependency 1: looking -- DO NOT USE -- weap
  1045.     char d1_tagclass[4];
  1046.     uint32_t d1_tagnamepointer;
  1047.     uint32_t d1_tagnamestringlength;
  1048.     uint32_t d1_tagid;
  1049.    
  1050.     uint8_t pad_396[268];   // 396, 268
  1051.    
  1052.     // dependency 2: looking -- DO NOT USE -- proj
  1053.     char d2_tagclass[4];
  1054.     uint32_t d2_tagnamepointer;
  1055.     uint32_t d2_tagnamestringlength;
  1056.     uint32_t d2_tagid;
  1057.    
  1058.     uint16_t unopposable_unreachable_danger_trigger_list;
  1059.     uint16_t unopposable_vehicle_danger_trigger_list;
  1060.     uint16_t unopposable_player_danger_trigger_list;
  1061.     uint8_t pad_686[2]; // 686, 2
  1062.     float unopposable_danger_trigger_time_from;
  1063.     float unopposable_danger_trigger_time_to;
  1064.     uint16_t unopposable_friends_killed_trigger;
  1065.     uint16_t unopposable_friends_retreating_trigger;
  1066.     uint8_t pad_700[12];    // 700, 12
  1067.     float unopposable_retreat_time_from;
  1068.     float unopposable_retreat_time_to;
  1069.     uint8_t pad_720[8]; // 720, 8
  1070.     float panic_cowering_time_from;
  1071.     float panic_cowering_time_to;
  1072.     float panic_friend_killed_panic_chance;
  1073.     uint16_t panic_leader_type_list;
  1074.     uint8_t pad_742[2]; // 742, 2
  1075.     float panic_leader_killed_panic_chance;
  1076.     float panic_panic_damage_threshold;
  1077.     float panic_surprise_distance;
  1078.     uint8_t pad_756[28];    // 756, 28
  1079.     float defensive_hide_behind_cover_time_from;
  1080.     float defensive_hide_behind_cover_time_to;
  1081.     float defensive_hide_target_not_visible_time;
  1082.     float defensive_hide_shield_fraction;
  1083.     float defensive_attack_shield_fraction;
  1084.     float defensive_pursue_shield_fraction;
  1085.     uint8_t pad_808[16];    // 808, 16
  1086.     uint16_t defensive_defensive_crouch_type_list;
  1087.     uint8_t pad_826[2]; // 826, 2
  1088.     float defensive_attacking_crouch_threshold;
  1089.     float defensive_defending_crouch_threshold;
  1090.     float defensive_minimum_stand_time;
  1091.     float defensive_minimum_crouch_time;
  1092.     float defensive_defending_hide_time_modifier;
  1093.     float defensive_attacking_evasion_threshold;
  1094.     float defensive_defending_evasion_threshold;
  1095.     float defensive_evasion_seek_cover_chance;
  1096.     float defensive_evasion_delay_time;
  1097.     float defensive_maximum_seek_cover_distance;
  1098.     float defensive_cover_damage_threshold;
  1099.     float defensive_stalking_discovery_time;
  1100.     float defensive_stalking_maximum_distance;
  1101.     float defensive_stationary_facing_angle_rad;
  1102.     float defensive_change_facing_stand_time;
  1103.     uint8_t pad_888[4]; // 888, 4
  1104.     float pursuit_uncover_delay_time_from;
  1105.     float pursuit_uncover_delay_time_to;
  1106.     float pursuit_target_search_time_from;
  1107.     float pursuit_target_search_time_to;
  1108.     float pursuit_pursuit_position_time_from;
  1109.     float pursuit_pursuit_position_time_to;
  1110.     uint16_t pursuit_num_positions_coord;
  1111.     uint16_t pursuit_num_positions_normal;
  1112.     uint8_t pad_920[32];    // 920, 32
  1113.     float berserk_melee_attack_delay;
  1114.     float berserk_melee_fudge_factor;
  1115.     float berserk_melee_charge_time;
  1116.     float berserk_melee_leap_range_from;
  1117.     float berserk_melee_leap_range_to;
  1118.     float berserk_melee_leap_velocity;
  1119.     float berserk_melee_leap_chance;
  1120.     float berserk_melee_leap_ballistic;
  1121.     float berserk_berserk_damage_amount;
  1122.     float berserk_berserk_damage_threshold;
  1123.     float berserk_berserk_proximity;
  1124.     float berserk_suicide_sensing_distance;
  1125.     float berserk_berserk_grenade_chance;
  1126.     uint8_t pad_1004[12];   // 1004, 12
  1127.     float firing_positions_guard_position_time_from;
  1128.     float firing_positions_guard_position_time_to;
  1129.     float firing_positions_combat_position_time_from;
  1130.     float firing_positions_combat_position_time_to;
  1131.     float firing_positions_old_position_avoid_distance;
  1132.     float firing_positions_friend_avoid_distance;
  1133.     uint8_t pad_1040[40];   // 1040, 40
  1134.     float communication_non_combat_idle_speech_time_from;
  1135.     float communication_non_combat_idle_speech_time_to;
  1136.     float communication_combat_idle_speech_time_from;
  1137.     float communication_combat_idle_speech_time_to;
  1138.     uint8_t pad_1096[176];  // 1096, 176
  1139.    
  1140.     // dependency 3: communication -- DO NOT USE -- actr
  1141.     char d3_tagclass[4];
  1142.     uint32_t d3_tagnamepointer;
  1143.     uint32_t d3_tagnamestringlength;
  1144.     uint32_t d3_tagid;
  1145.    
  1146.     uint8_t pad_1288[48];   // 1288, 48
  1147.    
  1148.     // 1336, tpns 1-3
  1149.     char** tpns;
  1150.    
  1151. } type_meta_actr;
  1152.  
  1153. #pragma mark -- actv
  1154.  
  1155. typedef struct {
  1156.     uint32_t flags_bf;  // toff 64  32-bit 0x000000FF
  1157.    
  1158.     // dependency 1: -- actor definition -- actr
  1159.     char d1_tagclass[5];
  1160.     uint32_t d1_tagnamepointer;
  1161.     uint32_t d1_tagnamestringlength;
  1162.     uint32_t d1_tagid;
  1163.    
  1164.     // dependency 2: -- unit -- bipd unit vehi
  1165.     char d2_tagclass[5];
  1166.     uint32_t d2_tagnamepointer;
  1167.     uint32_t d2_tagnamestringlength;
  1168.     uint32_t d2_tagid;
  1169.    
  1170.     // dependency 3: -- major variant -- actv
  1171.     char d3_tagclass[5];
  1172.     uint32_t d3_tagnamepointer;
  1173.     uint32_t d3_tagnamestringlength;
  1174.     uint32_t d3_tagid;
  1175.    
  1176.     // 116, 24
  1177.    
  1178.     uint16_t movement_switching_movement_type_list;   // offset 140
  1179.     // 142, 2
  1180.     float movement_switching_initial_crouch_chance_frac;   // offset 144
  1181.     float movement_switching_crouch_time_from;
  1182.     float movement_switching_crouch_time_to;
  1183.     float movement_switching_run_time_from;
  1184.     float movement_switching_run_time_to;
  1185.    
  1186.     // dependency 4: ranged combat -- weapon -- weap
  1187.     char d4_tagclass[5];
  1188.     uint32_t d4_tagnamepointer;
  1189.     uint32_t d4_tagnamestringlength;
  1190.     uint32_t d4_tagid;
  1191.    
  1192.     float ranged_combat_maximum_firing_distance;
  1193.     float ranged_combat_rate_of_fire;
  1194.     float ranged_combat_projectile_error;
  1195.     float ranged_combat_fire_burst_delay_time_from;
  1196.     float ranged_combat_fire_burst_delay_time_to;
  1197.     float ranged_combat_new_target_firing_pattern_time;
  1198.     float ranged_combat_surprise_delay_time;
  1199.     float ranged_combat_surprise_fire_wildly_time;
  1200.     float ranged_combat_death_fire_wildly_chance_frac;
  1201.     float ranged_combat_death_fire_wildly_time;
  1202.     float ranged_combat_desired_combat_range_from;
  1203.     float ranged_combat_desired_combat_range_to;
  1204.     float ranged_combat_custom_stand_gun_offset_i;
  1205.     float ranged_combat_custom_stand_gun_offset_j;
  1206.     float ranged_combat_custom_stand_gun_offset_k;
  1207.     float ranged_combat_custom_crouch_gun_offset_i;
  1208.     float ranged_combat_custom_crouch_gun_offset_j;
  1209.     float ranged_combat_custom_crouch_gun_offset_k;
  1210.     float ranged_combat_target_tracking_frac;
  1211.     float ranged_combat_target_leading_frac;
  1212.     float ranged_combat_weapon_damage_modifier;
  1213.     float ranged_combat_damage_per_second;
  1214.    
  1215.     float burst_geometry_burst_origin_radius;
  1216.     float burst_geometry_burst_origin_angle_rad;
  1217.     float burst_geometry_burst_return_length_from;
  1218.     float burst_geometry_burst_return_length_to;
  1219.     float burst_geometry_burst_return_angle_rad;
  1220.     float burst_geometry_burst_duration_from;
  1221.     float burst_geometry_burst_duration_to;
  1222.     float burst_geometry_burst_separation_from;
  1223.     float burst_geometry_burst_separation_to;
  1224.     float burst_geometry_burst_angular_velocity_rad;
  1225.     // 308, 4
  1226.     float burst_geometry_special_damage_modifier_frac;   // offset 312
  1227.     float burst_geometry_special_projectile_error_rad;
  1228.    
  1229.     float firing_patterns_new_target_burst_duration;
  1230.     float firing_patterns_new_target_burst_separation;
  1231.     float firing_patterns_new_target_rate_of_fire;
  1232.     float firing_patterns_new_target_projectile_error;
  1233.     // 336, 8
  1234.     float firing_patterns_moving_burst_duration;   // offset 344
  1235.     float firing_patterns_moving_burst_separation;
  1236.     float firing_patterns_moving_rate_of_fire;
  1237.     float firing_patterns_moving_projectile_error;
  1238.     // 360, 8
  1239.     float firing_patterns_berserk_burst_duration;   // offset 368
  1240.     float firing_patterns_berserk_burst_separation;
  1241.     float firing_patterns_berserk_rate_of_fire;
  1242.     float firing_patterns_berserk_projectile_error;
  1243.    
  1244.     // 384, 8
  1245.     float special_case_firing_properties_super_ballistic_range;   // offset 392
  1246.     float special_case_firing_properties_bombardment_range;
  1247.     float special_case_firing_properties_modified_vision_range;
  1248.     uint16_t special_case_firing_properties_special_fire_mode_list;
  1249.     uint16_t special_case_firing_properties_special_fire_situation_list;
  1250.     float special_case_firing_properties_special_fire_chance_frac;
  1251.     float special_case_firing_properties_special_fire_delay;
  1252.    
  1253.     float berserking_and_melee_melee_range;
  1254.     float berserking_and_melee_melee_abort_range;
  1255.     float berserking_and_melee_berserk_firing_ranges_from;
  1256.     float berserking_and_melee_berserk_firing_ranges_to;
  1257.     float berserking_and_melee_berserk_melee_range;
  1258.     float berserking_and_melee_berserk_melee_abort_range;
  1259.    
  1260.     // 440, 8
  1261.     uint16_t grenades_grenade_type_list;   // offset 448
  1262.     uint16_t grenades_trajectory_type_list;
  1263.     uint16_t grenades_grenade_stimulus_list;
  1264.     uint16_t grenades_minimum_enemy_count;
  1265.     float grenades_enemy_radius;
  1266.     // 460, 4
  1267.     float grenades_grenade_velocity;   // offset 464
  1268.     float grenades_grenade_ranges_from;
  1269.     float grenades_grenade_ranges_to;
  1270.     float grenades_collateral_damage_radius;
  1271.     float grenades_grenade_chance_frac;
  1272.     float grenades_grenade_check_time;
  1273.     float grenades_encounter_grenade_timeout;
  1274.    
  1275.     // 492, 20
  1276.    
  1277.     // dependency 5: items -- equipment -- eqip, offset 512
  1278.     char d5_tagclass[5];
  1279.     uint32_t d5_tagnamepointer;
  1280.     uint32_t d5_tagnamestringlength;
  1281.     uint32_t d5_tagid;
  1282.    
  1283.     uint16_t items_grenade_count_from;   // offset 528
  1284.     uint16_t items_grenade_count_to;
  1285.     float items_dont_drop_grenades_chance_frac;
  1286.     float items_drop_weapon_loaded_from_frac;
  1287.     float items_drop_weapon_loaded_to_frac;
  1288.     uint16_t items_drop_weapon_ammo_from;
  1289.     uint16_t items_drop_weapon_ammo_to;
  1290.    
  1291.     // 548, 28
  1292.     float unit_body_vitality;   // offset 576
  1293.     float unit_shield_vitality;
  1294.     float unit_shield_sapping_radius;
  1295.     uint16_t unit_forced_shader_permutation;
  1296.    
  1297.     // 590, 30
  1298.    
  1299.     // representation 1 board, offset 620
  1300.     // r1b_change_colors_
  1301.     uint32_t r1b_change_colors_entrycount;   // maximum of 4 cells
  1302.     uint32_t r1b_change_colors_random_id1;
  1303.     uint32_t r1b_change_colors_sig_id;   // value = 0x4C949C00 (little endian)
  1304.    
  1305.     // 632, tpns 1-5
  1306.    
  1307.     struct actv_r1c {
  1308.         // representation 1 cells
  1309.         // r1c_change_colors_
  1310.         // 32
  1311.         float r1c_change_colors_color_lower_bound_r;
  1312.         float r1c_change_colors_color_lower_bound_g;
  1313.         float r1c_change_colors_color_lower_bound_b;
  1314.         float r1c_change_colors_color_upper_bound_r;
  1315.         float r1c_change_colors_color_upper_bound_g;
  1316.         float r1c_change_colors_color_upper_bound_b;
  1317.         // 8
  1318.     } r1c_change_colors;
  1319.    
  1320. } type_meta_actv;
  1321.  
  1322. #pragma mark -- ant!
  1323.  
  1324. typedef struct {
  1325.     char attachment_marker_name[32];
  1326.    
  1327.     // dependency 1: -- bitmaps -- bitm, offset 96
  1328.     char d1_tagclass[5];
  1329.     uint32_t d1_tagnamepointer;
  1330.     uint32_t d1_tagnamestringlength;
  1331.     uint32_t d1_tagid;
  1332.    
  1333.     // dependency 2: -- physics -- pphy, offset 112
  1334.     char d2_tagclass[5];
  1335.     uint32_t d2_tagnamepointer;
  1336.     uint32_t d2_tagnamestringlength;
  1337.     uint32_t d2_tagid;
  1338.    
  1339.     // 128, 80
  1340.    
  1341.     float spring_strength_coefficient_frac;   // offset 208
  1342.     float falloff_pixels;
  1343.     float cutoff_pixels;
  1344.     float total_length_calc;   // undocumented; sum of all "length" values of r1b cells; Guerilla writes this in little endian, but the stock tags have this value in big endian, so present this value as internal but let the user swap its endianness
  1345.     // 224, 36
  1346.    
  1347.     // representation 1 board, offset 260
  1348.     // r1b_vertices_
  1349.     uint32_t r1b_vertices_entrycount;   // maximum of 20 cells
  1350.     uint32_t r1b_vertices_random_id1;
  1351.     uint32_t r1b_vertices_sig_id;   // value = 0xE4139D00
  1352.    
  1353.     // 272, tpns 1-2
  1354.    
  1355.     struct ant_r1c {
  1356.         // representation 1 cells
  1357.         // r1c_vertices_
  1358.         float r1c_vertices_spring_strength_coefficient_frac;
  1359.         // 24
  1360.         float r1c_vertices_angles_yaw_rad;
  1361.         float r1c_vertices_angles_pitch_rad;
  1362.         float r1c_vertices_length;
  1363.         uint16_t r1c_vertices_sequence_index;
  1364.         // 2
  1365.         float r1c_vertices_color_a_frac;
  1366.         float r1c_vertices_color_r_frac;
  1367.         float r1c_vertices_color_g_frac;
  1368.         float r1c_vertices_color_b_frac;
  1369.         float r1c_vertices_lod_color_a_frac;
  1370.         float r1c_vertices_lod_color_r_frac;
  1371.         float r1c_vertices_lod_color_g_frac;
  1372.         float r1c_vertices_lod_color_b_frac;
  1373.         // 40
  1374.        
  1375.         // three undocumented internal values (again, stock tag data is in big endian, but Guerilla writes in little endian)
  1376.         // these are calculated coordinate vectors probably representing the initial direction of the antenna
  1377.         float r1c_vertices_coordinate_vector_i_calc;
  1378.         float r1c_vertices_coordinate_vector_j_calc;
  1379.         float r1c_vertices_coordinate_vector_k_calc;
  1380.     } r1c_vertices;
  1381. } type_meta_ant;
  1382.  
  1383. #pragma mark -- antr
  1384.  
  1385. typedef struct {
  1386.     // representation 1 board, offset 64
  1387.     // r1b_objects_
  1388.     uint32_t r1b_objects_entrycount;   // maximum of 4 cells
  1389.     uint32_t r1b_objects_random_id1;
  1390.     uint32_t r1b_objects_sig_id;   // value = 0x806E9D00
  1391.    
  1392.     // representation 2 board, offset 76
  1393.     // r2b_units_
  1394.     uint32_t r2b_units_entrycount;   // maximum of 32 cells
  1395.     uint32_t r2b_units_random_id1;
  1396.     uint32_t r2b_units_sig_id;   // value = 0x1C729D00
  1397.    
  1398.     // representation 3 board, offset 88
  1399.     // r3b_weapons_
  1400.     uint32_t r3b_weapons_entrycount;   // maximum of 1 cell
  1401.     uint32_t r3b_weapons_random_id1;
  1402.     uint32_t r3b_weapons_sig_id;   // value = 0xB0729D00
  1403.    
  1404.     // representation 4 board, offset 100
  1405.     // r4b_vehicles_
  1406.     uint32_t r4b_vehicles_entrycount;   // maximum of 1 cell
  1407.     uint32_t r4b_vehicles_random_id1;
  1408.     uint32_t r4b_vehicles_sig_id;   // value = 0xC4749D00
  1409.    
  1410.     // representation 5 board, offset 112
  1411.     // r5b_devices_
  1412.     uint32_t r5b_devices_entrycount;   // maximum of 1 cell
  1413.     uint32_t r5b_devices_random_id1;
  1414.     uint32_t r5b_devices_sig_id;   // value = 0x58759D00
  1415.    
  1416.     // representation 6 board, offset 124
  1417.     // r6b_unit_damage_
  1418.     uint32_t r6b_unit_damage_entrycount;   // maximum of 176 cells
  1419.     uint32_t r6b_unit_damage_random_id1;
  1420.     uint32_t r6b_unit_damage_sig_id;   // value = 0xF86F9D00
  1421.    
  1422.     // representation 7 board, offset 136
  1423.     // r7b_first_person_weapons_
  1424.     uint32_t r7b_first_person_weapons_entrycount;   // maximum of 1 cell
  1425.     uint32_t r7b_first_person_weapons_random_id1;
  1426.     uint32_t r7b_first_person_weapons_sig_id;   // value = 0x44739D00
  1427.    
  1428.     // representation 8 board, offset 148
  1429.     // r8b_sound_references_
  1430.     uint32_t r8b_sound_references_entrycount;   // maximum of 257 cells
  1431.     uint32_t r8b_sound_references_random_id1;
  1432.     uint32_t r8b_sound_references_sig_id;   // value = 0xB06B9D00
  1433.    
  1434.     float limp_body_node_radius;   // offset 160
  1435.     // 164, 1
  1436.     uint8_t flags_bf;   // toff 164 8-bit 0x03
  1437.    
  1438.     // 166, 2
  1439.    
  1440.     // representation 9 board, offset 168
  1441.     // r9b_nodes_
  1442.     uint32_t r9b_nodes_entrycount;   // maximum of 64 cells
  1443.     uint32_t r9b_nodes_random_id1;
  1444.     uint32_t r9b_nodes_sig_id;   // value = 0x10769D00
  1445.    
  1446.     // representation 10 board, offset 180
  1447.     // r10b_animations_
  1448.     uint32_t r10b_animations_entrycount;   // maximum of 256 cells
  1449.     uint32_t r10b_animations_random_id1;
  1450.     uint32_t r10b_animations_sig_id;   // value = 0xD86D9D00
  1451.    
  1452.     struct antr_r1c {
  1453.         // representation 1 cells, offset 192
  1454.         // r1c_objects_
  1455.         uint16_t r1c_objects_animation_sel;
  1456.         uint16_t r1c_objects_function;
  1457.         uint16_t r1c_objects_function_controls;
  1458.         // 14
  1459.     } r1c_objects;
  1460.    
  1461.     struct antr_r2sc {
  1462.         // representation 2 sub-cells
  1463.         // r2c_units_
  1464.         char r2c_units_label[32];
  1465.         // r2c_units_looking_screen_bounds_
  1466.         float r2c_units_looking_screen_bounds_right_yaw_per_frame_rad;
  1467.         float r2c_units_looking_screen_bounds_left_yaw_per_frame_rad;
  1468.         uint16_t r2c_units_looking_screen_bounds_right_frame_count;
  1469.         uint16_t r2c_units_looking_screen_bounds_left_frame_count;
  1470.         float r2c_units_looking_screen_bounds_down_pitch_per_frame_rad;
  1471.         float r2c_units_looking_screen_bounds_up_pitch_per_frame_rad;
  1472.         uint16_t r2c_units_looking_screen_bounds_down_pitch_frame_count;
  1473.         uint16_t r2c_units_looking_screen_bounds_up_pitch_frame_count;
  1474.         // 8
  1475.        
  1476.         // representation 2 sub-board A
  1477.         // r2sbA_animations_
  1478.         uint32_t r2sbA_animations_entrycount;   // maximum of 30 cells
  1479.         uint32_t r2sbA_animations_random_id1;
  1480.         uint32_t r2sbA_animations_sig_id;   // value = 0x38719D00
  1481.        
  1482.         // representation 2 sub-board B
  1483.         // r2sbB_ik_points_
  1484.         uint32_t r2sbB_ik_points_entrycount;   // maximum of 4 cells
  1485.         uint32_t r2sbB_ik_points_random_id1;
  1486.         uint32_t r2sbB_ik_points_sig_id;   // value = 0xD06E9D00
  1487.        
  1488.         // representation 2 sub-board C
  1489.         // r2sbC_weapons_
  1490.         uint32_t r2sbC_weapons_entrycount;   // maximum of 16 cells
  1491.         uint32_t r2sbC_weapons_random_id1;
  1492.         uint32_t r2sbC_weapons_sig_id;   // value = 0xF4709D00
  1493.     } r2sc_units_1;
  1494.    
  1495.     struct antr_r2scA {
  1496.         // representation 2 sub-cells A
  1497.         // r2scA_animations_
  1498.         uint16_t r2scA_animations_animation_sel;
  1499.     } r2sc_units_animations;
  1500.    
  1501.     struct antr_r2scB {
  1502.         // representation 2 sub-cells B
  1503.         // r2scB_ik_points_
  1504.         char r2scB_ik_points_marker[32];
  1505.         char r2scB_ik_points_attach_to_marker[32];
  1506.     } r2sc_units_ik_points;
  1507.    
  1508.     struct antr_r2scC {
  1509.         // representation 2 sub-cells C
  1510.         // r2scC_weapons_
  1511.         char r2scC_weapons_name[32];
  1512.         char r2scC_weapons_grip_marker[32];
  1513.         char r2scC_weapons_hand_marker[32];
  1514.         float r2scC_weapons_aiming_screen_bounds_right_yaw_per_frame_rad;
  1515.         float r2scC_weapons_aiming_screen_bounds_left_yaw_per_frame_rad;
  1516.         uint16_t r2scC_weapons_aiming_screen_bounds_right_frame_count;
  1517.         uint16_t r2scC_weapons_aiming_screen_bounds_left_frame_count;
  1518.         float r2scC_weapons_aiming_screen_bounds_down_pitch_per_frame_rad;
  1519.         float r2scC_weapons_aiming_screen_bounds_up_pitch_per_frame_rad;
  1520.         uint16_t r2scC_weapons_aiming_screen_bounds_down_pitch_frame_count;
  1521.         uint16_t r2scC_weapons_aiming_screen_bounds_up_pitch_frame_count;
  1522.         // 32
  1523.        
  1524.         // representation 2 sub-cells C sub-board A
  1525.         // r2scCsbA_animations_
  1526.         uint32_t r2scCsbA_animations_entrycount;   // maximum of 55 cells
  1527.         uint32_t r2scCsbA_animations_random_id1;
  1528.         uint32_t r2scCsbA_animations_sig_id;   // value = 0xB46F9D00
  1529.        
  1530.         // representation 2 sub-cells C sub-board B
  1531.         // r2scCsbB_ik_points_
  1532.         uint32_t r2scCsbB_ik_points_entrycount;   // maximum of 4 cells
  1533.         uint32_t r2scCsbB_ik_points_random_id1;
  1534.         uint32_t r2scCsbB_ik_points_sig_id;   // value = 0xD06E9D00
  1535.        
  1536.         // representation 2 sub-cells C sub-board C
  1537.         // r2scCsbC_weapon_types_
  1538.         uint32_t r2scCsbC_weapon_types_entrycount;   // maximum of 16 cells
  1539.         uint32_t r2scCsbC_weapon_types_random_id1;
  1540.         uint32_t r2scCsbC_weapon_types_sig_id;   // value = 0x706F9D00
  1541.        
  1542.        
  1543.     } r2sc_units_weapons;
  1544.    
  1545.     struct antr_r2scCscA {
  1546.         // representation 2 sub-cells C sub-cells A
  1547.         // r2scCscA_animations_
  1548.         uint16_t r2scCscA_animations_animation_sel;
  1549.     } r2sc_units_weapons_animations;
  1550.    
  1551.     struct antr_r2scCscB {
  1552.         // representation 2 sub-cells C sub-cells B
  1553.         // r2scCscB_ik_points_
  1554.         char r2scCscB_ik_points_marker[32];
  1555.         char r2scCscB_ik_points_attach_to_marker[32];
  1556.     }r2sc_units_weapons_ik_points;
  1557.    
  1558.     struct antr_r2scCscC {
  1559.         // representation 2 sub-cells C sub-cells C
  1560.         // r2scCscC_weapon_types_
  1561.         char r2scCscC_weapon_types_label[32];
  1562.         // in cell here: 16 bytes of 0
  1563.        
  1564.         // representation 2 sub-cells C sub-cells C sub-board A
  1565.         // r2scCscCsbA_animations_
  1566.         uint32_t r2scCscCsbA_animations_entrycount;   // maximum of 10 cells
  1567.         uint32_t r2scCscCsbA_animations_random_id1;
  1568.         uint32_t r2scCscCsbA_animations_sig_id;   // value = 0x146F9D00
  1569.     }r2sc_units_weapons_weapon_types;
  1570.    
  1571.     struct antr_r2scCscCscA {
  1572.         // representation 2 sub-cells C sub-cells C sub-cells A
  1573.         // r2scCscCscA_animations_
  1574.         uint16_t r2scCscCscA_animations_animation_sel;
  1575.     }r2sc_units_weapons_weapon_types_animations;
  1576.    
  1577.     // end of representation 2 (units)
  1578.    
  1579.    
  1580.    
  1581.     struct antr_r3c {
  1582.         // representation 3 cells
  1583.         // r3c_weapons_
  1584.         // 16 bytes of 0
  1585.        
  1586.         // representation 3 sub-board A
  1587.         // r3sbA_animations_
  1588.         uint32_t r3sbA_animations_entrycount;   // maximum of 11 cells
  1589.         uint32_t r3sbA_animations_random_id1;
  1590.         uint32_t r3sbA_animations_sig_id;   // value = 0x60729D00
  1591.     }r3c_weapons;
  1592.    
  1593.     struct antr_r3scA {
  1594.         // representation 3 sub-cells A
  1595.         // r3scA_animations_
  1596.         uint16_t r3scA_animations_animation_sel;
  1597.     }r3sc_weapons_animations;
  1598.    
  1599.     struct antr_r4c {
  1600.         // representation 4 cells
  1601.         // r4c_vehicles_
  1602.         // r4c_vehicles_steering_screen_
  1603.         float r4c_vehicles_steering_screen_right_yaw_per_frame_rad;
  1604.         float r4c_vehicles_steering_screen_left_yaw_per_frame_rad;
  1605.         uint16_t r4c_vehicles_steering_screen_right_frame_count;
  1606.         uint16_t r4c_vehicles_steering_screen_left_frame_count;
  1607.         float r4c_vehicles_steering_screen_down_pitch_per_frame_rad;
  1608.         float r4c_vehicles_steering_screen_up_pitch_per_frame_rad;
  1609.         uint16_t r4c_vehicles_steering_screen_down_pitch_frame_count;
  1610.         uint16_t r4c_vehicles_steering_screen_up_pitch_frame_count;
  1611.        
  1612.         // in cell here: 68 bytes of 0
  1613.        
  1614.         // representation 4 sub-board A
  1615.         // r4sbA_animations_
  1616.         uint32_t r4sbA_animations_entrycount;   // maximum of 8 cells
  1617.         uint32_t r4sbA_animations_random_id1;
  1618.         uint32_t r4sbA_animations_sig_id;   // value = 0xFC739D00
  1619.        
  1620.         // representation 4 sub-board B
  1621.         // r4sbB_suspension_animations_
  1622.         uint32_t r4sbB_suspension_animations_entrycount;   // maximum of 8 cells
  1623.         uint32_t r4sbB_suspension_animations_random_id1;
  1624.         uint32_t r4sbB_suspension_animations_sig_id;   // value = 0xB8739D00
  1625.     }r4c_vehicles;
  1626.    
  1627.     struct antr_r4scA {
  1628.         // representation 4 sub-cells A
  1629.         // r4scA_animations_
  1630.         uint16_t r4scA_animations_animation_sel;
  1631.     }r4sc_vehicles_animations;
  1632.    
  1633.     struct antr_r4scB {
  1634.         // representation 4 sub-cells B
  1635.         // r4scB_suspension_animations_
  1636.         uint16_t r4scB_suspension_animations_mass_point_index;
  1637.         uint16_t r4scB_suspension_animations_animation_sel;
  1638.         float r4scB_suspension_animations_full_extension_ground_depth;
  1639.         float r4scB_suspension_animations_full_compression_ground_depth;
  1640.         // in cell here: 8 bytes of 0
  1641.     }r4sc_vehicles_suspension_animations;
  1642.    
  1643.     struct antr_r5c {
  1644.         // representation 5 cells
  1645.         // r5c_devices_
  1646.         // 84 bytes of 0
  1647.        
  1648.         // representation 5 cells sub-board A
  1649.         // r5csbA_animations_
  1650.         uint32_t r5csbA_animations_entrycount;   // maximum of 2 cells
  1651.         uint32_t r5csbA_animations_random_id1;
  1652.         uint32_t r5csbA_animations_sig_id;   // value = 0x08759D00
  1653.     }r5c_devices;
  1654.    
  1655.     struct antr_r5scA {
  1656.         // representation 5 sub-cells A
  1657.         // r5scA_animations_
  1658.         uint16_t r5scA_animations_animation_sel;
  1659.     }r5sc_devices_animations;
  1660.    
  1661.     struct antr_r6c {
  1662.         // representation 6 cells
  1663.         // r6c_unit_damage_
  1664.         uint16_t r6c_unit_damage_animation_sel;
  1665.     }r6c_unit_damage;
  1666.    
  1667.     struct antr_r7c {
  1668.         // representation 7 cells
  1669.         // r7c_first_person_weapons_
  1670.         // 16 bytes of 0
  1671.        
  1672.         // representation 7 cells sub-board A
  1673.         // r7csbA_animations_
  1674.         uint32_t r7csbA_animations_entrycount;   // maximum of 28 cells
  1675.         uint32_t r7csbA_animations_random_id1;
  1676.         uint32_t r7csbA_animations_sig_id;   // value = 0xF4729D00
  1677.        
  1678.     }r7c_first_person_weapons;
  1679.    
  1680.     struct antr_r7scA {
  1681.         // representation 7 sub-cells A
  1682.         // r7scA_animations_
  1683.         uint16_t r7scA_animations_animation_sel;
  1684.     }r7sc_first_person_weapons_animations;
  1685.    
  1686.     struct antr_r8c {
  1687.         // representation 8 cells
  1688.         // r8c_sound_references_
  1689.         // dependency 1: sound
  1690.         // r8c_sound_
  1691.         char r8c_sound_tagclass[5];      //unsigned char[5]
  1692.         uint32_t r8c_sound_tagnamepointer;   //uint32 ("random" number)
  1693.         uint32_t r8c_sound_tagnamestringlength;   //uint32
  1694.         uint32_t r8c_sound_tagid;        //uint32 (0xFFFFFFFF with tags)
  1695.         // char r8c_sound_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  1696.        
  1697.         // in cell here: 4 bytes of 0
  1698.     }r8c_sound_references;
  1699.    
  1700.     // r8c_sound_tagnamestring[255] null-terminated character array strings go here
  1701.    
  1702.     struct antr_r9c {
  1703.         // representation 9 cells
  1704.         // r9c_nodes_
  1705.         char r9c_nodes_name[32];
  1706.         uint16_t r9c_nodes_next_sibling_node_index_sel;
  1707.         uint16_t r9c_nodes_first_child_node_index_sel;
  1708.         uint16_t r9c_nodes_parent_node_index_sel;
  1709.         // in cell here: 2 bytes of 0
  1710.         uint32_t r9c_nodes_node_joint_flags;    //toff 232  32-bit 0x00000007
  1711.         float r9c_nodes_base_vector_i;
  1712.         float r9c_nodes_base_vector_j;
  1713.         float r9c_nodes_base_vector_k;
  1714.         float r9c_nodes_vector_range;
  1715.         // in cell here: 4 bytes of 0
  1716.     }s9c_nodes;
  1717.    
  1718.     struct antr_r10c {
  1719.         // representation 10 cells
  1720.         // r10c_animations_
  1721.         char r10c_animations_name[32];
  1722.         uint16_t r10c_animations_type;
  1723.         uint16_t r10c_animations_frame_count_calc;
  1724.         uint16_t r10c_animations_frame_size;
  1725.         uint16_t r10c_animations_frame_info_type;
  1726.         uint32_t r10c_animations_node_list_checksum;
  1727.         uint16_t r10c_animations_node_count;
  1728.         uint16_t r10c_animations_loop_frame_index;
  1729.         float r10c_animations_weight_frac;
  1730.         uint16_t r10c_animations_key_frame_index;
  1731.         uint16_t r10c_animations_second_key_frame_index;
  1732.         uint16_t r10c_animations_next_animation_sel;
  1733.         // 1
  1734.         uint8_t r10c_animations_flags;  //toff 314  8-bit 0x07
  1735.         uint16_t r10c_animations_sound_sel;
  1736.         uint16_t r10c_animations_sound_frame_index;
  1737.         uint8_t r10c_animations_left_foot_frame_index; // thanks for identifying the type http://stackoverflow.com/a/17744576/2846508
  1738.         uint8_t r10c_animations_right_foot_frame_index; // these int8_t types can be between -128 and 127, the same as in Guerilla, but Nari (Ronson) reports that negative values among the 16-bit entries and these 8-bit entries cause the game to crash
  1739.         uint16_t r10c_animations_INTERNAL_array_entry_id; // offset 66 into cell, incremental +1 number, starts at 0 for first animation cell
  1740.         float r10c_animations_INTERNAL_speed_multiplier; // offset 68 into cell, i'm guessing this is a playback speed multiplier, because it is normally 1
  1741.        
  1742.         // "frame info"
  1743.         // now, this is tricky.
  1744.         // in this "antr blank.model_animations" tag test file, which does not have any animation data, here are the values...
  1745.         // in this "antr blank.model_animations" file, we start here within our first cell at offset 964316 (at the most)
  1746.         // first, a little endian (despite big endian file data) float value of 1 (68 bytes into cell)
  1747.         // second, 8 bytes of 0 (72 bytes into cell)
  1748.         // lastly, what appears to be a board, normally with uint32_t entrycount, uint32_t random number, and uint32_t signature ID.
  1749.         // in this board, we have two random uint32_t's and a signature ID of 0xDC6A9D00 (big endian, as normal)
  1750.         // so the values in the current board are: 0x586A0F00   0xD03F1907   0xDC6A9D00
  1751.         // that concludes this tricky section; I will conduct further tests on this section
  1752.         uint32_t r10c_animations_frame_info; // offset 72 into cell, number of bytes in the frame's information data
  1753.         // offset 76 into cell = 4 bytes of 0
  1754.        
  1755.         // example values at offset 80 into cell:
  1756.         // tag with no animation data:
  1757.         // 586A 0F00   D03F 1907   DC6A 9D00
  1758.         // 586A 0F00   C04C 1907   DC6A 9D00
  1759.         // 586A 0F00   E04D 1907   DC6A 9D00
  1760.         // 586A 0F00   504A 1907   DC6A 9D00
  1761.         // cyborg model animations tag:
  1762.         // A538 0100   88D6 1900   9C00 9E00
  1763.         // 754D 0100   98EA 1900   9C00 9E00
  1764.         // E960 0100   98FE 1900   9C00 9E00
  1765.         // C96B 0100   5808 1A00   9C00 9E00
  1766.         // 150D 0200   30AA 1A00   9C00 9E00
  1767.         // CD0F 0200   78AD 1A00   9C00 9E00
  1768.         // needler first-person animations tag:
  1769.         // 4A16 0000   70CC 1C00   1482 6300
  1770.         // 4A35 0000   F8EB 1C00   1482 6300
  1771.        
  1772.         // basically, what we have here most obviously is this, with 3 uint32_t values in little endian:
  1773.         // first, the offset (after "blam") to the animation data (but not always accurate!). This value increments (always accurately) by adding the number of bytes in the "default data" and "frame data" values for the current value, to result in this value for the next animation cell
  1774.         // by the way, the "frame count" * "frame size" = "frame data" bytes value
  1775.         // second is an essentially-random number
  1776.         // third is the random number for that board or cell, basically just a random number that is repeated for each entry in a particular board or cell
  1777.         uint32_t r10c_animations_INTERNAL_frame_info_data_offset_pointer;
  1778.         uint32_t r10c_animations_INTERNAL_frame_info_data_random1;
  1779.         uint32_t r10c_animations_INTERNAL_frame_info_data_sig_id;
  1780.        
  1781.         // (insert appropriate values for the previous 24 bytes once deciphered)
  1782.         // then...
  1783.        
  1784.         uint32_t r10c_animations_node_translation_flag_data1;   // offset 92
  1785.         uint32_t r10c_animations_node_translation_flag_data2;
  1786.         // in cell here: 8 bytes of 0
  1787.         uint32_t r10c_animations_node_rotation_flag_data1;
  1788.         uint32_t r10c_animations_node_rotation_flag_data2;
  1789.         // in cell here: 8 bytes of 0
  1790.         uint32_t r10c_animations_node_scale_flag_data1;
  1791.         uint32_t r10c_animations_node_scale_flag_data2;
  1792.         // in cell here: 4 bytes of 0
  1793.         uint32_t r10c_animations_offset_to_compressed_data;
  1794.        
  1795.         // more complicated stuff...
  1796.        
  1797.         // default data
  1798.         // (140 bytes into cell)
  1799.         uint32_t r10c_animations_default_data;
  1800.         // in cell here: 4 bytes of 0
  1801.         // board with these values:
  1802.         // 0x586A0F00 (____0F00)   0x204D1907 (____1907)   0x7C6B9D00 (____9D00)
  1803.         uint32_t r10c_animations_INTERNAL_default_data_offset_pointer;
  1804.         uint32_t r10c_animations_INTERNAL_default_data_random1;
  1805.         uint32_t r10c_animations_INTERNAL_default_data_sig_id;
  1806.         // frame data
  1807.         // (160 bytes into cell)
  1808.         uint32_t r10c_animations_frame_data;
  1809.         // in cell here: 4 bytes of 0
  1810.         // board with these values:
  1811.         // 0x586A0F00 (____0F00)   0x00431907 (____1907)   0x6C6B9D00 (____9D00)
  1812.         uint32_t r10c_animations_INTERNAL_frame_data_offset_pointer;
  1813.         uint32_t r10c_animations_INTERNAL_frame_data_random1;
  1814.         uint32_t r10c_animations_INTERNAL_frame_data_sig_id;
  1815.     }r10c_animations;
  1816.    
  1817.     // then comes the animations data, which will need to be handled within the methods rather than here
  1818.     // example data is at offset 80341 in cyborg.model_animations (but this file has animation data offset values that are short by 240 bytes)
  1819.     // 34761 says 288 bytes at offset 80037 (really 80341) with random number 58401800 and sig ID 3C019E00
  1820.     // 34781 says 5040 bytes at offset 80325 (really 80629) with random number B8D61900 and sig ID 2C019E00
  1821.    
  1822. } type_meta_antr;
  1823.  
  1824. #pragma mark -- bipd
  1825.  
  1826. typedef struct {
  1827.     // OBJE DATA 1 START
  1828.     uint16_t INTERNAL_obje_index;   // 0 (little endian)
  1829.     // 66, 1
  1830.     uint8_t flags;  //toff 66   8-bit 0x0F
  1831.     float bounding_radius;
  1832.     float bounding_offset_x;
  1833.     float bounding_offset_y;
  1834.     float bounding_offset_z;
  1835.     float origin_offset_x;
  1836.     float origin_offset_y;
  1837.     float origin_offset_z;
  1838.     float acceleration_scale;
  1839.     // offset 100 = 4 bytes of 0
  1840.    
  1841.     // dependency 1: model mod2
  1842.     char model_tagclass[5];      //unsigned char[5]
  1843.     uint32_t model_tagnamepointer;   //uint32 ("random" number)
  1844.     uint32_t model_tagnamestringlength;   //uint32
  1845.     uint32_t model_tagid;        //uint32 (0xFFFFFFFF with tags)
  1846.     // char model_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  1847.    
  1848.     // dependency 2: animation graph antr
  1849.     char animation_graph_tagclass[5];        //unsigned char[5]
  1850.     uint32_t animation_graph_tagnamepointer;   //uint32 ("random" number)
  1851.     uint32_t animation_graph_tagnamestringlength;   //uint32
  1852.     uint32_t animation_graph_tagid;      //uint32 (0xFFFFFFFF with tags)
  1853.     // char animation_graph_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  1854.    
  1855.     // offset 136 = 40 bytes of 0
  1856.    
  1857.     // dependency 3: collision model coll
  1858.     char collision_model_tagclass[5];        //unsigned char[5]
  1859.     uint32_t collision_model_tagnamepointer;   //uint32 ("random" number)
  1860.     uint32_t collision_model_tagnamestringlength;   //uint32
  1861.     uint32_t collision_model_tagid;      //uint32 (0xFFFFFFFF with tags)
  1862.     // char collision_model_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  1863.    
  1864.     // dependency 4: physics phys
  1865.     char physics_tagclass[5];        //unsigned char[5]
  1866.     uint32_t physics_tagnamepointer;   //uint32 ("random" number)
  1867.     uint32_t physics_tagnamestringlength;   //uint32
  1868.     uint32_t physics_tagid;      //uint32 (0xFFFFFFFF with tags)
  1869.     // char physics_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  1870.    
  1871.     // dependency 5: modifier shader shdr senv soso schi scex sotr sgla smet spla swat
  1872.     char modifier_shader_tagclass[5];        //unsigned char[5]
  1873.     uint32_t modifier_shader_tagnamepointer;   //uint32 ("random" number)
  1874.     uint32_t modifier_shader_tagnamestringlength;   //uint32
  1875.     uint32_t modifier_shader_tagid;      //uint32 (0xFFFFFFFF with tags)
  1876.     // char modifier_shader_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  1877.    
  1878.     // dependency 6: creation effect effe
  1879.     char creation_effect_tagclass[5];        //unsigned char[5]
  1880.     uint32_t creation_effect_tagnamepointer;   //uint32 ("random" number)
  1881.     uint32_t creation_effect_tagnamestringlength;   //uint32
  1882.     uint32_t creation_effect_tagid;      //uint32 (0xFFFFFFFF with tags)
  1883.     // char creation_effect_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  1884.    
  1885.     // offset 240 = 84 bytes of 0
  1886.    
  1887.     float render_bounding_radius;
  1888.    
  1889.     uint16_t export_to_functions_a_in;
  1890.     uint16_t export_to_functions_b_in;
  1891.     uint16_t export_to_functions_c_in;
  1892.     uint16_t export_to_functions_d_in;
  1893.    
  1894.     // offset 336 = 44 bytes of 0
  1895.    
  1896.     uint16_t export_to_functions_hud_text_message_index;
  1897.     uint16_t export_to_functions_forced_shader_permutation_index;
  1898.    
  1899.     // representation 1 board, offset 384
  1900.     // r1b_attachments_
  1901.     uint32_t r1b_attachments_entrycount; // maximum of 8 cells
  1902.     uint32_t r1b_attachments_random_id;
  1903.     uint32_t r1b_attachments_sig_id; // example value = 0x08479D00
  1904.    
  1905.     // representation 2 board, offset 396
  1906.     // r2b_widgets_
  1907.     uint32_t r2b_widgets_entrycount; // maximum of 4 cells
  1908.     uint32_t r2b_widgets_random_id;
  1909.     uint32_t r2b_widgets_sig_id; // example value = 0x7C479D00
  1910.    
  1911.     // representation 3 board, offset 408
  1912.     // r3b_functions_
  1913.     uint32_t r3b_functions_entrycount; // maximum of 4 cells
  1914.     uint32_t r3b_functions_random_id;
  1915.     uint32_t r3b_functions_sig_id; // example value = 0x50469D00
  1916.    
  1917.     // representation 4 board, offset 420
  1918.     // r4b_change_colors_
  1919.     uint32_t r4b_change_colors_entrycount; // maximum of 4 cells
  1920.     uint32_t r4b_change_colors_random_id;
  1921.     uint32_t r4b_change_colors_sig_id; // example value = 0x6C489D00
  1922.    
  1923.     // representation 5 board, offset 432
  1924.     // r5b_predicted_resources_
  1925.     uint32_t r5b_predicted_resources_entrycount; // maximum of 1024 cells
  1926.     uint32_t r5b_predicted_resources_random_id;
  1927.     uint32_t r5b_predicted_resources_sig_id; // example value = 0x105FA000
  1928.    
  1929.     // OBJE DATA 1 END
  1930.    
  1931.     // unit_
  1932.     uint32_t unit_flags;    // toff 444 (filled already)    0x01FFFFFF
  1933.     uint16_t unit_default_team;
  1934.     uint16_t unit_constant_sound_volume;
  1935.     float unit_rider_damage_fraction;
  1936.    
  1937.     // dependency 7: unit_integrated_light_toggle_ effe
  1938.     char unit_integrated_light_toggle_tagclass[5];       //unsigned char[5]
  1939.     uint32_t unit_integrated_light_toggle_tagnamepointer;   //uint32 ("random" number)
  1940.     uint32_t unit_integrated_light_toggle_tagnamestringlength;   //uint32
  1941.     uint32_t unit_integrated_light_toggle_tagid;         //uint32 (0xFFFFFFFF with tags)
  1942.     // char unit_integrated_light_toggle_tagnamestring[255];
  1943.    
  1944.     uint16_t unit_a_in;
  1945.     uint16_t unit_b_in;
  1946.     uint16_t unit_c_in;
  1947.     uint16_t unit_d_in;
  1948.    
  1949.     float unit_camera_field_of_view_rad;
  1950.     float unit_camera_stiffness;
  1951.     char unit_camera_marker_name[32];
  1952.     char unit_camera_submerged_marker_name[32];
  1953.    
  1954.     float unit_pitch_auto_level_rad;
  1955.     float unit_pitch_range_from_rad;
  1956.     float unit_pitch_range_to_rad;
  1957.    
  1958.     // representation 6 board, offset 564
  1959.     // r6b_unit_camera_tracks_
  1960.     uint32_t r6b_unit_camera_tracks_entrycount; // maximum of 2 cells
  1961.     uint32_t r6b_unit_camera_tracks_random_id;
  1962.     uint32_t r6b_unit_camera_tracks_sig_id; // example value = 0xFC579D00
  1963.    
  1964.     float unit_seat_acceleration_scale_i;
  1965.     float unit_seat_acceleration_scale_j;
  1966.     float unit_seat_acceleration_scale_k;
  1967.    
  1968.     // offset 588 = 12 bytes of 0
  1969.    
  1970.     float unit_soft_ping_threhold_frac;
  1971.     float unit_soft_ping_interrupt_time;
  1972.     float unit_hard_ping_threshold_frac;
  1973.     float unit_hard_ping_interrupt_time;
  1974.     float unit_hard_death_threshold_frac;
  1975.     float unit_feign_death_threshold_frac;
  1976.     float unit_feign_death_time;
  1977.     float unit_distance_of_evade_animation;
  1978.     float unit_distance_of_dive_animation;
  1979.     // offset 636 = 4 bytes of 0
  1980.     float unit_stunned_movement_threshold_frac;
  1981.     float unit_feign_death_chance_frac;
  1982.     float unit_feign_repeat_chance_frac;
  1983.    
  1984.     // dependency 8: unit_spawned_actor_ actv
  1985.     char unit_spawned_actor_tagclass[5];         //unsigned char[5]
  1986.     uint32_t unit_spawned_actor_tagnamepointer;   //uint32 ("random" number)
  1987.     uint32_t unit_spawned_actor_tagnamestringlength;   //uint32
  1988.     uint32_t unit_spawned_actor_tagid;       //uint32 (0xFFFFFFFF with tags)
  1989.     // char unit_spawned_actor_tagnamestring[255];
  1990.    
  1991.     uint16_t unit_spawned_actor_count_from;
  1992.     uint16_t unit_spawned_actor_count_to;
  1993.    
  1994.     float unit_spawned_velocity;
  1995.     float unit_aiming_velocity_maximum_rad;
  1996.     float unit_aiming_acceleration_maximum_rad;
  1997.     float unit_casual_aiming_modifier_frac;
  1998.     float unit_looking_velocity_maximum_rad;
  1999.     float unit_looking_acceleration_maximum_rad;
  2000.    
  2001.     // offset 696 = 8 bytes of 0
  2002.    
  2003.     float unit_ai_vehicle_radius;
  2004.     float unit_ai_danger_radius;
  2005.    
  2006.     // dependency 8: unit_melee_damage_ jpt!
  2007.     char unit_melee_damage_tagclass[5];      //unsigned char[5]
  2008.     uint32_t unit_melee_damage_tagnamepointer;   //uint32 ("random" number)
  2009.     uint32_t unit_melee_damage_tagnamestringlength;   //uint32
  2010.     uint32_t unit_melee_damage_tagid;        //uint32 (0xFFFFFFFF with tags)
  2011.     // char unit_melee_damage_tagnamestring[255];
  2012.    
  2013.     uint16_t unit_motion_sensor_blip_size;
  2014.    
  2015.     // offset 730 = 14 bytes of 0
  2016.    
  2017.     // representation 7 board, offset 744
  2018.     // r7b_unit_new_hud_interfaces_
  2019.     uint32_t r7b_unit_new_hud_interfaces_entrycount; // maximum of 2 cells
  2020.     uint32_t r7b_unit_new_hud_interfaces_random_id;
  2021.     uint32_t r7b_unit_new_hud_interfaces_sig_id; // example value = 0xA4579D00
  2022.    
  2023.     // representation 8 board, offset 756
  2024.     // r8b_unit_dialogue_variants_
  2025.     uint32_t r8b_unit_dialogue_variants_entrycount; // maximum of 16 cells
  2026.     uint32_t r8b_unit_dialogue_variants_random_id;
  2027.     uint32_t r8b_unit_dialogue_variants_sig_id; // example value = 0xA85A9D00
  2028.    
  2029.     float unit_grenade_velocity;
  2030.     uint16_t unit_grenade_type;
  2031.     uint16_t unit_grenade_count;
  2032.    
  2033.     // offset 776 = 4 bytes of 0
  2034.    
  2035.     // representation 9 board, offset 780
  2036.     // r9b_unit_powered_seats_
  2037.     uint32_t r9b_unit_powered_seats_entrycount; // maximum of 2 cells
  2038.     uint32_t r9b_unit_powered_seats_random_id;
  2039.     uint32_t r9b_unit_powered_seats_sig_id; // example value = 0x345A9D00
  2040.    
  2041.     // representation 10 board, offset 792
  2042.     // r10b_unit_weapons_
  2043.     uint32_t r10b_unit_weapons_entrycount; // maximum of 4 cells
  2044.     uint32_t r10b_unit_weapons_random_id;
  2045.     uint32_t r10b_unit_weapons_sig_id; // example value = 0xC4599D00
  2046.    
  2047.     // representation 11 board, offset 804
  2048.     // r11b_unit_seats_
  2049.     uint32_t r11b_unit_seats_entrycount; // maximum of 16 cells
  2050.     uint32_t r11b_unit_seats_random_id;
  2051.     uint32_t r11b_unit_seats_sig_id; // example value = 0x68599D00
  2052.    
  2053.     float biped_moving_turning_speed_rad;
  2054.     uint32_t biped_flags;   //toff 820  32-bit 0x00001FFF
  2055.     float biped_stationary_turning_threshold_rad;
  2056.    
  2057.     // offset 828 = 16 bytes of 0
  2058.    
  2059.     uint16_t biped_a_in;
  2060.     uint16_t biped_b_in;
  2061.     uint16_t biped_c_in;
  2062.     uint16_t biped_d_in;
  2063.    
  2064.     // dependency 9: biped_do_not_use_ jpt!
  2065.     char biped_do_not_use_tagclass[5];       //unsigned char[5]
  2066.     uint32_t biped_do_not_use_tagnamepointer;   //uint32 ("random" number)
  2067.     uint32_t biped_do_not_use_tagnamestringlength;   //uint32
  2068.     uint32_t biped_do_not_use_tagid;         //uint32 (0xFFFFFFFF with tags)
  2069.     // char biped_do_not_use_tagnamestring[255];
  2070.    
  2071.     float biped_flying_bank_angle_rad;
  2072.     float biped_flying_bank_apply_time;
  2073.     float biped_flying_bank_decay_time;
  2074.     float biped_flying_pitch_ratio;
  2075.     float biped_flying_max_velocity;
  2076.     float biped_flying_max_sidestep_velocity;
  2077.     float biped_flying_acceleration;
  2078.     float biped_flying_deceleration;
  2079.     float biped_flying_angular_velocity_maximum_rad;
  2080.     float biped_flying_angular_acceleration_maximum;
  2081.     float biped_flying_crouch_velocity_modifier_frac;
  2082.     // offset 912 = 8 bytes of 0
  2083.    
  2084.     float biped_movement_maximum_slope_angle_rad;
  2085.     float biped_movement_downhill_falloff_angle_rad;
  2086.     float biped_movement_downhill_cutoff_angle_rad;
  2087.     float biped_movement_downhill_velocity_scale;
  2088.     float biped_movement_uphill_falloff_angle_rad;
  2089.     float biped_movement_uphill_cutoff_angle_rad;
  2090.     float biped_movement_uphill_velocity_scale;
  2091.    
  2092.     // offset 948 = 24 bytes of 0
  2093.    
  2094.     // dependency 10: biped_movement_footsteps_ foot
  2095.     char biped_movement_footsteps_tagclass[5];       //unsigned char[5]
  2096.     uint32_t biped_movement_footsteps_tagnamepointer;   //uint32 ("random" number)
  2097.     uint32_t biped_movement_footsteps_tagnamestringlength;   //uint32
  2098.     uint32_t biped_movement_footsteps_tagid;         //uint32 (0xFFFFFFFF with tags)
  2099.     // char biped_movement_footsteps_tagnamestring[255];
  2100.    
  2101.     // offset 988 = 24 bytes of 0
  2102.    
  2103.     float biped_jumping_and_landing_jump_velocity;
  2104.    
  2105.     // offset 1016 = 28 bytes of 0
  2106.    
  2107.     float biped_jumping_and_landing_maximum_soft_landing_time;
  2108.     float biped_jumping_and_landing_maximum_hard_landing_time;
  2109.     float biped_jumping_and_landing_minimum_soft_landing_velocity;
  2110.     float biped_jumping_and_landing_minimum_hard_landing_velocity;
  2111.     float biped_jumping_and_landing_death_hard_landing_velocity;
  2112.    
  2113.     // offset 1068 = 20 (24 when compiled! (edit: nope!)) bytes of 0
  2114.    
  2115.     float biped_camera_collision_and_autoaim_standing_camera_height;
  2116.     float biped_camera_collision_and_autoaim_crouching_camera_height;
  2117.     float biped_camera_collision_and_autoaim_crouch_transition_time;
  2118.    
  2119.     // offset 1100 = 24 bytes of 0
  2120.    
  2121.     float biped_camera_collision_and_autoaim_standing_collision_height;
  2122.     float biped_camera_collision_and_autoaim_crouching_collision_height;
  2123.     float biped_camera_collision_and_autoaim_collision_radius;
  2124.    
  2125.     // offset 1136 = 40 bytes of 0
  2126.    
  2127.     float biped_camera_collision_and_autoaim_autoaim_width;
  2128.    
  2129.     // ! decipher
  2130.     // offset 1180 = 108 bytes of 0
  2131.     // offset 1288 = 5 float values in little endian (internal use):
  2132.     // 1 1 1 0x00000080("-0") 0x00000080("-0")
  2133.     // offset 1308 = 8 bytes of 0
  2134.     // offset 1316 = int32_t value of -1 (0xFFFFFFFF)
  2135.     // ! end
  2136.    
  2137.     // deciphering:
  2138.     // there are 8 float values which are populated at least during map compilation
  2139.     // example data from sbscbeach_12 at offset 326003224:
  2140.     // 0000003F   ABAA2A3E   F304353F   431DAFBE   F30435BF   431DAF3E   F304353F   00000C00
  2141.     // which means:
  2142.     // 0.5    0.166667   0.707107   -0.34202   -0.707107   0.34202    0.707107   1.10203E-39 (or 3072 in big endian)
  2143.     // these looked like coordinates, however, during testing, this is what I am finding:
  2144.     // these values affect first-person camera behavior, not the behavior of the third-person model; the footstep sounds are related to the third-person model
  2145.    
  2146.     // value 1: setting to <0 prevents the footstep turning sound; setting to >1 makes the footstep turning sound constant (not sure why, since the third-person model is what affects footstep sounds) [moment scale?] [foot gravity multiplier?] [foot weight (as in, percentage weight, 0-1)?] *[ground normal k0]*
  2147.     // value 2: snaps crouching camera movement [fp camera crouching velocity, 0-1], affects player speed (so you could set this to 0 and be crouching in third-person view but be able to move at running speed)
  2148.     // value 3: physics: [relative ground depth?] (can be used for legit walking on walls (negative value) or floating (>0.707107)) *[ground normal k1]*
  2149.     // value 4: unknown (related to water/air?) [water/air acceleration multiplier?]
  2150.     // value 5: unknown [water/air normal k1?] (water depth?)
  2151.     // value 6: [ground acceleration modifier] (0 and 1 = default) (-1 to 1) (negative values keep speed at minimum, higher values reach maximum speed) [foot weight] (how heavy the feet are)
  2152.     // value 7: (similar effect as value 6)
  2153.     // value 8: unknown [mass? then unused] (default value is -1, 0xFFFFFFFF)
  2154.     // end of deciphering
  2155.    
  2156.     // representation 12 board, offset 1320
  2157.     // r12b_biped_contact_points_
  2158.     uint32_t r12b_biped_contact_points_entrycount; // maximum of 2 cells
  2159.     uint32_t r12b_biped_contact_points_random_id;
  2160.     uint32_t r12b_biped_contact_points_sig_id; // example value = 0xC4539D00
  2161.    
  2162.     // offset 1332 is the null-terminated tag pathname strings
  2163.    
  2164.     // OBJE DATA 2 START
  2165.    
  2166.     struct bipd_r1c {
  2167.         // representation 1 cells
  2168.         // r1c_attachments_
  2169.        
  2170.         // dependency r1c 1: r1c_attachments_type_ cont effe ligh mgs2 pctl lsnd
  2171.         char r1c_attachments_type_tagclass[5];       //unsigned char[5]
  2172.         uint32_t r1c_attachments_type_tagnamepointer;   //uint32 ("random" number)
  2173.         uint32_t r1c_attachments_type_tagnamestringlength;   //uint32
  2174.         uint32_t r1c_attachments_type_tagid;         //uint32 (0xFFFFFFFF with tags)
  2175.         // char r1c_attachments_type_tagnamestring[255];
  2176.        
  2177.         char r1c_attachments_marker[32];
  2178.         uint16_t r1c_attachments_primary_scale;
  2179.         uint16_t r1c_attachments_secondary_scale;
  2180.         uint16_t r1c_attachments_change_color;
  2181.        
  2182.         // in cell here: 18 bytes of 0
  2183.        
  2184.     }r1c_attachments;
  2185.    
  2186.     // r1c 1 tag name strings here
  2187.    
  2188.     struct bipd_r2c {
  2189.         // representation 2 cells
  2190.         // r2c_widgets_
  2191.        
  2192.         // dependency r2c 1: r2c_widgets_reference_ ant! flag glw! mgs2 elec
  2193.         char r2c_widgets_reference_tagclass[5];      //unsigned char[5]
  2194.         uint32_t r2c_widgets_reference_tagnamepointer;   //uint32 ("random" number)
  2195.         uint32_t r2c_widgets_reference_tagnamestringlength;   //uint32
  2196.         uint32_t r2c_widgets_reference_tagid;        //uint32 (0xFFFFFFFF with tags)
  2197.         // char r2c_widgets_reference_tagnamestring[255];
  2198.        
  2199.         // in cell here: 16 bytes of 0
  2200.     }r2c_widgets;
  2201.    
  2202.     // r2c 1 tag name strings here
  2203.    
  2204.     struct bipd_r3c {
  2205.         // representation 3 cells
  2206.         // r3c_functions_
  2207.        
  2208.         uint32_t r3c_functions_flags;   // toff 1332    32-bit 0x00000007
  2209.         float r3c_functions_period;
  2210.         uint16_t r3c_functions_scale_period_by;
  2211.         uint16_t r3c_functions_function;
  2212.         uint16_t r3c_functions_scale_function_by;
  2213.         uint16_t r3c_functions_wobble_function;
  2214.         float r3c_functions_wobble_period;
  2215.         float r3c_functions_wobble_magnitude;
  2216.         float r3c_functions_square_wave_threshold_frac;
  2217.         uint16_t r3c_functions_step_count;
  2218.         uint16_t r3c_functions_map_to;
  2219.         uint16_t r3c_functions_sawtooth_count;
  2220.         uint16_t r3c_functions_add;
  2221.         uint16_t r3c_functions_scale_result_by;
  2222.         uint16_t r3c_functions_bounds_mode;
  2223.         float r3c_functions_bounds_from_frac;
  2224.         float r3c_functions_bounds_to_frac;
  2225.         // in cell here: 6 bytes of 0
  2226.         uint16_t r3c_functions_turn_off_with_sel;
  2227.         float r3c_functions_scale_by;
  2228.         // in cell here: 268 bytes of 0 (reminiscent of the pre-padding of other times strings come after cells)
  2229.         char r3c_functions_usage[32];
  2230.        
  2231.     }r3c_functions;
  2232.    
  2233.     struct bipd_r4c {
  2234.         // representation 4 cells
  2235.         // r4c_change_colors_
  2236.         uint16_t r4c_change_colors_darken_by;
  2237.         uint16_t r4c_change_colors_scale_by;
  2238.         uint32_t r4c_change_colors_scale_flags; //toff 1696 32-bit 0x00000003
  2239.         float r4c_change_colors_color_lower_bound_r_frac;
  2240.         float r4c_change_colors_color_lower_bound_g_frac;
  2241.         float r4c_change_colors_color_lower_bound_b_frac;
  2242.         float r4c_change_colors_color_upper_bound_r_frac;
  2243.         float r4c_change_colors_color_upper_bound_g_frac;
  2244.         float r4c_change_colors_color_upper_bound_b_frac;
  2245.        
  2246.         // representation 4 sub-board A
  2247.         // r4sbA_permutations_
  2248.         uint32_t r4sbA_permutations_entrycount;   // maximum of 8 cells
  2249.         uint32_t r4sbA_permutations_random_id1;
  2250.         uint32_t r4sbA_permutations_sig_id;   // example value = 0xD8479D00
  2251.     }r4c_change_colors;
  2252.    
  2253.     struct bipd_r4scA
  2254.     {
  2255.         // representation 4 sub-cells A
  2256.         // r4scA_permutations_
  2257.         float r4scA_permutations_weight_frac;
  2258.         float r4scA_permutations_color_lower_bound_r_frac;
  2259.         float r4scA_permutations_color_lower_bound_g_frac;
  2260.         float r4scA_permutations_color_lower_bound_b_frac;
  2261.         float r4scA_permutations_color_upper_bound_r_frac;
  2262.         float r4scA_permutations_color_upper_bound_g_frac;
  2263.         float r4scA_permutations_color_upper_bound_b_frac;
  2264.     }r4sc_change_colors_permutations;
  2265.    
  2266.     struct bipd_r5c {
  2267.         // representation 5 cells
  2268.         // r5c_predicted_resources_
  2269.         uint16_t r5c_predicted_resources_type;
  2270.         uint16_t r5c_predicted_resources_resource_index;
  2271.         uint32_t r5c_predicted_resources_tag_index;
  2272.     }r5c_predicted_resources;
  2273.    
  2274.     // OBJE DATA 2 END
  2275.    
  2276.     // dependency 7 unit_integrated_light_toggle_tagnamestring goes here
  2277.    
  2278.     struct bipd_r6c {
  2279.         // representation 6 cells
  2280.         // r6c_camera_tracks_
  2281.        
  2282.         // dependency r6c 1: r6c_camera_tracks_track_ trak
  2283.         char r6c_camera_tracks_track_tagclass[5];        //unsigned char[5]
  2284.         uint32_t r6c_camera_tracks_track_tagnamepointer;   //uint32 ("random" number)
  2285.         uint32_t r6c_camera_tracks_track_tagnamestringlength;   //uint32
  2286.         uint32_t r6c_camera_tracks_track_tagid;      //uint32 (0xFFFFFFFF with tags)
  2287.         // char r6c_camera_tracks_track_tagnamestring[255];
  2288.        
  2289.         // in cell here: 12 bytes of 0
  2290.        
  2291.     }r6c_unit_camera_tracks;
  2292.    
  2293.     // r6c 1 tagnamestrings go here
  2294.    
  2295.     // dependency 8 tagnamestring goes here
  2296.    
  2297.     // dependency 9 tagnamestring goes here
  2298.    
  2299.     struct bipd_r7c {
  2300.         // representation 7 cells
  2301.         // r7c_new_hud_interfaces_
  2302.        
  2303.         // dependency r7c 1: r7c_new_hud_interfaces_unit_hud_interface_ unhi
  2304.         char r7c_new_hud_interfaces_unit_hud_interface_tagclass[5];      //unsigned char[5]
  2305.         uint32_t r7c_new_hud_interfaces_unit_hud_interface_tagnamepointer;   //uint32 ("random" number)
  2306.         uint32_t r7c_new_hud_interfaces_unit_hud_interface_tagnamestringlength;   //uint32
  2307.         uint32_t r7c_new_hud_interfaces_unit_hud_interface_tagid;        //uint32 (0xFFFFFFFF with tags)
  2308.         // char r7c_new_hud_interfaces_unit_hud_interface_tagnamestring[255];
  2309.        
  2310.         // in cell here: 32 bytes of 0
  2311.        
  2312.     }r7c_unit_new_hud_interfaces;
  2313.    
  2314.     // r7c 1 tagnamestrings here
  2315.    
  2316.     struct bipd_r8c {
  2317.         // representation 8 cells
  2318.         // r8c_dialogue_variants_
  2319.         uint16_t r8c_dialogue_variants_variant_number;
  2320.        
  2321.         // in cell here: 6 bytes of 0
  2322.        
  2323.         // dependency r8c 1: r8c_dialogue_variants_dialogue_ udlg
  2324.         char r8c_dialogue_variants_dialogue_tagclass[5];         //unsigned char[5]
  2325.         uint32_t r8c_dialogue_variants_dialogue_tagnamepointer;   //uint32 ("random" number)
  2326.         uint32_t r8c_dialogue_variants_dialogue_tagnamestringlength;   //uint32
  2327.         uint32_t r8c_dialogue_variants_dialogue_tagid;       //uint32 (0xFFFFFFFF with tags)
  2328.         // char r8c_dialogue_variants_dialogue_tagnamestring[255];
  2329.     }r8c_unit_dialogue_variants;
  2330.    
  2331.     // r8c 1 tagnamestrings here
  2332.    
  2333.     struct bipd_r9c {
  2334.         // representation 9 cells
  2335.         // r9c_powered_seats_
  2336.        
  2337.         // in cell here: 4 bytes of 0
  2338.        
  2339.         float r9c_powered_seats_driver_powerup_time;
  2340.         float r9c_powered_seats_driver_powerdown_time;
  2341.        
  2342.         // in cell here: 56 bytes of 0
  2343.     }r9c_unit_powered_seats;
  2344.    
  2345.     struct bipd_r10c {
  2346.         // representation 10 cells
  2347.         // r10c_weapons_
  2348.        
  2349.         // dependency r10c 1: r10c_weapons_weapon_ weap
  2350.         char r10c_weapons_weapon_tagclass[5];        //unsigned char[5]
  2351.         uint32_t r10c_weapons_weapon_tagnamepointer;   //uint32 ("random" number)
  2352.         uint32_t r10c_weapons_weapon_tagnamestringlength;   //uint32
  2353.         uint32_t r10c_weapons_weapon_tagid;      //uint32 (0xFFFFFFFF with tags)
  2354.         // char r10c_weapons_weapon_tagnamestring[255];
  2355.        
  2356.         // in cell here: 20 bytes of 0
  2357.     }r10c_unit_weapons;
  2358.    
  2359.     // r10c tagnamestrings here
  2360.    
  2361.     struct bipd_r11c {
  2362.         // representation 11 cells
  2363.         // r11c_seats_
  2364.        
  2365.         uint32_t r11c_seats_flags;  // toff 1736    32-bit 0x000007FF
  2366.         char r11c_seats_label[32];
  2367.         char r11c_seats_marker_name[32];
  2368.         // in cell here: 32 bytes of 0
  2369.        
  2370.         float r11c_seats_acceleration_scale_i;
  2371.         float r11c_seats_acceleration_scale_j;
  2372.         float r11c_seats_acceleration_scale_k;
  2373.        
  2374.         // in cell here: 12 bytes of 0
  2375.        
  2376.         float r11c_seats_yaw_rate;
  2377.         float r11c_seats_pitch_rate;
  2378.        
  2379.         char r11c_seats_camera_marker_name[32];
  2380.         char r11c_seats_camera_submerged_marker_name[32];
  2381.        
  2382.         float r11c_seats_pitch_auto_level_rad;
  2383.         float r11c_seats_pitch_range_from_rad;
  2384.         float r11c_seats_pitch_range_to_rad;
  2385.        
  2386.         // representation 11 sub-board A
  2387.         // r11sbA_camera_tracks_
  2388.         uint32_t r11sbA_camera_tracks_entrycount;   // maximum of 2 cells
  2389.         uint32_t r11sbA_camera_tracks_random_id1;
  2390.         uint32_t r11sbA_camera_tracks_sig_id;   // example value = 0xFC579D00
  2391.        
  2392.         // representation 11 sub-board B
  2393.         // r11sbB_unit_hud_interface_
  2394.         uint32_t r11sbB_unit_hud_interface_entrycount;   // maximum of 2 cells
  2395.         uint32_t r11sbB_unit_hud_interface_random_id1;
  2396.         uint32_t r11sbB_unit_hud_interface_sig_id;   // example value = 0xA4579D00
  2397.        
  2398.         // in cell here: 4 bytes of 0
  2399.        
  2400.         uint16_t r11c_seats_hud_text_message_index;
  2401.        
  2402.         // in cell here: 2 bytes of 0
  2403.        
  2404.         float r11c_seats_yaw_minimum_rad;
  2405.         float r11c_seats_yaw_maximum_rad;
  2406.        
  2407.         // dependency r11c 1: r11c_seats_built_in_gunner_ actv
  2408.         char r11c_seats_built_in_gunner_tagclass[5];         //unsigned char[5]
  2409.         uint32_t r11c_seats_built_in_gunner_tagnamepointer;   //uint32 ("random" number)
  2410.         uint32_t r11c_seats_built_in_gunner_tagnamestringlength;   //uint32
  2411.         uint32_t r11c_seats_built_in_gunner_tagid;       //uint32 (0xFFFFFFFF with tags)
  2412.         // char r11c_seats_built_in_gunner_tagnamestring[255];
  2413.        
  2414.         // in cell here: 20 bytes of 0
  2415.        
  2416.     }r11c_unit_seats;
  2417.    
  2418.     // this is a little different from usual, it seems they wanted to have variable-size structs here with the biped unit seats' sub-cells, but they are still not embedded, just grouped together differently. The offset for this in the test bipd.biped tag file is 18371, each container as 220 (variable) bytes, so 3520 bytes total, up to offset 21891:
  2419.    
  2420.     struct bipd_r11sc {
  2421.         // representation 11 sub-cells grouping container (unusual)
  2422.         struct bipd_r11scA {
  2423.             // representation 11 sub-cells A
  2424.             // r11scA_camera_tracks_
  2425.            
  2426.             // dependency r11scA 1: r11scA_camera_tracks_track_ trak
  2427.             char r11scA_camera_tracks_track_tagclass[5];         //unsigned char[5]
  2428.             uint32_t r11scA_camera_tracks_track_tagnamepointer;   //uint32 ("random" number)
  2429.             uint32_t r11scA_camera_tracks_track_tagnamestringlength;   //uint32
  2430.             uint32_t r11scA_camera_tracks_track_tagid;       //uint32 (0xFFFFFFFF with tags)
  2431.             // char r11scA_camera_tracks_track_tagnamestring[255];
  2432.            
  2433.             // in cell here: 12 bytes of 0
  2434.            
  2435.         }r11scA_seats_camera_tracks;
  2436.        
  2437.         // r11scA 1 tagnamestrings here
  2438.        
  2439.         struct bipd_r11scB {
  2440.             // representation 11 sub-cells B
  2441.             // r11scB_unit_hud_interface_
  2442.            
  2443.             // dependency r11scB 1: r11scB_unit_hud_interface_unit_hud_interface_ unhi
  2444.             char r11scB_unit_hud_interface_unit_hud_interface_tagclass[5];       //unsigned char[5]
  2445.             uint32_t r11scB_unit_hud_interface_unit_hud_interface_tagnamepointer;   //uint32 ("random" number)
  2446.             uint32_t r11scB_unit_hud_interface_unit_hud_interface_tagnamestringlength;   //uint32
  2447.             uint32_t r11scB_unit_hud_interface_unit_hud_interface_tagid;         //uint32 (0xFFFFFFFF with tags)
  2448.             // char r11scB_unit_hud_interface_unit_hud_interface_tagnamestring[255];
  2449.            
  2450.             // in cell here: 32 bytes of 0
  2451.            
  2452.         }r11scB_seats_unit_hud_interface;
  2453.        
  2454.         // r11scB 1 tagnamestrings here
  2455.        
  2456.         // dependency r11c 1 r11c_seats_built_in_gunner_tagnamestring here
  2457.     }r11sc_container;
  2458.    
  2459.     // dependency 9 biped_do_not_use_tagnamestring here
  2460.     // dependency 10 biped_movement_footsteps_tagnamestring here
  2461.    
  2462.     struct bipd_r12c {
  2463.         // representation 12 cells
  2464.         // r12c_contact_points_
  2465.        
  2466.         // in cell here: 32 bytes of 0
  2467.         char r12c_contact_points_marker_name[32];
  2468.        
  2469.     }r12c_biped_contact_points;
  2470.    
  2471. } type_meta_bipd;
  2472.  
  2473. #pragma mark -- bitm
  2474.  
  2475. typedef struct {
  2476.     uint16_t type;
  2477.     uint16_t format;
  2478.     uint16_t usage;
  2479.     // 70, 1
  2480.     uint8_t usage_flags;    // toff 70  8-bit 0x0F
  2481.    
  2482.     float post_processing_detail_fade_factor_frac;
  2483.     float post_processing_sharpen_amount_frac;
  2484.     float post_processing_bump_height_frac;
  2485.    
  2486.     uint16_t sprite_processing_sprite_budget_size;
  2487.     uint16_t sprite_processing_sprite_budget_count;
  2488.    
  2489.     uint16_t color_plate_color_plate_width;
  2490.     uint16_t color_plate_color_plate_height;
  2491.    
  2492.     uint32_t color_plate_compressed_color_plate_data;
  2493.     // offset 96 = 4 bytes of 0
  2494.     // little endian internal board values:
  2495.     uint32_t color_plate_INTERNAL_compressed_color_plate_data_offset_pointer;   // example value = 108
  2496.     uint32_t color_plate_INTERNAL_compressed_color_plate_data_random1;
  2497.     uint32_t color_plate_INTERNAL_compressed_color_plate_data_sig_id;   // example value = 0x04689D00
  2498.    
  2499.     uint32_t processed_pixel_data;
  2500.     // offset 116 = 4 bytes of 0
  2501.     // little endian internal board values:
  2502.     uint32_t processed_pixel_data_INTERNAL_processed_pixel_data_offset_pointer;   // example value = 35631
  2503.     uint32_t processed_pixel_data_INTERNAL_processed_pixel_data_random1;
  2504.     uint32_t processed_pixel_data_INTERNAL_processed_pixel_data_sig_id;   // example value = 0xF4679D00
  2505.    
  2506.     float miscellaneous_blur_filter_size;
  2507.     float miscellaneous_alpha_bias;
  2508.     uint16_t miscellaneous_mipmap_count;
  2509.    
  2510.     uint16_t more_sprite_processing_sprite_usage;
  2511.     uint16_t more_sprite_processing_sprite_spacing;
  2512.    
  2513.     // offset 146 = 2 bytes of 0
  2514.    
  2515.     // representation 1 board, offset 148
  2516.     // r1b_sequences_
  2517.     uint32_t r1b_sequences_entrycount; // maximum of 256 cells
  2518.     uint32_t r1b_sequences_random_id;
  2519.     uint32_t r1b_sequences_sig_id; // example value = 0x10679D00
  2520.    
  2521.     // representation 2 board, offset 160
  2522.     // r2b_bitmaps_
  2523.     uint32_t r2b_bitmaps_entrycount; // maximum of 2048 cells
  2524.     uint32_t r2b_bitmaps_random_id;
  2525.     uint32_t r2b_bitmaps_sig_id; // example value = 0x00669D00
  2526.    
  2527.     // offset 172 is the start of the compressed color plate data
  2528.     // directly after that is the processed pixel data (in this example case, in a8r8g8b8)
  2529.     // 172 + color_plate_compressed_color_plate_data + processed_pixel_data = offset of continued metadata
  2530.     // in this example, it's 172 + 363203, so offset 363375
  2531.    
  2532.     struct bitm_r1c {
  2533.         // representation 1 cells
  2534.         // r1c_sequences_
  2535.        
  2536.         char r1c_sequences_name[32];
  2537.         uint16_t r1c_sequences_first_bitmap_index;
  2538.         uint16_t r1c_sequences_bitmap_count;
  2539.        
  2540.         // in cell here: 16 bytes of 0
  2541.        
  2542.         // representation 1 sub-board A
  2543.         // r1sbA_sprites_
  2544.         uint32_t r1sbA_sprites_entrycount; // maximum of 64 cells
  2545.         uint32_t r1sbA_sprites_random_id;
  2546.         uint32_t r1sbA_sprites_sig_id; // example value = 0x9C669D00
  2547.        
  2548.     }r1c_sequences;
  2549.    
  2550.     struct bitm_r1scA {
  2551.         // representation 1 sub-cells A
  2552.         // r1scA_sprites_
  2553.         uint16_t r1scA_sprites_bitmap_index;
  2554.         // in cell here: 6 bytes of 0
  2555.         float r1scA_sprites_left;
  2556.         float r1scA_sprites_right;
  2557.         float r1scA_sprites_top;
  2558.         float r1scA_sprites_bottom;
  2559.         float r1scA_sprites_registration_point_x;
  2560.         float r1scA_sprites_registration_point_y;
  2561.        
  2562.     }r1scA_sequences_sprites;
  2563.    
  2564.     struct bitm_r2c {
  2565.         // representation 2 cells
  2566.         // r2c_bitmaps_
  2567.        
  2568.         char r2c_bitmaps_signature[5];   // 4 bytes only, "bitm"
  2569.         uint16_t r2c_bitmaps_width;
  2570.         uint16_t r2c_bitmaps_height;
  2571.         uint16_t r2c_bitmaps_depth;
  2572.         uint16_t r2c_bitmaps_type;
  2573.         uint16_t r2c_bitmaps_format;
  2574.         uint16_t r2c_bitmaps_flags;   // Even though the first byte is not used, Guerilla will crash if it is anything besides 0x00 (update: both bytes are used, not all flags are listed in Guerilla, only 6 shown of at least 9), toff 1274  16-bit (0x01FF ?)
  2575.         uint16_t r2c_bitmaps_registration_point_x;
  2576.         uint16_t r2c_bitmaps_registration_point_y;
  2577.         uint16_t r2c_bitmaps_mipmap_count;
  2578.        
  2579.         // the rest of the values are questionably-associated... I think they actually mean other things, but whatever.
  2580.        
  2581.         uint16_t r2c_bitmaps_INTERNAL_ihavenoidea1;   // example value = 8192
  2582.         uint32_t r2c_bitmaps_pixels_offset;
  2583.         uint32_t r2c_bitmaps_unknown1;  // pixel count
  2584.         uint32_t r2c_bitmaps_unknown2;   // this, and probably other values here also, is signed for negative number values
  2585.         uint32_t r2c_bitmaps_INTERNAL_ihavenoidea2;   // example value = -1 (0xFFFFFFFF)
  2586.        
  2587.         // in cell here: 4 bytes of 0
  2588.        
  2589.         uint32_t r2c_bitmaps_base_address;
  2590.        
  2591.        
  2592.     }r2c_bitmaps;
  2593.    
  2594. } type_meta_bitm;
  2595.  
  2596. #pragma mark -- boom
  2597.  
  2598. typedef struct {
  2599.     // this tag type is unused by the game engine (probably)
  2600.     // in this example, offset 64 = 4 bytes of 0
  2601.     // I'm going to guess that it's a float value of "radius" for the spheroid
  2602.     // Guerilla does not overwrite the value -- it is ignored like padding
  2603.     float radius;
  2604. } type_meta_boom;
  2605.  
  2606. #pragma mark -- cdmg
  2607.  
  2608. typedef struct {
  2609.     float radius_from;
  2610.     float radius_to;
  2611.     float cutoff_scale_frac;
  2612.     // offset 76 = 24 bytes of 0
  2613.     float vibrate_parameters_low_frequency_frac;
  2614.     float vibrate_parameters_high_frequency_frac;
  2615.     // offset 108 = 24 bytes of 0
  2616.     float camera_shaking_random_translation;
  2617.     float camera_shaking_random_rotation_rad;
  2618.     // offset 140 = 12 bytes of 0
  2619.     uint16_t camera_shaking_wobble_function;
  2620.     // offset 154 = 2 bytes of 0
  2621.     float camera_shaking_wobble_function_period;
  2622.     float camera_shaking_wobble_weight_frac;
  2623.     // offset 164 = 192 bytes of 0
  2624.     uint16_t damage_side_effect;
  2625.     uint16_t damage_category;
  2626.     uint32_t damage_flags;  // toff 360 32-bit 0x00001FFF
  2627.     // offset 364 = 4 bytes of 0
  2628.     float damage_damage_lower_bound;
  2629.     float damage_damage_upper_bound_from;
  2630.     float damage_damage_upper_bound_to;
  2631.     float damage_vehicle_passthrough_penalty_frac;
  2632.     // offset 384 = 4 bytes of 0
  2633.     float damage_stun_frac;
  2634.     float damage_maximum_stun_frac;
  2635.     float damage_stun_time;
  2636.     // offset 400 = 4 bytes of 0
  2637.     float damage_instantaneous_acceleration;
  2638.     // offset 408 = 8 bytes of 0
  2639.     float damage_modifiers_dirt;
  2640.     float damage_modifiers_sand;
  2641.     float damage_modifiers_stone;
  2642.     float damage_modifiers_snow;
  2643.     float damage_modifiers_wood;
  2644.     float damage_modifiers_metal_hollow;
  2645.     float damage_modifiers_metal_thin;
  2646.     float damage_modifiers_metal_thick;
  2647.     float damage_modifiers_rubber;
  2648.     float damage_modifiers_glass;
  2649.     float damage_modifiers_force_field;
  2650.     float damage_modifiers_grunt;
  2651.     float damage_modifiers_hunter_armor;
  2652.     float damage_modifiers_hunter_skin;
  2653.     float damage_modifiers_elite;
  2654.     float damage_modifiers_jackal;
  2655.     float damage_modifiers_jackal_energy_shield;
  2656.     float damage_modifiers_engineer;
  2657.     float damage_modifiers_engineer_force_field;
  2658.     float damage_modifiers_flood_combat_form;
  2659.     float damage_modifiers_flood_carrier_form;
  2660.     float damage_modifiers_cyborg;
  2661.     float damage_modifiers_cyborg_energy_shield;
  2662.     float damage_modifiers_armored_human;
  2663.     float damage_modifiers_human;
  2664.     float damage_modifiers_sentinel;
  2665.     float damage_modifiers_monitor;
  2666.     float damage_modifiers_plastic;
  2667.     float damage_modifiers_water;
  2668.     float damage_modifiers_leaves;
  2669.     float damage_modifiers_elite_energy_shield;
  2670.     float damage_modifiers_ice;
  2671.     float damage_modifiers_hunter_shield;
  2672.    
  2673.     // offset 548 = 28 bytes of 0
  2674. } type_meta_cdmg;
  2675.  
  2676. #pragma mark -- coll
  2677.  
  2678. typedef struct {
  2679.     uint32_t flags; // toff 64  32-bit 0x0000007F
  2680.     uint16_t indirect_damage_material_sel;
  2681.     // offset 70 = 2 bytes of 0
  2682.     float body_maximum_body_vitality;
  2683.     float body_body_system_shock;
  2684.     // offset 80 = 52 bytes of 0
  2685.     float body_friendly_damage_resistance_frac;
  2686.     // offset 136 = 40 bytes of 0
  2687.    
  2688.     // dependency 1: body_localized_damage_effect effe
  2689.     char body_localized_damage_effect_tagclass[5];       //unsigned char[5]
  2690.     uint32_t body_localized_damage_effect_tagnamepointer;   //uint32 ("random" number)
  2691.     uint32_t body_localized_damage_effect_tagnamestringlength;   //uint32
  2692.     uint32_t body_localized_damage_effect_tagid;         //uint32 (0xFFFFFFFF with tags)
  2693.     // char body_localized_damage_effect_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  2694.    
  2695.     float body_area_damage_effect_threshold_frac;
  2696.    
  2697.     // dependency 2: body_area_damage_effect effe
  2698.     char body_area_damage_effect_tagclass[5];        //unsigned char[5]
  2699.     uint32_t body_area_damage_effect_tagnamepointer;   //uint32 ("random" number)
  2700.     uint32_t body_area_damage_effect_tagnamestringlength;   //uint32
  2701.     uint32_t body_area_damage_effect_tagid;      //uint32 (0xFFFFFFFF with tags)
  2702.     // char body_area_damage_effect_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  2703.    
  2704.     float body_body_damaged_threshold;
  2705.    
  2706.     // dependency 3: body_body_damaged_effect effe
  2707.     char body_body_damaged_effect_tagclass[5];       //unsigned char[5]
  2708.     uint32_t body_body_damaged_effect_tagnamepointer;   //uint32 ("random" number)
  2709.     uint32_t body_body_damaged_effect_tagnamestringlength;   //uint32
  2710.     uint32_t body_body_damaged_effect_tagid;         //uint32 (0xFFFFFFFF with tags)
  2711.     // char body_body_damaged_effect_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  2712.    
  2713.     // dependency 4: body_body_depleted_effect effe
  2714.     char body_body_depleted_effect_tagclass[5];      //unsigned char[5]
  2715.     uint32_t body_body_depleted_effect_tagnamepointer;   //uint32 ("random" number)
  2716.     uint32_t body_body_depleted_effect_tagnamestringlength;   //uint32
  2717.     uint32_t body_body_depleted_effect_tagid;        //uint32 (0xFFFFFFFF with tags)
  2718.     // char body_body_depleted_effect_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  2719.    
  2720.     float body_body_destroyed_threshold;
  2721.    
  2722.     // dependency 5: body_body_destroyed_effect effe
  2723.     char body_body_destroyed_effect_tagclass[5];         //unsigned char[5]
  2724.     uint32_t body_body_destroyed_effect_tagnamepointer;   //uint32 ("random" number)
  2725.     uint32_t body_body_destroyed_effect_tagnamestringlength;   //uint32
  2726.     uint32_t body_body_destroyed_effect_tagid;       //uint32 (0xFFFFFFFF with tags)
  2727.     // char body_body_destroyed_effect_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  2728.    
  2729.     float shield_maximum_shield_vitality;
  2730.     // offset 272 = 2 bytes of 0
  2731.     uint16_t shield_shield_material_type;
  2732.     // offset 276 = 24 bytes of 0
  2733.     uint16_t shield_shield_failure_function;
  2734.     // offset 302 = 2 bytes of 0
  2735.     float shield_shield_failure_threshold_frac;
  2736.     float shield_failing_shield_leak_fraction_frac;
  2737.     // offset 312 = 16 bytes of 0
  2738.     float shield_minimum_stun_damage;
  2739.     float shield_stun_time;
  2740.     float shield_recharge_time;
  2741.     // offset 340 = 112 bytes of 0
  2742.     float shield_shield_damaged_threshold;
  2743.    
  2744.     // dependency 6: shield_shield_damaged_effect effe
  2745.     char shield_shield_damaged_effect_tagclass[5];       //unsigned char[5]
  2746.     uint32_t shield_shield_damaged_effect_tagnamepointer;   //uint32 ("random" number)
  2747.     uint32_t shield_shield_damaged_effect_tagnamestringlength;   //uint32
  2748.     uint32_t shield_shield_damaged_effect_tagid;         //uint32 (0xFFFFFFFF with tags)
  2749.     // char shield_shield_damaged_effect_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  2750.    
  2751.     // dependency 7: shield_shield_depleted_effect effe
  2752.     char shield_shield_depleted_effect_tagclass[5];      //unsigned char[5]
  2753.     uint32_t shield_shield_depleted_effect_tagnamepointer;   //uint32 ("random" number)
  2754.     uint32_t shield_shield_depleted_effect_tagnamestringlength;   //uint32
  2755.     uint32_t shield_shield_depleted_effect_tagid;        //uint32 (0xFFFFFFFF with tags)
  2756.     // char shield_shield_depleted_effect_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  2757.    
  2758.     // dependency 8: shield_shield_recharging_effect effe
  2759.     char shield_shield_recharging_effect_tagclass[5];        //unsigned char[5]
  2760.     uint32_t shield_shield_recharging_effect_tagnamepointer;   //uint32 ("random" number)
  2761.     uint32_t shield_shield_recharging_effect_tagnamestringlength;   //uint32
  2762.     uint32_t shield_shield_recharging_effect_tagid;      //uint32 (0xFFFFFFFF with tags)
  2763.     // char shield_shield_recharging_effect_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  2764.    
  2765.     // offset 504 = 124 bytes of 0
  2766.    
  2767.     // representation 1 board, offset 628
  2768.     // r1b_materials_
  2769.     uint32_t r1b_materials_entrycount; // maximum of 32 cells (note that the foot and matg classes specify 33 material types)
  2770.     uint32_t r1b_materials_random_id;
  2771.     uint32_t r1b_materials_sig_id; // example value = 0x10F19C00
  2772.    
  2773.     // representation 2 board, offset 640
  2774.     // r2b_regions_
  2775.     uint32_t r2b_regions_entrycount; // maximum of 8 cells
  2776.     uint32_t r2b_regions_random_id;
  2777.     uint32_t r2b_regions_sig_id; // example value = 0x10F29C00
  2778.    
  2779.     // representation 3 board, offset 652
  2780.     // r3b_modifiers_
  2781.     uint32_t r3b_modifiers_entrycount; // maximum of 0 cells (this is apparently unused)
  2782.     uint32_t r3b_modifiers_random_id;
  2783.     uint32_t r3b_modifiers_sig_id; // example value = 0x54F29C00
  2784.    
  2785.     // offset 664 = 16 bytes of 0
  2786.    
  2787.     float pathfinding_box_x_from;
  2788.     float pathfinding_box_x_to;
  2789.     float pathfinding_box_y_from;
  2790.     float pathfinding_box_y_to;
  2791.     float pathfinding_box_z_from;
  2792.     float pathfinding_box_z_to;
  2793.    
  2794.     // representation 4 board, offset 704
  2795.     // r4b_pathfinding_spheres_
  2796.     uint32_t r4b_pathfinding_spheres_entrycount; // maximum of 32 cells
  2797.     uint32_t r4b_pathfinding_spheres_random_id;
  2798.     uint32_t r4b_pathfinding_spheres_sig_id; // example value = 0xA8F39C00
  2799.    
  2800.     // representation 5 board, offset 716
  2801.     // r5b_nodes_
  2802.     uint32_t r5b_nodes_entrycount; // maximum of 64 cells
  2803.     uint32_t r5b_nodes_random_id;
  2804.     uint32_t r5b_nodes_sig_id; // example value = 0x30F39C00
  2805.    
  2806.     // offset 728 = dependency tag pathnames thus far, in order: 1,2,3,4,5,6,7,8
  2807.    
  2808.     struct coll_r1c {
  2809.         // representation 1 cells
  2810.         // r1c_materials_
  2811.        
  2812.         char r1c_materials_name[32];
  2813.         uint32_t r1c_materials_flags;   // toff 760 32-bit 0x00000001
  2814.         uint16_t r1c_materials_material_type;
  2815.         // in cell here: 2 bytes of 0
  2816.         float r1c_materials_shield_leak_percentage_frac;
  2817.         float r1c_materials_shield_damage_multiplier;
  2818.         // in cell here: 12 bytes of 0
  2819.         float r1c_materials_body_damage_multiplier;
  2820.         // in cell here: 8 bytes of 0
  2821.        
  2822.     }r1c_materials;
  2823.    
  2824.     struct coll_r2c {
  2825.         // representation 2 cells
  2826.         // r2c_regions_
  2827.        
  2828.         char r2c_regions_name[32];
  2829.         uint32_t r2c_regions_flags; //toff 832  32-bit 0x000003FF
  2830.         // in cell here: 4 bytes of 0
  2831.         float r2c_regions_damage_threshold;
  2832.         // in cell here: 12 bytes of 0
  2833.        
  2834.         // dependency r2c 1: r2c_regions_destroyed_effect_ effe
  2835.         char r2c_regions_destroyed_effect_tagclass[5];       //unsigned char[5]
  2836.         uint32_t r2c_regions_destroyed_effect_tagnamepointer;   //uint32 ("random" number)
  2837.         uint32_t r2c_regions_destroyed_effect_tagnamestringlength;   //uint32
  2838.         uint32_t r2c_regions_destroyed_effect_tagid;         //uint32 (0xFFFFFFFF with tags)
  2839.         // char r2c_regions_destroyed_effect_tagnamestring[255];
  2840.        
  2841.         // representation 2 sub-board A
  2842.         // r2sbA_permutations_
  2843.         uint32_t r2sbA_permutations_entrycount;   // maximum of 32 cells
  2844.         uint32_t r2sbA_permutations_random_id1;
  2845.         uint32_t r2sbA_permutations_sig_id;   // example value = 0x84F19C00
  2846.        
  2847.     }r2c_regions;
  2848.    
  2849.     // here is another case of unusual grouping, like the bipd r11sc; in the test tag, this grouping is 1041 (variable) bytes, starting at offset 3880
  2850.    
  2851.     struct coll_r2sc {
  2852.         // r2c_regions_destroyed_effect_tagnamestring here
  2853.        
  2854.         struct coll_r2scA {
  2855.             // representation 2 sub-cells A
  2856.             // r2scA_permutations_
  2857.             char r2scA_permutations_name[32];
  2858.            
  2859.         }r2scA_regions_permutations;
  2860.     }r2sc_container;
  2861.    
  2862.     // r3 is unused (test offset 12208) so we continue with r4c rather than r3c
  2863.    
  2864.     struct coll_r4c {
  2865.         // representation 4 cells
  2866.         // r4c_pathfinding_spheres_
  2867.        
  2868.         uint16_t r4c_pathfinding_spheres_node_sel;
  2869.         // in cell here: 14 bytes of 0
  2870.         float r4c_pathfinding_spheres_center_x;
  2871.         float r4c_pathfinding_spheres_center_y;
  2872.         float r4c_pathfinding_spheres_center_z;
  2873.         float r4c_pathfinding_spheres_radius;
  2874.        
  2875.     }r4c_pathfinding_spheres;
  2876.    
  2877.     struct coll_r5c {
  2878.         // representation 5 cells
  2879.         // r5c_nodes_
  2880.        
  2881.         char r5c_nodes_name[32];
  2882.         uint16_t r5c_nodes_region_sel;
  2883.         uint16_t r5c_nodes_parent_node_sel;
  2884.         uint16_t r5c_nodes_next_sibling_node_sel;
  2885.         uint16_t r5c_nodes_first_child_node_sel;
  2886.        
  2887.         // in cell here: 12 bytes of 0
  2888.        
  2889.         // representation 5 sub-board A
  2890.         // r5sbA_bsps_
  2891.         uint32_t r5sbA_bsps_entrycount;   // maximum of 32 cells
  2892.         uint32_t r5sbA_bsps_random_id1;
  2893.         uint32_t r5sbA_bsps_sig_id;   // example value = 0xA4F29C00
  2894.        
  2895.     }r5c_nodes;
  2896.    
  2897.     struct coll_r5sc {   // The r5 (nodes) sub-cells for A (bsps) is repeated, in this test tag, spanning 3380 bytes and repeated 3 times.
  2898.         // In the test tag, each contains repeat groupings as such -- where [, (, and { indicate embedded repeat groupings:
  2899.         // [{r5scA} ({r5scAsca}{r5scAscb}{r5scAscc}{r5scAscd}{r5scAsce}{r5scAscf}{r5scAscg}{r5scAsch})]
  2900.         // or
  2901.         // r5sc = [{r5scA} (r5scAsc)]
  2902.         struct coll_r5scA {
  2903.             // representation 5 sub-cells A
  2904.             // r5scA_bsps_
  2905.            
  2906.             // representation 5 sub-cells A sub-board a
  2907.             // r5scAsba_bsp3d_nodes_
  2908.             uint32_t r5scAsba_bsp3d_nodes_entrycount;   // maximum of n/a cells (MosesofEgypt's reclaimer: 131072)
  2909.             uint32_t r5scAsba_bsp3d_nodes_random_id1;
  2910.             uint32_t r5scAsba_bsp3d_nodes_sig_id;   // example value = 0x504DA100
  2911.            
  2912.             // representation 5 sub-cells A sub-board b
  2913.             // r5scAsbb_planes_
  2914.             uint32_t r5scAsbb_planes_entrycount;   // maximum of n/a cells (MosesofEgypt's reclaimer: 65535)
  2915.             uint32_t r5scAsbb_planes_random_id1;
  2916.             uint32_t r5scAsbb_planes_sig_id;   // example value = 0x944DA100
  2917.            
  2918.             // representation 5 sub-cells A sub-board c
  2919.             // r5scAsbc_leaves_
  2920.             uint32_t r5scAsbc_leaves_entrycount;   // maximum of n/a cells (MosesofEgypt's reclaimer: 65535)
  2921.             uint32_t r5scAsbc_leaves_random_id1;
  2922.             uint32_t r5scAsbc_leaves_sig_id;   // example value = 0xFC4DA100
  2923.            
  2924.             // representation 5 sub-cells A sub-board d
  2925.             // r5scAsbd_bsp2d_references_
  2926.             uint32_t r5scAsbd_bsp2d_references_entrycount;   // maximum of n/a cells (MosesofEgypt's reclaimer: )131072
  2927.             uint32_t r5scAsbd_bsp2d_references_random_id1;
  2928.             uint32_t r5scAsbd_bsp2d_references_sig_id;   // example value = 0xA84EA100
  2929.            
  2930.             // representation 5 sub-cells A sub-board e
  2931.             // r5scAsbe_bsp2d_nodes_
  2932.             uint32_t r5scAsbe_bsp2d_nodes_entrycount;   // maximum of n/a cells (MosesofEgypt's reclaimer: 65535)
  2933.             uint32_t r5scAsbe_bsp2d_nodes_random_id1;
  2934.             uint32_t r5scAsbe_bsp2d_nodes_sig_id;   // example value = 0x584EA100
  2935.            
  2936.             // representation 5 sub-cells A sub-board f
  2937.             // r5scAsbf_surfaces_
  2938.             uint32_t r5scAsbf_surfaces_entrycount;   // maximum of n/a cells (MosesofEgypt's reclaimer: 131072)
  2939.             uint32_t r5scAsbf_surfaces_random_id1;
  2940.             uint32_t r5scAsbf_surfaces_sig_id;   // example value = 0x384FA100
  2941.            
  2942.             // representation 5 sub-cells A sub-board g
  2943.             // r5scAsbg_edges_
  2944.             uint32_t r5scAsbg_edges_entrycount;   // maximum of n/a cells (MosesofEgypt's reclaimer: 262144)
  2945.             uint32_t r5scAsbg_edges_random_id1;
  2946.             uint32_t r5scAsbg_edges_sig_id;   // example value = 0xBC4FA100
  2947.            
  2948.             // representation 5 sub-cells A sub-board h
  2949.             // r5scAsbh_vertices_
  2950.             uint32_t r5scAsbh_vertices_entrycount;   // maximum of n/a cells (MosesofEgypt's reclaimer: 131072)
  2951.             uint32_t r5scAsbh_vertices_random_id1;
  2952.             uint32_t r5scAsbh_vertices_sig_id;   // example value = 0x0C50A100
  2953.            
  2954.         }r5scA_nodes_bsps;
  2955.        
  2956.         struct coll_r5scAsc {
  2957.             struct coll_r5scAsca {
  2958.                 // representation 5 sub-cells A sub-cells a
  2959.                 // r5scAsca_bsp3d_nodes_
  2960.                 uint32_t r5scAsca_bsp3d_nodes_plane;
  2961.                 uint32_t r5scAsca_bsp3d_nodes_back_child;
  2962.                 uint32_t r5scAsca_bsp3d_nodes_front_child;
  2963.                
  2964.             }r5scAsca_nodes_bsps_bsp3d_nodes;
  2965.            
  2966.             struct coll_r5scAscb {
  2967.                 // representation 5 sub-cells A sub-cells b
  2968.                 // r5scAscb_planes_
  2969.                 float r5scAscb_planes_plane_i;
  2970.                 float r5scAscb_planes_plane_j;
  2971.                 float r5scAscb_planes_plane_k;
  2972.                 float r5scAscb_planes_plane_d;
  2973.             }r5scAscb_nodes_bsps_planes;
  2974.            
  2975.             struct coll_r5scAscc {
  2976.                 // representation 5 sub-cells A sub-cells c
  2977.                 // r5scAscc_leaves_
  2978.                
  2979.                 // 1
  2980.                 uint8_t r5scAscc_leaves_flags;  //toff 1044 8-bit 0x01
  2981.                 uint16_t r5scAscc_leaves_bsp2d_reference_count;
  2982.                 uint32_t r5scAscc_leaves_first_bsp2d_reference;
  2983.             }r5scAscc_nodes_bsps_leaves;
  2984.            
  2985.             struct coll_r5scAscd {
  2986.                 // representation 5 sub-cells A sub-cells d
  2987.                 // r5scAscd_bsp2d_references_
  2988.                 uint32_t r5scAscd_bsp2d_references_plane;
  2989.                 uint32_t r5scAscd_bsp2d_references_bsp2d_node;
  2990.             }r5scAscd_nodes_bsps_bsp2d_references;
  2991.            
  2992.             struct coll_r5scAsce {
  2993.                 // representation 5 sub-cells A sub-cells e
  2994.                 // r5scAsce_bsp2d_nodes_
  2995.                 float r5scAsce_bsp2d_nodes_plane_i;
  2996.                 float r5scAsce_bsp2d_nodes_plane_j;
  2997.                 float r5scAsce_bsp2d_nodes_plane_d;
  2998.                 uint32_t r5scAsce_bsp2d_nodes_left_child;
  2999.                 uint32_t r5scAsce_bsp2d_nodes_right_child;
  3000.             }r5scAsce_nodes_bsps_bsp2d_nodes;
  3001.            
  3002.             struct coll_r5scAscf {
  3003.                 // representation 5 sub-cells A sub-cells f
  3004.                 // r5scAscf_surfaces_
  3005.                 uint32_t r5scAscf_surfaces_plane;
  3006.                 uint32_t r5scAscf_surfaces_first_edge;
  3007.                 uint8_t r5scAscf_surfaces_flags;    // toff 1060 (no test)  0x0F
  3008.                 uint8_t r5scAscf_surfaces_breakable_surface;   // -128 to 127
  3009.                 uint16_t r5scAscf_surfaces_material;   // this is supposed to be set above -1, since every surface must be assigned a material
  3010.             }r5scAscf_nodes_bsps_surfaces;
  3011.            
  3012.             struct coll_r5scAscg {
  3013.                 // representation 5 sub-cells A sub-cells g
  3014.                 // r5scAscg_edges_
  3015.                 uint32_t r5scAscg_edges_start_vertex;
  3016.                 uint32_t r5scAscg_edges_end_vertex;
  3017.                 uint32_t r5scAscg_edges_forward_edge;
  3018.                 uint32_t r5scAscg_edges_reverse_edge;
  3019.                 uint32_t r5scAscg_edges_left_surface;
  3020.                 uint32_t r5scAscg_edges_right_surface;
  3021.             }r5scAscg_nodes_bsps_edges;
  3022.            
  3023.             struct coll_r5scAsch {
  3024.                 // representation 5 sub-cells A sub-cells h
  3025.                 // r5scAsch_vertices_
  3026.                 float r5scAsch_vertices_point_x;
  3027.                 float r5scAsch_vertices_point_y;
  3028.                 float r5scAsch_vertices_point_z;
  3029.                 uint32_t r5scAsch_vertices_first_edge;
  3030.             }r5scAsch_nodes_bsps_vertices;
  3031.            
  3032.         }r5scAsc_container;
  3033.        
  3034.     }r5sc_container;
  3035. } type_meta_coll;
  3036.  
  3037. #pragma mark -- colo
  3038.  
  3039. typedef struct {
  3040.    
  3041.     // representation 1 board, offset 64
  3042.     // r1b_colors_
  3043.     uint32_t r1b_colors_entrycount; // maximum of 512 cells
  3044.     uint32_t r1b_colors_random_id;
  3045.     uint32_t r1b_colors_sig_id; // example value = 0xB4639D00
  3046.    
  3047.     struct colo_r1c {
  3048.         // representation 1 cells
  3049.         // r1c_colors_
  3050.         char r1c_colors_name[32];
  3051.         float r1c_colors_color_a_frac;
  3052.         float r1c_colors_color_r_frac;
  3053.         float r1c_colors_color_g_frac;
  3054.         float r1c_colors_color_b_frac;
  3055.     }r1c_colors;
  3056.    
  3057. } type_meta_colo;
  3058.  
  3059. #pragma mark -- cont
  3060.  
  3061. typedef struct {
  3062.     // 64, 1
  3063.     uint8_t flags;  //toff 64   8-bit 0x7F
  3064.     uint16_t scale_flags;   //toff 66   16-bit 0x03FF
  3065.    
  3066.     float point_creation_point_generation_rate;
  3067.     float point_creation_point_velocity_from;
  3068.     float point_creation_point_velocity_to;
  3069.     float point_creation_point_velocity_cone_angle_rad;
  3070.     float point_creation_inherited_velocity_fraction_frac;
  3071.     uint16_t rendering_render_type;
  3072.     // offset 90 = 2 bytes of 0
  3073.     float rendering_texture_repeats_u;
  3074.     float rendering_texture_repeats_v;
  3075.     float rendering_texture_animation_u;
  3076.     float rendering_texture_animation_v;
  3077.     float rendering_animation_rate;
  3078.    
  3079.     // dependency 1: rendering_bitmap bitm
  3080.     char rendering_bitmap_tagclass[5];       //unsigned char[5]
  3081.     uint32_t rendering_bitmap_tagnamepointer;   //uint32 ("random" number)
  3082.     uint32_t rendering_bitmap_tagnamestringlength;   //uint32
  3083.     uint32_t rendering_bitmap_tagid;         //uint32 (0xFFFFFFFF with tags)
  3084.     // char rendering_bitmap_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  3085.    
  3086.     uint16_t rendering_first_sequence_index;
  3087.     uint16_t rendering_sequence_count;
  3088.    
  3089.     // offset 132 = 104 bytes of 0
  3090.    
  3091.     // 236, 1
  3092.     uint8_t rendering_shader_flags; // toff 236 8-bit 0x07
  3093.     uint16_t rendering_framebuffer_blend_function;
  3094.     uint16_t rendering_framebuffer_fade_mode;
  3095.     // 242, 1
  3096.     uint8_t rendering_map_flags;    // toff 242 8-bit 0x01
  3097.    
  3098.     // offset 244 = 28 bytes of 0
  3099.    
  3100.     // dependency 2: secondary_map_bitmap bitm
  3101.     char secondary_map_bitmap_tagclass[5];       //unsigned char[5]
  3102.     uint32_t secondary_map_bitmap_tagnamepointer;   //uint32 ("random" number)
  3103.     uint32_t secondary_map_bitmap_tagnamestringlength;   //uint32
  3104.     uint32_t secondary_map_bitmap_tagid;         //uint32 (0xFFFFFFFF with tags)
  3105.     // char secondary_map_bitmap_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  3106.    
  3107.     uint16_t secondary_map_anchor;   // offset 288
  3108.     // 290, 1
  3109.     uint8_t secondary_map_flags;    //toff 290  8-bit 0x01
  3110.     uint16_t secondary_map_u_animation_source;
  3111.     uint16_t secondary_map_u_animation_function;
  3112.     float secondary_map_u_animation_period;
  3113.     float secondary_map_u_animation_phase;
  3114.     float secondary_map_u_animation_scale;
  3115.    
  3116.     uint16_t secondary_map_v_animation_source;
  3117.     uint16_t secondary_map_v_animation_function;
  3118.     float secondary_map_v_animation_period;
  3119.     float secondary_map_v_animation_phase;
  3120.     float secondary_map_v_animation_scale;
  3121.    
  3122.     uint16_t secondary_map_rotation_animation_source;
  3123.     uint16_t secondary_map_rotation_animation_function;
  3124.     float secondary_map_rotation_animation_period;
  3125.     float secondary_map_rotation_animation_phase;
  3126.     float secondary_map_rotation_animation_scale;
  3127.     float secondary_map_rotation_animation_center_x;
  3128.     float secondary_map_rotation_animation_center_y;
  3129.    
  3130.     // offset 348 = 4 bytes of 0
  3131.    
  3132.     float secondary_map_zsprite_radius_scale;
  3133.    
  3134.     // offset 356 = 20 bytes of 0
  3135.    
  3136.     // representation 1 board, offset 376
  3137.     // r1b_point_states_
  3138.     uint32_t r1b_point_states_entrycount; // maximum of 16 cells
  3139.     uint32_t r1b_point_states_random_id;
  3140.     uint32_t r1b_point_states_sig_id; // example value = 0xBC409D00
  3141.    
  3142.     // dependency 1 tagpathname string goes here
  3143.     // dependency 2 tagpathname string goes here
  3144.    
  3145.     struct cont_r1c {
  3146.         // representation 1 cells
  3147.         // r1c_point_states_
  3148.         float r1c_point_states_state_timing_duration_from;
  3149.         float r1c_point_states_state_timing_duration_to;
  3150.         float r1c_point_states_state_timing_transition_duration_from;
  3151.         float r1c_point_states_state_timing_transition_duration_to;
  3152.        
  3153.         // dependency 3: point_states_point_variables_physics pphy
  3154.         char point_states_point_variables_physics_tagclass[5];       //unsigned char[5]
  3155.         uint32_t point_states_point_variables_physics_tagnamepointer;   //uint32 ("random" number)
  3156.         uint32_t point_states_point_variables_physics_tagnamestringlength;   //uint32
  3157.         uint32_t point_states_point_variables_physics_tagid;         //uint32 (0xFFFFFFFF with tags)
  3158.         // char point_states_point_variables_physics_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  3159.        
  3160.         // in cell here: 32 bytes of 0
  3161.        
  3162.         float point_states_point_variables_width;
  3163.         float point_states_point_variables_color_lower_bound_a_frac;
  3164.         float point_states_point_variables_color_lower_bound_r_frac;
  3165.         float point_states_point_variables_color_lower_bound_g_frac;
  3166.         float point_states_point_variables_color_lower_bound_b_frac;
  3167.         float point_states_point_variables_color_upper_bound_a_frac;
  3168.         float point_states_point_variables_color_upper_bound_r_frac;
  3169.         float point_states_point_variables_color_upper_bound_g_frac;
  3170.         float point_states_point_variables_color_upper_bound_b_frac;
  3171.         uint32_t point_states_point_variables_scale_flags;  // toff 488 32-bit 0x0000003F
  3172.        
  3173.     }r1c_point_states;
  3174.    
  3175.     // dependency 3 tagpathname strings go here
  3176.    
  3177. } type_meta_cont;
  3178.  
  3179. #pragma mark -- ctrl
  3180.  
  3181. typedef struct {
  3182.     // OBJE 1 DATA START
  3183.     uint16_t INTERNAL_obje_index;   // 8 (little endian)
  3184.     // 66, 1
  3185.     uint8_t flags;  // toff 66  8-bit 0x0F
  3186.     float bounding_radius;
  3187.     float bounding_offset_x;
  3188.     float bounding_offset_y;
  3189.     float bounding_offset_z;
  3190.     float origin_offset_x;
  3191.     float origin_offset_y;
  3192.     float origin_offset_z;
  3193.     float acceleration_scale;
  3194.     // offset 100 = 4 bytes of 0
  3195.    
  3196.     // dependency 1: model mod2
  3197.     char model_tagclass[5];      //unsigned char[5]
  3198.     uint32_t model_tagnamepointer;   //uint32 ("random" number)
  3199.     uint32_t model_tagnamestringlength;   //uint32
  3200.     uint32_t model_tagid;        //uint32 (0xFFFFFFFF with tags)
  3201.     // char model_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  3202.    
  3203.     // dependency 2: animation graph antr
  3204.     char animation_graph_tagclass[5];        //unsigned char[5]
  3205.     uint32_t animation_graph_tagnamepointer;   //uint32 ("random" number)
  3206.     uint32_t animation_graph_tagnamestringlength;   //uint32
  3207.     uint32_t animation_graph_tagid;      //uint32 (0xFFFFFFFF with tags)
  3208.     // char animation_graph_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  3209.    
  3210.     // offset 136 = 40 bytes of 0
  3211.    
  3212.     // dependency 3: collision model coll
  3213.     char collision_model_tagclass[5];        //unsigned char[5]
  3214.     uint32_t collision_model_tagnamepointer;   //uint32 ("random" number)
  3215.     uint32_t collision_model_tagnamestringlength;   //uint32
  3216.     uint32_t collision_model_tagid;      //uint32 (0xFFFFFFFF with tags)
  3217.     // char collision_model_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  3218.    
  3219.     // dependency 4: physics phys
  3220.     char physics_tagclass[5];        //unsigned char[5]
  3221.     uint32_t physics_tagnamepointer;   //uint32 ("random" number)
  3222.     uint32_t physics_tagnamestringlength;   //uint32
  3223.     uint32_t physics_tagid;      //uint32 (0xFFFFFFFF with tags)
  3224.     // char physics_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  3225.    
  3226.     // dependency 5: modifier shader shdr senv soso schi scex sotr sgla smet spla swat
  3227.     char modifier_shader_tagclass[5];        //unsigned char[5]
  3228.     uint32_t modifier_shader_tagnamepointer;   //uint32 ("random" number)
  3229.     uint32_t modifier_shader_tagnamestringlength;   //uint32
  3230.     uint32_t modifier_shader_tagid;      //uint32 (0xFFFFFFFF with tags)
  3231.     // char modifier_shader_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  3232.    
  3233.     // dependency 6: creation effect effe
  3234.     char creation_effect_tagclass[5];        //unsigned char[5]
  3235.     uint32_t creation_effect_tagnamepointer;   //uint32 ("random" number)
  3236.     uint32_t creation_effect_tagnamestringlength;   //uint32
  3237.     uint32_t creation_effect_tagid;      //uint32 (0xFFFFFFFF with tags)
  3238.     // char creation_effect_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  3239.    
  3240.     // offset 240 = 84 bytes of 0
  3241.    
  3242.     float render_bounding_radius;
  3243.    
  3244.     uint16_t export_to_functions_a_in;
  3245.     uint16_t export_to_functions_b_in;
  3246.     uint16_t export_to_functions_c_in;
  3247.     uint16_t export_to_functions_d_in;
  3248.    
  3249.     // offset 336 = 44 bytes of 0
  3250.    
  3251.     uint16_t export_to_functions_hud_text_message_index;
  3252.     uint16_t export_to_functions_forced_shader_permutation_index;
  3253.    
  3254.     // representation 1 board, offset 384
  3255.     // r1b_attachments_
  3256.     uint32_t r1b_attachments_entrycount; // maximum of 8 cells
  3257.     uint32_t r1b_attachments_random_id;
  3258.     uint32_t r1b_attachments_sig_id; // example value = 0x08479D00
  3259.    
  3260.     // representation 2 board, offset 396
  3261.     // r2b_widgets_
  3262.     uint32_t r2b_widgets_entrycount; // maximum of 4 cells
  3263.     uint32_t r2b_widgets_random_id;
  3264.     uint32_t r2b_widgets_sig_id; // example value = 0x7C479D00
  3265.    
  3266.     // representation 3 board, offset 408
  3267.     // r3b_functions_
  3268.     uint32_t r3b_functions_entrycount; // maximum of 4 cells
  3269.     uint32_t r3b_functions_random_id;
  3270.     uint32_t r3b_functions_sig_id; // example value = 0x50469D00
  3271.    
  3272.     // representation 4 board, offset 420
  3273.     // r4b_change_colors_
  3274.     uint32_t r4b_change_colors_entrycount; // maximum of 4 cells
  3275.     uint32_t r4b_change_colors_random_id;
  3276.     uint32_t r4b_change_colors_sig_id; // example value = 0x6C489D00
  3277.    
  3278.     // representation 5 board, offset 432
  3279.     // r5b_predicted_resources_
  3280.     uint32_t r5b_predicted_resources_entrycount; // maximum of 1024 cells
  3281.     uint32_t r5b_predicted_resources_random_id;
  3282.     uint32_t r5b_predicted_resources_sig_id; // example value = 0x105FA000
  3283.    
  3284.     // OBJE 1 DATA END
  3285.    
  3286.     uint32_t device_flags;   // offset 444, toff 444    32-bit 0x00000003
  3287.     float device_power_transition_time;
  3288.     float device_power_acceleration_time;
  3289.     float device_position_transition_time;
  3290.     float device_position_acceleration_time;
  3291.     float device_depowered_position_transition_time;
  3292.     float device_depowered_position_acceleration_time;
  3293.     uint16_t device_a_in;
  3294.     uint16_t device_b_in;
  3295.     uint16_t device_c_in;
  3296.     uint16_t device_d_in;
  3297.    
  3298.     // dependency 7: open (up) effe snd!
  3299.     char device_open_up_tagclass[5];         //unsigned char[5]
  3300.     uint32_t device_open_up_tagnamepointer;   //uint32 ("random" number)
  3301.     uint32_t device_open_up_tagnamestringlength;   //uint32
  3302.     uint32_t device_open_up_tagid;       //uint32 (0xFFFFFFFF with tags)
  3303.     // char device_open_up_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  3304.    
  3305.     // dependency 8: close (down) effe snd!
  3306.     char device_close_down_tagclass[5];      //unsigned char[5]
  3307.     uint32_t device_close_down_tagnamepointer;   //uint32 ("random" number)
  3308.     uint32_t device_close_down_tagnamestringlength;   //uint32
  3309.     uint32_t device_close_down_tagid;        //uint32 (0xFFFFFFFF with tags)
  3310.     // char device_close_down_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  3311.    
  3312.     // dependency 9: opened effe snd!
  3313.     char device_opened_tagclass[5];      //unsigned char[5]
  3314.     uint32_t device_opened_tagnamepointer;   //uint32 ("random" number)
  3315.     uint32_t device_opened_tagnamestringlength;   //uint32
  3316.     uint32_t device_opened_tagid;        //uint32 (0xFFFFFFFF with tags)
  3317.     // char device_opened_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  3318.    
  3319.     // dependency 10: closed effe snd!
  3320.     char device_closed_tagclass[5];      //unsigned char[5]
  3321.     uint32_t device_closed_tagnamepointer;   //uint32 ("random" number)
  3322.     uint32_t device_closed_tagnamestringlength;   //uint32
  3323.     uint32_t device_closed_tagid;        //uint32 (0xFFFFFFFF with tags)
  3324.     // char device_closed_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  3325.    
  3326.     // dependency 11: depowered effe snd!
  3327.     char device_depowered_tagclass[5];       //unsigned char[5]
  3328.     uint32_t device_depowered_tagnamepointer;   //uint32 ("random" number)
  3329.     uint32_t device_depowered_tagnamestringlength;   //uint32
  3330.     uint32_t device_depowered_tagid;         //uint32 (0xFFFFFFFF with tags)
  3331.     // char device_depowered_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  3332.    
  3333.     // dependency 12: repowered effe snd!
  3334.     char device_repowered_tagclass[5];       //unsigned char[5]
  3335.     uint32_t device_repowered_tagnamepointer;   //uint32 ("random" number)
  3336.     uint32_t device_repowered_tagnamestringlength;   //uint32
  3337.     uint32_t device_repowered_tagid;         //uint32 (0xFFFFFFFF with tags)
  3338.     // char device_repowered_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  3339.    
  3340.     float device_delay_time;   // offset 576
  3341.     // offset 580 = 8 bytes of 0
  3342.    
  3343.     // dependency 13: delay effect effe snd!
  3344.     char device_delay_effect_tagclass[5];        //unsigned char[5]
  3345.     uint32_t device_delay_effect_tagnamepointer;   //uint32 ("random" number)
  3346.     uint32_t device_delay_effect_tagnamestringlength;   //uint32
  3347.     uint32_t device_delay_effect_tagid;      //uint32 (0xFFFFFFFF with tags)
  3348.     // char device_delay_effect_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  3349.    
  3350.     float device_automatic_activation_radius;
  3351.    
  3352.     // offset 608 = 112 bytes of 0
  3353.    
  3354.     uint16_t control_type;   // offset 720
  3355.     uint16_t control_triggers_when;
  3356.     float control_call_value_frac;   // this is unenforced by Guerilla, like many other values intended to be used as fractional of 1.
  3357.    
  3358.     // offset 728 = 80 bytes of 0
  3359.    
  3360.     // dependency 14: on effe snd!
  3361.     char control_on_tagclass[5];         //unsigned char[5]
  3362.     uint32_t control_on_tagnamepointer;   //uint32 ("random" number)
  3363.     uint32_t control_on_tagnamestringlength;   //uint32
  3364.     uint32_t control_on_tagid;       //uint32 (0xFFFFFFFF with tags)
  3365.     // char control_on_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  3366.    
  3367.     // dependency 15: off effe snd!
  3368.     char control_off_tagclass[5];        //unsigned char[5]
  3369.     uint32_t control_off_tagnamepointer;   //uint32 ("random" number)
  3370.     uint32_t control_off_tagnamestringlength;   //uint32
  3371.     uint32_t control_off_tagid;      //uint32 (0xFFFFFFFF with tags)
  3372.     // char control_off_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  3373.    
  3374.     // dependency 16: deny effe snd!
  3375.     char control_deny_tagclass[5];       //unsigned char[5]
  3376.     uint32_t control_deny_tagnamepointer;   //uint32 ("random" number)
  3377.     uint32_t control_deny_tagnamestringlength;   //uint32
  3378.     uint32_t control_deny_tagid;         //uint32 (0xFFFFFFFF with tags)
  3379.     // char control_deny_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  3380.    
  3381.     // dependencies 1-6 tagpathname strings go here
  3382.    
  3383.     // OBJE DATA 2 START
  3384.    
  3385.     struct ctrl_r1c {
  3386.         // representation 1 cells
  3387.         // r1c_attachments_
  3388.        
  3389.         // dependency r1c 1: r1c_attachments_type_ cont effe ligh mgs2 pctl lsnd
  3390.         char r1c_attachments_type_tagclass[5];       //unsigned char[5]
  3391.         uint32_t r1c_attachments_type_tagnamepointer;   //uint32 ("random" number)
  3392.         uint32_t r1c_attachments_type_tagnamestringlength;   //uint32
  3393.         uint32_t r1c_attachments_type_tagid;         //uint32 (0xFFFFFFFF with tags)
  3394.         // char r1c_attachments_type_tagnamestring[255];
  3395.        
  3396.         char r1c_attachments_marker[32];
  3397.         uint16_t r1c_attachments_primary_scale;
  3398.         uint16_t r1c_attachments_secondary_scale;
  3399.         uint16_t r1c_attachments_change_color;
  3400.        
  3401.         // in cell here: 18 bytes of 0
  3402.        
  3403.     }r1c_attachments;
  3404.    
  3405.     // r1c 1 tag name strings here
  3406.    
  3407.     struct ctrl_r2c {
  3408.         // representation 2 cells
  3409.         // r2c_widgets_
  3410.        
  3411.         // dependency r2c 1: r2c_widgets_reference_ ant! flag glw! mgs2 elec
  3412.         char r2c_widgets_reference_tagclass[5];      //unsigned char[5]
  3413.         uint32_t r2c_widgets_reference_tagnamepointer;   //uint32 ("random" number)
  3414.         uint32_t r2c_widgets_reference_tagnamestringlength;   //uint32
  3415.         uint32_t r2c_widgets_reference_tagid;        //uint32 (0xFFFFFFFF with tags)
  3416.         // char r2c_widgets_reference_tagnamestring[255];
  3417.        
  3418.         // in cell here: 16 bytes of 0
  3419.     }r2c_widgets;
  3420.    
  3421.     // r2c 1 tag name strings here
  3422.    
  3423.     struct ctrl_r3c {
  3424.         // representation 3 cells
  3425.         // r3c_functions_
  3426.        
  3427.         uint32_t r3c_functions_flags;   // toff 856 32-bit 0x00000007
  3428.         float r3c_functions_period;
  3429.         uint16_t r3c_functions_scale_period_by;
  3430.         uint16_t r3c_functions_function;
  3431.         uint16_t r3c_functions_scale_function_by;
  3432.         uint16_t r3c_functions_wobble_function;
  3433.         float r3c_functions_wobble_period;
  3434.         float r3c_functions_wobble_magnitude;
  3435.         float r3c_functions_square_wave_threshold_frac;
  3436.         uint16_t r3c_functions_step_count;
  3437.         uint16_t r3c_functions_map_to;
  3438.         uint16_t r3c_functions_sawtooth_count;
  3439.         uint16_t r3c_functions_add;
  3440.         uint16_t r3c_functions_scale_result_by;
  3441.         uint16_t r3c_functions_bounds_mode;
  3442.         float r3c_functions_bounds_from_frac;
  3443.         float r3c_functions_bounds_to_frac;
  3444.         // in cell here: 6 bytes of 0
  3445.         uint16_t r3c_functions_turn_off_with_sel;
  3446.         float r3c_functions_scale_by;
  3447.         // in cell here: 268 bytes of 0 (reminiscent of the pre-padding of other times strings come after cells)
  3448.         char r3c_functions_usage[32];
  3449.        
  3450.     }r3c_functions;
  3451.    
  3452.     struct ctrl_r4c {
  3453.         // representation 4 cells
  3454.         // r4c_change_colors_
  3455.         uint16_t r4c_change_colors_darken_by;
  3456.         uint16_t r4c_change_colors_scale_by;
  3457.         uint32_t r4c_change_colors_scale_flags; // toff 1220    32-bit 0x00000003
  3458.         float r4c_change_colors_color_lower_bound_r_frac;
  3459.         float r4c_change_colors_color_lower_bound_g_frac;
  3460.         float r4c_change_colors_color_lower_bound_b_frac;
  3461.         float r4c_change_colors_color_upper_bound_r_frac;
  3462.         float r4c_change_colors_color_upper_bound_g_frac;
  3463.         float r4c_change_colors_color_upper_bound_b_frac;
  3464.        
  3465.         // representation 4 sub-board A
  3466.         // r4sbA_permutations_
  3467.         uint32_t r4sbA_permutations_entrycount;   // maximum of 8 cells
  3468.         uint32_t r4sbA_permutations_random_id1;
  3469.         uint32_t r4sbA_permutations_sig_id;   // example value = 0xD8479D00
  3470.     }r4c_change_colors;
  3471.    
  3472.     struct ctrl_r4scA
  3473.     {
  3474.         // representation 4 sub-cells A
  3475.         // r4scA_permutations_
  3476.         float r4scA_permutations_weight_frac;
  3477.         float r4scA_permutations_color_lower_bound_r_frac;
  3478.         float r4scA_permutations_color_lower_bound_g_frac;
  3479.         float r4scA_permutations_color_lower_bound_b_frac;
  3480.         float r4scA_permutations_color_upper_bound_r_frac;
  3481.         float r4scA_permutations_color_upper_bound_g_frac;
  3482.         float r4scA_permutations_color_upper_bound_b_frac;
  3483.     }r4sc_change_colors_permutations;
  3484.    
  3485.     struct ctrl_r5c {
  3486.         // representation 5 cells
  3487.         // r5c_predicted_resources_
  3488.         uint16_t r5c_predicted_resources_type;
  3489.         uint16_t r5c_predicted_resources_resource_index;
  3490.         uint32_t r5c_predicted_resources_tag_index;
  3491.     }r5c_predicted_resources;
  3492.    
  3493.     // OBJE DATA 2 END
  3494.    
  3495.     // dependencies 7-16 tagpathname strings go here
  3496.    
  3497. } type_meta_ctrl;
  3498.  
  3499. #pragma mark -- deca
  3500.  
  3501. typedef struct {
  3502.     uint16_t decal_flags;   //toff 64 (all bytes used)  0x01FF
  3503.     uint16_t decal_type;
  3504.     uint16_t decal_layer;
  3505.     // offset 70 = 2 bytes of 0
  3506.    
  3507.     // dependency 1: next decal in chain deca
  3508.     char decal_next_decal_in_chain_tagclass[5];      //unsigned char[5]
  3509.     uint32_t decal_next_decal_in_chain_tagnamepointer;   //uint32 ("random" number)
  3510.     uint32_t decal_next_decal_in_chain_tagnamestringlength;   //uint32
  3511.     uint32_t decal_next_decal_in_chain_tagid;        //uint32 (0xFFFFFFFF with tags)
  3512.     // char decal_next_decal_in_chain_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  3513.    
  3514.     float radius_and_color_radius_from;
  3515.     float radius_and_color_radius_to;
  3516.     // offset 96 = 12 bytes of 0
  3517.     float radius_and_color_intensity_from_frac;
  3518.     float radius_and_color_intensity_to_frac;
  3519.     float radius_and_color_color_lower_bounds_r_frac;
  3520.     float radius_and_color_color_lower_bounds_g_frac;
  3521.     float radius_and_color_color_lower_bounds_b_frac;
  3522.     float radius_and_color_color_upper_bounds_r_frac;
  3523.     float radius_and_color_color_upper_bounds_g_frac;
  3524.     float radius_and_color_color_upper_bounds_b_frac;
  3525.     // offset 140 = 12 bytes of 0
  3526.     uint16_t animation_animation_loop_frame;
  3527.     uint16_t animation_animation_speed;   // 1 to 120
  3528.     // offset 156 = 28 bytes of 0
  3529.     float animation_lifetime_from;
  3530.     float animation_lifetime_to;
  3531.     float animation_decay_time_from;
  3532.     float animation_decay_time_to;
  3533.     // offset 200 = 56 bytes of 0
  3534.     uint16_t shader_framebuffer_blend_function;   // offset 256
  3535.     // offset 258 = 22 bytes of 0
  3536.    
  3537.     // dependency 2: shader map bitm
  3538.     char shader_map_tagclass[5];         //unsigned char[5]
  3539.     uint32_t shader_map_tagnamepointer;   //uint32 ("random" number)
  3540.     uint32_t shader_map_tagnamestringlength;   //uint32
  3541.     uint32_t shader_map_tagid;       //uint32 (0xFFFFFFFF with tags)
  3542.     // char shader_map_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  3543.    
  3544.     // offset 296 = 20 bytes of 0
  3545.    
  3546.     float sprite_info_maximum_sprite_extent_fixed16;   // "fixed" value, meaning that no matter what value is actually specified here, Guerilla will only show a value of 16 here; you can save any value here, but it will only ever be displayed as a value of 16 in the window; it seems that 16 is the only acceptable value therefore (but this is not enforced with an error message). (offset 316)
  3547.    
  3548.     // offset 320 = 12 bytes of 0
  3549.    
  3550.     // dependency tagpathname strings go here
  3551.    
  3552. } type_meta_deca;
  3553.  
  3554. #pragma mark -- DeLa
  3555.  
  3556. typedef struct {
  3557.     uint16_t widget_type;
  3558.     uint16_t controller_index;
  3559.     char name[32];
  3560.     uint16_t bounds_top;
  3561.     uint16_t bounds_left;
  3562.     uint16_t bounds_bottom;
  3563.     uint16_t bounds_right;
  3564.     uint32_t flags; // toff 108 32-bit 0x0000FFFF
  3565.     uint32_t milliseconds_to_auto_close;
  3566.     uint32_t milliseconds_auto_close_fade_time;
  3567.    
  3568.     // dependency 1: background bitmap bitm
  3569.     char background_bitmap_tagclass[5];      //unsigned char[5]
  3570.     uint32_t background_bitmap_tagnamepointer;   //uint32 ("random" number)
  3571.     uint32_t background_bitmap_tagnamestringlength;   //uint32
  3572.     uint32_t background_bitmap_tagid;        //uint32 (0xFFFFFFFF with tags)
  3573.     // char background_bitmap_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  3574.    
  3575.     // representation 1 board, offset 136
  3576.     // r1b_game_data_inputs_
  3577.     uint32_t r1b_game_data_inputs_entrycount; // maximum of 64 cells
  3578.     uint32_t r1b_game_data_inputs_random_id;
  3579.     uint32_t r1b_game_data_inputs_sig_id; // example value = 0xF0239C00
  3580.    
  3581.     // representation 2 board, offset 148
  3582.     // r2b_event_handlers_
  3583.     uint32_t r2b_event_handlers_entrycount; // maximum of 32 cells
  3584.     uint32_t r2b_event_handlers_random_id;
  3585.     uint32_t r2b_event_handlers_sig_id; // example value = 0xAC249C00
  3586.    
  3587.     // representation 3 board, offset 160
  3588.     // r3b_search_and_replace_functions_
  3589.     uint32_t r3b_search_and_replace_functions_entrycount; // maximum of 32 cells
  3590.     uint32_t r3b_search_and_replace_functions_random_id;
  3591.     uint32_t r3b_search_and_replace_functions_sig_id; // example value = 0x18269C00
  3592.    
  3593.     // offset 172 = 128 bytes of 0
  3594.    
  3595.     // dependency 2: text label unicode strings list ustr
  3596.     char text_box_text_label_unicode_strings_list_tagclass[5];       //unsigned char[5]
  3597.     uint32_t text_box_text_label_unicode_strings_list_tagnamepointer;   //uint32 ("random" number)
  3598.     uint32_t text_box_text_label_unicode_strings_list_tagnamestringlength;   //uint32
  3599.     uint32_t text_box_text_label_unicode_strings_list_tagid;         //uint32 (0xFFFFFFFF with tags)
  3600.     // char text_box_text_label_unicode_strings_list_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  3601.    
  3602.     // dependency 3: text font font
  3603.     char text_box_text_font_tagclass[5];         //unsigned char[5]
  3604.     uint32_t text_box_text_font_tagnamepointer;   //uint32 ("random" number)
  3605.     uint32_t text_box_text_font_tagnamestringlength;   //uint32
  3606.     uint32_t text_box_text_font_tagid;       //uint32 (0xFFFFFFFF with tags)
  3607.     // char text_box_text_font_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  3608.    
  3609.     float text_box_text_color_a_frac;
  3610.     float text_box_text_color_r_frac;
  3611.     float text_box_text_color_g_frac;
  3612.     float text_box_text_color_b_frac;
  3613.    
  3614.     uint16_t text_box_justification;
  3615.     uint32_t text_box_flags;    //toff 350  32-bit 0x0000000F
  3616.     // offset 354 = 12 bytes of 0
  3617.     uint16_t more_text_box_parameters_string_list_index;   // offset 366
  3618.     uint16_t more_text_box_parameters_horizontal_offset;
  3619.     uint16_t more_text_box_parameters_vertical_offset;
  3620.    
  3621.     // offset 372 = 28 bytes of 0
  3622.    
  3623.     uint32_t list_items_flags;  //toff 400  32-bit 0x0000000F
  3624.    
  3625.     // dependency 4: list header bitmap bitm
  3626.     char spinner_list_list_header_bitmap_tagclass[5];        //unsigned char[5]
  3627.     uint32_t spinner_list_list_header_bitmap_tagnamepointer;   //uint32 ("random" number)
  3628.     uint32_t spinner_list_list_header_bitmap_tagnamestringlength;   //uint32
  3629.     uint32_t spinner_list_list_header_bitmap_tagid;      //uint32 (0xFFFFFFFF with tags)
  3630.     // char spinner_list_list_header_bitmap_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  3631.    
  3632.     // dependency 5: list footer bitmap bitm
  3633.     char spinner_list_list_footer_bitmap_tagclass[5];        //unsigned char[5]
  3634.     uint32_t spinner_list_list_footer_bitmap_tagnamepointer;   //uint32 ("random" number)
  3635.     uint32_t spinner_list_list_footer_bitmap_tagnamestringlength;   //uint32
  3636.     uint32_t spinner_list_list_footer_bitmap_tagid;      //uint32 (0xFFFFFFFF with tags)
  3637.     // char spinner_list_list_footer_bitmap_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  3638.    
  3639.     uint16_t spinner_list_header_bounds_top;
  3640.     uint16_t spinner_list_header_bounds_left;
  3641.     uint16_t spinner_list_header_bounds_bottom;
  3642.     uint16_t spinner_list_header_bounds_right;
  3643.     uint16_t spinner_list_footer_bounds_top;
  3644.     uint16_t spinner_list_footer_bounds_left;
  3645.     uint16_t spinner_list_footer_bounds_bottom;
  3646.     uint16_t spinner_list_footer_bounds_right;
  3647.    
  3648.     // offset 452 = 32 bytes of 0
  3649.    
  3650.     // dependency 6: extended description widget DeLa
  3651.     char column_list_extended_description_widget_tagclass[5];        //unsigned char[5]
  3652.     uint32_t column_list_extended_description_widget_tagnamepointer;   //uint32 ("random" number)
  3653.     uint32_t column_list_extended_description_widget_tagnamestringlength;   //uint32
  3654.     uint32_t column_list_extended_description_widget_tagid;      //uint32 (0xFFFFFFFF with tags)
  3655.     // char column_list_extended_description_widget_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  3656.    
  3657.     // offset 500 = 288 bytes of 0
  3658.    
  3659.     // representation 4 board, offset 788
  3660.     // r4b_conditional_widgets_
  3661.     uint32_t r4b_conditional_widgets_entrycount; // maximum of 32 cells
  3662.     uint32_t r4b_conditional_widgets_random_id;
  3663.     uint32_t r4b_conditional_widgets_sig_id; // example value = 0x30259C00
  3664.    
  3665.     // offset 800 = 256 bytes of 0
  3666.    
  3667.     // representation 5 board, offset 1056
  3668.     // r5b_child_widgets_
  3669.     uint32_t r5b_child_widgets_entrycount; // maximum of 32 cells
  3670.     uint32_t r5b_child_widgets_random_id;
  3671.     uint32_t r5b_child_widgets_sig_id; // example value = 0xC8259C00
  3672.    
  3673.     // dependency 1 tagpathname string goes here
  3674.    
  3675.     struct dela_r1c {
  3676.         // representation 1 cells
  3677.         // r1c_game_data_inputs_
  3678.         uint16_t r1c_game_data_inputs_function;
  3679.         // in cell here: 34 bytes of 0
  3680.     }r1c_game_data_inputs;
  3681.    
  3682.     struct dela_r2c {
  3683.         // representation 2 cells
  3684.         // r2c_event_handlers_
  3685.         uint32_t r2c_event_handlers_flags;  // toff 1068    32-bit 0x00000BFF
  3686.         uint16_t r2c_event_handlers_event_type;
  3687.         uint16_t r2c_event_handlers_function;
  3688.        
  3689.         // dependency r2c 1: widget tag DeLa
  3690.         char r2c1_widget_tag_tagclass[5];        //unsigned char[5]
  3691.         uint32_t r2c1_widget_tag_tagnamepointer;   //uint32 ("random" number)
  3692.         uint32_t r2c1_widget_tag_tagnamestringlength;   //uint32
  3693.         uint32_t r2c1_widget_tag_tagid;      //uint32 (0xFFFFFFFF with tags)
  3694.         // char r2c1_widget_tag_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  3695.        
  3696.         // dependency r2c 2: sound effect snd!
  3697.         char r2c2_sound_effect_tagclass[5];      //unsigned char[5]
  3698.         uint32_t r2c2_sound_effect_tagnamepointer;   //uint32 ("random" number)
  3699.         uint32_t r2c2_sound_effect_tagnamestringlength;   //uint32
  3700.         uint32_t r2c2_sound_effect_tagid;        //uint32 (0xFFFFFFFF with tags)
  3701.         // char r2c2_sound_effect_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  3702.        
  3703.         char r2c_event_handlers_script[32];
  3704.        
  3705.     }r2c_event_handlers;
  3706.    
  3707.     // sets of r2c1 and r2c2 dependency tagpathname strings go here, grouped as {r2c1 r2c2}, repeated like a struct (but I'm not going to code it here since the strings are of variable lengths)
  3708.    
  3709.     struct dela_r3c {
  3710.         // representation 3 cells
  3711.         // r3c_search_and_replace_functions_
  3712.        
  3713.         char r3c_search_and_replace_functions_search_string[32];
  3714.         uint16_t r3c_search_and_replace_functions_replace_function;
  3715.        
  3716.     }r3c_search_and_replace_functions;
  3717.    
  3718.     // dependencies 2-6 tagpathname strings go here
  3719.    
  3720.     struct dela_r4c {
  3721.         // representation 4 cells
  3722.         // r4c_conditional_widgets_
  3723.        
  3724.         // dependency r4c 1: widget tag DeLa
  3725.         char r4c1_widget_tag_tagclass[5];        //unsigned char[5]
  3726.         uint32_t r4c1_widget_tag_tagnamepointer;   //uint32 ("random" number)
  3727.         uint32_t r4c1_widget_tag_tagnamestringlength;   //uint32
  3728.         uint32_t r4c1_widget_tag_tagid;      //uint32 (0xFFFFFFFF with tags)
  3729.         // char r4c1_widget_tag_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  3730.        
  3731.         char r4c_conditional_widgets_name_unused[32];
  3732.         uint32_t r4c_conditional_widgets_flags; // toff 1188    32-bit 0x00000001
  3733.         uint16_t r4c_conditional_widgets_custom_controller_index_unused;
  3734.        
  3735.         // in cell here: 26 bytes of 0
  3736.        
  3737.     }r4c_conditional_widgets;
  3738.    
  3739.     // r4c1 dependency tagpathname strings go here
  3740.    
  3741.     struct dela_r5c {
  3742.         // representation 5 cells
  3743.         // r5c_child_widgets_
  3744.        
  3745.         // dependency r5c 1: widget tag DeLa
  3746.         char r5c1_widget_tag_tagclass[5];        //unsigned char[5]
  3747.         uint32_t r5c1_widget_tag_tagnamepointer;   //uint32 ("random" number)
  3748.         uint32_t r5c1_widget_tag_tagnamestringlength;   //uint32
  3749.         uint32_t r5c1_widget_tag_tagid;      //uint32 (0xFFFFFFFF with tags)
  3750.         // char r5c1_widget_tag_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  3751.        
  3752.         char r5c_child_widgets_name_unused[32];
  3753.         uint32_t r5c_child_widgets_flags;   // toff 1268    32-bit 0x00000001
  3754.         uint16_t r5c_child_widgets_custom_controller_index;
  3755.         uint16_t r5c_child_widgets_vertical_offset;
  3756.         uint16_t r5c_child_widgets_horizontal_offset;
  3757.        
  3758.         // in cell here: 22 bytes of 0
  3759.        
  3760.     }r5c_child_widgets;
  3761.    
  3762.     // r5c1 dependency tagpathname strings go here
  3763.    
  3764. } type_meta_dela;
  3765.  
  3766. #pragma mark -- devc
  3767.  
  3768. typedef struct {
  3769.     uint16_t device_type;
  3770.     // 66, 1
  3771.     uint8_t flags;  // toff 66  8-bit 0x01
  3772.    
  3773.     uint32_t device_id;   // 16
  3774.     // offset 72 = 4 bytes of 0
  3775.     // little endian internal board values:
  3776.     uint32_t INTERNAL_device_id_offset_pointer;   // example value = 44 (for mt sparky tag)
  3777.     uint32_t INTERNAL_device_id_random1;
  3778.     uint32_t INTERNAL_device_id_sig_id;   // example value = 0x88999B00
  3779.    
  3780.     uint32_t profile;   // 8188 (the file data size of .sav "Halo Savegames" type profiles)
  3781.     // offset 92 = 4 bytes of 0
  3782.     // little endian internal board values:
  3783.     uint32_t INTERNAL_profile_offset_pointer;   // example value = 44 (for mt sparky tag, which is wrong), or 60 (for sparky tag, which is right)
  3784.     uint32_t INTERNAL_profile_random1;
  3785.     uint32_t INTERNAL_profile_sig_id;   // example value = 0x98999B00
  3786.    
  3787.     // offset 108 is the start of the device id data (which apparently is always going to be 16 bytes)
  3788.     // directly after that is the profile data, which is the data from the Halo Savegame .sav profile file that is loaded into the tag (so include a button to load the information and display the information...)
  3789.    
  3790.     // (include all values for .sav profile's device id here)
  3791.    
  3792.     // device id data:
  3793.    
  3794.     float DI_1;
  3795.     float DI_2;
  3796.     // little endian internal values:
  3797.     uint16_t DI_INTERNAL_1;   // example value = 27521
  3798.     uint16_t DI_INTERNAL_2;   // example value = 27493
  3799.     uint16_t DI_INTERNAL_3;   // example value = 26502
  3800.     uint16_t DI_INTERNAL_4;   // example value = 29653
  3801.    
  3802.     // (include all values for .sav profile here)
  3803.     // note that values in the .sav data are mostly in little endian
  3804.    
  3805.     // the first 302 bytes of the .sav file are zeroed (ignored, basically) in the "Sparky" test file, but there was at least the profile name in the start of the "[MT] Sparky" test file
  3806.     // the rest of the data is modified from what was in the .sav file, with the exception of most of the key binding settings; the last float value in the .sav file is not included in the data; in the Sparky test file, the end of the .sav file is a float value of 0.0988519 at offset 8188, but the data in the devc tag only has 8188 bytes, so it stops short of transferring that value
  3807.    
  3808. } type_meta_devc;
  3809.  
  3810. #pragma mark -- devi
  3811.  
  3812. typedef struct {
  3813.     // Guerilla misreads the first four bytes as 0x0000FFFF
  3814.     // this is actually a single 32-bit flags value, but only data for a 16-bit value with inverted bits is stored (meaning in the last two bytes)
  3815.     // so when interpreting the value, the default is 0x0000FFFF with all fields checked and unchecking a field subtracts by its amount
  3816.     //uint16_t INTERNAL_optimization;   // 0; this is probably some sort of mistake, but these first two bytes are written as 0
  3817.     uint32_t device_flags;   // only the first two bits are written, so both flag values set to off yields 0xFFFC (all 1's except the first two bits), toff 66 (untested, obvious)  0xFFFF
  3818.     float device_power_transition_time;
  3819.     float device_power_acceleration_time;
  3820.     float device_position_transition_time;
  3821.     float device_position_acceleration_time;
  3822.     float device_depowered_position_transition_time;
  3823.     float device_depowered_position_acceleration_time;
  3824.     uint16_t device_a_in;
  3825.     uint16_t device_b_in;
  3826.     uint16_t device_c_in;
  3827.     uint16_t device_d_in;
  3828.    
  3829.     // dependency 1: open (up) effe snd!
  3830.     char device_open_up_tagclass[5];         //unsigned char[5]   NOTE: Guerilla misreads offset 100, interpreting it as 0xFFFFFFFF
  3831.     uint32_t device_open_up_tagnamepointer;   //uint32 ("random" number)
  3832.     uint32_t device_open_up_tagnamestringlength;   //uint32
  3833.     uint32_t device_open_up_tagid;       //uint32 (0xFFFFFFFF with tags)
  3834.     // char device_open_up_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  3835.    
  3836.     // dependency 2: close (down) effe snd!
  3837.     char device_close_down_tagclass[5];      //unsigned char[5]
  3838.     uint32_t device_close_down_tagnamepointer;   //uint32 ("random" number)
  3839.     uint32_t device_close_down_tagnamestringlength;   //uint32
  3840.     uint32_t device_close_down_tagid;        //uint32 (0xFFFFFFFF with tags)
  3841.     // char device_close_down_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  3842.    
  3843.     // dependency 3: opened effe snd!
  3844.     char device_opened_tagclass[5];      //unsigned char[5]
  3845.     uint32_t device_opened_tagnamepointer;   //uint32 ("random" number)
  3846.     uint32_t device_opened_tagnamestringlength;   //uint32
  3847.     uint32_t device_opened_tagid;        //uint32 (0xFFFFFFFF with tags)
  3848.     // char device_opened_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  3849.    
  3850.     // dependency 4: closed effe snd!
  3851.     char device_closed_tagclass[5];      //unsigned char[5]
  3852.     uint32_t device_closed_tagnamepointer;   //uint32 ("random" number)
  3853.     uint32_t device_closed_tagnamestringlength;   //uint32
  3854.     uint32_t device_closed_tagid;        //uint32 (0xFFFFFFFF with tags)
  3855.     // char device_closed_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  3856.    
  3857.     // dependency 5: depowered effe snd!
  3858.     char device_depowered_tagclass[5];       //unsigned char[5]
  3859.     uint32_t device_depowered_tagnamepointer;   //uint32 ("random" number)
  3860.     uint32_t device_depowered_tagnamestringlength;   //uint32
  3861.     uint32_t device_depowered_tagid;         //uint32 (0xFFFFFFFF with tags)
  3862.     // char device_depowered_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  3863.    
  3864.     // dependency 6: repowered effe snd!
  3865.     char device_repowered_tagclass[5];       //unsigned char[5]
  3866.     uint32_t device_repowered_tagnamepointer;   //uint32 ("random" number)
  3867.     uint32_t device_repowered_tagnamestringlength;   //uint32
  3868.     uint32_t device_repowered_tagid;         //uint32 (0xFFFFFFFF with tags)
  3869.     // char device_repowered_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  3870.    
  3871.     float device_delay_time;   // offset 196
  3872.     // offset 200 = 8 bytes of 0
  3873.    
  3874.     // dependency 7: delay effect effe snd!
  3875.     char device_delay_effect_tagclass[5];        //unsigned char[5]
  3876.     uint32_t device_delay_effect_tagnamepointer;   //uint32 ("random" number)
  3877.     uint32_t device_delay_effect_tagnamestringlength;   //uint32
  3878.     uint32_t device_delay_effect_tagid;      //uint32 (0xFFFFFFFF with tags)
  3879.     // char device_delay_effect_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  3880.    
  3881.     float device_automatic_activation_radius;
  3882.    
  3883.     // offset 228 = 112 bytes of 0
  3884.    
  3885.     // dependency tagpathname strings go here
  3886.    
  3887. } type_meta_devi;
  3888.  
  3889. #pragma mark -- dobc
  3890.  
  3891. typedef struct {
  3892.     uint16_t collection_type;
  3893.     // offset 66 = 2 bytes of 0
  3894.     float global_z_offset;
  3895.     // offset 72 = 44 bytes of 0
  3896.    
  3897.     // dependency 1: sprite plate bitm
  3898.     char sprite_plate_tagclass[5];       //unsigned char[5]
  3899.     uint32_t sprite_plate_tagnamepointer;   //uint32 ("random" number)
  3900.     uint32_t sprite_plate_tagnamestringlength;   //uint32
  3901.     uint32_t sprite_plate_tagid;         //uint32 (0xFFFFFFFF with tags)
  3902.     // char sprite_plate_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  3903.    
  3904.     // representation 1 board, offset 132
  3905.     // r1b_types_
  3906.     uint32_t r1b_types_entrycount; // maximum of 16 cells
  3907.     uint32_t r1b_types_random_id;
  3908.     uint32_t r1b_types_sig_id; // example value = 0x6C2D9C00
  3909.    
  3910.     // offset 144 = 48 bytes of 0
  3911.    
  3912.     // dependency 1 tagpathname string goes here
  3913.    
  3914.     struct dobc_r1c {
  3915.         // representation 1 cells
  3916.         // r1c_types_
  3917.         char r1c_types_name[32];
  3918.         uint8_t r1c_types_sequence_index;   // -128 to 127
  3919.         uint8_t r1c_types_type_flags;   // toff 225 (untested)  0x0F
  3920.         // in cell here: 2 bytes of 0
  3921.         float r1c_types_color_override_factor_frac;
  3922.         // in cell here: 8 bytes of 0
  3923.         float r1c_types_near_fade_distance;
  3924.         float r1c_types_far_fade_distance;
  3925.         float r1c_types_size;
  3926.         // in cell here: 4 bytes of 0
  3927.         float r1c_types_minimum_color_r_frac;
  3928.         float r1c_types_minimum_color_g_frac;
  3929.         float r1c_types_minimum_color_b_frac;
  3930.         float r1c_types_maximum_color_r_frac;
  3931.         float r1c_types_maximum_color_g_frac;
  3932.         float r1c_types_maximum_color_b_frac;
  3933.         uint8_t r1c_types_ambient_color_a;
  3934.         uint8_t r1c_types_ambient_color_r;
  3935.         uint8_t r1c_types_ambient_color_g;
  3936.         uint8_t r1c_types_ambient_color_b;
  3937.         // in cell here: 4 bytes of 0
  3938.        
  3939.     }r1c_types;
  3940.    
  3941. } type_meta_dobc;
  3942.  
  3943. #pragma mark -- effe
  3944.  
  3945. typedef struct {
  3946.     uint32_t flags; // toff 64  32-bit 0x00000003
  3947.     uint16_t loop_start_event_sel;
  3948.     uint16_t loop_stop_event_sel;
  3949.     // offset 72 = 32 bytes of 0
  3950.    
  3951.     // representation 1 board, offset 104
  3952.     // r1b_locations_
  3953.     uint32_t r1b_locations_entrycount; // maximum of 32 cells
  3954.     uint32_t r1b_locations_random_id;
  3955.     uint32_t r1b_locations_sig_id; // example value = 0x98309D00
  3956.    
  3957.     // representation 2 board, offset 116
  3958.     // r2b_events_
  3959.     uint32_t r2b_events_entrycount; // maximum of 32 cells
  3960.     uint32_t r2b_events_random_id;
  3961.     uint32_t r2b_events_sig_id; // example value = 0x58349D00
  3962.    
  3963.     struct effe_r1c {
  3964.         // representation 1 cells
  3965.         // r1c_locations_
  3966.        
  3967.         char r1c_locations_marker_name[32];
  3968.        
  3969.     }r1c_locations;
  3970.    
  3971.     struct effe_r2c {
  3972.         // representation 2 cells
  3973.         // r2c_events_
  3974.         // 68
  3975.        
  3976.         // in cell here: 4 bytes of 0
  3977.         float r2c_events_skip_fraction_frac;
  3978.         float r2c_events_delay_bounds_from;
  3979.         float r2c_events_delay_bounds_to;
  3980.         float r2c_events_duration_bounds_from;
  3981.         float r2c_events_duration_bounds_to;
  3982.        
  3983.         // in cell here: 20 bytes of 0
  3984.        
  3985.         // representation 2 sub-board A
  3986.         // r2sbA_parts_
  3987.         uint32_t r2sbA_parts_entrycount; // maximum of 32 cells
  3988.         uint32_t r2sbA_parts_random_id;
  3989.         uint32_t r2sbA_parts_sig_id; // example value = 0xC8339D00
  3990.        
  3991.         // representation 2 sub-board B
  3992.         // r2sbB_particles_
  3993.         uint32_t r2sbB_particles_entrycount; // maximum of 32 cells
  3994.         uint32_t r2sbB_particles_random_id;
  3995.         uint32_t r2sbB_particles_sig_id; // example value = 0xB0329D00
  3996.        
  3997.     }r2c_events;
  3998.    
  3999.     // exstof: 3328
  4000.    
  4001.     struct effe_r2sc {
  4002.         struct effe_r2scA {
  4003.             // representation 2 sub-cells A
  4004.             // r2scA_parts_
  4005.             // 104
  4006.            
  4007.             uint16_t r2scA_parts_create_in_environment;
  4008.             uint16_t r2scA_parts_create_in_mode;
  4009.             uint16_t r2scA_parts_location_sel;
  4010.             // 1
  4011.             uint8_t r2scA_parts_flags;  // toff 202 8-bit 0x01
  4012.             // in cell here: 16 bytes of 0 (for map files instead: 12 bytes of 0 followed by a tag type according to the following note)
  4013.            
  4014.             // note from 002: when compiled into a map cache file, Tool adds a four-byte tag type string here to indicate how the following dependency is used.
  4015.             // the value can be: obje (for all obje types), jpt!, deca, ligh, pctl, unit (?) or snd!, and affects the behavior of the dependency.
  4016.             // "obje spawns an object, jpt! does damage, snd! plays a sound, etc."
  4017.             // this is probably a shorthand for determining to which memory table it should be added
  4018.            
  4019.             // dependency r2scA 1: type bipd jpt! deca devi ctrl lifi mach eqip garb item ligh obje pctl plac proj scen snd! ssce unit vehi weap
  4020.             char r2scA1_type_tagclass[5];        //unsigned char[5]
  4021.             uint32_t r2scA1_type_tagnamepointer;   //uint32 ("random" number)
  4022.             uint32_t r2scA1_type_tagnamestringlength;   //uint32
  4023.             uint32_t r2scA1_type_tagid;      //uint32 (0xFFFFFFFF with tags)
  4024.             // char r2scA1_type_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  4025.            
  4026.             // in cell here: 24 bytes of 0
  4027.            
  4028.             float r2scA_parts_velocity_bounds_from;
  4029.             float r2scA_parts_velocity_bounds_to;
  4030.             float r2scA_parts_velocity_cone_angle_rad;
  4031.             float r2scA_parts_angular_velocity_bounds_from_rad;
  4032.             float r2scA_parts_angular_velocity_bounds_to_rad;
  4033.             float r2scA_parts_radius_modifier_bounds_from;
  4034.             float r2scA_parts_radius_modifier_bounds_to;
  4035.             // in cell here: 4 bytes of 0
  4036.            
  4037.             uint32_t r2scA_parts_scale_modifiers_a_scales_values;   //toff 292  32-bit 0x0000003F
  4038.             uint32_t r2scA_parts_scale_modifiers_b_scales_values;   //toff 296  32-bit 0x0000003F
  4039.            
  4040.         }r2scA_events_parts;
  4041.        
  4042.         // r2scA1 tagpathname strings go here
  4043.         // exstof: 6816
  4044.        
  4045.         struct effe_r2scB {
  4046.             // representation 2 sub-cells B
  4047.             // r2scB_particles_
  4048.            
  4049.             uint16_t r2scB_particles_create_in_environment;
  4050.             uint16_t r2scB_particles_create_in_mode;
  4051.             uint16_t r2scB_particles_create_in_camera_mode;
  4052.            
  4053.             // in cell here: 2 bytes of 0
  4054.             uint16_t r2scB_particles_location_sel;
  4055.             // in cell here: 2 bytes of 0
  4056.            
  4057.             float r2scB_particles_relative_direction_yaw_rad;
  4058.             float r2scB_particles_relative_direction_pitch_rad;
  4059.             float r2scB_particles_relative_offset_i;
  4060.             float r2scB_particles_relative_offset_j;
  4061.             float r2scB_particles_relative_offset_k;
  4062.            
  4063.             // in cell here: 52 bytes of 0
  4064.            
  4065.             // dependency r2scB 1: particle type part
  4066.             char r2scB1_particle_type_tagclass[5];       //unsigned char[5]
  4067.             uint32_t r2scB1_particle_type_tagnamepointer;   //uint32 ("random" number)
  4068.             uint32_t r2scB1_particle_type_tagnamestringlength;   //uint32
  4069.             uint32_t r2scB1_particle_type_tagid;         //uint32 (0xFFFFFFFF with tags)
  4070.             // char r2scB1_particle_type_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  4071.            
  4072.             uint32_t r2scB_particles_flags; // toff 400 32-bit 0x0000001F
  4073.            
  4074.             uint16_t r2scB_particles_distribution_function;
  4075.             // in cell here: 2 bytes of 0
  4076.            
  4077.             uint16_t r2scB_particles_count_from;
  4078.             uint16_t r2scB_particles_count_to;
  4079.            
  4080.             float r2scB_particles_distribution_radius_from;
  4081.             float r2scB_particles_distribution_radius_to;
  4082.             // in cell here: 12 bytes of 0
  4083.            
  4084.             float r2scB_particles_velocity_from;
  4085.             float r2scB_particles_velocity_to;
  4086.             float r2scB_particles_velocity_cone_angle_rad;
  4087.             float r2scB_particles_angular_velocity_from_rad;
  4088.             float r2scB_particles_angular_velocity_to_rad;
  4089.            
  4090.             // in cell here: 8 bytes of 0
  4091.            
  4092.             float r2scB_particles_radius_from;
  4093.             float r2scB_particles_radius_to;
  4094.            
  4095.             // in cell here: 8 bytes of 0
  4096.            
  4097.             float r2scB_particles_tint_lower_bound_a_frac;
  4098.             float r2scB_particles_tint_lower_bound_r_frac;
  4099.             float r2scB_particles_tint_lower_bound_g_frac;
  4100.             float r2scB_particles_tint_lower_bound_b_frac;
  4101.             float r2scB_particles_tint_upper_bound_a_frac;
  4102.             float r2scB_particles_tint_upper_bound_r_frac;
  4103.             float r2scB_particles_tint_upper_bound_g_frac;
  4104.             float r2scB_particles_tint_upper_bound_b_frac;
  4105.            
  4106.             // in cell here: 16 bytes of 0
  4107.            
  4108.             uint32_t r2scB_particles_scale_modifiers_a_scales_values;   // toff 524 32-bit 0x00000FFF
  4109.             uint32_t r2scB_particles_scale_modifiers_b_scales_values;   // toff 528 32-bit 0x00000FFF
  4110.            
  4111.         }r2scB_events_particles;
  4112.        
  4113.         // r2scB1 tagpathname strings go here
  4114.        
  4115.     }r2sc_container;
  4116.    
  4117. } type_meta_effe;
  4118.  
  4119. #pragma mark -- elec
  4120.  
  4121. typedef struct {
  4122.     uint32_t count;
  4123.     // offset 68 = 16 bytes of 0
  4124.     float near_fade_distance;
  4125.     float far_fade_distance;
  4126.     // offset 92 = 16 bytes of 0
  4127.     uint16_t jitter_scale_source;
  4128.     uint16_t thickness_scale_source;
  4129.     uint16_t tint_modulation_source;
  4130.     uint16_t brightness_scale_source;
  4131.    
  4132.     // dependency 1: bitmap bitm
  4133.     char bitmap_tagclass[5];         //unsigned char[5]
  4134.     uint32_t bitmap_tagnamepointer;   //uint32 ("random" number)
  4135.     uint32_t bitmap_tagnamestringlength;   //uint32
  4136.     uint32_t bitmap_tagid;       //uint32 (0xFFFFFFFF with tags)
  4137.     // char bitmap_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  4138.    
  4139.     // offset 132 = 84 bytes of 0
  4140.    
  4141.     // representation 1 board, offset 216
  4142.     // r1b_markers_
  4143.     uint32_t r1b_markers_entrycount; // maximum of 16 cells
  4144.     uint32_t r1b_markers_random_id;
  4145.     uint32_t r1b_markers_sig_id; // example value = 0x30069D00
  4146.    
  4147.     // representation 2 board, offset 228
  4148.     // r2b_shader_
  4149.     uint32_t r2b_shader_entrycount; // maximum of 1 cell
  4150.     uint32_t r2b_shader_random_id;
  4151.     uint32_t r2b_shader_sig_id; // example value = 0xF0069D00
  4152.    
  4153.     // offset 240 = 88 bytes of 0
  4154.    
  4155.     // dependency 1 tagpathname string goes here
  4156.    
  4157.     struct elec_r1c {
  4158.         // representation 1 cells
  4159.         // r1c_markers_
  4160.         // 228
  4161.        
  4162.         char r1c_markers_attachment_marker[32];
  4163.         // 1
  4164.         uint8_t r1c_markers_flags;  // toff 360 8-bit 0x01
  4165.         // 2
  4166.         uint16_t r1c_markers_octaves_to_next_marker;
  4167.        
  4168.         // in cell here: 78 bytes of 0
  4169.        
  4170.         float r1c_markers_random_position_bounds_i;
  4171.         float r1c_markers_random_position_bounds_j;
  4172.         float r1c_markers_random_position_bounds_k;
  4173.        
  4174.         float r1c_markers_random_jitter;
  4175.         float r1c_markers_thickness;
  4176.        
  4177.         float r1c_markers_tint_a_frac;
  4178.         float r1c_markers_tint_r_frac;
  4179.         float r1c_markers_tint_g_frac;
  4180.         float r1c_markers_tint_b_frac;
  4181.        
  4182.         // in cell here: 76 bytes of 0
  4183.        
  4184.     }r1c_markers;
  4185.    
  4186.     struct elec_r2c {
  4187.         // representation 2 cells
  4188.         // r2c_shader_
  4189.        
  4190.         // in cell here: 41 bytes of 0
  4191.        
  4192.         uint8_t r2c_shader_shader_flags;    // toff 594 8-bit 0x07
  4193.         uint16_t r2c_shader_framebuffer_blend_function;
  4194.         uint16_t r2c_shader_framebuffer_fade_mode;
  4195.         // 1
  4196.         uint8_t r2c_shader_map_flags;   // toff 602 8-bit 0x01
  4197.        
  4198.         // in cell here: 132 bytes of 0 (or the rest of the particle shader metadata) (confirmed use as padding by Guerilla)
  4199.        
  4200.     }r2c_shader;
  4201.    
  4202. } type_meta_elec;
  4203.  
  4204. #pragma mark -- eqip
  4205.  
  4206. typedef struct {
  4207.    
  4208.     // OBJE 1 DATA START
  4209.     uint16_t INTERNAL_obje_index;   // 3 (little endian)
  4210.     // 66, 1
  4211.     uint8_t flags;  // toff 66  8-bit 0x0F
  4212.     float bounding_radius;
  4213.     float bounding_offset_x;
  4214.     float bounding_offset_y;
  4215.     float bounding_offset_z;
  4216.     float origin_offset_x;
  4217.     float origin_offset_y;
  4218.     float origin_offset_z;
  4219.     float acceleration_scale;
  4220.     // offset 100 = 4 bytes of 0
  4221.    
  4222.     // dependency 1: model mod2
  4223.     char model_tagclass[5];      //unsigned char[5]
  4224.     uint32_t model_tagnamepointer;   //uint32 ("random" number)
  4225.     uint32_t model_tagnamestringlength;   //uint32
  4226.     uint32_t model_tagid;        //uint32 (0xFFFFFFFF with tags)
  4227.     // char model_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  4228.    
  4229.     // dependency 2: animation graph antr
  4230.     char animation_graph_tagclass[5];        //unsigned char[5]
  4231.     uint32_t animation_graph_tagnamepointer;   //uint32 ("random" number)
  4232.     uint32_t animation_graph_tagnamestringlength;   //uint32
  4233.     uint32_t animation_graph_tagid;      //uint32 (0xFFFFFFFF with tags)
  4234.     // char animation_graph_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  4235.    
  4236.     // offset 136 = 40 bytes of 0
  4237.    
  4238.     // dependency 3: collision model coll
  4239.     char collision_model_tagclass[5];        //unsigned char[5]
  4240.     uint32_t collision_model_tagnamepointer;   //uint32 ("random" number)
  4241.     uint32_t collision_model_tagnamestringlength;   //uint32
  4242.     uint32_t collision_model_tagid;      //uint32 (0xFFFFFFFF with tags)
  4243.     // char collision_model_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  4244.    
  4245.     // dependency 4: physics phys
  4246.     char physics_tagclass[5];        //unsigned char[5]
  4247.     uint32_t physics_tagnamepointer;   //uint32 ("random" number)
  4248.     uint32_t physics_tagnamestringlength;   //uint32
  4249.     uint32_t physics_tagid;      //uint32 (0xFFFFFFFF with tags)
  4250.     // char physics_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  4251.    
  4252.     // dependency 5: modifier shader shdr senv soso schi scex sotr sgla smet spla swat
  4253.     char modifier_shader_tagclass[5];        //unsigned char[5]
  4254.     uint32_t modifier_shader_tagnamepointer;   //uint32 ("random" number)
  4255.     uint32_t modifier_shader_tagnamestringlength;   //uint32
  4256.     uint32_t modifier_shader_tagid;      //uint32 (0xFFFFFFFF with tags)
  4257.     // char modifier_shader_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  4258.    
  4259.     // dependency 6: creation effect effe
  4260.     char creation_effect_tagclass[5];        //unsigned char[5]
  4261.     uint32_t creation_effect_tagnamepointer;   //uint32 ("random" number)
  4262.     uint32_t creation_effect_tagnamestringlength;   //uint32
  4263.     uint32_t creation_effect_tagid;      //uint32 (0xFFFFFFFF with tags)
  4264.     // char creation_effect_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  4265.    
  4266.     // offset 240 = 84 bytes of 0
  4267.    
  4268.     float render_bounding_radius;
  4269.    
  4270.     uint16_t export_to_functions_a_in;
  4271.     uint16_t export_to_functions_b_in;
  4272.     uint16_t export_to_functions_c_in;
  4273.     uint16_t export_to_functions_d_in;
  4274.    
  4275.     // offset 336 = 44 bytes of 0
  4276.    
  4277.     uint16_t export_to_functions_hud_text_message_index;
  4278.     uint16_t export_to_functions_forced_shader_permutation_index;
  4279.    
  4280.     // representation 1 board, offset 384
  4281.     // r1b_attachments_
  4282.     uint32_t r1b_attachments_entrycount; // maximum of 8 cells
  4283.     uint32_t r1b_attachments_random_id;
  4284.     uint32_t r1b_attachments_sig_id; // example value = 0x08479D00
  4285.    
  4286.     // representation 2 board, offset 396
  4287.     // r2b_widgets_
  4288.     uint32_t r2b_widgets_entrycount; // maximum of 4 cells
  4289.     uint32_t r2b_widgets_random_id;
  4290.     uint32_t r2b_widgets_sig_id; // example value = 0x7C479D00
  4291.    
  4292.     // representation 3 board, offset 408
  4293.     // r3b_functions_
  4294.     uint32_t r3b_functions_entrycount; // maximum of 4 cells
  4295.     uint32_t r3b_functions_random_id;
  4296.     uint32_t r3b_functions_sig_id; // example value = 0x50469D00
  4297.    
  4298.     // representation 4 board, offset 420
  4299.     // r4b_change_colors_
  4300.     uint32_t r4b_change_colors_entrycount; // maximum of 4 cells
  4301.     uint32_t r4b_change_colors_random_id;
  4302.     uint32_t r4b_change_colors_sig_id; // example value = 0x6C489D00
  4303.    
  4304.     // representation 5 board, offset 432
  4305.     // r5b_predicted_resources_
  4306.     uint32_t r5b_predicted_resources_entrycount; // maximum of 1024 cells
  4307.     uint32_t r5b_predicted_resources_random_id;
  4308.     uint32_t r5b_predicted_resources_sig_id; // example value = 0x105FA000
  4309.    
  4310.     // OBJE 1 DATA END
  4311.    
  4312.     // ITEM DATA START
  4313.    
  4314.     uint32_t item_flags;    //toff 444  32-bit 0x00000007
  4315.     uint16_t message_index_message_index;
  4316.     uint16_t message_index_sort_order;
  4317.     float message_index_scale;
  4318.     uint16_t message_index_hud_message_value_scale;
  4319.    
  4320.     // offset 458 = 18 bytes of 0
  4321.    
  4322.     uint16_t message_index_a_in;   // "none" (0) is the only option for these four in's (offset 476)
  4323.     uint16_t message_index_b_in;
  4324.     uint16_t message_index_c_in;
  4325.     uint16_t message_index_d_in;
  4326.    
  4327.     // offset 484 = 164 bytes of 0
  4328.    
  4329.     // dependency 7: material effects foot
  4330.     char material_effects_tagclass[5];       //unsigned char[5]
  4331.     uint32_t material_effects_tagnamepointer;   //uint32 ("random" number)
  4332.     uint32_t material_effects_tagnamestringlength;   //uint32
  4333.     uint32_t material_effects_tagid;         //uint32 (0xFFFFFFFF with tags)
  4334.     // char material_effects_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  4335.    
  4336.     // dependency 8: collision sound snd!
  4337.     char collision_sound_tagclass[5];        //unsigned char[5]
  4338.     uint32_t collision_sound_tagnamepointer;   //uint32 ("random" number)
  4339.     uint32_t collision_sound_tagnamestringlength;   //uint32
  4340.     uint32_t collision_sound_tagid;      //uint32 (0xFFFFFFFF with tags)
  4341.     // char collision_sound_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  4342.    
  4343.     // offset 680 = 120 bytes of 0
  4344.    
  4345.     float message_index_detonation_delay_from;   // offset 800
  4346.     float message_index_detonation_delay_to;
  4347.    
  4348.     // dependency 9: detonating effect effe
  4349.     char detonating_effect_tagclass[5];      //unsigned char[5]
  4350.     uint32_t detonating_effect_tagnamepointer;   //uint32 ("random" number)
  4351.     uint32_t detonating_effect_tagnamestringlength;   //uint32
  4352.     uint32_t detonating_effect_tagid;        //uint32 (0xFFFFFFFF with tags)
  4353.     // char detonating_effect_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  4354.    
  4355.     // dependency 10: detonation effect effe
  4356.     char detonation_effect_tagclass[5];      //unsigned char[5]
  4357.     uint32_t detonation_effect_tagnamepointer;   //uint32 ("random" number)
  4358.     uint32_t detonation_effect_tagnamestringlength;   //uint32
  4359.     uint32_t detonation_effect_tagid;        //uint32 (0xFFFFFFFF with tags)
  4360.     // char detonation_effect_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  4361.    
  4362.    
  4363.     // ITEM DATA END
  4364.    
  4365.    
  4366.     uint16_t message_index_powerup_type;
  4367.     uint16_t message_index_grenade_type;
  4368.    
  4369.     float message_index_powerup_time;
  4370.    
  4371.     // dependency 11: pickup sound snd!
  4372.     char pickup_sound_tagclass[5];       //unsigned char[5]
  4373.     uint32_t pickup_sound_tagnamepointer;   //uint32 ("random" number)
  4374.     uint32_t pickup_sound_tagnamestringlength;   //uint32
  4375.     uint32_t pickup_sound_tagid;         //uint32 (0xFFFFFFFF with tags)
  4376.     // char pickup_sound_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  4377.    
  4378.    
  4379.     // offset 864 = 144 bytes of 0
  4380.    
  4381.     // dependencies 1-6 tagpathname strings go here
  4382.    
  4383.     // OBJE DATA 2 START
  4384.    
  4385.     struct eqip_r1c {
  4386.         // representation 1 cells
  4387.         // r1c_attachments_
  4388.        
  4389.         // dependency r1c 1: r1c_attachments_type_ cont effe ligh mgs2 pctl lsnd
  4390.         char r1c_attachments_type_tagclass[5];       //unsigned char[5]
  4391.         uint32_t r1c_attachments_type_tagnamepointer;   //uint32 ("random" number)
  4392.         uint32_t r1c_attachments_type_tagnamestringlength;   //uint32
  4393.         uint32_t r1c_attachments_type_tagid;         //uint32 (0xFFFFFFFF with tags)
  4394.         // char r1c_attachments_type_tagnamestring[255];
  4395.        
  4396.         char r1c_attachments_marker[32];
  4397.         uint16_t r1c_attachments_primary_scale;
  4398.         uint16_t r1c_attachments_secondary_scale;
  4399.         uint16_t r1c_attachments_change_color;
  4400.        
  4401.         // in cell here: 18 bytes of 0
  4402.        
  4403.     }r1c_attachments;
  4404.    
  4405.     // r1c 1 tag name strings here
  4406.    
  4407.     struct eqip_r2c {
  4408.         // representation 2 cells
  4409.         // r2c_widgets_
  4410.        
  4411.         // dependency r2c 1: r2c_widgets_reference_ ant! flag glw! mgs2 elec
  4412.         char r2c_widgets_reference_tagclass[5];      //unsigned char[5]
  4413.         uint32_t r2c_widgets_reference_tagnamepointer;   //uint32 ("random" number)
  4414.         uint32_t r2c_widgets_reference_tagnamestringlength;   //uint32
  4415.         uint32_t r2c_widgets_reference_tagid;        //uint32 (0xFFFFFFFF with tags)
  4416.         // char r2c_widgets_reference_tagnamestring[255];
  4417.        
  4418.         // in cell here: 16 bytes of 0
  4419.     }r2c_widgets;
  4420.    
  4421.     // r2c 1 tag name strings here
  4422.    
  4423.     struct eqip_r3c {
  4424.         // representation 3 cells
  4425.         // r3c_functions_
  4426.        
  4427.         uint32_t r3c_functions_flags;   // toff 1008    32-bit 0x00000007
  4428.         float r3c_functions_period;
  4429.         uint16_t r3c_functions_scale_period_by;
  4430.         uint16_t r3c_functions_function;
  4431.         uint16_t r3c_functions_scale_function_by;
  4432.         uint16_t r3c_functions_wobble_function;
  4433.         float r3c_functions_wobble_period;
  4434.         float r3c_functions_wobble_magnitude;
  4435.         float r3c_functions_square_wave_threshold_frac;
  4436.         uint16_t r3c_functions_step_count;
  4437.         uint16_t r3c_functions_map_to;
  4438.         uint16_t r3c_functions_sawtooth_count;
  4439.         uint16_t r3c_functions_add;
  4440.         uint16_t r3c_functions_scale_result_by;
  4441.         uint16_t r3c_functions_bounds_mode;
  4442.         float r3c_functions_bounds_from_frac;
  4443.         float r3c_functions_bounds_to_frac;
  4444.         // in cell here: 6 bytes of 0
  4445.         uint16_t r3c_functions_turn_off_with_sel;
  4446.         float r3c_functions_scale_by;
  4447.         // in cell here: 268 bytes of 0 (reminiscent of the pre-padding of other times strings come after cells)
  4448.         char r3c_functions_usage[32];
  4449.        
  4450.     }r3c_functions;
  4451.    
  4452.     struct eqip_r4c {
  4453.         // representation 4 cells
  4454.         // r4c_change_colors_
  4455.         uint16_t r4c_change_colors_darken_by;
  4456.         uint16_t r4c_change_colors_scale_by;
  4457.         uint32_t r4c_change_colors_scale_flags; // toff 1372    32-bit 0x00000003
  4458.         float r4c_change_colors_color_lower_bound_r_frac;
  4459.         float r4c_change_colors_color_lower_bound_g_frac;
  4460.         float r4c_change_colors_color_lower_bound_b_frac;
  4461.         float r4c_change_colors_color_upper_bound_r_frac;
  4462.         float r4c_change_colors_color_upper_bound_g_frac;
  4463.         float r4c_change_colors_color_upper_bound_b_frac;
  4464.        
  4465.         // representation 4 sub-board A
  4466.         // r4sbA_permutations_
  4467.         uint32_t r4sbA_permutations_entrycount;   // maximum of 8 cells
  4468.         uint32_t r4sbA_permutations_random_id1;
  4469.         uint32_t r4sbA_permutations_sig_id;   // example value = 0xD8479D00
  4470.     }r4c_change_colors;
  4471.    
  4472.     struct eqip_r4scA
  4473.     {
  4474.         // representation 4 sub-cells A
  4475.         // r4scA_permutations_
  4476.         float r4scA_permutations_weight_frac;
  4477.         float r4scA_permutations_color_lower_bound_r_frac;
  4478.         float r4scA_permutations_color_lower_bound_g_frac;
  4479.         float r4scA_permutations_color_lower_bound_b_frac;
  4480.         float r4scA_permutations_color_upper_bound_r_frac;
  4481.         float r4scA_permutations_color_upper_bound_g_frac;
  4482.         float r4scA_permutations_color_upper_bound_b_frac;
  4483.     }r4sc_change_colors_permutations;
  4484.    
  4485.     struct eqip_r5c {
  4486.         // representation 5 cells
  4487.         // r5c_predicted_resources_
  4488.         uint16_t r5c_predicted_resources_type;
  4489.         uint16_t r5c_predicted_resources_resource_index;
  4490.         uint32_t r5c_predicted_resources_tag_index;
  4491.     }r5c_predicted_resources;
  4492.    
  4493.     // OBJE DATA 2 END
  4494.    
  4495.     // dependencies 7-11 tagpathname strings go here
  4496.    
  4497. } type_meta_eqip;
  4498.  
  4499. #pragma mark -- flag
  4500.  
  4501. typedef struct {
  4502.     // offset 64 = 4 bytes of 0
  4503.     uint16_t trailing_edge_shape;
  4504.     uint16_t trailing_edge_shape_offset;
  4505.     uint16_t attached_edge_shape;
  4506.     // offset 74 = 2 bytes of 0
  4507.     uint16_t width;
  4508.     uint16_t height;
  4509.     float cell_width;
  4510.     float cell_height;
  4511.    
  4512.     // dependency 1: red flag shader shdr senv soso schi scex sotr sgla smet spla swat
  4513.     char red_flag_shader_tagclass[5];        //unsigned char[5]
  4514.     uint32_t red_flag_shader_tagnamepointer;   //uint32 ("random" number)
  4515.     uint32_t red_flag_shader_tagnamestringlength;   //uint32
  4516.     uint32_t red_flag_shader_tagid;      //uint32 (0xFFFFFFFF with tags)
  4517.     // char red_flag_shader_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  4518.    
  4519.     // dependency 2: physics pphy
  4520.     char physics_tagclass[5];        //unsigned char[5]
  4521.     uint32_t physics_tagnamepointer;   //uint32 ("random" number)
  4522.     uint32_t physics_tagnamestringlength;   //uint32
  4523.     uint32_t physics_tagid;      //uint32 (0xFFFFFFFF with tags)
  4524.     // char physics_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  4525.    
  4526.     float wind_noise;
  4527.    
  4528.     // offset 124 = 8 bytes of 0
  4529.    
  4530.     // dependency 3: blue flag shader shdr senv soso schi scex sotr sgla smet spla swat
  4531.     char blue_flag_shader_tagclass[5];       //unsigned char[5]
  4532.     uint32_t blue_flag_shader_tagnamepointer;   //uint32 ("random" number)
  4533.     uint32_t blue_flag_shader_tagnamestringlength;   //uint32
  4534.     uint32_t blue_flag_shader_tagid;         //uint32 (0xFFFFFFFF with tags)
  4535.     // char blue_flag_shader_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  4536.    
  4537.     // representation 1 board, offset 148
  4538.     // r1b_attachment_points_
  4539.     uint32_t r1b_attachment_points_entrycount; // maximum of 5 cells
  4540.     uint32_t r1b_attachment_points_random_id;
  4541.     uint32_t r1b_attachment_points_sig_id; // example value = 0x54159D00
  4542.    
  4543.     // dependencies 1-3 tagpathname strings go here
  4544.    
  4545.     struct flag_r1c {
  4546.         // representation 1 cells
  4547.         // r1c_attachment_points_
  4548.         uint16_t r1c_attachment_points_height_to_next_attachment;
  4549.         // in cell here: 18 bytes of 0
  4550.         char r1c_attachment_points_marker_name[32];
  4551.     }r1c_attachment_points;
  4552.    
  4553. } type_meta_flag;
  4554.  
  4555. #pragma mark -- fog
  4556.  
  4557. typedef struct {
  4558.    
  4559.     uint32_t flags_flags;   // toff 64  32-bit 0x00000007
  4560.    
  4561.     // offset 68 = 84 bytes of 0
  4562.    
  4563.     float density_maximum_density_frac;   // offset 152
  4564.     // offset 156 = 4 bytes of 0
  4565.     float density_opaque_distance;
  4566.     // offset 164 = 4 bytes of 0
  4567.     float density_opaque_depth;
  4568.     // offset 172 = 8 bytes of 0
  4569.     float density_distance_to_water_plane;
  4570.    
  4571.     float color_color_r_frac;
  4572.     float color_color_g_frac;
  4573.     float color_color_b_frac;
  4574.    
  4575.     // 196, 1
  4576.     uint8_t screen_layers_flags;    // toff 196 8-bit 0x07
  4577.     uint16_t screen_layers_layer_count;
  4578.     float screen_layers_distance_gradient_from;
  4579.     float screen_layers_distance_gradient_to;
  4580.     float screen_layers_density_gradient_from_frac;
  4581.     float screen_layers_density_gradient_to_frac;
  4582.     float screen_layers_start_distance_from_fog_plane;
  4583.     // offset 220 = 4 bytes of 0
  4584.    
  4585.     uint8_t screen_layers_color_a;   // not in Guerilla UI, so probably unused
  4586.     uint8_t screen_layers_color_r;
  4587.     uint8_t screen_layers_color_g;
  4588.     uint8_t screen_layers_color_b;
  4589.    
  4590.     float screen_layers_rotation_multiplier_frac;
  4591.     float screen_layers_strafing_multiplier_frac;
  4592.     float screen_layers_zoom_multiplier_frac;
  4593.     // offset 240 = 8 bytes of 0
  4594.    
  4595.     float screen_layers_map_scale;   // offset 248
  4596.    
  4597.     // dependency 1: map bitm
  4598.     char map_tagclass[5];        //unsigned char[5]
  4599.     uint32_t map_tagnamepointer;   //uint32 ("random" number)
  4600.     uint32_t map_tagnamestringlength;   //uint32
  4601.     uint32_t map_tagid;      //uint32 (0xFFFFFFFF with tags)
  4602.     // char map_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  4603.    
  4604.     float screen_layer_animation_animation_period;
  4605.     // offset 272 = 4 bytes of 0
  4606.     float screen_layer_animation_wind_velocity_from;
  4607.     float screen_layer_animation_wind_velocity_to;
  4608.     float screen_layer_animation_wind_period_from;
  4609.     float screen_layer_animation_wind_period_to;
  4610.     float screen_layer_animation_wind_acceleration_weight_frac;
  4611.     float screen_layer_animation_wind_perpendicular_weight_frac;
  4612.     // offset 300 = 8 bytes of 0
  4613.    
  4614.     // dependency 2: background sound lsnd
  4615.     char background_sound_tagclass[5];       //unsigned char[5]
  4616.     uint32_t background_sound_tagnamepointer;   //uint32 ("random" number)
  4617.     uint32_t background_sound_tagnamestringlength;   //uint32
  4618.     uint32_t background_sound_tagid;         //uint32 (0xFFFFFFFF with tags)
  4619.     // char background_sound_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  4620.    
  4621.     // dependency 3: sound environment snde
  4622.     char sound_environment_tagclass[5];      //unsigned char[5]
  4623.     uint32_t sound_environment_tagnamepointer;   //uint32 ("random" number)
  4624.     uint32_t sound_environment_tagnamestringlength;   //uint32
  4625.     uint32_t sound_environment_tagid;        //uint32 (0xFFFFFFFF with tags)
  4626.     // char sound_environment_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  4627.    
  4628.     // offset 340 = 120 bytes of 0
  4629.    
  4630.     // dependency tagpathname strings go here
  4631.    
  4632. } type_meta_fog;
  4633.  
  4634. #pragma mark -- font
  4635.  
  4636. typedef struct {
  4637.     uint32_t flags;
  4638.     uint16_t ascending_height;
  4639.     uint16_t descending_height;
  4640.     uint16_t leading_height;
  4641.     uint16_t leadin_width_calc;   // calculated regardless of the value stored here; Guerilla does not display the stored value, it displays the value that it calculates for this when the tag is opened. (offset 74)
  4642.    
  4643.     // offset 76 = 36 bytes of 0
  4644.    
  4645.     // representation 1 board, offset 112
  4646.     // r1b_character_tables_
  4647.     uint32_t r1b_character_tables_entrycount; // maximum of 256 cells
  4648.     uint32_t r1b_character_tables_random_id;
  4649.     uint32_t r1b_character_tables_sig_id; // example value = 0x1C609D00
  4650.    
  4651.     // dependency 1: bold font
  4652.     char bold_tagclass[5];       //unsigned char[5]
  4653.     uint32_t bold_tagnamepointer;   //uint32 ("random" number)
  4654.     uint32_t bold_tagnamestringlength;   //uint32
  4655.     uint32_t bold_tagid;         //uint32 (0xFFFFFFFF with tags)
  4656.     // char bold_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  4657.    
  4658.     // dependency 2: italic font
  4659.     char italic_tagclass[5];         //unsigned char[5]
  4660.     uint32_t italic_tagnamepointer;   //uint32 ("random" number)
  4661.     uint32_t italic_tagnamestringlength;   //uint32
  4662.     uint32_t italic_tagid;       //uint32 (0xFFFFFFFF with tags)
  4663.     // char italic_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  4664.    
  4665.     // dependency 3: condense font
  4666.     char condense_tagclass[5];       //unsigned char[5]
  4667.     uint32_t condense_tagnamepointer;   //uint32 ("random" number)
  4668.     uint32_t condense_tagnamestringlength;   //uint32
  4669.     uint32_t condense_tagid;         //uint32 (0xFFFFFFFF with tags)
  4670.     // char condense_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  4671.    
  4672.     // dependency 4: underline font
  4673.     char underline_tagclass[5];      //unsigned char[5]
  4674.     uint32_t underline_tagnamepointer;   //uint32 ("random" number)
  4675.     uint32_t underline_tagnamestringlength;   //uint32
  4676.     uint32_t underline_tagid;        //uint32 (0xFFFFFFFF with tags)
  4677.     // char underline_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  4678.    
  4679.     // representation 2 board, offset 188
  4680.     // r2b_characters_
  4681.     uint32_t r2b_characters_entrycount; // maximum of 32000 cells
  4682.     uint32_t r2b_characters_random_id;
  4683.     uint32_t r2b_characters_sig_id; // example value = 0x785F9D00
  4684.    
  4685.     uint32_t pixels;
  4686.     // offset 204 = 4 bytes of 0
  4687.     // little endian internal board values:
  4688.     uint32_t INTERNAL_compressed_pixels_offset_pointer;   // example values = 10268 (wrong) and 156 (right)
  4689.     uint32_t INTERNAL_compressed_pixels_random1;
  4690.     uint32_t INTERNAL_compressed_pixels_sig_id;   // example value = 0xA45F9D00
  4691.    
  4692.     struct font_r1c {
  4693.         // representation 1 cells
  4694.         // r1c_character_tables_
  4695.        
  4696.         // representation 1 sub-board A
  4697.         // r1sbA_character_table_
  4698.         uint32_t r1sbA_character_table_entrycount; // maximum of 256 cells
  4699.         uint32_t r1sbA_character_table_random_id;
  4700.         uint32_t r1sbA_character_table_sig_id; // example value = 0xD85F9D00
  4701.        
  4702.     }r1c_character_tables;
  4703.    
  4704.     struct font_r1scA {   // offset 3292 in tests
  4705.         // representation 1 sub-cells A
  4706.         // r1scA_character_table_
  4707.        
  4708.         uint16_t r1scA_character_table_character_index_sel;
  4709.        
  4710.     }r1scA_character_tables_character_table;
  4711.    
  4712.     // dependency tagpathname strings go here (offset 134364 in "font blank" test)
  4713.    
  4714.     struct font_r2c {
  4715.         // representation 2 cells
  4716.         // r2c_characters_
  4717.        
  4718.         uint16_t r2c_characters_character;   // functionally uint16_t
  4719.         uint16_t r2c_characters_character_width;
  4720.         uint16_t r2c_characters_bitmap_width;
  4721.         uint16_t r2c_characters_bitmap_height;
  4722.         uint16_t r2c_characters_bitmap_origin_x;   // interpret these two as signed
  4723.         uint16_t r2c_characters_bitmap_origin_y;
  4724.         uint16_t r2c_characters_hardware_character_index_calc;   // -1 if no data, calculated regardless of stored value
  4725.         // in cell here: 2 bytes of 0
  4726.         uint32_t r2c_characters_pixels_offset;   // interpret as signed
  4727.        
  4728.     }r2c_characters;
  4729.    
  4730. } type_meta_font;
  4731.  
  4732. #pragma mark -- foot
  4733.  
  4734. typedef struct {
  4735.    
  4736.     // representation 1 board, offset 64
  4737.     // r1b_effects_
  4738.     uint32_t r1b_effects_entrycount; // maximum of 13 cells (walk, run, sliding, shuffle, jump, jump land, biped unused1, biped unused2, impact, vehicle tire slip, vehicle chassis slip, vehicle unused 1, vehicle unused 2)
  4739.     uint32_t r1b_effects_random_id;
  4740.     uint32_t r1b_effects_sig_id; // example value = 0x50169C00
  4741.    
  4742.     // offset 76 = 128 bytes of 0
  4743.    
  4744.     struct foot_r1c {
  4745.         // representation 1 cells
  4746.         // r1c_effects_
  4747.        
  4748.         // representation 1 sub-board A
  4749.         // r1sbA_materials_
  4750.         uint32_t r1sbA_materials_entrycount; // maximum of 33 cells (dirt, sand, stone, snow, wood, metal (hollow), metal (thin), metal (thick), rubber, glass, force field, grunt, hunter armor, hunter skin, elite, jackal, jackal energy shield, engineer skin, engineer force field, flood combat form, flood carrier form, cyborg armor, cyborg energy shield, human armor, human skin, sentinel, monitor, plastic, water, leaves, elite energy shield, ice, hunter shield)
  4751.         uint32_t r1sbA_materials_random_id;
  4752.         uint32_t r1sbA_materials_sig_id; // example value = 0x00169C00
  4753.        
  4754.         // in cell here: 16 bytes of 0
  4755.        
  4756.     }r1c_effects;
  4757.    
  4758.     struct foot_r1sc {
  4759.         struct foot_r1scA {
  4760.             // representation 1 sub-cells A
  4761.             // r1scA_materials_
  4762.            
  4763.             // dependency r1scA 1: effect effe
  4764.             char r1scA_effect_tagclass[5];       //unsigned char[5]
  4765.             uint32_t r1scA_effect_tagnamepointer;   //uint32 ("random" number)
  4766.             uint32_t r1scA_effect_tagnamestringlength;   //uint32
  4767.             uint32_t r1scA_effect_tagid;         //uint32 (0xFFFFFFFF with tags)
  4768.             // char r1scA_effect_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  4769.            
  4770.             // dependency r1scA 2: sound snd!
  4771.             char r1scA_sound_tagclass[5];        //unsigned char[5]
  4772.             uint32_t r1scA_sound_tagnamepointer;   //uint32 ("random" number)
  4773.             uint32_t r1scA_sound_tagnamestringlength;   //uint32
  4774.             uint32_t r1scA_sound_tagid;      //uint32 (0xFFFFFFFF with tags)
  4775.             // char r1scA_sound_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  4776.            
  4777.             // in cell here: 16 bytes of 0
  4778.            
  4779.         }r1scA_effects_materials;
  4780.        
  4781.         // r1scA dependencies' tagpathname strings go here
  4782.     }r1sc_container;
  4783.    
  4784. } type_meta_foot;
  4785.  
  4786. #pragma mark -- garb
  4787.  
  4788. typedef struct {
  4789.    
  4790.     // OBJE 1 DATA START
  4791.     uint16_t INTERNAL_obje_index;   // 4 (little endian) -- besides this value, the priority value, and the tag type string, the rest of the file is the same as eqip, but without the last four values that eqip has at the end
  4792.     // 66, 1
  4793.     uint8_t flags;  // toff 66  8-bit 0x0F
  4794.     float bounding_radius;
  4795.     float bounding_offset_x;
  4796.     float bounding_offset_y;
  4797.     float bounding_offset_z;
  4798.     float origin_offset_x;
  4799.     float origin_offset_y;
  4800.     float origin_offset_z;
  4801.     float acceleration_scale;
  4802.     // offset 100 = 4 bytes of 0
  4803.    
  4804.     // dependency 1: model mod2
  4805.     char model_tagclass[5];      //unsigned char[5]
  4806.     uint32_t model_tagnamepointer;   //uint32 ("random" number)
  4807.     uint32_t model_tagnamestringlength;   //uint32
  4808.     uint32_t model_tagid;        //uint32 (0xFFFFFFFF with tags)
  4809.     // char model_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  4810.    
  4811.     // dependency 2: animation graph antr
  4812.     char animation_graph_tagclass[5];        //unsigned char[5]
  4813.     uint32_t animation_graph_tagnamepointer;   //uint32 ("random" number)
  4814.     uint32_t animation_graph_tagnamestringlength;   //uint32
  4815.     uint32_t animation_graph_tagid;      //uint32 (0xFFFFFFFF with tags)
  4816.     // char animation_graph_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  4817.    
  4818.     // offset 136 = 40 bytes of 0
  4819.    
  4820.     // dependency 3: collision model coll
  4821.     char collision_model_tagclass[5];        //unsigned char[5]
  4822.     uint32_t collision_model_tagnamepointer;   //uint32 ("random" number)
  4823.     uint32_t collision_model_tagnamestringlength;   //uint32
  4824.     uint32_t collision_model_tagid;      //uint32 (0xFFFFFFFF with tags)
  4825.     // char collision_model_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  4826.    
  4827.     // dependency 4: physics phys
  4828.     char physics_tagclass[5];        //unsigned char[5]
  4829.     uint32_t physics_tagnamepointer;   //uint32 ("random" number)
  4830.     uint32_t physics_tagnamestringlength;   //uint32
  4831.     uint32_t physics_tagid;      //uint32 (0xFFFFFFFF with tags)
  4832.     // char physics_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  4833.    
  4834.     // dependency 5: modifier shader shdr senv soso schi scex sotr sgla smet spla swat
  4835.     char modifier_shader_tagclass[5];        //unsigned char[5]
  4836.     uint32_t modifier_shader_tagnamepointer;   //uint32 ("random" number)
  4837.     uint32_t modifier_shader_tagnamestringlength;   //uint32
  4838.     uint32_t modifier_shader_tagid;      //uint32 (0xFFFFFFFF with tags)
  4839.     // char modifier_shader_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  4840.    
  4841.     // dependency 6: creation effect effe
  4842.     char creation_effect_tagclass[5];        //unsigned char[5]
  4843.     uint32_t creation_effect_tagnamepointer;   //uint32 ("random" number)
  4844.     uint32_t creation_effect_tagnamestringlength;   //uint32
  4845.     uint32_t creation_effect_tagid;      //uint32 (0xFFFFFFFF with tags)
  4846.     // char creation_effect_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  4847.    
  4848.     // offset 240 = 84 bytes of 0
  4849.    
  4850.     float render_bounding_radius;
  4851.    
  4852.     uint16_t export_to_functions_a_in;
  4853.     uint16_t export_to_functions_b_in;
  4854.     uint16_t export_to_functions_c_in;
  4855.     uint16_t export_to_functions_d_in;
  4856.    
  4857.     // offset 336 = 44 bytes of 0
  4858.    
  4859.     uint16_t export_to_functions_hud_text_message_index;
  4860.     uint16_t export_to_functions_forced_shader_permutation_index;
  4861.    
  4862.     // representation 1 board, offset 384
  4863.     // r1b_attachments_
  4864.     uint32_t r1b_attachments_entrycount; // maximum of 8 cells
  4865.     uint32_t r1b_attachments_random_id;
  4866.     uint32_t r1b_attachments_sig_id; // example value = 0x08479D00
  4867.    
  4868.     // representation 2 board, offset 396
  4869.     // r2b_widgets_
  4870.     uint32_t r2b_widgets_entrycount; // maximum of 4 cells
  4871.     uint32_t r2b_widgets_random_id;
  4872.     uint32_t r2b_widgets_sig_id; // example value = 0x7C479D00
  4873.    
  4874.     // representation 3 board, offset 408
  4875.     // r3b_functions_
  4876.     uint32_t r3b_functions_entrycount; // maximum of 4 cells
  4877.     uint32_t r3b_functions_random_id;
  4878.     uint32_t r3b_functions_sig_id; // example value = 0x50469D00
  4879.    
  4880.     // representation 4 board, offset 420
  4881.     // r4b_change_colors_
  4882.     uint32_t r4b_change_colors_entrycount; // maximum of 4 cells
  4883.     uint32_t r4b_change_colors_random_id;
  4884.     uint32_t r4b_change_colors_sig_id; // example value = 0x6C489D00
  4885.    
  4886.     // representation 5 board, offset 432
  4887.     // r5b_predicted_resources_
  4888.     uint32_t r5b_predicted_resources_entrycount; // maximum of 1024 cells
  4889.     uint32_t r5b_predicted_resources_random_id;
  4890.     uint32_t r5b_predicted_resources_sig_id; // example value = 0x105FA000
  4891.    
  4892.     // OBJE 1 DATA END
  4893.    
  4894.     // ITEM DATA START
  4895.    
  4896.     uint32_t item_flags;    // toff 444 32-bit 0x00000007
  4897.     uint16_t message_index_message_index;
  4898.     uint16_t message_index_sort_order;
  4899.     float message_index_scale;
  4900.     uint16_t message_index_hud_message_value_scale;
  4901.    
  4902.     // offset 458 = 18 bytes of 0
  4903.    
  4904.     uint16_t message_index_a_in;   // "none" (0) is the only option for these four in's (offset 476)
  4905.     uint16_t message_index_b_in;
  4906.     uint16_t message_index_c_in;
  4907.     uint16_t message_index_d_in;
  4908.    
  4909.     // offset 484 = 164 bytes of 0
  4910.    
  4911.     // dependency 7: material effects foot
  4912.     char material_effects_tagclass[5];       //unsigned char[5]
  4913.     uint32_t material_effects_tagnamepointer;   //uint32 ("random" number)
  4914.     uint32_t material_effects_tagnamestringlength;   //uint32
  4915.     uint32_t material_effects_tagid;         //uint32 (0xFFFFFFFF with tags)
  4916.     // char material_effects_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  4917.    
  4918.     // dependency 8: collision sound snd!
  4919.     char collision_sound_tagclass[5];        //unsigned char[5]
  4920.     uint32_t collision_sound_tagnamepointer;   //uint32 ("random" number)
  4921.     uint32_t collision_sound_tagnamestringlength;   //uint32
  4922.     uint32_t collision_sound_tagid;      //uint32 (0xFFFFFFFF with tags)
  4923.     // char collision_sound_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  4924.    
  4925.     // offset 680 = 120 bytes of 0
  4926.    
  4927.     float message_index_detonation_delay_from;   // offset 800
  4928.     float message_index_detonation_delay_to;
  4929.    
  4930.     // dependency 9: detonating effect effe
  4931.     char detonating_effect_tagclass[5];      //unsigned char[5]
  4932.     uint32_t detonating_effect_tagnamepointer;   //uint32 ("random" number)
  4933.     uint32_t detonating_effect_tagnamestringlength;   //uint32
  4934.     uint32_t detonating_effect_tagid;        //uint32 (0xFFFFFFFF with tags)
  4935.     // char detonating_effect_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  4936.    
  4937.     // dependency 10: detonation effect effe
  4938.     char detonation_effect_tagclass[5];      //unsigned char[5]
  4939.     uint32_t detonation_effect_tagnamepointer;   //uint32 ("random" number)
  4940.     uint32_t detonation_effect_tagnamestringlength;   //uint32
  4941.     uint32_t detonation_effect_tagid;        //uint32 (0xFFFFFFFF with tags)
  4942.     // char detonation_effect_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  4943.    
  4944.     // offset 840 = 168 bytes of 0
  4945.    
  4946.     // ITEM DATA END
  4947.    
  4948.     // offset 864 = 144 bytes of 0
  4949.    
  4950.     // dependencies 1-6 tagpathname strings go here
  4951.    
  4952.     // OBJE DATA 2 START
  4953.    
  4954.     struct garb_r1c {
  4955.         // representation 1 cells
  4956.         // r1c_attachments_
  4957.        
  4958.         // dependency r1c 1: r1c_attachments_type_ cont effe ligh mgs2 pctl lsnd
  4959.         char r1c_attachments_type_tagclass[5];       //unsigned char[5]
  4960.         uint32_t r1c_attachments_type_tagnamepointer;   //uint32 ("random" number)
  4961.         uint32_t r1c_attachments_type_tagnamestringlength;   //uint32
  4962.         uint32_t r1c_attachments_type_tagid;         //uint32 (0xFFFFFFFF with tags)
  4963.         // char r1c_attachments_type_tagnamestring[255];
  4964.        
  4965.         char r1c_attachments_marker[32];
  4966.         uint16_t r1c_attachments_primary_scale;
  4967.         uint16_t r1c_attachments_secondary_scale;
  4968.         uint16_t r1c_attachments_change_color;
  4969.        
  4970.         // in cell here: 18 bytes of 0
  4971.        
  4972.     }r1c_attachments;
  4973.    
  4974.     // r1c 1 tag name strings here
  4975.    
  4976.     struct garb_r2c {
  4977.         // representation 2 cells
  4978.         // r2c_widgets_
  4979.        
  4980.         // dependency r2c 1: r2c_widgets_reference_ ant! flag glw! mgs2 elec
  4981.         char r2c_widgets_reference_tagclass[5];      //unsigned char[5]
  4982.         uint32_t r2c_widgets_reference_tagnamepointer;   //uint32 ("random" number)
  4983.         uint32_t r2c_widgets_reference_tagnamestringlength;   //uint32
  4984.         uint32_t r2c_widgets_reference_tagid;        //uint32 (0xFFFFFFFF with tags)
  4985.         // char r2c_widgets_reference_tagnamestring[255];
  4986.        
  4987.         // in cell here: 16 bytes of 0
  4988.     }r2c_widgets;
  4989.    
  4990.     // r2c 1 tag name strings here
  4991.    
  4992.     struct garb_r3c {
  4993.         // representation 3 cells
  4994.         // r3c_functions_
  4995.        
  4996.         uint32_t r3c_functions_flags;   // toff 1008    32-bit 0x00000007
  4997.         float r3c_functions_period;
  4998.         uint16_t r3c_functions_scale_period_by;
  4999.         uint16_t r3c_functions_function;
  5000.         uint16_t r3c_functions_scale_function_by;
  5001.         uint16_t r3c_functions_wobble_function;
  5002.         float r3c_functions_wobble_period;
  5003.         float r3c_functions_wobble_magnitude;
  5004.         float r3c_functions_square_wave_threshold_frac;
  5005.         uint16_t r3c_functions_step_count;
  5006.         uint16_t r3c_functions_map_to;
  5007.         uint16_t r3c_functions_sawtooth_count;
  5008.         uint16_t r3c_functions_add;
  5009.         uint16_t r3c_functions_scale_result_by;
  5010.         uint16_t r3c_functions_bounds_mode;
  5011.         float r3c_functions_bounds_from_frac;
  5012.         float r3c_functions_bounds_to_frac;
  5013.         // in cell here: 6 bytes of 0
  5014.         uint16_t r3c_functions_turn_off_with_sel;
  5015.         float r3c_functions_scale_by;
  5016.         // in cell here: 268 bytes of 0 (reminiscent of the pre-padding of other times strings come after cells)
  5017.         char r3c_functions_usage[32];
  5018.        
  5019.     }r3c_functions;
  5020.    
  5021.     struct garb_r4c {
  5022.         // representation 4 cells
  5023.         // r4c_change_colors_
  5024.         uint16_t r4c_change_colors_darken_by;
  5025.         uint16_t r4c_change_colors_scale_by;
  5026.         uint32_t r4c_change_colors_scale_flags; //toff 1372 32-bit 0x00000003
  5027.         float r4c_change_colors_color_lower_bound_r_frac;
  5028.         float r4c_change_colors_color_lower_bound_g_frac;
  5029.         float r4c_change_colors_color_lower_bound_b_frac;
  5030.         float r4c_change_colors_color_upper_bound_r_frac;
  5031.         float r4c_change_colors_color_upper_bound_g_frac;
  5032.         float r4c_change_colors_color_upper_bound_b_frac;
  5033.        
  5034.         // representation 4 sub-board A
  5035.         // r4sbA_permutations_
  5036.         uint32_t r4sbA_permutations_entrycount;   // maximum of 8 cells
  5037.         uint32_t r4sbA_permutations_random_id1;
  5038.         uint32_t r4sbA_permutations_sig_id;   // example value = 0xD8479D00
  5039.     }r4c_change_colors;
  5040.    
  5041.     struct garb_r4scA
  5042.     {
  5043.         // representation 4 sub-cells A
  5044.         // r4scA_permutations_
  5045.         float r4scA_permutations_weight_frac;
  5046.         float r4scA_permutations_color_lower_bound_r_frac;
  5047.         float r4scA_permutations_color_lower_bound_g_frac;
  5048.         float r4scA_permutations_color_lower_bound_b_frac;
  5049.         float r4scA_permutations_color_upper_bound_r_frac;
  5050.         float r4scA_permutations_color_upper_bound_g_frac;
  5051.         float r4scA_permutations_color_upper_bound_b_frac;
  5052.     }r4sc_change_colors_permutations;
  5053.    
  5054.     struct garb_r5c {
  5055.         // representation 5 cells
  5056.         // r5c_predicted_resources_
  5057.         uint16_t r5c_predicted_resources_type;
  5058.         uint16_t r5c_predicted_resources_resource_index;
  5059.         uint32_t r5c_predicted_resources_tag_index;
  5060.     }r5c_predicted_resources;
  5061.    
  5062.     // OBJE DATA 2 END
  5063.    
  5064.     // dependencies 7-10 tagpathname strings go here
  5065.    
  5066. } type_meta_garb;
  5067.  
  5068. #pragma mark -- glw!
  5069.  
  5070. typedef struct {
  5071.     char attachment_marker[32];
  5072.     uint16_t number_of_particles;
  5073.     uint16_t boundary_effect;
  5074.     uint16_t normal_particle_distribution;
  5075.     uint16_t trailing_particle_distribution;
  5076.     uint32_t glow_flags;    //toff 104  32-bit 0x0000003F
  5077.     // offset 108 = 36 bytes of 0
  5078.    
  5079.     uint16_t attachment_particle_rotation;
  5080.     // offset 146 = 2 bytes of 0
  5081.     float particle_rotational_velocity;
  5082.     float particle_rotational_velocity_multiplier_low;
  5083.     float particle_rotational_velocity_multiplier_high;
  5084.    
  5085.     uint16_t attachment_effect_rotation;
  5086.     // offset 162 = 2 bytes of 0
  5087.     float effect_rotational_velocity;
  5088.     float effect_rotational_velocity_multiplier_low;
  5089.     float effect_rotational_velocity_multiplier_high;
  5090.    
  5091.     uint16_t attachment_effect_translation;
  5092.     // offset 178 = 2 bytes of 0
  5093.     float effect_translational_velocity;
  5094.     float effect_translational_velocity_multiplier_low;
  5095.     float effect_translational_velocity_multiplier_high;
  5096.    
  5097.     uint16_t attachment_distance;
  5098.     // offset 194 = 2 bytes of 0
  5099.     float minimum_distance_particle_to_object;
  5100.     float maximum_distance_particle_to_object;
  5101.     float distance_to_object_multiplier_low;
  5102.     float distance_to_object_multiplier_high;
  5103.     // offset 212 = 8 bytes of 0
  5104.    
  5105.     uint16_t attachment_size;
  5106.     // offset 222 = 2 bytes of 0
  5107.    
  5108.     float particle_size_bounds_from;
  5109.     float particle_size_bounds_to;
  5110.     float size_attachment_multiplier_from;
  5111.     float size_attachment_multiplier_to;
  5112.    
  5113.     uint16_t attachment_color;
  5114.     // offset 242 = 2 bytes of 0
  5115.     float color_bound_0_a_frac;
  5116.     float color_bound_0_r_frac;
  5117.     float color_bound_0_g_frac;
  5118.     float color_bound_0_b_frac;
  5119.     float color_bound_1_a_frac;
  5120.     float color_bound_1_r_frac;
  5121.     float color_bound_1_g_frac;
  5122.     float color_bound_1_b_frac;
  5123.     float scale_color_0_a_frac;
  5124.     float scale_color_0_r_frac;
  5125.     float scale_color_0_g_frac;
  5126.     float scale_color_0_b_frac;
  5127.     float scale_color_1_a_frac;
  5128.     float scale_color_1_r_frac;
  5129.     float scale_color_1_g_frac;
  5130.     float scale_color_1_b_frac;
  5131.    
  5132.     float color_rate_of_change;
  5133.     float fading_percentage_of_glow;
  5134.     float particle_generation_frequency;
  5135.     float lifetime_of_trailing_particles;
  5136.     float velocity_of_trailing_particles;
  5137.     float trailing_particle_minimum_translation;
  5138.     float trailing_particle_maximum_translation;
  5139.    
  5140.     // offset 336 = 52 bytes of 0
  5141.    
  5142.     // dependency 1: texture bitm
  5143.     char texture_tagclass[5];        //unsigned char[5]
  5144.     uint32_t texture_tagnamepointer;   //uint32 ("random" number)
  5145.     uint32_t texture_tagnamestringlength;   //uint32
  5146.     uint32_t texture_tagid;      //uint32 (0xFFFFFFFF with tags)
  5147.     // char texture_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  5148.    
  5149.     // dependency 1 tagpathname string goes here (how sudden! ;) )
  5150.    
  5151. } type_meta_glw;
  5152.  
  5153. #pragma mark -- grhi
  5154.  
  5155. typedef struct {
  5156.     uint16_t grenade_hud_screen_alignment_anchor;
  5157.     // offset 66 = 34 bytes of 0
  5158.     uint16_t grenade_hud_background_anchor_offset_x;   // interpret these two as signed
  5159.     uint16_t grenade_hud_background_anchor_offset_y;
  5160.     float grenade_hud_background_width_scale;
  5161.     float grenade_hud_background_height_scale;
  5162.     // 112, 1
  5163.     uint8_t grenade_hud_background_scaling_flags;   //toff 112  8-bit 0x07
  5164.     // offset 114 = 22 bytes of 0
  5165.    
  5166.     // dependency 1: grenade hud background interface bitmap bitm
  5167.     char grenade_hud_background_interface_bitmap_tagclass[5];        //unsigned char[5]
  5168.     uint32_t grenade_hud_background_interface_bitmap_tagnamepointer;   //uint32 ("random" number)
  5169.     uint32_t grenade_hud_background_interface_bitmap_tagnamestringlength;   //uint32
  5170.     uint32_t grenade_hud_background_interface_bitmap_tagid;      //uint32 (0xFFFFFFFF with tags)
  5171.     // char grenade_hud_background_interface_bitmap_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  5172.    
  5173.     uint8_t grenade_hud_background_default_color_a;
  5174.     uint8_t grenade_hud_background_default_color_r;
  5175.     uint8_t grenade_hud_background_default_color_g;
  5176.     uint8_t grenade_hud_background_default_color_b;
  5177.     uint8_t grenade_hud_background_flashing_color_a;
  5178.     uint8_t grenade_hud_background_flashing_color_r;
  5179.     uint8_t grenade_hud_background_flashing_color_g;
  5180.     uint8_t grenade_hud_background_flashing_color_b;
  5181.    
  5182.     float grenade_hud_background_flash_period;
  5183.     float grenade_hud_background_flash_delay;
  5184.     uint16_t grenade_hud_background_number_of_flashes;
  5185.     // 170, 1
  5186.     uint8_t grenade_hud_background_flash_flags; //toff 170  0x01
  5187.     float grenade_hud_background_flash_length;
  5188.    
  5189.     uint8_t grenade_hud_background_disabled_color_a;
  5190.     uint8_t grenade_hud_background_disabled_color_r;
  5191.     uint8_t grenade_hud_background_disabled_color_g;
  5192.     uint8_t grenade_hud_background_disabled_color_b;
  5193.    
  5194.     // offset 180 = 4 bytes of 0
  5195.    
  5196.     uint16_t grenade_hud_background_sequence_index;
  5197.     // offset 186 = 2 bytes of 0
  5198.    
  5199.     // representation 1 board, offset 188
  5200.     // r1b_grenade_hud_background_multitex_overlay_
  5201.     uint32_t r1b_grenade_hud_background_multitex_overlay_entrycount; // maximum of 30 cells
  5202.     uint32_t r1b_grenade_hud_background_multitex_overlay_random_id;
  5203.     uint32_t r1b_grenade_hud_background_multitex_overlay_sig_id; // example value = 0xCC3A9C00
  5204.    
  5205.     // offset 200 = 4 (my new shorthand for "4 bytes of 0")
  5206.    
  5207.     uint16_t total_grenades_background_anchor_offset_x;   // interpret these two as signed
  5208.     uint16_t total_grenades_background_anchor_offset_y;
  5209.    
  5210.     float total_grenades_background_width_scale;
  5211.     float total_grenades_background_height_scale;
  5212.     // 216, 1
  5213.     uint8_t total_grenades_background_scaling_flags;    //toff 216  0x07
  5214.     // offset 218 = 22
  5215.    
  5216.     // dependency 2: total grenades background interface bitmap bitm
  5217.     char total_grenades_background_interface_bitmap_tagclass[5];         //unsigned char[5]
  5218.     uint32_t total_grenades_background_interface_bitmap_tagnamepointer;   //uint32 ("random" number)
  5219.     uint32_t total_grenades_background_interface_bitmap_tagnamestringlength;   //uint32
  5220.     uint32_t total_grenades_background_interface_bitmap_tagid;       //uint32 (0xFFFFFFFF with tags)
  5221.     // char total_grenades_background_interface_bitmap_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  5222.    
  5223.     uint8_t total_grenades_background_default_color_a;
  5224.     uint8_t total_grenades_background_default_color_r;
  5225.     uint8_t total_grenades_background_default_color_g;
  5226.     uint8_t total_grenades_background_default_color_b;
  5227.     uint8_t total_grenades_background_flashing_color_a;
  5228.     uint8_t total_grenades_background_flashing_color_r;
  5229.     uint8_t total_grenades_background_flashing_color_g;
  5230.     uint8_t total_grenades_background_flashing_color_b;
  5231.    
  5232.     float total_grenades_background_flash_period;
  5233.     float total_grenades_background_flash_delay;
  5234.    
  5235.     uint16_t total_grenades_background_number_of_flashes;
  5236.     // 274, 1
  5237.     uint8_t total_grenades_background_flash_flags;  //toff 274  0x01
  5238.    
  5239.     float total_grenades_background_flash_length;
  5240.    
  5241.     uint8_t total_grenades_background_disabled_color_a;
  5242.     uint8_t total_grenades_background_disabled_color_r;
  5243.     uint8_t total_grenades_background_disabled_color_g;
  5244.     uint8_t total_grenades_background_disabled_color_b;
  5245.    
  5246.     // offset 284 = 4 bytes of 0
  5247.    
  5248.     uint16_t total_grenades_background_sequence_index;
  5249.     // offset 290 = 2 bytes of 0
  5250.    
  5251.     // representation 2 board, offset 188
  5252.     // r2b_total_grenades_background_multitex_overlay_
  5253.     uint32_t r2b_total_grenades_background_multitex_overlay_entrycount; // maximum of 30 cells
  5254.     uint32_t r2b_total_grenades_background_multitex_overlay_random_id;
  5255.     uint32_t r2b_total_grenades_background_multitex_overlay_sig_id; // example value = 0xCC3A9C00 (same for each "multitex overlay"...)
  5256.    
  5257.     // offset 304 = 4 bytes of 0
  5258.    
  5259.     uint16_t total_grenades_numbers_anchor_offset_x;   // interpret these two as signed
  5260.     uint16_t total_grenades_numbers_anchor_offset_y;
  5261.     float total_grenades_numbers_width_scale;
  5262.     float total_grenades_numbers_height_scale;
  5263.     // 320, 1
  5264.     uint8_t total_grenades_numbers_scaling_flags;   //toff 320  0x07
  5265.    
  5266.     // offset 322 = 22 bytes of 0
  5267.    
  5268.     uint8_t total_grenades_numbers_default_color_a;
  5269.     uint8_t total_grenades_numbers_default_color_r;
  5270.     uint8_t total_grenades_numbers_default_color_g;
  5271.     uint8_t total_grenades_numbers_default_color_b;
  5272.     uint8_t total_grenades_numbers_flashing_color_a;
  5273.     uint8_t total_grenades_numbers_flashing_color_r;
  5274.     uint8_t total_grenades_numbers_flashing_color_g;
  5275.     uint8_t total_grenades_numbers_flashing_color_b;
  5276.    
  5277.     float total_grenades_numbers_flash_period;
  5278.     float total_grenades_numbers_flash_delay;
  5279.     uint16_t total_grenades_numbers_number_of_flashes;
  5280.     // 362, 1
  5281.     uint8_t total_grenades_numbers_flash_flags; //toff 362  0x01
  5282.    
  5283.     float total_grenades_numbers_flash_length;
  5284.    
  5285.     uint8_t total_grenades_numbers_disabled_color_a;
  5286.     uint8_t total_grenades_numbers_disabled_color_r;
  5287.     uint8_t total_grenades_numbers_disabled_color_g;
  5288.     uint8_t total_grenades_numbers_disabled_color_b;
  5289.    
  5290.     // offset 372 = 4 bytes of 0
  5291.    
  5292.     // the following three values are all byte sized, but I don't understand why, and it is unusual
  5293.     uint8_t total_grenades_numbers_maximum_number_of_digits;   // -128 to 127, but why?
  5294.     uint8_t total_grenades_numbers_flags;   //toff 377 (untested)   0x07
  5295.     uint8_t total_grenades_numbers_number_of_fractional_digits;   // -128 to 127, but why?
  5296.    
  5297.     // offset 379 = 13 bytes of 0
  5298.    
  5299.     uint16_t total_grenades_numbers_flash_cutoff;   // offset 392
  5300.    
  5301.     // offset 394 = 2 (again, shorthand for "2 bytes of 0")
  5302.    
  5303.     // dependency 3: total grenades overlays overlay bitmap bitm
  5304.     char total_grenades_overlays_overlay_bitmap_tagclass[5];         //unsigned char[5]
  5305.     uint32_t total_grenades_overlays_overlay_bitmap_tagnamepointer;   //uint32 ("random" number)
  5306.     uint32_t total_grenades_overlays_overlay_bitmap_tagnamestringlength;   //uint32
  5307.     uint32_t total_grenades_overlays_overlay_bitmap_tagid;       //uint32 (0xFFFFFFFF with tags)
  5308.     // char total_grenades_overlays_overlay_bitmap_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  5309.    
  5310.     // representation 3 board, offset 412
  5311.     // r3b_total_grenades_overlays_overlays_
  5312.     uint32_t r3b_total_grenades_overlays_overlays_entrycount; // maximum of 16 cells
  5313.     uint32_t r3b_total_grenades_overlays_overlays_random_id;
  5314.     uint32_t r3b_total_grenades_overlays_overlays_sig_id; // example value = 0x485E9C00
  5315.    
  5316.     // representation 4 board, offset 424
  5317.     // r4b_warning_sounds_
  5318.     uint32_t r4b_warning_sounds_entrycount; // maximum of 12 cells
  5319.     uint32_t r4b_warning_sounds_random_id;
  5320.     uint32_t r4b_warning_sounds_sig_id; // example value = 0xD05E9C00
  5321.    
  5322.     // offset 436 = 68
  5323.    
  5324.     uint16_t messaging_information_sequence_index;
  5325.     uint16_t messaging_information_width_offset;   // interpret these three as signed
  5326.     uint16_t messaging_information_offset_from_reference_corner_x;
  5327.     uint16_t messaging_information_offset_from_reference_corner_y;
  5328.    
  5329.     uint8_t messaging_information_override_icon_color_a;
  5330.     uint8_t messaging_information_override_icon_color_r;
  5331.     uint8_t messaging_information_override_icon_color_g;
  5332.     uint8_t messaging_information_override_icon_color_b;
  5333.    
  5334.     uint8_t messaging_information_frame_rate;   // -128 to 127
  5335.     uint8_t messaging_information_flags;    //toff 517 (untested)   0x07
  5336.     uint16_t messaging_information_text_index;
  5337.    
  5338.     // offset 520 = 48
  5339.    
  5340.     // dependency 1 tagpathname string goes here
  5341.    
  5342.     struct grhi_r1c {
  5343.         // representation 1 cells
  5344.         // r1c_grenade_hud_background_multitex_overlay_
  5345.        
  5346.         // in cell here: 2 bytes of 0
  5347.        
  5348.         uint16_t r1c_grenade_hud_background_multitex_overlay_type;
  5349.         uint16_t r1c_grenade_hud_background_multitex_overlay_framebuffer_blend_function;
  5350.        
  5351.         // in cell here: 34 (shorthand for "34 bytes of 0")
  5352.        
  5353.         uint16_t r1c_grenade_hud_background_multitex_overlay_anchors_primary_anchor;
  5354.         uint16_t r1c_grenade_hud_background_multitex_overlay_anchors_secondary_anchor;
  5355.         uint16_t r1c_grenade_hud_background_multitex_overlay_anchors_tertiary_anchor;
  5356.         uint16_t r1c_grenade_hud_background_multitex_overlay_blending_function_0_to_1_blend_function;
  5357.         uint16_t r1c_grenade_hud_background_multitex_overlay_blending_function_1_to_2_blend_function;
  5358.        
  5359.         // o 635 = 2 (shorthand for "offset 635 = 2 bytes of 0")
  5360.        
  5361.         float r1c_grenade_hud_background_multitex_overlay_map_scales_primary_scale_x;
  5362.         float r1c_grenade_hud_background_multitex_overlay_map_scales_primary_scale_y;
  5363.         float r1c_grenade_hud_background_multitex_overlay_map_scales_secondary_scale_x;
  5364.         float r1c_grenade_hud_background_multitex_overlay_map_scales_secondary_scale_y;
  5365.         float r1c_grenade_hud_background_multitex_overlay_map_scales_tertiary_scale_x;
  5366.         float r1c_grenade_hud_background_multitex_overlay_map_scales_tertiary_scale_y;
  5367.        
  5368.         float r1c_grenade_hud_background_multitex_overlay_map_offsets_primary_offset_x;
  5369.         float r1c_grenade_hud_background_multitex_overlay_map_offsets_primary_offset_y;
  5370.         float r1c_grenade_hud_background_multitex_overlay_map_offsets_secondary_offset_x;
  5371.         float r1c_grenade_hud_background_multitex_overlay_map_offsets_secondary_offset_y;
  5372.         float r1c_grenade_hud_background_multitex_overlay_map_offsets_tertiary_offset_x;
  5373.         float r1c_grenade_hud_background_multitex_overlay_map_offsets_tertiary_offset_y;
  5374.        
  5375.         // dependency r1c 1: grenade hud background multitex overlay map primary bitm
  5376.         char r1c1_grenade_hud_background_multitex_overlay_map_primary_tagclass[5];       //unsigned char[5]
  5377.         uint32_t r1c1_grenade_hud_background_multitex_overlay_map_primary_tagnamepointer;   //uint32 ("random" number)
  5378.         uint32_t r1c1_grenade_hud_background_multitex_overlay_map_primary_tagnamestringlength;   //uint32
  5379.         uint32_t r1c1_grenade_hud_background_multitex_overlay_map_primary_tagid;         //uint32 (0xFFFFFFFF with tags)
  5380.         // char r1c1_grenade_hud_background_multitex_overlay_map_primary_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  5381.        
  5382.         // dependency r1c 2: grenade hud background multitex overlay map secondary bitm
  5383.         char r1c2_grenade_hud_background_multitex_overlay_map_secondary_tagclass[5];         //unsigned char[5]
  5384.         uint32_t r1c2_grenade_hud_background_multitex_overlay_map_secondary_tagnamepointer;   //uint32 ("random" number)
  5385.         uint32_t r1c2_grenade_hud_background_multitex_overlay_map_secondary_tagnamestringlength;   //uint32
  5386.         uint32_t r1c2_grenade_hud_background_multitex_overlay_map_secondary_tagid;       //uint32 (0xFFFFFFFF with tags)
  5387.         // char r1c2_grenade_hud_background_multitex_overlay_map_secondary_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  5388.        
  5389.         // dependency r1c 3: grenade hud background multitex overlay map tertiary bitm
  5390.         char r1c3_grenade_hud_background_multitex_overlay_map_tertiary_tagclass[5];      //unsigned char[5]
  5391.         uint32_t r1c3_grenade_hud_background_multitex_overlay_map_tertiary_tagnamepointer;   //uint32 ("random" number)
  5392.         uint32_t r1c3_grenade_hud_background_multitex_overlay_map_tertiary_tagnamestringlength;   //uint32
  5393.         uint32_t r1c3_grenade_hud_background_multitex_overlay_map_tertiary_tagid;        //uint32 (0xFFFFFFFF with tags)
  5394.         // char r1c3_grenade_hud_background_multitex_overlay_map_tertiary_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  5395.        
  5396.         uint16_t r1c_grenade_hud_background_multitex_overlay_map_primary_wrap_mode;
  5397.         uint16_t r1c_grenade_hud_background_multitex_overlay_map_secondary_wrap_mode;
  5398.         uint16_t r1c_grenade_hud_background_multitex_overlay_map_tertiary_wrap_mode;
  5399.        
  5400.         // in cell here: 186 bytes of 0
  5401.        
  5402.         // representation 1 sub-board A
  5403.         // r1sbA_multitex_overlay_effectors_
  5404.         uint32_t r1sbA_multitex_overlay_effectors_entrycount; // maximum of 30 cells
  5405.         uint32_t r1sbA_multitex_overlay_effectors_random_id;
  5406.         uint32_t r1sbA_multitex_overlay_effectors_sig_id; // example value = 0x10399C00
  5407.        
  5408.         // in cell here: 128 bytes of 0
  5409.        
  5410.     }r1c_grenade_hud_background_multitex_overlay;
  5411.    
  5412.     // tags are so freaking retarted and inconsistent, I am really annoyed.
  5413.     // After all the above cells' data, you have:
  5414.     // r1c's 3 dependency tagpathname strings FOR THE CURRENT CELL ONLY
  5415.     // followed by
  5416.     // the sub-cells for Effectors (r1scA) FOR THE CURRENT CELL ONLY
  5417.    
  5418.     //... it doesn't make any sense, why can't they just do it right! Gosh, that's annoying.
  5419.    
  5420.     // so illogical!
  5421.    
  5422.     // so you have a logical grouping of the tagpathname strings with the effectors, but that is incorrect!
  5423.     // the only way to logically present this is as such, where the strings are at the top of a separate container that also contains the effectors for that cell:
  5424.    
  5425.     struct grhi_r1_misgrouped_data {
  5426.         // mis-grouped data for representation 1
  5427.         // see my annoyed comments above
  5428.         // r1mdc_
  5429.        
  5430.         // tagpathname strings for dependencies r1c 1, r1c 2 and r1c 3 OF THE CURRENT CELL go here
  5431.        
  5432.         struct grhi_r1scA {
  5433.             // representation 1 sub-cells A
  5434.             // r1scA_multitex_overlay_effectors_
  5435.             // (all the sub-cells A for the current cell)
  5436.            
  5437.             // in cell here: 64 bytes of 0
  5438.            
  5439.             uint16_t r1scA_multitex_overlay_effectors_source_destination_destination_type;
  5440.             uint16_t r1scA_multitex_overlay_effectors_source_destination_destination;
  5441.             uint16_t r1scA_multitex_overlay_effectors_source_destination_source;
  5442.             // in cell here: 2 bytes of 0
  5443.             float r1scA_multitex_overlay_effectors_in_out_bounds_in_bounds_from;
  5444.             float r1scA_multitex_overlay_effectors_in_out_bounds_in_bounds_to;
  5445.             float r1scA_multitex_overlay_effectors_in_out_bounds_out_bounds_from;
  5446.             float r1scA_multitex_overlay_effectors_in_out_bounds_out_bounds_to;
  5447.            
  5448.             // in cell here: 64 bytes of 0
  5449.            
  5450.             float r1scA_multitex_overlay_effectors_tint_color_bounds_tint_color_lower_bound_r_frac;
  5451.             float r1scA_multitex_overlay_effectors_tint_color_bounds_tint_color_lower_bound_g_frac;
  5452.             float r1scA_multitex_overlay_effectors_tint_color_bounds_tint_color_lower_bound_b_frac;
  5453.             float r1scA_multitex_overlay_effectors_tint_color_bounds_tint_color_upper_bound_r_frac;
  5454.             float r1scA_multitex_overlay_effectors_tint_color_bounds_tint_color_upper_bound_g_frac;
  5455.             float r1scA_multitex_overlay_effectors_tint_color_bounds_tint_color_upper_bound_b_frac;
  5456.            
  5457.             uint16_t r1scA_multitex_overlay_effectors_periodic_functions_periodic_function;
  5458.             // in cell here: 2 bytes of 0
  5459.            
  5460.             float r1scA_multitex_overlay_effectors_periodic_functions_function_period;
  5461.             float r1scA_multitex_overlay_effectors_periodic_functions_function_phase;
  5462.            
  5463.             // in cell here: 32 bytes of 0
  5464.         }r1scA_multitex_overlay_effectors;
  5465.        
  5466.     }r1_misgrouped_data_container;
  5467.    
  5468.     // offset 213795 in test data
  5469.    
  5470.     // dependency 2 tagpathname string goes here
  5471.    
  5472.     struct grhi_r2c {
  5473.         // representation 2 cells
  5474.         // r2c_total_grenades_background_multitex_overlay_
  5475.        
  5476.         // in cell here: 2 bytes of 0
  5477.        
  5478.         uint16_t r2c_total_grenades_background_multitex_overlay_type;
  5479.         uint16_t r2c_total_grenades_background_multitex_overlay_framebuffer_blend_function;
  5480.        
  5481.         // in cell here: 34 (shorthand for "34 bytes of 0")
  5482.        
  5483.         uint16_t r2c_total_grenades_background_multitex_overlay_anchors_primary_anchor;
  5484.         uint16_t r2c_total_grenades_background_multitex_overlay_anchors_secondary_anchor;
  5485.         uint16_t r2c_total_grenades_background_multitex_overlay_anchors_tertiary_anchor;
  5486.         uint16_t r2c_total_grenades_background_multitex_overlay_blending_function_0_to_1_blend_function;
  5487.         uint16_t r2c_total_grenades_background_multitex_overlay_blending_function_1_to_2_blend_function;
  5488.        
  5489.         // 2 (shorthand for "in cell here: 2 bytes of 0")
  5490.        
  5491.         float r2c_total_grenades_background_multitex_overlay_map_scales_primary_scale_x;
  5492.         float r2c_total_grenades_background_multitex_overlay_map_scales_primary_scale_y;
  5493.         float r2c_total_grenades_background_multitex_overlay_map_scales_secondary_scale_x;
  5494.         float r2c_total_grenades_background_multitex_overlay_map_scales_secondary_scale_y;
  5495.         float r2c_total_grenades_background_multitex_overlay_map_scales_tertiary_scale_x;
  5496.         float r2c_total_grenades_background_multitex_overlay_map_scales_tertiary_scale_y;
  5497.        
  5498.         float r2c_total_grenades_background_multitex_overlay_map_offsets_primary_offset_x;
  5499.         float r2c_total_grenades_background_multitex_overlay_map_offsets_primary_offset_y;
  5500.         float r2c_total_grenades_background_multitex_overlay_map_offsets_secondary_offset_x;
  5501.         float r2c_total_grenades_background_multitex_overlay_map_offsets_secondary_offset_y;
  5502.         float r2c_total_grenades_background_multitex_overlay_map_offsets_tertiary_offset_x;
  5503.         float r2c_total_grenades_background_multitex_overlay_map_offsets_tertiary_offset_y;
  5504.        
  5505.         // dependency r2c 1: total grenades background multitex overlay map primary bitm
  5506.         char r2c1_total_grenades_background_multitex_overlay_map_primary_tagclass[5];        //unsigned char[5]
  5507.         uint32_t r2c1_total_grenades_background_multitex_overlay_map_primary_tagnamepointer;   //uint32 ("random" number)
  5508.         uint32_t r2c1_total_grenades_background_multitex_overlay_map_primary_tagnamestringlength;   //uint32
  5509.         uint32_t r2c1_total_grenades_background_multitex_overlay_map_primary_tagid;      //uint32 (0xFFFFFFFF with tags)
  5510.         // char r2c1_total_grenades_background_multitex_overlay_map_primary_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  5511.        
  5512.         // dependency r2c 2: total grenades background multitex overlay map secondary bitm
  5513.         char r2c2_total_grenades_background_multitex_overlay_map_secondary_tagclass[5];      //unsigned char[5]
  5514.         uint32_t r2c2_total_grenades_background_multitex_overlay_map_secondary_tagnamepointer;   //uint32 ("random" number)
  5515.         uint32_t r2c2_total_grenades_background_multitex_overlay_map_secondary_tagnamestringlength;   //uint32
  5516.         uint32_t r2c2_total_grenades_background_multitex_overlay_map_secondary_tagid;        //uint32 (0xFFFFFFFF with tags)
  5517.         // char r2c2_total_grenades_background_multitex_overlay_map_secondary_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  5518.        
  5519.         // dependency r2c 3: total grenades background multitex overlay map tertiary bitm
  5520.         char r2c3_total_grenades_background_multitex_overlay_map_tertiary_tagclass[5];       //unsigned char[5]
  5521.         uint32_t r2c3_total_grenades_background_multitex_overlay_map_tertiary_tagnamepointer;   //uint32 ("random" number)
  5522.         uint32_t r2c3_total_grenades_background_multitex_overlay_map_tertiary_tagnamestringlength;   //uint32
  5523.         uint32_t r2c3_total_grenades_background_multitex_overlay_map_tertiary_tagid;         //uint32 (0xFFFFFFFF with tags)
  5524.         // char r2c3_total_grenades_background_multitex_overlay_map_tertiary_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  5525.        
  5526.         uint16_t r2c_total_grenades_background_multitex_overlay_map_primary_wrap_mode;
  5527.         uint16_t r2c_total_grenades_background_multitex_overlay_map_secondary_wrap_mode;
  5528.         uint16_t r2c_total_grenades_background_multitex_overlay_map_tertiary_wrap_mode;
  5529.        
  5530.         // in cell here: 186 bytes of 0
  5531.        
  5532.         // representation 2 sub-board A
  5533.         // r2sbA_multitex_overlay_effectors_
  5534.         uint32_t r2sbA_multitex_overlay_effectors_entrycount; // maximum of 30 cells
  5535.         uint32_t r2sbA_multitex_overlay_effectors_random_id;
  5536.         uint32_t r2sbA_multitex_overlay_effectors_sig_id; // example value = 0x10399C00 (same)
  5537.        
  5538.         // in cell here: 128 bytes of 0
  5539.        
  5540.     }r2c_total_grenades_background_multitex_overlay;
  5541.    
  5542.     struct grhi_r2_misgrouped_data {
  5543.         // mis-grouped data for representation 2
  5544.         // r2mdc_
  5545.        
  5546.         // tagpathname strings for dependencies r2c 1, r2c 2 and r2c 3 OF THE CURRENT CELL go here
  5547.        
  5548.         struct grhi_r2scA {
  5549.             // representation 2 sub-cells A
  5550.             // r2scA_multitex_overlay_effectors_
  5551.             // (all the sub-cells A for the current cell)
  5552.            
  5553.             // in cell here: 64 bytes of 0
  5554.            
  5555.             uint16_t r2scA_multitex_overlay_effectors_source_destination_destination_type;
  5556.             uint16_t r2scA_multitex_overlay_effectors_source_destination_destination;
  5557.             uint16_t r2scA_multitex_overlay_effectors_source_destination_source;
  5558.             // in cell here: 2 bytes of 0
  5559.             float r2scA_multitex_overlay_effectors_in_out_bounds_in_bounds_from;
  5560.             float r2scA_multitex_overlay_effectors_in_out_bounds_in_bounds_to;
  5561.             float r2scA_multitex_overlay_effectors_in_out_bounds_out_bounds_from;
  5562.             float r2scA_multitex_overlay_effectors_in_out_bounds_out_bounds_to;
  5563.            
  5564.             // in cell here: 64 bytes of 0
  5565.            
  5566.             float r2scA_multitex_overlay_effectors_tint_color_bounds_tint_color_lower_bound_r_frac;
  5567.             float r2scA_multitex_overlay_effectors_tint_color_bounds_tint_color_lower_bound_g_frac;
  5568.             float r2scA_multitex_overlay_effectors_tint_color_bounds_tint_color_lower_bound_b_frac;
  5569.             float r2scA_multitex_overlay_effectors_tint_color_bounds_tint_color_upper_bound_r_frac;
  5570.             float r2scA_multitex_overlay_effectors_tint_color_bounds_tint_color_upper_bound_g_frac;
  5571.             float r2scA_multitex_overlay_effectors_tint_color_bounds_tint_color_upper_bound_b_frac;
  5572.            
  5573.             uint16_t r2scA_multitex_overlay_effectors_periodic_functions_periodic_function;
  5574.             // in cell here: 2 bytes of 0
  5575.            
  5576.             float r2scA_multitex_overlay_effectors_periodic_functions_function_period;
  5577.             float r2scA_multitex_overlay_effectors_periodic_functions_function_phase;
  5578.            
  5579.             // in cell here: 32 bytes of 0
  5580.         }r2scA_multitex_overlay_effectors;
  5581.        
  5582.     }r2_misgrouped_data_container;
  5583.    
  5584.     // offset 427022 in test data
  5585.    
  5586.     // dependency 3 tagpathname string goes here
  5587.    
  5588.     struct grhi_r3c {
  5589.         // representation 3 cells
  5590.         // r3c_total_grenades_overlays_overlays_
  5591.        
  5592.         uint16_t r3c_total_grenades_overlays_overlays_anchor_offset_x;   // interpret these two as signed
  5593.         uint16_t r3c_total_grenades_overlays_overlays_anchor_offset_y;
  5594.         float r3c_total_grenades_overlays_overlays_width_scale;
  5595.         float r3c_total_grenades_overlays_overlays_height_scale;
  5596.         // 1
  5597.         uint8_t r3c_total_grenades_overlays_overlays_scaling_flags; //toff 580  0x07
  5598.        
  5599.         // 22
  5600.        
  5601.         uint8_t r3c_total_grenades_overlays_overlays_default_color_a;
  5602.         uint8_t r3c_total_grenades_overlays_overlays_default_color_r;
  5603.         uint8_t r3c_total_grenades_overlays_overlays_default_color_g;
  5604.         uint8_t r3c_total_grenades_overlays_overlays_default_color_b;
  5605.        
  5606.         uint8_t r3c_total_grenades_overlays_overlays_flashing_color_a;
  5607.         uint8_t r3c_total_grenades_overlays_overlays_flashing_color_r;
  5608.         uint8_t r3c_total_grenades_overlays_overlays_flashing_color_g;
  5609.         uint8_t r3c_total_grenades_overlays_overlays_flashing_color_b;
  5610.        
  5611.         float r3c_total_grenades_overlays_overlays_flash_period;
  5612.         float r3c_total_grenades_overlays_overlays_flash_delay;
  5613.        
  5614.         uint16_t r3c_total_grenades_overlays_overlays_number_of_flashes;
  5615.         // 1
  5616.         uint8_t r3c_total_grenades_overlays_overlays_flash_flags;   //toff 622  0x01
  5617.        
  5618.         float r3c_total_grenades_overlays_overlays_flash_length;
  5619.        
  5620.         uint8_t r3c_total_grenades_overlays_overlays_disabled_color_a;
  5621.         uint8_t r3c_total_grenades_overlays_overlays_disabled_color_r;
  5622.         uint8_t r3c_total_grenades_overlays_overlays_disabled_color_g;
  5623.         uint8_t r3c_total_grenades_overlays_overlays_disabled_color_b;
  5624.        
  5625.         // 4
  5626.        
  5627.         float r3c_total_grenades_overlays_overlays_frame_rate;  // exof: 427105, differs from wphi which stores as uint16_t
  5628.        
  5629.         uint16_t r3c_total_grenades_overlays_overlays_sequence_index;
  5630.         // 1
  5631.         uint8_t r3c_total_grenades_overlays_overlays_type;  //toff 642  0x0F
  5632.        
  5633.         uint32_t r3c_total_grenades_overlays_overlays_flags;    //toff 644  0x00000001
  5634.        
  5635.         // 56
  5636.        
  5637.     }r3c_total_grenades_overlays_overlays;
  5638.     // exstof: 429213
  5639.     struct grhi_r4c {
  5640.         // representation 4 cells
  5641.         // r4c_warning_sounds_
  5642.        
  5643.         // dependency r4c 1: sound snd! lsnd
  5644.         char r4c1_sound_tagclass[5];         //unsigned char[5]
  5645.         uint32_t r4c1_sound_tagnamepointer;   //uint32 ("random" number)
  5646.         uint32_t r4c1_sound_tagnamestringlength;   //uint32
  5647.         uint32_t r4c1_sound_tagid;       //uint32 (0xFFFFFFFF with tags)
  5648.         // char rr4c1_sound_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  5649.        
  5650.         uint32_t r4c_warning_sounds_latched_to; //toff 720  0x00000007
  5651.         float r4c_warning_sounds_scale;
  5652.        
  5653.         // 32
  5654.        
  5655.     }r4c_warning_sounds;
  5656.    
  5657.     // dependency r4c 1 tagpathname strings go here
  5658.    
  5659. } type_meta_grhi;
  5660.  
  5661. #pragma mark -- hmt
  5662.  
  5663. typedef struct {
  5664.    
  5665.     uint32_t text_data;
  5666.     // offset 68 = 4
  5667.     // little endian internal board values:
  5668.     uint32_t INTERNAL_text_data_offset_pointer;   // example value = 128 (correct)
  5669.     uint32_t INTERNAL_text_data_random1;
  5670.     uint32_t INTERNAL_text_data_sig_id;   // example value = 0x302A9C00
  5671.    
  5672.     // representation 1 board, offset 84
  5673.     // r1b_message_elements_
  5674.     uint32_t r1b_message_elements_entrycount; // maximum of 8192 cells
  5675.     uint32_t r1b_message_elements_random_id;
  5676.     uint32_t r1b_message_elements_sig_id; // example value = 0x642A9C00
  5677.    
  5678.     // representation 2 board, offset 96
  5679.     // r2b_messages_
  5680.     uint32_t r2b_messages_entrycount; // maximum of 1024 cells
  5681.     uint32_t r2b_messages_random_id;
  5682.     uint32_t r2b_messages_sig_id; // example value = 0xE42A9C00
  5683.    
  5684.     // 84
  5685.    
  5686.     // if there is any text data with null-padded characters (hud message text approach) then it goes here
  5687.    
  5688.     struct hmt_r1c {
  5689.         // representation 1 cells
  5690.         // r1c_message_elements_
  5691.        
  5692.         // for some reason, these values are considered signed, making the longest string 128 characters (so 64 null-padded hmt characters)
  5693.         uint8_t r1c_message_elements_type;   // -127 to 128
  5694.         uint8_t r1c_message_elements_data;   // -127 to 128
  5695.     }r1c_message_elements;
  5696.    
  5697.     struct hmt_r2c {
  5698.         // representation 2 cells
  5699.         // r2c_messages_
  5700.        
  5701.         char r2c_messages_name[32];
  5702.         uint16_t r2c_messages_start_index_into_text_blob;
  5703.         uint16_t r2c_messages_start_index_of_message_block;
  5704.         uint8_t r2c_messages_panel_count;   // -127 to 128
  5705.        
  5706.         // 27
  5707.        
  5708.     }r2c_messages;
  5709.    
  5710. } type_meta_hmt;
  5711.  
  5712. #pragma mark -- hudg
  5713.  
  5714. typedef struct {
  5715.     uint16_t messaging_parameters_anchor;
  5716.     // 66, 34 (shorthand for "offset 66 = 34 bytes of 0)
  5717.     uint16_t messaging_parameters_anchor_offset_x;   // interpret these two as signed
  5718.     uint16_t messaging_parameters_anchor_offset_y;
  5719.     float messaging_parameters_width_scale;
  5720.     float messaging_parameters_height_scale;
  5721.     // 112, 1
  5722.     uint8_t messaging_parameters_scaling_flags; //toff 112  0x07
  5723.     // 114, 22
  5724.    
  5725.     // dependency 1: messaging parameters single player font font
  5726.     char messaging_parameters_single_player_font_tagclass[5];        //unsigned char[5]
  5727.     uint32_t messaging_parameters_single_player_font_tagnamepointer;   //uint32 ("random" number)
  5728.     uint32_t messaging_parameters_single_player_font_tagnamestringlength;   //uint32
  5729.     uint32_t messaging_parameters_single_player_font_tagid;      //uint32 (0xFFFFFFFF with tags)
  5730.     // char messaging_parameters_single_player_font_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  5731.    
  5732.     // dependency 2: messaging parameters multi player font font
  5733.     char messaging_parameters_multi_player_font_tagclass[5];         //unsigned char[5]
  5734.     uint32_t messaging_parameters_multi_player_font_tagnamepointer;   //uint32 ("random" number)
  5735.     uint32_t messaging_parameters_multi_player_font_tagnamestringlength;   //uint32
  5736.     uint32_t messaging_parameters_multi_player_font_tagid;       //uint32 (0xFFFFFFFF with tags)
  5737.     // char messaging_parameters_multi_player_font_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  5738.    
  5739.     float messaging_parameters_up_time;
  5740.     float messaging_parameters_fade_time;
  5741.    
  5742.     float messaging_parameters_icon_color_a_frac;
  5743.     float messaging_parameters_icon_color_r_frac;
  5744.     float messaging_parameters_icon_color_g_frac;
  5745.     float messaging_parameters_icon_color_b_frac;
  5746.    
  5747.     float messaging_parameters_text_color_a_frac;
  5748.     float messaging_parameters_text_color_r_frac;
  5749.     float messaging_parameters_text_color_g_frac;
  5750.     float messaging_parameters_text_color_b_frac;
  5751.    
  5752.     float messaging_parameters_text_spacing;
  5753.    
  5754.     // dependency 3: messaging parameters item message text ustr
  5755.     char messaging_parameters_item_message_text_tagclass[5];         //unsigned char[5]
  5756.     uint32_t messaging_parameters_item_message_text_tagnamepointer;   //uint32 ("random" number)
  5757.     uint32_t messaging_parameters_item_message_text_tagnamestringlength;   //uint32
  5758.     uint32_t messaging_parameters_item_message_text_tagid;       //uint32 (0xFFFFFFFF with tags)
  5759.     // char messaging_parameters_item_message_text_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  5760.    
  5761.     // dependency 4: messaging parameters icon bitmap bitm
  5762.     char messaging_parameters_icon_bitmap_tagclass[5];       //unsigned char[5]
  5763.     uint32_t messaging_parameters_icon_bitmap_tagnamepointer;   //uint32 ("random" number)
  5764.     uint32_t messaging_parameters_icon_bitmap_tagnamestringlength;   //uint32
  5765.     uint32_t messaging_parameters_icon_bitmap_tagid;         //uint32 (0xFFFFFFFF with tags)
  5766.     // char messaging_parameters_icon_bitmap_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  5767.    
  5768.     // dependency 5: messaging parameters alternate icon text ustr
  5769.     char messaging_parameters_alternate_icon_text_tagclass[5];       //unsigned char[5]
  5770.     uint32_t messaging_parameters_alternate_icon_text_tagnamepointer;   //uint32 ("random" number)
  5771.     uint32_t messaging_parameters_alternate_icon_text_tagnamestringlength;   //uint32
  5772.     uint32_t messaging_parameters_alternate_icon_text_tagid;         //uint32 (0xFFFFFFFF with tags)
  5773.     // char messaging_parameters_alternate_icon_text_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  5774.    
  5775.     // representation 1 board, offset 260
  5776.     // r1b_button_icons_
  5777.     uint32_t r1b_button_icons_entrycount; // maximum of 18 cells (a button, b button, x button, y button, black button, white button, left trigger, right trigger, dpad up, dpad down, dpad left, dpad right, start button, back button, left thumb button, right thumb button, left stick (not a button), right stick (not a button)
  5778.     uint32_t r1b_button_icons_random_id;
  5779.     uint32_t r1b_button_icons_sig_id; // example value = 0xC03C9C00
  5780.    
  5781.     uint8_t hud_help_text_color_default_color_a;
  5782.     uint8_t hud_help_text_color_default_color_r;
  5783.     uint8_t hud_help_text_color_default_color_g;
  5784.     uint8_t hud_help_text_color_default_color_b;
  5785.    
  5786.     uint8_t hud_help_text_color_flashing_color_a;
  5787.     uint8_t hud_help_text_color_flashing_color_r;
  5788.     uint8_t hud_help_text_color_flashing_color_g;
  5789.     uint8_t hud_help_text_color_flashing_color_b;
  5790.    
  5791.     float hud_help_text_color_flash_period;
  5792.     float hud_help_text_color_flash_delay;
  5793.     uint16_t hud_help_text_color_number_of_flashes;
  5794.     // 290, 1
  5795.     uint8_t hud_help_text_color_flash_flags;    //toff 290  0x01
  5796.    
  5797.     float hud_help_text_color_flash_length;
  5798.    
  5799.     uint8_t hud_help_text_color_disabled_color_a;
  5800.     uint8_t hud_help_text_color_disabled_color_r;
  5801.     uint8_t hud_help_text_color_disabled_color_g;
  5802.     uint8_t hud_help_text_color_disabled_color_b;
  5803.    
  5804.     // 300, 4
  5805.    
  5806.     // dependency 6: other hud messaging data hud messages hmt
  5807.     char other_hud_messaging_data_hud_messages_tagclass[5];      //unsigned char[5]
  5808.     uint32_t other_hud_messaging_data_hud_messages_tagnamepointer;   //uint32 ("random" number)
  5809.     uint32_t other_hud_messaging_data_hud_messages_tagnamestringlength;   //uint32
  5810.     uint32_t other_hud_messaging_data_hud_messages_tagid;        //uint32 (0xFFFFFFFF with tags)
  5811.     // char other_hud_messaging_data_hud_messages_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  5812.    
  5813.     uint8_t objective_colors_default_color_a;
  5814.     uint8_t objective_colors_default_color_r;
  5815.     uint8_t objective_colors_default_color_g;
  5816.     uint8_t objective_colors_default_color_b;
  5817.    
  5818.     uint8_t objective_colors_flashing_color_a;
  5819.     uint8_t objective_colors_flashing_color_r;
  5820.     uint8_t objective_colors_flashing_color_g;
  5821.     uint8_t objective_colors_flashing_color_b;
  5822.    
  5823.     float objective_colors_flash_period;
  5824.     float objective_colors_flash_delay;
  5825.    
  5826.     uint16_t objective_colors_number_of_flashes;
  5827.     // 338, 1
  5828.     uint8_t objective_colors_flash_flags;   //toff 338  0x01
  5829.    
  5830.     float objective_colors_flash_length;
  5831.    
  5832.     uint8_t objective_colors_disabled_color_a;
  5833.     uint8_t objective_colors_disabled_color_r;
  5834.     uint8_t objective_colors_disabled_color_g;
  5835.     uint8_t objective_colors_disabled_color_b;
  5836.    
  5837.     uint16_t objective_colors_uptime_ticks;
  5838.     uint16_t objective_colors_fade_ticks;
  5839.    
  5840.     float waypoint_parameters_top_offset;
  5841.     float waypoint_parameters_bottom_offset;
  5842.     float waypoint_parameters_left_offset;
  5843.     float waypoint_parameters_right_offset;
  5844.    
  5845.     // 368, 32
  5846.    
  5847.     // dependency 7: waypoint parameters arrow bitmap bitm
  5848.     char waypoint_parameters_arrow_bitmap_tagclass[5];       //unsigned char[5]
  5849.     uint32_t waypoint_parameters_arrow_bitmap_tagnamepointer;   //uint32 ("random" number)
  5850.     uint32_t waypoint_parameters_arrow_bitmap_tagnamestringlength;   //uint32
  5851.     uint32_t waypoint_parameters_arrow_bitmap_tagid;         //uint32 (0xFFFFFFFF with tags)
  5852.     // char waypoint_parameters_arrow_bitmap_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  5853.    
  5854.     // representation 2 board, offset 416
  5855.     // r2b_waypoint_arrows_
  5856.     uint32_t r2b_waypoint_arrows_entrycount; // maximum of 16 cells
  5857.     uint32_t r2b_waypoint_arrows_random_id;
  5858.     uint32_t r2b_waypoint_arrows_sig_id; // example value = 0x8C3D9C00
  5859.    
  5860.     // 428, 80
  5861.    
  5862.     float multiplayer_parameters_hud_scale_in_multiplayer;
  5863.    
  5864.     // 512, 256
  5865.    
  5866.     // dependency 8: hud globals default weapon hud wphi
  5867.     char hud_globals_default_weapon_hud_tagclass[5];         //unsigned char[5]
  5868.     uint32_t hud_globals_default_weapon_hud_tagnamepointer;   //uint32 ("random" number)
  5869.     uint32_t hud_globals_default_weapon_hud_tagnamestringlength;   //uint32
  5870.     uint32_t hud_globals_default_weapon_hud_tagid;       //uint32 (0xFFFFFFFF with tags)
  5871.     // char hud_globals_default_weapon_hud_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  5872.    
  5873.     float hud_globals_motion_sensor_range;
  5874.     float hud_globals_motion_sensor_velocity_sensitivity;
  5875.     float hud_globals_motion_sensor_scale_dont_touch_ever;
  5876.    
  5877.     uint16_t hud_globals_default_chapter_title_bounds_top;   // interpret these four as signed
  5878.     uint16_t hud_globals_default_chapter_title_bounds_left;
  5879.     uint16_t hud_globals_default_chapter_title_bounds_bottom;
  5880.     uint16_t hud_globals_default_chapter_title_bounds_right;
  5881.    
  5882.     // 804, 44
  5883.    
  5884.     uint16_t hud_damage_indicators_top_offset;   // interpret these four as signed
  5885.     uint16_t hud_damage_indicators_bottom_offset;
  5886.     uint16_t hud_damage_indicators_left_offset;
  5887.     uint16_t hud_damage_indicators_right_offset;
  5888.    
  5889.     // 856, 32
  5890.    
  5891.     // dependency 9: hud damage indicators indicator bitmap bitm
  5892.     char hud_damage_indicators_indicator_bitmap_tagclass[5];         //unsigned char[5]
  5893.     uint32_t hud_damage_indicators_indicator_bitmap_tagnamepointer;   //uint32 ("random" number)
  5894.     uint32_t hud_damage_indicators_indicator_bitmap_tagnamestringlength;   //uint32
  5895.     uint32_t hud_damage_indicators_indicator_bitmap_tagid;       //uint32 (0xFFFFFFFF with tags)
  5896.     // char hud_damage_indicators_indicator_bitmap_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  5897.    
  5898.     uint16_t hud_damage_indicators_sequence_index;
  5899.     uint16_t hud_damage_indicators_multiplayer_sequence_index;
  5900.    
  5901.     uint8_t hud_damage_indicators_color_a;
  5902.     uint8_t hud_damage_indicators_color_r;
  5903.     uint8_t hud_damage_indicators_color_g;
  5904.     uint8_t hud_damage_indicators_color_b;
  5905.    
  5906.     // 912, 16
  5907.    
  5908.     uint8_t not_much_time_left_flash_color_default_color_a;
  5909.     uint8_t not_much_time_left_flash_color_default_color_r;
  5910.     uint8_t not_much_time_left_flash_color_default_color_g;
  5911.     uint8_t not_much_time_left_flash_color_default_color_b;
  5912.     uint8_t not_much_time_left_flash_color_flashing_color_a;
  5913.     uint8_t not_much_time_left_flash_color_flashing_color_r;
  5914.     uint8_t not_much_time_left_flash_color_flashing_color_g;
  5915.     uint8_t not_much_time_left_flash_color_flashing_color_b;
  5916.    
  5917.     float not_much_time_left_flash_color_flash_period;
  5918.     float not_much_time_left_flash_color_flash_delay;
  5919.     uint16_t not_much_time_left_flash_color_number_of_flashes;
  5920.     // 946, 1
  5921.     uint8_t not_much_time_left_flash_color_flash_flags; // toff 946 0x01
  5922.     float not_much_time_left_flash_color_flash_length;
  5923.    
  5924.     uint8_t not_much_time_left_flash_color_disabled_color_a;
  5925.     uint8_t not_much_time_left_flash_color_disabled_color_r;
  5926.     uint8_t not_much_time_left_flash_color_disabled_color_g;
  5927.     uint8_t not_much_time_left_flash_color_disabled_color_b;
  5928.    
  5929.     // 956, 4
  5930.    
  5931.     uint8_t time_out_flash_color_default_color_a;
  5932.     uint8_t time_out_flash_color_default_color_r;
  5933.     uint8_t time_out_flash_color_default_color_g;
  5934.     uint8_t time_out_flash_color_default_color_b;
  5935.     uint8_t time_out_flash_color_flashing_color_a;
  5936.     uint8_t time_out_flash_color_flashing_color_r;
  5937.     uint8_t time_out_flash_color_flashing_color_g;
  5938.     uint8_t time_out_flash_color_flashing_color_b;
  5939.     float time_out_flash_color_flash_period;
  5940.     float time_out_flash_color_flash_delay;
  5941.     uint16_t time_out_flash_color_number_of_flashes;
  5942.     // 978, 1
  5943.     uint8_t time_out_flash_color_flash_flags;   //toff 978  0x01
  5944.     float time_out_flash_color_flash_length;
  5945.     uint8_t time_out_flash_color_disabled_color_a;
  5946.     uint8_t time_out_flash_color_disabled_color_r;
  5947.     uint8_t time_out_flash_color_disabled_color_g;
  5948.     uint8_t time_out_flash_color_disabled_color_b;
  5949.    
  5950.     // 988, 44
  5951.    
  5952.     // dependency 10: time out flash color carnage report bitmap bitm
  5953.     char time_out_flash_color_carnage_report_bitmap_tagclass[5];         //unsigned char[5]
  5954.     uint32_t time_out_flash_color_carnage_report_bitmap_tagnamepointer;   //uint32 ("random" number)
  5955.     uint32_t time_out_flash_color_carnage_report_bitmap_tagnamestringlength;   //uint32
  5956.     uint32_t time_out_flash_color_carnage_report_bitmap_tagid;       //uint32 (0xFFFFFFFF with tags)
  5957.     // char time_out_flash_color_carnage_report_bitmap_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  5958.    
  5959.     uint16_t extra_hud_info_loading_begin_text;
  5960.     uint16_t extra_hud_info_loading_end_text;
  5961.     uint16_t extra_hud_info_checkpoint_begin_text;
  5962.     uint16_t extra_hud_info_checkpoint_end_text;
  5963.    
  5964.     // dependency 11: extra hud info checkpoint sound snd!
  5965.     char extra_hud_info_checkpoint_sound_tagclass[5];        //unsigned char[5]
  5966.     uint32_t extra_hud_info_checkpoint_sound_tagnamepointer;   //uint32 ("random" number)
  5967.     uint32_t extra_hud_info_checkpoint_sound_tagnamestringlength;   //uint32
  5968.     uint32_t extra_hud_info_checkpoint_sound_tagid;      //uint32 (0xFFFFFFFF with tags)
  5969.     // char extra_hud_info_checkpoint_sound_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  5970.    
  5971.     // 1072, 96
  5972.    
  5973.     // dependencies 1-5 tagpathname strings go here
  5974.    
  5975.     struct hudg_r1c {
  5976.         // representation 1 cells
  5977.         // r1c_button_icons_
  5978.        
  5979.         uint16_t r1c_button_icons_sequence_index;
  5980.         uint16_t r1c_button_icons_width_offset;   // interpret these three as signed
  5981.         uint16_t r1c_button_icons_offset_from_reference_corner_x;
  5982.         uint16_t r1c_button_icons_offset_from_reference_corner_y;
  5983.         uint8_t r1c_button_icons_override_icon_color_a;
  5984.         uint8_t r1c_button_icons_override_icon_color_r;
  5985.         uint8_t r1c_button_icons_override_icon_color_g;
  5986.         uint8_t r1c_button_icons_override_icon_color_b;
  5987.        
  5988.         uint8_t r1c_button_icons_frame_rate;   // -127 to 128
  5989.         uint8_t r1c_button_icons_flags; //toff 1181 0x07
  5990.         uint16_t r1c_button_icons_text_index;
  5991.        
  5992.     }r1c_button_icons;
  5993.    
  5994.     // dependencies 6-7 tagpathname strings go here
  5995.    
  5996.     struct hudg_r2c {
  5997.         // representation 2 cells
  5998.         // r2c_waypoint_arrows_
  5999.        
  6000.         char r2c_waypoint_arrows_name[32];
  6001.        
  6002.         // 8
  6003.        
  6004.         uint8_t r2c_waypoint_arrows_color_a;   //unused
  6005.         uint8_t r2c_waypoint_arrows_color_r;
  6006.         uint8_t r2c_waypoint_arrows_color_g;
  6007.         uint8_t r2c_waypoint_arrows_color_b;
  6008.        
  6009.         float r2c_waypoint_arrows_opacity;
  6010.         float r2c_waypoint_arrows_translucency;
  6011.        
  6012.         uint16_t r2c_waypoint_arrows_on_screen_sequence_index;
  6013.         uint16_t r2c_waypoint_arrows_off_screen_sequence_index;
  6014.         uint16_t r2c_waypoint_arrows_occluded_sequence_index;
  6015.        
  6016.         // 18
  6017.        
  6018.         uint32_t r2c_waypoint_arrows_flags; //toff 1260 0x00000001
  6019.        
  6020.         // 24
  6021.        
  6022.     }r2c_waypoint_arrows;
  6023.    
  6024.     // dependencies 8-11 tagpathname strings go here
  6025.    
  6026. } type_meta_hudg;
  6027.  
  6028. #pragma mark -- hud#
  6029.  
  6030. typedef struct {
  6031.     // dependency 1: digits bitmap bitm
  6032.     char digits_bitmap_tagclass[5];      //unsigned char[5]
  6033.     uint32_t digits_bitmap_tagnamepointer;   //uint32 ("random" number)
  6034.     uint32_t digits_bitmap_tagnamestringlength;   //uint32
  6035.     uint32_t digits_bitmap_tagid;        //uint32 (0xFFFFFFFF with tags)
  6036.     // char digits_bitmap_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  6037.    
  6038.     uint8_t bitmap_digit_width;   // these are all -127 to 128
  6039.     uint8_t screen_digit_width;
  6040.     uint8_t x_offset;   // interpret as signed
  6041.     uint8_t y_offset;   // interpret as signed
  6042.     uint8_t decimal_point_width;
  6043.     uint8_t colon_width;
  6044.    
  6045.     // 78
  6046.    
  6047.     // dependency 1 tagpathname string goes here
  6048. } type_meta_hudn;
  6049.  
  6050. #pragma mark -- item
  6051.  
  6052. typedef struct {
  6053.     // ITEM DATA START
  6054.    
  6055.     // same mishandling as the devi (device) tag type:
  6056.     // Guerilla misreads the first four bytes as 0x0000FFFF
  6057.     // this is actually a single 32-bit flags value, but only data for a 16-bit value with inverted bits is stored (meaning in the last two bytes)
  6058.     // so when interpreting the value, the default is 0x0000FFFF with all fields checked and unchecking a field subtracts by its amount
  6059.     //uint16_t INTERNAL_optimization;   // 0; this is probably some sort of mistake, but these first two bytes are written as 0 (confirmed)
  6060.     uint32_t item_flags;   // only the first three bits are written, so all three flag values set to off yields 0xFFF8 (all 1's except the first three bits), toff 66 (untested, obvious)   0xFFFF
  6061.    
  6062.     uint16_t message_index_message_index;
  6063.     uint16_t message_index_sort_order;
  6064.     float message_index_scale;
  6065.     uint16_t message_index_hud_message_value_scale;
  6066.    
  6067.     // 78, 18
  6068.    
  6069.     uint16_t message_index_a_in;   // "none" (0) is the only option for these four in's (offset 96)
  6070.     uint16_t message_index_b_in;
  6071.     uint16_t message_index_c_in;
  6072.     uint16_t message_index_d_in;
  6073.    
  6074.     // 104, 164
  6075.    
  6076.     // dependency 1: material effects foot
  6077.     char material_effects_tagclass[5];       //unsigned char[5]
  6078.     uint32_t material_effects_tagnamepointer;   //uint32 ("random" number)
  6079.     uint32_t material_effects_tagnamestringlength;   //uint32
  6080.     uint32_t material_effects_tagid;         //uint32 (0xFFFFFFFF with tags)
  6081.     // char material_effects_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  6082.    
  6083.     // dependency 2: collision sound snd!
  6084.     char collision_sound_tagclass[5];        //unsigned char[5]
  6085.     uint32_t collision_sound_tagnamepointer;   //uint32 ("random" number)
  6086.     uint32_t collision_sound_tagnamestringlength;   //uint32
  6087.     uint32_t collision_sound_tagid;      //uint32 (0xFFFFFFFF with tags)
  6088.     // char collision_sound_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  6089.    
  6090.     // offset 300 = 120 bytes of 0
  6091.    
  6092.     float message_index_detonation_delay_from;   // offset 420
  6093.     float message_index_detonation_delay_to;
  6094.    
  6095.     // dependency 3: detonating effect effe
  6096.     char detonating_effect_tagclass[5];      //unsigned char[5]
  6097.     uint32_t detonating_effect_tagnamepointer;   //uint32 ("random" number)
  6098.     uint32_t detonating_effect_tagnamestringlength;   //uint32
  6099.     uint32_t detonating_effect_tagid;        //uint32 (0xFFFFFFFF with tags)
  6100.     // char detonating_effect_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  6101.    
  6102.     // dependency 4: detonation effect effe
  6103.     char detonation_effect_tagclass[5];      //unsigned char[5]
  6104.     uint32_t detonation_effect_tagnamepointer;   //uint32 ("random" number)
  6105.     uint32_t detonation_effect_tagnamestringlength;   //uint32
  6106.     uint32_t detonation_effect_tagid;        //uint32 (0xFFFFFFFF with tags)
  6107.     // char detonation_effect_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  6108.    
  6109.     // ITEM DATA END
  6110.    
  6111.     // dependencies 1-4 tagpathname strings go here
  6112. } type_meta_item;
  6113.  
  6114. #pragma mark -- itmc
  6115.  
  6116. typedef struct {
  6117.     // representation 1 board, offset 64
  6118.     // r1b_item_permutations_
  6119.     uint32_t r1b_item_permutations_entrycount; // maximum of 32 cells
  6120.     uint32_t r1b_item_permutations_random_id;
  6121.     uint32_t r1b_item_permutations_sig_id; // example value = 0x80659C00
  6122.    
  6123.     uint16_t spawn_time;
  6124.    
  6125.     // 78, 78 (lol)
  6126.    
  6127.     struct itmc_r1c {
  6128.         // representation 1 cells
  6129.         // r1c_item_permutations_
  6130.        
  6131.         // 32
  6132.        
  6133.         float r1c_item_permutations_weight_frac;
  6134.        
  6135.         // dependency r1c 1: item permutations item eqip garb item weap
  6136.         char item_permutations_item_tagclass[5];         //unsigned char[5]
  6137.         uint32_t item_permutations_item_tagnamepointer;   //uint32 ("random" number)
  6138.         uint32_t item_permutations_item_tagnamestringlength;   //uint32
  6139.         uint32_t item_permutations_item_tagid;       //uint32 (0xFFFFFFFF with tags)
  6140.         // char item_permutations_item_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  6141.        
  6142.         // 32
  6143.        
  6144.     }r1c_item_permutations;
  6145.    
  6146.     // dependency r1c 1 tagpathname strings go here
  6147.    
  6148. } type_meta_itmc;
  6149.  
  6150. #pragma mark -- jpt!
  6151.  
  6152. typedef struct {
  6153.     float radius_from;
  6154.     float radius_to;
  6155.     float cutoff_scale_frac;
  6156.     uint32_t flags;   // confirmed 32 bit type, toff 76 (adjust previous line!? removed padding)    0x00000001
  6157.     // 80, 20
  6158.    
  6159.     uint16_t screen_flash_type;
  6160.     uint16_t screen_flash_priority;
  6161.     // 104, 12
  6162.     float screen_flash_duration;
  6163.     uint16_t screen_flash_fade_function;
  6164.     // 122, 10
  6165.     float screen_flash_maximum_intensity_frac;
  6166.     // 136, 4
  6167.     float screen_flash_color_a_frac;
  6168.     float screen_flash_color_r_frac;
  6169.     float screen_flash_color_g_frac;
  6170.     float screen_flash_color_b_frac;
  6171.    
  6172.     float low_frequency_vibrate_frequency_frac;
  6173.     float low_frequency_vibrate_duration;
  6174.     uint16_t low_frequency_vibrate_fade_function;
  6175.    
  6176.     // 166, 10
  6177.    
  6178.     float high_frequency_vibrate_frequency_frac;
  6179.     float high_frequency_vibrate_duration;
  6180.     uint16_t high_frequency_vibrate_fade_function;
  6181.    
  6182.     // 186, 30
  6183.    
  6184.     float temporary_camera_impulse_duration;
  6185.     uint16_t temporary_camera_impulse_fade_function;
  6186.     // 222, 2
  6187.     float temporary_camera_impulse_rotation_rad;
  6188.     float temporary_camera_impulse_pushback;
  6189.     float temporary_camera_impulse_jitter_from;
  6190.     float temporary_camera_impulse_jitter_to;
  6191.    
  6192.     // 240, 8
  6193.    
  6194.     float permanent_camera_impulse_angle_rad;
  6195.    
  6196.     // 252, 16
  6197.    
  6198.     float camera_shaking_duration;
  6199.     uint16_t camera_shaking_falloff_function;
  6200.     // 274, 2
  6201.     float camera_shaking_random_translation;
  6202.     float camera_shaking_random_rotation_rad;
  6203.     // 284, 12
  6204.     uint16_t camera_shaking_wobble_function;
  6205.     // 298, 2
  6206.     float camera_shaking_wobble_function_period;
  6207.     float camera_shaking_wobble_weight_frac;
  6208.    
  6209.     // 308, 32
  6210.    
  6211.     // dependency 1: sound sound snd!
  6212.     char sound_sound_tagclass[5];        //unsigned char[5]
  6213.     uint32_t sound_sound_tagnamepointer;   //uint32 ("random" number)
  6214.     uint32_t sound_sound_tagnamestringlength;   //uint32
  6215.     uint32_t sound_sound_tagid;      //uint32 (0xFFFFFFFF with tags)
  6216.     // char sound_sound_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  6217.    
  6218.     // 356, 112
  6219.    
  6220.     float breaking_effect_forward_velocity;
  6221.     float breaking_effect_forward_radius;
  6222.     float breaking_effect_forward_exponent;
  6223.     // 480, 12
  6224.    
  6225.     float breaking_effect_outward_velocity;
  6226.     float breaking_effect_outward_radius;
  6227.     float breaking_effect_outward_exponent;
  6228.    
  6229.     // 504, 12
  6230.    
  6231.     uint16_t damage_side_effect;
  6232.     uint16_t damage_category;
  6233.     uint32_t damage_flags;  //toff 520  0x00001FFF
  6234.     float damage_aoe_core_radius;
  6235.     float damage_damage_lower_bound;
  6236.     float damage_damage_upper_bound_from;
  6237.     float damage_damage_upper_bound_to;
  6238.     float damage_vehicle_passthrough_penalty_frac;   // none of these are checked for errors in fractionality
  6239.     float damage_active_camouflage_damage_frac;
  6240.     float damage_stun_frac;
  6241.     float damage_maximum_stun_frac;
  6242.     float damage_stun_time;
  6243.    
  6244.     // 560, 4
  6245.    
  6246.     float damage_instantaneous_acceleration;
  6247.    
  6248.     // 568, 8
  6249.    
  6250.     float damage_modifiers_dirt;
  6251.     float damage_modifiers_sand;
  6252.     float damage_modifiers_stone;
  6253.     float damage_modifiers_snow;
  6254.     float damage_modifiers_wood;
  6255.     float damage_modifiers_metal_hollow;
  6256.     float damage_modifiers_metal_thin;
  6257.     float damage_modifiers_metal_thick;
  6258.     float damage_modifiers_rubber;
  6259.     float damage_modifiers_glass;
  6260.     float damage_modifiers_force_field;
  6261.     float damage_modifiers_grunt;
  6262.     float damage_modifiers_hunter_armor;
  6263.     float damage_modifiers_hunter_skin;
  6264.     float damage_modifiers_elite;
  6265.     float damage_modifiers_jackal;
  6266.     float damage_modifiers_jackal_energy_shield;
  6267.     float damage_modifiers_engineer;
  6268.     float damage_modifiers_engineer_force_field;
  6269.     float damage_modifiers_flood_combat_form;
  6270.     float damage_modifiers_flood_carrier_form;
  6271.     float damage_modifiers_cyborg;
  6272.     float damage_modifiers_cyborg_energy_shield;
  6273.     float damage_modifiers_armored_human;
  6274.     float damage_modifiers_human;
  6275.     float damage_modifiers_sentinel;
  6276.     float damage_modifiers_monitor;
  6277.     float damage_modifiers_plastic;
  6278.     float damage_modifiers_water;
  6279.     float damage_modifiers_leaves;
  6280.     float damage_modifiers_elite_energy_shield;
  6281.     float damage_modifiers_ice;
  6282.     float damage_modifiers_hunter_shield;
  6283.    
  6284.     // 708, 28
  6285.     // dependency 1 tagpathname string goes here
  6286.    
  6287. } type_meta_jpt;
  6288.  
  6289. #pragma mark -- lens
  6290.  
  6291. typedef struct {
  6292.     float lens_flare_falloff_angle_rad;
  6293.     float lens_flare_cutoff_angle_rad;
  6294.     float INTERNAL_val1;   // 1 (little endian)
  6295.     float INTERNAL_val2;   // 1 (little endian)
  6296.     float occlusion_occlusion_radius;
  6297.     uint16_t occlusion_occlusion_offset_direction;
  6298.     // 86, 2
  6299.     float occlusion_near_fade_distance;
  6300.     float occlusion_far_fade_distance;
  6301.    
  6302.     // dependency 1: bitmaps bitmap bitm
  6303.     char bitmaps_bitmap_tagclass[5];         //unsigned char[5]
  6304.     uint32_t bitmaps_bitmap_tagnamepointer;   //uint32 ("random" number)
  6305.     uint32_t bitmaps_bitmap_tagnamestringlength;   //uint32
  6306.     uint32_t bitmaps_bitmap_tagid;       //uint32 (0xFFFFFFFF with tags)
  6307.     // char bitmaps_bitmap_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  6308.    
  6309.     // 112, 1
  6310.     uint8_t bitmaps_flags;  //toff 112  FIXED   0x01
  6311.    
  6312.     // 114, 78
  6313.     uint16_t corona_rotation_rotation_function;
  6314.     // 194, 2
  6315.     float corona_rotation_rotation_function_scale_rad;
  6316.     // 200, 24
  6317.     float corona_radius_scale_horizontal_scale;
  6318.     float corona_radius_scale_vertical_scale;
  6319.    
  6320.     // 232, 28
  6321.    
  6322.     // representation 1 board, offset 260
  6323.     // r1b_reflections_
  6324.     uint32_t r1b_reflections_entrycount; // maximum of 32 cells
  6325.     uint32_t r1b_reflections_random_id;
  6326.     uint32_t r1b_reflections_sig_id; // example value = 0x5C849C00
  6327.    
  6328.     // 272, 32
  6329.    
  6330.     // dependency 1 tagpathname string goes here
  6331.    
  6332.     struct lens_r1c {
  6333.         // representation 1 cells
  6334.         // r1c_reflections_
  6335.        
  6336.         // 1
  6337.         uint8_t r1c_reflections_flags;  //toff 304  0x0F    FIXED
  6338.        
  6339.         // 2
  6340.        
  6341.         uint16_t r1c_reflections_bitmap_index;
  6342.        
  6343.         // 22
  6344.        
  6345.         float r1c_reflections_position;
  6346.         float r1c_reflections_rotation_offset;   // not radians
  6347.         // 4
  6348.         float r1c_reflections_radius_from;
  6349.         float r1c_reflections_radius_to;
  6350.         uint16_t r1c_reflections_radius_scaled_by;
  6351.         // 2
  6352.         float r1c_reflections_brightness_from_frac;
  6353.         float r1c_reflections_brightness_to_frac;
  6354.         uint16_t r1c_reflections_brightness_scaled_by;
  6355.         // 2
  6356.        
  6357.         float r1c_reflections_tint_color_a_frac;
  6358.         float r1c_reflections_tint_color_r_frac;
  6359.         float r1c_reflections_tint_color_g_frac;
  6360.         float r1c_reflections_tint_color_b_frac;
  6361.        
  6362.         float r1c_reflections_animation_color_lower_bound_a_frac;
  6363.         float r1c_reflections_animation_color_lower_bound_r_frac;
  6364.         float r1c_reflections_animation_color_lower_bound_g_frac;
  6365.         float r1c_reflections_animation_color_lower_bound_b_frac;
  6366.        
  6367.         float r1c_reflections_animation_color_upper_bound_a_frac;
  6368.         float r1c_reflections_animation_color_upper_bound_r_frac;
  6369.         float r1c_reflections_animation_color_upper_bound_g_frac;
  6370.         float r1c_reflections_animation_color_upper_bound_b_frac;
  6371.        
  6372.         // 1
  6373.         uint8_t r1c_reflections_animation_flags;    //toff 416  0x03    FIXED
  6374.         uint16_t r1c_reflections_animation_animation_function;
  6375.         float r1c_reflections_animation_animation_period;
  6376.         float r1c_reflections_animation_animation_phase;
  6377.        
  6378.         // 4
  6379.        
  6380.     }r1c_reflections;
  6381.    
  6382. } type_meta_lens;
  6383.  
  6384. #pragma mark -- lifi
  6385.  
  6386. typedef struct {
  6387.     // OBJE 1 DATA START
  6388.     uint16_t INTERNAL_obje_index;   // 9 (little endian)
  6389.     // 1
  6390.     uint8_t flags;  //toff 66   0x0F    FIXED
  6391.     float bounding_radius;
  6392.     float bounding_offset_x;
  6393.     float bounding_offset_y;
  6394.     float bounding_offset_z;
  6395.     float origin_offset_x;
  6396.     float origin_offset_y;
  6397.     float origin_offset_z;
  6398.     float acceleration_scale;
  6399.     // offset 100 = 4 bytes of 0
  6400.    
  6401.     // dependency 1: model mod2
  6402.     char model_tagclass[5];      //unsigned char[5]
  6403.     uint32_t model_tagnamepointer;   //uint32 ("random" number)
  6404.     uint32_t model_tagnamestringlength;   //uint32
  6405.     uint32_t model_tagid;        //uint32 (0xFFFFFFFF with tags)
  6406.     // char model_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  6407.    
  6408.     // dependency 2: animation graph antr
  6409.     char animation_graph_tagclass[5];        //unsigned char[5]
  6410.     uint32_t animation_graph_tagnamepointer;   //uint32 ("random" number)
  6411.     uint32_t animation_graph_tagnamestringlength;   //uint32
  6412.     uint32_t animation_graph_tagid;      //uint32 (0xFFFFFFFF with tags)
  6413.     // char animation_graph_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  6414.    
  6415.     // offset 136 = 40 bytes of 0
  6416.    
  6417.     // dependency 3: collision model coll
  6418.     char collision_model_tagclass[5];        //unsigned char[5]
  6419.     uint32_t collision_model_tagnamepointer;   //uint32 ("random" number)
  6420.     uint32_t collision_model_tagnamestringlength;   //uint32
  6421.     uint32_t collision_model_tagid;      //uint32 (0xFFFFFFFF with tags)
  6422.     // char collision_model_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  6423.    
  6424.     // dependency 4: physics phys
  6425.     char physics_tagclass[5];        //unsigned char[5]
  6426.     uint32_t physics_tagnamepointer;   //uint32 ("random" number)
  6427.     uint32_t physics_tagnamestringlength;   //uint32
  6428.     uint32_t physics_tagid;      //uint32 (0xFFFFFFFF with tags)
  6429.     // char physics_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  6430.    
  6431.     // dependency 5: modifier shader shdr senv soso schi scex sotr sgla smet spla swat
  6432.     char modifier_shader_tagclass[5];        //unsigned char[5]
  6433.     uint32_t modifier_shader_tagnamepointer;   //uint32 ("random" number)
  6434.     uint32_t modifier_shader_tagnamestringlength;   //uint32
  6435.     uint32_t modifier_shader_tagid;      //uint32 (0xFFFFFFFF with tags)
  6436.     // char modifier_shader_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  6437.    
  6438.     // dependency 6: creation effect effe
  6439.     char creation_effect_tagclass[5];        //unsigned char[5]
  6440.     uint32_t creation_effect_tagnamepointer;   //uint32 ("random" number)
  6441.     uint32_t creation_effect_tagnamestringlength;   //uint32
  6442.     uint32_t creation_effect_tagid;      //uint32 (0xFFFFFFFF with tags)
  6443.     // char creation_effect_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  6444.    
  6445.     // offset 240 = 84 bytes of 0
  6446.    
  6447.     float render_bounding_radius;
  6448.    
  6449.     uint16_t export_to_functions_a_in;
  6450.     uint16_t export_to_functions_b_in;
  6451.     uint16_t export_to_functions_c_in;
  6452.     uint16_t export_to_functions_d_in;
  6453.    
  6454.     // offset 336 = 44 bytes of 0
  6455.    
  6456.     uint16_t export_to_functions_hud_text_message_index;
  6457.     uint16_t export_to_functions_forced_shader_permutation_index;
  6458.    
  6459.     // representation 1 board, offset 384
  6460.     // r1b_attachments_
  6461.     uint32_t r1b_attachments_entrycount; // maximum of 8 cells
  6462.     uint32_t r1b_attachments_random_id;
  6463.     uint32_t r1b_attachments_sig_id; // example value = 0x08479D00
  6464.    
  6465.     // representation 2 board, offset 396
  6466.     // r2b_widgets_
  6467.     uint32_t r2b_widgets_entrycount; // maximum of 4 cells
  6468.     uint32_t r2b_widgets_random_id;
  6469.     uint32_t r2b_widgets_sig_id; // example value = 0x7C479D00
  6470.    
  6471.     // representation 3 board, offset 408
  6472.     // r3b_functions_
  6473.     uint32_t r3b_functions_entrycount; // maximum of 4 cells
  6474.     uint32_t r3b_functions_random_id;
  6475.     uint32_t r3b_functions_sig_id; // example value = 0x50469D00
  6476.    
  6477.     // representation 4 board, offset 420
  6478.     // r4b_change_colors_
  6479.     uint32_t r4b_change_colors_entrycount; // maximum of 4 cells
  6480.     uint32_t r4b_change_colors_random_id;
  6481.     uint32_t r4b_change_colors_sig_id; // example value = 0x6C489D00
  6482.    
  6483.     // representation 5 board, offset 432
  6484.     // r5b_predicted_resources_
  6485.     uint32_t r5b_predicted_resources_entrycount; // maximum of 1024 cells
  6486.     uint32_t r5b_predicted_resources_random_id;
  6487.     uint32_t r5b_predicted_resources_sig_id; // example value = 0x105FA000
  6488.    
  6489.     // OBJE 1 DATA END
  6490.    
  6491.     uint32_t device_flags;   // offset 444, toff 444    0x00000003
  6492.     float device_power_transition_time;
  6493.     float device_power_acceleration_time;
  6494.     float device_position_transition_time;
  6495.     float device_position_acceleration_time;
  6496.     float device_depowered_position_transition_time;
  6497.     float device_depowered_position_acceleration_time;
  6498.     uint16_t device_a_in;
  6499.     uint16_t device_b_in;
  6500.     uint16_t device_c_in;
  6501.     uint16_t device_d_in;
  6502.    
  6503.     // dependency 7: open (up) effe snd!
  6504.     char device_open_up_tagclass[5];         //unsigned char[5]
  6505.     uint32_t device_open_up_tagnamepointer;   //uint32 ("random" number)
  6506.     uint32_t device_open_up_tagnamestringlength;   //uint32
  6507.     uint32_t device_open_up_tagid;       //uint32 (0xFFFFFFFF with tags)
  6508.     // char device_open_up_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  6509.    
  6510.     // dependency 8: close (down) effe snd!
  6511.     char device_close_down_tagclass[5];      //unsigned char[5]
  6512.     uint32_t device_close_down_tagnamepointer;   //uint32 ("random" number)
  6513.     uint32_t device_close_down_tagnamestringlength;   //uint32
  6514.     uint32_t device_close_down_tagid;        //uint32 (0xFFFFFFFF with tags)
  6515.     // char device_close_down_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  6516.    
  6517.     // dependency 9: opened effe snd!
  6518.     char device_opened_tagclass[5];      //unsigned char[5]
  6519.     uint32_t device_opened_tagnamepointer;   //uint32 ("random" number)
  6520.     uint32_t device_opened_tagnamestringlength;   //uint32
  6521.     uint32_t device_opened_tagid;        //uint32 (0xFFFFFFFF with tags)
  6522.     // char device_opened_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  6523.    
  6524.     // dependency 10: closed effe snd!
  6525.     char device_closed_tagclass[5];      //unsigned char[5]
  6526.     uint32_t device_closed_tagnamepointer;   //uint32 ("random" number)
  6527.     uint32_t device_closed_tagnamestringlength;   //uint32
  6528.     uint32_t device_closed_tagid;        //uint32 (0xFFFFFFFF with tags)
  6529.     // char device_closed_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  6530.    
  6531.     // dependency 11: depowered effe snd!
  6532.     char device_depowered_tagclass[5];       //unsigned char[5]
  6533.     uint32_t device_depowered_tagnamepointer;   //uint32 ("random" number)
  6534.     uint32_t device_depowered_tagnamestringlength;   //uint32
  6535.     uint32_t device_depowered_tagid;         //uint32 (0xFFFFFFFF with tags)
  6536.     // char device_depowered_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  6537.    
  6538.     // dependency 12: repowered effe snd!
  6539.     char device_repowered_tagclass[5];       //unsigned char[5]
  6540.     uint32_t device_repowered_tagnamepointer;   //uint32 ("random" number)
  6541.     uint32_t device_repowered_tagnamestringlength;   //uint32
  6542.     uint32_t device_repowered_tagid;         //uint32 (0xFFFFFFFF with tags)
  6543.     // char device_repowered_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  6544.    
  6545.     float device_delay_time;   // offset 576
  6546.     // offset 580 = 8 bytes of 0
  6547.    
  6548.     // dependency 13: delay effect effe snd!
  6549.     char device_delay_effect_tagclass[5];        //unsigned char[5]
  6550.     uint32_t device_delay_effect_tagnamepointer;   //uint32 ("random" number)
  6551.     uint32_t device_delay_effect_tagnamestringlength;   //uint32
  6552.     uint32_t device_delay_effect_tagid;      //uint32 (0xFFFFFFFF with tags)
  6553.     // char device_delay_effect_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  6554.    
  6555.     float device_automatic_activation_radius;
  6556.    
  6557.     // (henceforth differs from ctrl)
  6558.     // 608, 176
  6559.    
  6560.     // dependencies 1-6 tagpathname strings go here
  6561.    
  6562.     // OBJE DATA 2 START
  6563.    
  6564.     struct lifi_r1c {
  6565.         // representation 1 cells
  6566.         // r1c_attachments_
  6567.        
  6568.         // dependency r1c 1: r1c_attachments_type_ cont effe ligh mgs2 pctl lsnd
  6569.         char r1c_attachments_type_tagclass[5];       //unsigned char[5]
  6570.         uint32_t r1c_attachments_type_tagnamepointer;   //uint32 ("random" number)
  6571.         uint32_t r1c_attachments_type_tagnamestringlength;   //uint32
  6572.         uint32_t r1c_attachments_type_tagid;         //uint32 (0xFFFFFFFF with tags)
  6573.         // char r1c_attachments_type_tagnamestring[255];
  6574.        
  6575.         char r1c_attachments_marker[32];
  6576.         uint16_t r1c_attachments_primary_scale;
  6577.         uint16_t r1c_attachments_secondary_scale;
  6578.         uint16_t r1c_attachments_change_color;
  6579.        
  6580.         // in cell here: 18 bytes of 0
  6581.        
  6582.     }r1c_attachments;
  6583.    
  6584.     // r1c 1 tag name strings here
  6585.    
  6586.     struct lifi_r2c {
  6587.         // representation 2 cells
  6588.         // r2c_widgets_
  6589.        
  6590.         // dependency r2c 1: r2c_widgets_reference_ ant! flag glw! mgs2 elec
  6591.         char r2c_widgets_reference_tagclass[5];      //unsigned char[5]
  6592.         uint32_t r2c_widgets_reference_tagnamepointer;   //uint32 ("random" number)
  6593.         uint32_t r2c_widgets_reference_tagnamestringlength;   //uint32
  6594.         uint32_t r2c_widgets_reference_tagid;        //uint32 (0xFFFFFFFF with tags)
  6595.         // char r2c_widgets_reference_tagnamestring[255];
  6596.        
  6597.         // in cell here: 16 bytes of 0
  6598.     }r2c_widgets;
  6599.    
  6600.     // r2c 1 tag name strings here
  6601.    
  6602.     struct lifi_r3c {
  6603.         // representation 3 cells
  6604.         // r3c_functions_
  6605.        
  6606.         uint32_t r3c_functions_flags;   //toff 784  0x00000007
  6607.         float r3c_functions_period;
  6608.         uint16_t r3c_functions_scale_period_by;
  6609.         uint16_t r3c_functions_function;
  6610.         uint16_t r3c_functions_scale_function_by;
  6611.         uint16_t r3c_functions_wobble_function;
  6612.         float r3c_functions_wobble_period;
  6613.         float r3c_functions_wobble_magnitude;
  6614.         float r3c_functions_square_wave_threshold_frac;
  6615.         uint16_t r3c_functions_step_count;
  6616.         uint16_t r3c_functions_map_to;
  6617.         uint16_t r3c_functions_sawtooth_count;
  6618.         uint16_t r3c_functions_add;
  6619.         uint16_t r3c_functions_scale_result_by;
  6620.         uint16_t r3c_functions_bounds_mode;
  6621.         float r3c_functions_bounds_from_frac;
  6622.         float r3c_functions_bounds_to_frac;
  6623.         // in cell here: 6 bytes of 0
  6624.         uint16_t r3c_functions_turn_off_with_sel;
  6625.         float r3c_functions_scale_by;
  6626.         // in cell here: 268 bytes of 0 (reminiscent of the pre-padding of other times strings come after cells)
  6627.         char r3c_functions_usage[32];
  6628.        
  6629.     }r3c_functions;
  6630.    
  6631.     struct lifi_r4c {
  6632.         // representation 4 cells
  6633.         // r4c_change_colors_
  6634.         uint16_t r4c_change_colors_darken_by;
  6635.         uint16_t r4c_change_colors_scale_by;
  6636.         uint32_t r4c_change_colors_scale_flags; //toff 1148 0x00000003
  6637.         float r4c_change_colors_color_lower_bound_r_frac;
  6638.         float r4c_change_colors_color_lower_bound_g_frac;
  6639.         float r4c_change_colors_color_lower_bound_b_frac;
  6640.         float r4c_change_colors_color_upper_bound_r_frac;
  6641.         float r4c_change_colors_color_upper_bound_g_frac;
  6642.         float r4c_change_colors_color_upper_bound_b_frac;
  6643.        
  6644.         // representation 4 sub-board A
  6645.         // r4sbA_permutations_
  6646.         uint32_t r4sbA_permutations_entrycount;   // maximum of 8 cells
  6647.         uint32_t r4sbA_permutations_random_id1;
  6648.         uint32_t r4sbA_permutations_sig_id;   // example value = 0xD8479D00
  6649.     }r4c_change_colors;
  6650.    
  6651.     struct lifi_r4scA
  6652.     {
  6653.         // representation 4 sub-cells A
  6654.         // r4scA_permutations_
  6655.         float r4scA_permutations_weight_frac;
  6656.         float r4scA_permutations_color_lower_bound_r_frac;
  6657.         float r4scA_permutations_color_lower_bound_g_frac;
  6658.         float r4scA_permutations_color_lower_bound_b_frac;
  6659.         float r4scA_permutations_color_upper_bound_r_frac;
  6660.         float r4scA_permutations_color_upper_bound_g_frac;
  6661.         float r4scA_permutations_color_upper_bound_b_frac;
  6662.     }r4sc_change_colors_permutations;
  6663.    
  6664.     struct lifi_r5c {
  6665.         // representation 5 cells
  6666.         // r5c_predicted_resources_
  6667.         uint16_t r5c_predicted_resources_type;
  6668.         uint16_t r5c_predicted_resources_resource_index;
  6669.         uint32_t r5c_predicted_resources_tag_index;
  6670.     }r5c_predicted_resources;
  6671.    
  6672.     // OBJE DATA 2 END
  6673.    
  6674.     // dependencies 7-13 tagpathname strings go here
  6675.    
  6676. } type_meta_lifi;
  6677.  
  6678. #pragma mark -- ligh
  6679.  
  6680. typedef struct {
  6681.     //uint16_t INTERNAL_optimization;   // 0 -- as usual, I'm unable to determine if this is just part of a uint32_t for flags; the value is written, however, but possibly as part of the flags
  6682.     uint32_t flags; //toff 64   0x0000003F  FIXED
  6683.    
  6684.     float shape_radius;
  6685.     float shape_radius_modifier_from;
  6686.     float shape_radius_modifier_to;
  6687.     float shape_falloff_angle_rad;
  6688.     float shape_cutoff_angle_rad;
  6689.     float shape_lens_flare_only_radius;
  6690.    
  6691.     // 92, 24
  6692.    
  6693.     uint32_t color_interpolation_flags; //toff 116  0x00000003
  6694.     float color_color_lower_bound_a_frac;
  6695.     float color_color_lower_bound_r_frac;
  6696.     float color_color_lower_bound_g_frac;
  6697.     float color_color_lower_bound_b_frac;
  6698.    
  6699.     float color_color_upper_bound_a_frac;
  6700.     float color_color_upper_bound_r_frac;
  6701.     float color_color_upper_bound_g_frac;
  6702.     float color_color_upper_bound_b_frac;
  6703.    
  6704.     // 152, 12
  6705.    
  6706.     // dependency 1: gel primary cube map bitm
  6707.     char gel_primary_cube_map_tagclass[5];       //unsigned char[5]
  6708.     uint32_t gel_primary_cube_map_tagnamepointer;   //uint32 ("random" number)
  6709.     uint32_t gel_primary_cube_map_tagnamestringlength;   //uint32
  6710.     uint32_t gel_primary_cube_map_tagid;         //uint32 (0xFFFFFFFF with tags)
  6711.     // char gel_primary_cube_map_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  6712.    
  6713.     // 180, 2
  6714.    
  6715.     uint16_t gel_texture_animation_function;
  6716.     float gel_texture_animation_period;
  6717.    
  6718.     // dependency 2: gel secondary cube map bitm
  6719.     char gel_secondary_cube_map_tagclass[5];         //unsigned char[5]
  6720.     uint32_t gel_secondary_cube_map_tagnamepointer;   //uint32 ("random" number)
  6721.     uint32_t gel_secondary_cube_map_tagnamestringlength;   //uint32
  6722.     uint32_t gel_secondary_cube_map_tagid;       //uint32 (0xFFFFFFFF with tags)
  6723.     // char gel_secondary_cube_map_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  6724.    
  6725.     // 204, 2
  6726.     uint16_t gel_yaw_function;
  6727.     float gel_yaw_period;
  6728.     // 212, 2
  6729.     uint16_t gel_roll_function;
  6730.     float gel_roll_period;
  6731.     // 220, 2
  6732.     uint16_t gel_pitch_function;
  6733.     float gel_pitch_period;
  6734.     // 228, 8
  6735.    
  6736.     // dependency 3: lens flare lens flare lens
  6737.     char lens_flare_lens_flare_tagclass[5];      //unsigned char[5]
  6738.     uint32_t lens_flare_lens_flare_tagnamepointer;   //uint32 ("random" number)
  6739.     uint32_t lens_flare_lens_flare_tagnamestringlength;   //uint32
  6740.     uint32_t lens_flare_lens_flare_tagid;        //uint32 (0xFFFFFFFF with tags)
  6741.     // char lens_flare_lens_flare_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  6742.    
  6743.     // 252, 24
  6744.    
  6745.     float radiosity_intensity;
  6746.     float radiosity_color_r_frac;
  6747.     float radiosity_color_g_frac;
  6748.     float radiosity_color_b_frac;
  6749.    
  6750.     // 292, 16
  6751.    
  6752.     float effect_parameters_duration;
  6753.     // 312, 2
  6754.     uint16_t effect_parameters_falloff_function;
  6755.    
  6756.     // 316, 100
  6757.    
  6758.     // dependency tagpathname strings go here
  6759.    
  6760. } type_meta_ligh;
  6761.  
  6762. #pragma mark -- lsnd
  6763.  
  6764. typedef struct {
  6765.     //uint16_t INTERNAL_optimization;   // 0 -- as usual, I'm unable to determine if this is just part of a uint32_t for flags; the value is written, however, but possibly as part of the flags
  6766.     uint32_t flags; //toff 64 (previous is not logical) 0x00000007  FIXED
  6767.     float when_scale_is_zero_detail_sound_period;
  6768.     // 72, 8
  6769.     float when_scale_is_one_detail_sound_period;
  6770.     // 84, 24
  6771.    
  6772.     // dependency 1: when scale is one continuous damage effect cdmg
  6773.     char when_scale_is_one_continuous_damage_effect_tagclass[5];         //unsigned char[5]
  6774.     uint32_t when_scale_is_one_continuous_damage_effect_tagnamepointer;   //uint32 ("random" number)
  6775.     uint32_t when_scale_is_one_continuous_damage_effect_tagnamestringlength;   //uint32
  6776.     uint32_t when_scale_is_one_continuous_damage_effect_tagid;       //uint32 (0xFFFFFFFF with tags)
  6777.     // char when_scale_is_one_continuous_damage_effect_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  6778.    
  6779.     // representation 1 board, offset 124
  6780.     // r1b_tracks_
  6781.     uint32_t r1b_tracks_entrycount; // maximum of 4 cells
  6782.     uint32_t r1b_tracks_random_id;
  6783.     uint32_t r1b_tracks_sig_id; // example value = 0x9C969B00
  6784.    
  6785.     // representation 2 board, offset 136
  6786.     // r2b_detail_sounds_
  6787.     uint32_t r2b_detail_sounds_entrycount; // maximum of 32 cells
  6788.     uint32_t r2b_detail_sounds_random_id;
  6789.     uint32_t r2b_detail_sounds_sig_id; // example value = 0x5C979B00
  6790.    
  6791.     // dependency 1 tagpathname string goes here
  6792.    
  6793.     struct lsnd_r1c {
  6794.         // representation 1 cells
  6795.         // r1c_tracks_
  6796.        
  6797.         uint32_t r1c_tracks_flags;   // confirmed 32 bit, toff 148  0x00000007
  6798.        
  6799.         float r1c_tracks_gain_frac;
  6800.         float r1c_tracks_fade_in_duration;
  6801.         float r1c_tracks_fade_out_duration;
  6802.        
  6803.         // 32
  6804.        
  6805.         // dependency r1c 1: tracks start snd!
  6806.         char r1c1_tracks_start_tagclass[5];      //unsigned char[5]
  6807.         uint32_t r1c1_tracks_start_tagnamepointer;   //uint32 ("random" number)
  6808.         uint32_t r1c1_tracks_start_tagnamestringlength;   //uint32
  6809.         uint32_t r1c1_tracks_start_tagid;        //uint32 (0xFFFFFFFF with tags)
  6810.         // char r1c1_tracks_start_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  6811.        
  6812.         // dependency r1c 2: tracks loop snd!
  6813.         char r1c2_tracks_loop_tagclass[5];       //unsigned char[5]
  6814.         uint32_t r1c2_tracks_loop_tagnamepointer;   //uint32 ("random" number)
  6815.         uint32_t r1c2_tracks_loop_tagnamestringlength;   //uint32
  6816.         uint32_t r1c2_tracks_loop_tagid;         //uint32 (0xFFFFFFFF with tags)
  6817.         // char r1c2_tracks_loop_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  6818.        
  6819.         // dependency r1c 3: tracks end snd!
  6820.         char r1c3_tracks_end_tagclass[5];        //unsigned char[5]
  6821.         uint32_t r1c3_tracks_end_tagnamepointer;   //uint32 ("random" number)
  6822.         uint32_t r1c3_tracks_end_tagnamestringlength;   //uint32
  6823.         uint32_t r1c3_tracks_end_tagid;      //uint32 (0xFFFFFFFF with tags)
  6824.         // char r1c3_tracks_end_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  6825.        
  6826.         // 32
  6827.        
  6828.         // dependency r1c 4: tracks alternate loop snd!
  6829.         char r1c4_tracks_alternate_loop_tagclass[5];         //unsigned char[5]
  6830.         uint32_t r1c4_tracks_alternate_loop_tagnamepointer;   //uint32 ("random" number)
  6831.         uint32_t r1c4_tracks_alternate_loop_tagnamestringlength;   //uint32
  6832.         uint32_t r1c4_tracks_alternate_loop_tagid;       //uint32 (0xFFFFFFFF with tags)
  6833.         // char r1c4_tracks_alternate_loop_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  6834.        
  6835.         // dependency r1c 5: tracks alternate end snd!
  6836.         char r1c5_tracks_alternate_end_tagclass[5];      //unsigned char[5]
  6837.         uint32_t r1c5_tracks_alternate_end_tagnamepointer;   //uint32 ("random" number)
  6838.         uint32_t r1c5_tracks_alternate_end_tagnamestringlength;   //uint32
  6839.         uint32_t r1c5_tracks_alternate_end_tagid;        //uint32 (0xFFFFFFFF with tags)
  6840.         // char r1c5_tracks_alternate_end_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  6841.        
  6842.     }r1c_tracks;
  6843.    
  6844.     // dependencies r1c 1-5 tagpathname strings go here, as {1 2 3 4 5}
  6845.    
  6846.     struct lsnd_r2c {
  6847.         // representation 2 cells
  6848.         // r2c_detail_sounds_
  6849.        
  6850.         // dependency r2c 1: detail sounds sound snd!
  6851.         char r2c1_detail_sounds_sound_tagclass[5];       //unsigned char[5]
  6852.         uint32_t r2c1_detail_sounds_sound_tagnamepointer;   //uint32 ("random" number)
  6853.         uint32_t r2c1_detail_sounds_sound_tagnamestringlength;   //uint32
  6854.         uint32_t r2c1_detail_sounds_sound_tagid;         //uint32 (0xFFFFFFFF with tags)
  6855.         // char r2c1_detail_sounds_sound_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  6856.        
  6857.         float r2c_detail_sounds_frequency_of_play_random_period_bounds_from;
  6858.         float r2c_detail_sounds_frequency_of_play_random_period_bounds_to;
  6859.         float r2c_detail_sounds_frequency_of_play_gain_frac;
  6860.         uint32_t r2c_detail_sounds_frequency_of_play_flags; // toff 336 0x00000003
  6861.        
  6862.         // 48
  6863.        
  6864.         float r2c_detail_sounds_random_spatialization_yaw_bounds_from_rad;
  6865.         float r2c_detail_sounds_random_spatialization_yaw_bounds_to_rad;
  6866.         float r2c_detail_sounds_random_spatialization_pitch_bounds_from_rad;
  6867.         float r2c_detail_sounds_random_spatialization_pitch_bounds_to_rad;
  6868.         float r2c_detail_sounds_random_spatialization_distance_bounds_from;
  6869.         float r2c_detail_sounds_random_spatialization_distance_bounds_to;
  6870.        
  6871.     }r2c_detail_sounds;
  6872.    
  6873.     // dependency r2c 1 tagpathname strings go here
  6874. } type_meta_lsnd;
  6875.  
  6876. #pragma mark -- mach
  6877.  
  6878. typedef struct {
  6879.     // OBJE 1 DATA START
  6880.     uint16_t INTERNAL_obje_index;   // 7 (little endian)
  6881.     // 1
  6882.     uint8_t flags;  //toff 66   0x0F    FIXED
  6883.     float bounding_radius;
  6884.     float bounding_offset_x;
  6885.     float bounding_offset_y;
  6886.     float bounding_offset_z;
  6887.     float origin_offset_x;
  6888.     float origin_offset_y;
  6889.     float origin_offset_z;
  6890.     float acceleration_scale;
  6891.     // offset 100 = 4 bytes of 0
  6892.    
  6893.     // dependency 1: model mod2
  6894.     char model_tagclass[5];      //unsigned char[5]
  6895.     uint32_t model_tagnamepointer;   //uint32 ("random" number)
  6896.     uint32_t model_tagnamestringlength;   //uint32
  6897.     uint32_t model_tagid;        //uint32 (0xFFFFFFFF with tags)
  6898.     // char model_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  6899.    
  6900.     // dependency 2: animation graph antr
  6901.     char animation_graph_tagclass[5];        //unsigned char[5]
  6902.     uint32_t animation_graph_tagnamepointer;   //uint32 ("random" number)
  6903.     uint32_t animation_graph_tagnamestringlength;   //uint32
  6904.     uint32_t animation_graph_tagid;      //uint32 (0xFFFFFFFF with tags)
  6905.     // char animation_graph_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  6906.    
  6907.     // offset 136 = 40 bytes of 0
  6908.    
  6909.     // dependency 3: collision model coll
  6910.     char collision_model_tagclass[5];        //unsigned char[5]
  6911.     uint32_t collision_model_tagnamepointer;   //uint32 ("random" number)
  6912.     uint32_t collision_model_tagnamestringlength;   //uint32
  6913.     uint32_t collision_model_tagid;      //uint32 (0xFFFFFFFF with tags)
  6914.     // char collision_model_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  6915.    
  6916.     // dependency 4: physics phys
  6917.     char physics_tagclass[5];        //unsigned char[5]
  6918.     uint32_t physics_tagnamepointer;   //uint32 ("random" number)
  6919.     uint32_t physics_tagnamestringlength;   //uint32
  6920.     uint32_t physics_tagid;      //uint32 (0xFFFFFFFF with tags)
  6921.     // char physics_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  6922.    
  6923.     // dependency 5: modifier shader shdr senv soso schi scex sotr sgla smet spla swat
  6924.     char modifier_shader_tagclass[5];        //unsigned char[5]
  6925.     uint32_t modifier_shader_tagnamepointer;   //uint32 ("random" number)
  6926.     uint32_t modifier_shader_tagnamestringlength;   //uint32
  6927.     uint32_t modifier_shader_tagid;      //uint32 (0xFFFFFFFF with tags)
  6928.     // char modifier_shader_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  6929.    
  6930.     // dependency 6: creation effect effe
  6931.     char creation_effect_tagclass[5];        //unsigned char[5]
  6932.     uint32_t creation_effect_tagnamepointer;   //uint32 ("random" number)
  6933.     uint32_t creation_effect_tagnamestringlength;   //uint32
  6934.     uint32_t creation_effect_tagid;      //uint32 (0xFFFFFFFF with tags)
  6935.     // char creation_effect_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  6936.    
  6937.     // offset 240 = 84 bytes of 0
  6938.    
  6939.     float render_bounding_radius;
  6940.    
  6941.     uint16_t export_to_functions_a_in;
  6942.     uint16_t export_to_functions_b_in;
  6943.     uint16_t export_to_functions_c_in;
  6944.     uint16_t export_to_functions_d_in;
  6945.    
  6946.     // offset 336 = 44 bytes of 0
  6947.    
  6948.     uint16_t export_to_functions_hud_text_message_index;
  6949.     uint16_t export_to_functions_forced_shader_permutation_index;
  6950.    
  6951.     // representation 1 board, offset 384
  6952.     // r1b_attachments_
  6953.     uint32_t r1b_attachments_entrycount; // maximum of 8 cells
  6954.     uint32_t r1b_attachments_random_id;
  6955.     uint32_t r1b_attachments_sig_id; // example value = 0x08479D00
  6956.    
  6957.     // representation 2 board, offset 396
  6958.     // r2b_widgets_
  6959.     uint32_t r2b_widgets_entrycount; // maximum of 4 cells
  6960.     uint32_t r2b_widgets_random_id;
  6961.     uint32_t r2b_widgets_sig_id; // example value = 0x7C479D00
  6962.    
  6963.     // representation 3 board, offset 408
  6964.     // r3b_functions_
  6965.     uint32_t r3b_functions_entrycount; // maximum of 4 cells
  6966.     uint32_t r3b_functions_random_id;
  6967.     uint32_t r3b_functions_sig_id; // example value = 0x50469D00
  6968.    
  6969.     // representation 4 board, offset 420
  6970.     // r4b_change_colors_
  6971.     uint32_t r4b_change_colors_entrycount; // maximum of 4 cells
  6972.     uint32_t r4b_change_colors_random_id;
  6973.     uint32_t r4b_change_colors_sig_id; // example value = 0x6C489D00
  6974.    
  6975.     // representation 5 board, offset 432
  6976.     // r5b_predicted_resources_
  6977.     uint32_t r5b_predicted_resources_entrycount; // maximum of 1024 cells
  6978.     uint32_t r5b_predicted_resources_random_id;
  6979.     uint32_t r5b_predicted_resources_sig_id; // example value = 0x105FA000
  6980.    
  6981.     // OBJE 1 DATA END
  6982.    
  6983.     uint32_t device_flags;   // offset 444, toff 444    0X00000003
  6984.     float device_power_transition_time;
  6985.     float device_power_acceleration_time;
  6986.     float device_position_transition_time;
  6987.     float device_position_acceleration_time;
  6988.     float device_depowered_position_transition_time;
  6989.     float device_depowered_position_acceleration_time;
  6990.     uint16_t device_a_in;
  6991.     uint16_t device_b_in;
  6992.     uint16_t device_c_in;
  6993.     uint16_t device_d_in;
  6994.    
  6995.     // dependency 7: open (up) effe snd!
  6996.     char device_open_up_tagclass[5];         //unsigned char[5]
  6997.     uint32_t device_open_up_tagnamepointer;   //uint32 ("random" number)
  6998.     uint32_t device_open_up_tagnamestringlength;   //uint32
  6999.     uint32_t device_open_up_tagid;       //uint32 (0xFFFFFFFF with tags)
  7000.     // char device_open_up_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  7001.    
  7002.     // dependency 8: close (down) effe snd!
  7003.     char device_close_down_tagclass[5];      //unsigned char[5]
  7004.     uint32_t device_close_down_tagnamepointer;   //uint32 ("random" number)
  7005.     uint32_t device_close_down_tagnamestringlength;   //uint32
  7006.     uint32_t device_close_down_tagid;        //uint32 (0xFFFFFFFF with tags)
  7007.     // char device_close_down_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  7008.    
  7009.     // dependency 9: opened effe snd!
  7010.     char device_opened_tagclass[5];      //unsigned char[5]
  7011.     uint32_t device_opened_tagnamepointer;   //uint32 ("random" number)
  7012.     uint32_t device_opened_tagnamestringlength;   //uint32
  7013.     uint32_t device_opened_tagid;        //uint32 (0xFFFFFFFF with tags)
  7014.     // char device_opened_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  7015.    
  7016.     // dependency 10: closed effe snd!
  7017.     char device_closed_tagclass[5];      //unsigned char[5]
  7018.     uint32_t device_closed_tagnamepointer;   //uint32 ("random" number)
  7019.     uint32_t device_closed_tagnamestringlength;   //uint32
  7020.     uint32_t device_closed_tagid;        //uint32 (0xFFFFFFFF with tags)
  7021.     // char device_closed_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  7022.    
  7023.     // dependency 11: depowered effe snd!
  7024.     char device_depowered_tagclass[5];       //unsigned char[5]
  7025.     uint32_t device_depowered_tagnamepointer;   //uint32 ("random" number)
  7026.     uint32_t device_depowered_tagnamestringlength;   //uint32
  7027.     uint32_t device_depowered_tagid;         //uint32 (0xFFFFFFFF with tags)
  7028.     // char device_depowered_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  7029.    
  7030.     // dependency 12: repowered effe snd!
  7031.     char device_repowered_tagclass[5];       //unsigned char[5]
  7032.     uint32_t device_repowered_tagnamepointer;   //uint32 ("random" number)
  7033.     uint32_t device_repowered_tagnamestringlength;   //uint32
  7034.     uint32_t device_repowered_tagid;         //uint32 (0xFFFFFFFF with tags)
  7035.     // char device_repowered_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  7036.    
  7037.     float device_delay_time;   // offset 576
  7038.     // offset 580 = 8 bytes of 0
  7039.    
  7040.     // dependency 13: delay effect effe snd!
  7041.     char device_delay_effect_tagclass[5];        //unsigned char[5]
  7042.     uint32_t device_delay_effect_tagnamepointer;   //uint32 ("random" number)
  7043.     uint32_t device_delay_effect_tagnamestringlength;   //uint32
  7044.     uint32_t device_delay_effect_tagid;      //uint32 (0xFFFFFFFF with tags)
  7045.     // char device_delay_effect_tagnamestring[255];   // the actual tag path name, before converting '\' to '/' for use as NSURL
  7046.    
  7047.     float device_automatic_activation_radius;
  7048.    
  7049.     // (henceforth differs from ctrl and lifi)
  7050.     // 608, 112