<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mii.j0.lol/index.php?action=history&amp;feed=atom&amp;title=Un.mii</id>
	<title>Un.mii - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mii.j0.lol/index.php?action=history&amp;feed=atom&amp;title=Un.mii"/>
	<link rel="alternate" type="text/html" href="https://mii.j0.lol/index.php?title=Un.mii&amp;action=history"/>
	<updated>2026-05-06T08:28:14Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>https://mii.j0.lol/index.php?title=Un.mii&amp;diff=310&amp;oldid=prev</id>
		<title>Arian: add images and type name list</title>
		<link rel="alternate" type="text/html" href="https://mii.j0.lol/index.php?title=Un.mii&amp;diff=310&amp;oldid=prev"/>
		<updated>2025-08-31T17:11:55Z</updated>

		<summary type="html">&lt;p&gt;add images and type name list&lt;/p&gt;
&lt;a href=&quot;https://mii.j0.lol/index.php?title=Un.mii&amp;amp;diff=310&amp;amp;oldid=306&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Arian</name></author>
	</entry>
	<entry>
		<id>https://mii.j0.lol/index.php?title=Un.mii&amp;diff=306&amp;oldid=prev</id>
		<title>172.28.0.1: initial page: what is it, interesting facts, and why they made, why it is the way it is</title>
		<link rel="alternate" type="text/html" href="https://mii.j0.lol/index.php?title=Un.mii&amp;diff=306&amp;oldid=prev"/>
		<updated>2025-08-31T17:00:19Z</updated>

		<summary type="html">&lt;p&gt;initial page: what is it, interesting facts, and why they made, why it is the way it is&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;#039;&amp;#039;un.mii&amp;#039;&amp;#039; is a Mii rendering and parsing library written in C# that was found to be used in [[Pikmin Bloom]]. Presumably, it&amp;#039;s also used in [[Mario Kart Tour]], given that it&amp;#039;s also using Unity and can render 3D Mii heads.&lt;br /&gt;
&lt;br /&gt;
Info about this library and its namespace hierarchy was found in Pikmin Bloom&amp;#039;s &amp;#039;&amp;#039;global-metadata.dat&amp;#039;&amp;#039;, which stores metadata about .NET assemblies that were compiled using il2cpp, which is an obfuscation/optimization technique Unity uses when compiling .NET bytecode to native machine code.&lt;br /&gt;
&lt;br /&gt;
In order to read the &amp;#039;&amp;#039;global-metadata.dat&amp;#039;&amp;#039; file, a tool such as this can be used: https://twy.name/Tools/global-metadata/. The un.mii namespace is included in &amp;lt;code&amp;gt;Assembly-CSharp-firstpass.dll&amp;lt;/code&amp;gt;, although there are two others with one class each: &amp;lt;code&amp;gt;CoreDataConverter.dll&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;CharInfoConverter.dll&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The library itself highly resembles [[nn::mii]]. Class names/members, enums, method names, and method parameters are all shared with nn::mii.&lt;br /&gt;
&lt;br /&gt;
==== nn::mii resemblance ====&lt;br /&gt;
* There are &amp;quot;CharModel&amp;quot; and &amp;quot;CharModelImpl&amp;quot; classes, which follow the [[wikipedia:Opaque_pointer|&amp;quot;p_Impl&amp;quot; pattern]] that isn&amp;#039;t typical in C#.&lt;br /&gt;
* There are class members that are prefixed with &amp;quot;m&amp;quot;, and argument names prefixed with &amp;quot;p&amp;quot; (pointer). Neither conventions are used in C#. (Look at &amp;quot;Mask&amp;quot;)&lt;br /&gt;
* Since C# is strictly object-oriented, all methods are now in classes. An example is the &amp;quot;Adjustment&amp;quot; class, taken from &amp;quot;mii_Adjustment.cpp&amp;quot;. Names like &amp;quot;un.mii.Adjustment.GetEyeRotateOffset()&amp;quot; would&amp;#039;ve previously been &amp;quot;nn::mii::detail::GetEyeRotateOffset()&amp;quot;, as C++ does not force everything to be in classes.&lt;br /&gt;
* un.mii has many enums for every type, e.g.: EyeType, HairType, EyeScale, Ver3BirthPlatform, etc. These enums are also present in nn::mii, but there they&amp;#039;re usually isolated to the &amp;quot;mii_ParamCommon.h&amp;quot; or &amp;quot;detail/mii_Ver3Common.h&amp;quot; headers, whereas here they all live in the un.mii namespace.&lt;br /&gt;
** The enums are usually just made up of &amp;quot;Min&amp;quot;, &amp;quot;Max&amp;quot;, &amp;quot;End&amp;quot;, sometimes &amp;quot;Empty&amp;quot;, and on occasion other values.&lt;br /&gt;
* The anonymous namespace of Assembly-CSharp-firstpass.dll contains types from un.mii that are also anonymous in nn::mii. For example: Three &amp;quot;DrawType&amp;quot; enums for faceline/mask/model, DrawTypeImpl also found in nn::mii::detail::CharModelImpl, then types seen in MaskImpl like ExpressionDrawParam, EyeComponent, EyePlaceParam, EyeTexturePair...&lt;br /&gt;
* Some classes are &amp;quot;accessors&amp;quot; for data used with Get/Set methods, which are copied from nn::mii (e.g.: Ver3StoreDataRaw, ParamCharInfoAccessor), which are kept the same despite C# having property getter/setters that can be used instead. However, the CharInfo class does use properties with getters/setters.&lt;br /&gt;
* There are also structs/enums from libnn_mii_core that had previously unknown fields. For example: Ver3StoreDataMember/Type, Ver3StoreDataTableElement, CommonColorElement, real names for Mask constants, VerifyReason, Ver3BirthPlatform max being 7, RandomMii tables... This makes it a good resource to reverse nn::mii.&lt;br /&gt;
Given all of this information, &amp;#039;&amp;#039;un.mii&amp;#039;&amp;#039; seems to be a direct source port of [[nn::mii]] in C# for use with Unity. There are many signs that the C++ code was directly ported without following C#/.NET conventions. There are also, of course, signs that it&amp;#039;s only meant to be used with Unity.&lt;br /&gt;
&lt;br /&gt;
==== Unique traits of the library ====&lt;br /&gt;
&lt;br /&gt;
* un.mii does not read any existing [[Mii Resources|Mii resource file formats]], instead opting to store and retrieve shape and texture data from the data.unity3d file, where you can indeed find shapes and textures for Miis in Pikmin Bloom&amp;#039;s data.unity3d. The assets are also in the &amp;quot;un.mii&amp;quot; namespace.&lt;br /&gt;
** Shapes are categorized as &amp;quot;middle&amp;quot; and &amp;quot;high&amp;quot;, as well as having &amp;quot;low&amp;quot; and &amp;quot;middle&amp;quot; textures, once again suggesting the NintendoSDK/nn::mii lineage. The files are named with their internal part names (for example, &amp;quot;FaceT_line06&amp;quot;) and may match up with internal tooling Nintendo uses to pack/unpack Mii resources.&lt;br /&gt;
** Textures are stored in ASTC6x6, and stretched to the proper shape (e.g. eyes are stored in square shape)&lt;br /&gt;
* There are &amp;quot;TextureRendererBehaviour&amp;quot; and &amp;quot;FacelineTextureRendererBehaviour&amp;quot; types, suggesting Mono behaviours. There&amp;#039;s also Renderer classes for both, containing a &amp;quot;CreateGameObject&amp;quot; method that clearly refers to the Unity GameObject type. Likewise, CharModel and CharModelImpl have references to the RenderQueue type.&lt;br /&gt;
* The &amp;quot;Database&amp;quot; class from nn::mii is kept, albehit just has three methods: GetDefault, GetRandom, and GetRandomVer3StoreData. So it has nothing to do with the [[Mii Database]], but functions are categorized there just like nn::mii did.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Overall, it&amp;#039;s just a port of the nn::mii codebase to C# with a few tweaks made for Unity. It&amp;#039;s interesting given that nn::mii can be considered a port of FFL, with many pieces of code copy-pasted from it.&lt;br /&gt;
&lt;br /&gt;
Ironically, given that Unity compiles .NET code to C++ anyway, it may have made more sense to just use nn::mii as-is using [https://learn.microsoft.com/en-us/dotnet/standard/native-interop/pinvoke P/Invoke]&amp;lt;sup&amp;gt;, like [https://github.com/ariankordi/FFLSharp FFLSharp].&amp;lt;/sup&amp;gt; However, the reasons they couldn&amp;#039;t include that all versions of the [[Face Libraries|Face Library]] heavily depend on the system/SDK&amp;#039;s graphics API (GX, GX2, nn::gfx) and rely on their respective resource binary format. Interop with C libraries is also inconvenient and avoided in most languages, so combined with the inflexibility mentioned, is why they made the choice they did.&lt;br /&gt;
&lt;br /&gt;
Notably for Miitomo they did go the route of modifying [[Cafe Face Library|FFL]] to remove GX2 calls and made [[Arch Face Library|AFL]], but it accumulated tech debt over time by trying to merge it with libnn_mii_core. It&amp;#039;s less likely they would&amp;#039;ve done this for [[nn::mii]], given that the way it manually manages graphics buffers and pipelines makes it even more dependent on nn::gfx than FFL is on GX2.&lt;br /&gt;
&lt;br /&gt;
== Uses ==&lt;br /&gt;
* Pikmin Bloom&lt;br /&gt;
** While the global-metadata.dat is visible, it&amp;#039;s not clear where all il2cpp types and methods go to.&lt;br /&gt;
** The [https://github.com/djkaty/Il2CppInspector/ Il2CppInspector tool] is unable to open its libil2cpp.so.&lt;br /&gt;
* Mario Kart Tour(?)&lt;br /&gt;
** Its global-metadata.dat is hidden, and libil2cpp.so is reportedly encrypted: https://gameguardian.net/forum/topic/26082-mario-kart-tour/page/38/#comment-110128&lt;br /&gt;
** Mii assets also can&amp;#039;t be found in its data.unity3d file.&lt;br /&gt;
{{FL-Navbox}}&lt;br /&gt;
[[Category:Face libraries]]&lt;/div&gt;</summary>
		<author><name>172.28.0.1</name></author>
	</entry>
</feed>