Difference between revisions of "Datamining"

From Dragalia Lost Wiki
Jump to navigation Jump to search
imported>Elaeagnifolia
m
imported>Elaeagnifolia
m

Revision as of 18:32, 27 January 2019

Obtaining the Assets

Android

The assets are located in:

/data/com.nintendo.zaga/files/assets

iOS

The assets are located in:

Payload/zaga.app/Data/Raw/PreinResource/AssetBundle

Extracting the Assets

The assets can be extracted using any Unity asset extractor, such as AssetStudio.

AssetStudio

  1. Go to File > Load Folder
  2. Select the folder where the asset are located.
  3. Wait for AssetStudio to finish loading the files.
  4. Go to Asset List tab.
  5. Select the assets you would like to export (or skip to next step if you would like to extract everything).
    1. It is recommended to go to Filter Type, and select the asset types you would like to extract. The types the Wiki usually extracts are:
      1. Texture2D - Character images, icons, backgrounds, model textures, etc. Basically any and all images in the game.
      2. Mesh - 3D models and objects
      3. MonoBehavior - Text and data including story script transitions, character data, etc. As well as a lot of unreadable junk data.
      4. Sprite - Similar to Texture2D, but sometimes has icons cut out (vs. Texture2D putting all the icons into one UI file which need to be cut out).
  6. Go to Export > All assets / Selected assets / Filtered assets to export and save the assets.

Asset Type Details

Texture2D

Texture2D images are often split into separate images, and in order to get them into their proper formats as seen in-game, other tools are needed to combine these images such as Python, Imagemagick, or Matlab.

YCbCr

Several of the image files in the Texture2D folder are files split into their YCbCr channels. The following include code snippets on how to convert these split YCbCr images into one properly colored image.

For example, Karl's character image is split into the following files:

  • 110008_01_r04_Y.png
  • 110008_01_r04_Cb.png
  • 110008_01_r04_Cr.png
Python
  • Requires Python Pillow (Python Imaging Library)
from PIL import Image

base_file_name = "110008_01_r04"
(z,z,z,y) = Image.open(base_file_name + "_Y.png").convert('RGBA').split()
u = Image.open(base_file_name + "_Cb.png").convert('L').resize((1024,1024), Image.LANCZOS)
v = Image.open(base_file_name + "_Cr.png").convert('L').resize((1024,1024), Image.LANCZOS)

merged = Image.merge("YCbCr", (y,u,v)).convert('RGB')
merged.save("file save location here")
ImageMagick
magick convert 110008_01_r04_Y.png -colorspace YCbCr -separate ysplit.png

magick convert ysplit-3.png 110008_01_r04_Cb.png 110008_01_r04_Cr.png -set colorspace YCbCr -combine -colorspace sRGB combined.png
Matlab
  • Note that Matlab requires a paid license to use outside of the 30-day free trial.
image1 = imread('110008_01_r04_Y.png');
image2 = imread('110008_01_r04_Cb.png');
image3 = imread('110008_01_r04_Cr.png');
image2 = imresize(image2, 2);
image3 = imresize(image3, 2);
y = image1(:,:,1);
b = image2(:,:,2);
r = image3(:,:,3);
B = cat(3,y,b,r);
B1 = ycbcr2rgb(B);
imshow(B1);

Alpha

Many of the Texture2D images are not transparent, but have their alpha files separated into another file. These files can be identified if they have an _alphaA8, _A, _alpha, or _Alpha at the end of the file name. Similar to YCbCr, you will need separate tools to combine the original image and the alpha image.

Additionally, note that there are two different ways for the alpha file to be combined depending on the alpha image.

Python

Method 1:

from PIL import Image

base_file_name = "100029_02_r05.png"
alpha_file_name = "100029_02_r05_alphaA8.png"

(r,g,b,z) = Image.open(base_file_name).convert('RGBA').split()
(z,z,z,a) = Image.open(alpha_file_name).resize((w,h), Image.LANCZOS).split()

merged = Image.merge("RGBA", (r,g,b,a))
merged.save("file save location here")

Method 2:

from PIL import Image

base_file_name = "101401_IMG_03_base_01.png"
alpha_file_name = "101401_IMG_03_base_01_alpha.png"

(r,g,b,z) = Image.open(base_file_name).convert('RGBA').split()
a = Image.open(alpha_file_name).resize((w,h), Image.LANCZOS).convert('L')

merged = Image.merge("RGBA", (r,g,b,a))
merged.save("file save location here")

Model Textures

File(s) Description
cXXXXXX_XX.png (eg. c100001_01.png) Character / Humanoid Enemy Model Textures
dXXXXXX_XX.png (eg. d200001_01.png) Dragon Model Textures
eXXXXXXX.png (eg. e0010101.png) Enemy Model Textures
rXXXXXXX_XX.png (eg. r0010101_01.png) Raid Boss Textures
wXXXXXX_XX.png (eg. w301001_01.png) Weapon Model Textures

Mesh

The following is table to help identify some of the mesh models more easily. For the texture files for the models, see Texture2D#Model Textures.

File(s) Description
cXXXXXX_XX.obj (eg. c100001_01.obj) Character Models
mBody Enemy / Dragon / Character Models
mBodyAll Humanoid Character Models (eg. Human Enemies like Imperial Soldiers, Dark Zethia's model, etc.)
mAxe, mBow, mDagger, etc. Weapon Models