Welcome to Open Carnage

We're a community of gamers and technology enthusiasts, with a very unique means of rewarding content creation and support. Have a wander to see why we're worth the time!

Sign in to follow this  
Followers 0
002

Tritium

Tritium is an open-source library written in Rust. This is not a tool by itself, but I or someone else may end up using it at a later date for a future Halo tool.

 

Features include (for programmers):

  • No segfaults - Rust guarantees that safe code does not result in segmentation fault.
  • Open source - You are free to download the source code. You can use it in your project and modify it as you please (aside from the MIT license), though you can also use it as a crate and simply depend on it with your project, if that's what you want.
  • Easy to use - You only need to provide the map data as a slice to make it usable. When you're done with the map data, you can turn it back into a cache file, if you want. If you're just reading the map file, that's okay, too.
  • Speed - While it's not the main goal of the project, it's notable that it's quite fast. As of the current build from July 16 on a computer with an Intel Core i3-6100 with DDR4 memory at 2666 MHz, Blood Gulch takes around 18 milliseconds to open and just under 44 milliseconds to rebuild.

 

Features include (for modders):

  • Recursive tag importation - You can import a tag, or recursively import a tag. Importing a tag non-recursively is a little faster, but it will fail if its dependencies cannot be resolved.
  • Tag deletion - You can delete a specific tag, as well as any unreferenced tags. Deleting a tag will automatically remove any references to it.
  • Tag data manipulation - You can insert/remove data into tags, which can be helpful for things such as reflexive addition and subtraction.

Source Code: https://github.com/Halogen002/Tritium

Tucker933 likes this

status.png?customhost=ProtonNebula.com:2302

status.png?customhost=ProtonNebula.com:2333&format=userbar

competent.png

Share this post


Link to post
Share on other sites

Dislike the ads? Log in or register to never see them again!

Here's a demonstration of Tritium: a CE map translator for HaloMD

 

 

Now MD users can run most CE maps without any conversion being done to the map file. This plugin may see use in tandem with Samuco's netcode bridge.

aLTis and WaeV like this

status.png?customhost=ProtonNebula.com:2302

status.png?customhost=ProtonNebula.com:2333&format=userbar

competent.png

Share this post


Link to post
Share on other sites

Tritium has been updated to 0.4. Here are the changes:

  • Strings in map names and tag paths now use latin1 instead of UTF-8. Halo only supports UTF-16 for unicode and uses ISO 8859-1 for map names and tag paths. This resulted in a new package dependency, encoding, though Cargo should automatically download it and compile it for you.
  • Effect tags' dependencies and addresses have been mapped out. This will lead to less error-prone and more efficient reading time and was necessary for a program I'm working on.
  • Tags now have an implicit property (true/false). Use this instead of checking if resource_index is Some, as sound tags do not utilize a resource index. This modification was important for many CE maps.
  • Cyclical references no longer result in a panic and are handled properly when importing, now.
Tucker933 likes this

status.png?customhost=ProtonNebula.com:2302

status.png?customhost=ProtonNebula.com:2333&format=userbar

competent.png

Share this post


Link to post
Share on other sites

Here's a demonstration of Tritium: A CE map converter which I have named "Amethyst" for now. This map converter does not require a maps folder to be specified and is much faster than Pearl. It's run in a command line interface, taking each argument as a path to a map to be converted. This allows for batch conversion of multiple maps at once. It's not immune to map protections (if a map is protected, use Deathstar) but shares some code from my Sapphire plugin with HaloMD and is essentially a copy of the same CE converter used in my Fire Dragon application for HaloMD users. It's slightly better than Pearl in some conversions and slightly worse in others.

 

There are two files required for this tool to work and must be placed in the same directory. They are all located in the amethyst.7z download.

 

Source code: https://gist.github.com/Halogen002/9e84bd67645bc4a93894af113b22bc17

 

Download (Windows - 32-bit): amethyst.7z

Tucker933 likes this

status.png?customhost=ProtonNebula.com:2302

status.png?customhost=ProtonNebula.com:2333&format=userbar

competent.png

Share this post


Link to post
Share on other sites

Here's a demonstration of Tritium: its speed compared to even the Mac version of Eschaton, which happens to be around 3x faster than the Windows version for an unknown reason. Note that the dependency swapping part does not use Tritium, so ignore it if you want. There's also some elevator-like music that YouTube provided.

 

 

If you want some numbers:

 

Expanding

 

Fire Dragon took 204 ms total. Retrieving the map from the SSD took 19 milliseconds and Tritium's tritium::map::Map::from_cache_file() function took 30 milliseconds parsing the opened map file. The remaining time was spent with the application processing Tritium's resulting struct into its user interface.


In comparison, Eschaton's H1.map_expander took 4.69 seconds, nearly 23 times longer than Fire Dragon. One of my assumptions was that Eschaton was being bottlenecked by my SSD, so I put bloodgulch.map onto a RAM disk. As a result, Eschaton took 4.69 seconds.

 

 

Importing

 

The tag used was b30.map's characters\marine_armored\marined_armored actor variant tag.

 

Fire Dragon took 3 milliseconds to extract, with Tritium's tritium::tag::tag_array::TagArray::insert_recursive taking 2 milliseconds when extracting and isolating the tag. It then took 191 milliseconds to import the extracted tag with tritium::tag::tag_array::TagArray::insert_recursive taking 9 milliseconds, with the rest of the time spent on the user interface.

 

In comparison, Eschaton's H1.Map.expandTag took 1.41 seconds to recursively extract and H1.Map.addTags took 1.74 seconds to import.

 

 

Rebuilding

 

Unlike in the video, I reopened bloodgulch.map when recording these numbers, so this is done using a stock bloodgulch.map with no tags imported.

 

Fire Dragon took 117 ms total. Tritium's tritium::map::Map::to_cache_file() function took 60 milliseconds. Saving the result to the SSD took 55 milliseconds.

 

In comparison, Eschaton's H1.map_writer took 2.85 seconds, 24 times longer than Fire Dragon. Writing directly to a RAM disk took 2.67 seconds, an 8% improvement.

 

 

Specs: Intel Core i7-3667U. 8 GB of RAM @ 1600 MHz. Mac OS X 10.11.5 "El Capitan"

Tucker933 likes this

status.png?customhost=ProtonNebula.com:2302

status.png?customhost=ProtonNebula.com:2333&format=userbar

competent.png

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0
  • Recently Browsing   0 members

    No registered users viewing this page.