Unity3d game development Using disunity extract Unity3d game resources

Source: Internet
Author: User

Dear friends, Hello, I am Qin Yuanpei. What bloggers want and share today is the use of disunity to extract Unity3d game footage. This tool, bloggers in the Unity3d game development of the anti-compilation Assetbundle extract game resources This article has actually been mentioned, but because some friends on how to use this tool is still a problem, So the blogger decided to write an article to explain how to use disunity to extract material from the Unity3d game.

Preparatory work
    • Disunity: Responsible for unpacking the Unity3d data files
    • Unity3d: Responsible for displaying the exported data file
    • Bleander or 3DsMax: Responsible for UNITY3D data file conversion processing, two select one can. Personally recommended Blender.
    • Java: Responsible for providing a compilation environment for disunity
Test file
    • "New Paladin ol" Download
    • "Xuan Jian 6 gate"
    • "Rain Blood prequel: Mirage House" Download
Extraction Process

Well, after making sure all the preparation is done, we can formally start today's content!

Compiling disunity

Although we can download the release version from the Disunity Project homepage, the blogger still recommends compiling the disunity for the sake of insurance. The method of compiling is to switch to the disunity directory on the command line and then execute the command:

java -jar disunity.jar

If there is no problem with the Java environment, then we should be able to see:

[Info]DisUnityv0.3.4

and a variety of usage and parameter options for this tool. Well, now we're familiar with the common commands for the disunity tool. The basic form of the disunity command is:

disunity[CommandName][CommandOptions]
Disunity command
    • Dump: Converts a binary object into a text message that humans can read.
    • Dump-struct: Converts a binary object into structured information.
    • Extract: Convert Unity3d data files into common text, sounds, pictures, and other information.
    • Extract-raw: Converts a Unity3d data file into a serializable object that is used if the extract command is not supported.
    • Extract-txt: And the dump command resembles the output conversion result to the command line.
    • Extract-struct: And the dump-struct command resembles the output conversion result to the command line.
    • Info: Output unity3d data files and variable information for assetbundle files.
    • Bundle-extract: Releases all files that are packaged into the assetbundle.
    • Bundle-inject: Repackage files packaged from Assetbundle

For the time being, we can refer to the Readme.md file in the disunity project if we need to delve into these commands, as other commands are basically not available.

Analysis of the Assetbundle file of "new Paladin ol"

Here we take the game directory/assetbundles/npc/models/under the S049.UNITY3D_CC9026FB as an example to explain the game model extraction.

Model file Extraction

First we change the extension of this file to S049.unity3d, because this is its original extension and is a file format for exporting Assetbundle in Unity3d. OK, we will put this file in a directory without Chinese path, here is an example of C:\Users\Robin\Desktop, the desktop. Note First enter the disunity directory, and then execute the command:

disunity extract C:\Users\Robin\Desktop\s049.unity3d

Next, the desktop will generate a folder named s049, in this folder to find the mesh sub-folder, you will get a s049.obj file, this file is the model file we extracted.

Model Map Extraction

OK, let's look at how to extract the map of this model file, there is a file named S049_1.unity3d_1d2446b9 under the game directory/assetbundles/npc/texture/, this is the map of s049 this model. Similarly, we rename it to S049_1.unity3d and then execute the command:

disunity extract C:\Users\Robin\Desktop\s049_1.unity3d

Next, generate a folder named S049_1 on the desktop, in this folder to find the Texture2d subfolder, you will get a map file named S049_1.dds, this is the model we want to extract s049 map file.

Merging models and maps

We open blender and import the S049.obj file and then delete the default lights and cameras in the scene, because we only need a model file, we find that the model is already visible in blender, because the FBX model is used in Unity3d, so here we export the model file as FBX fallback 。 Because Unity3d can recognize a DDS-type map, we don't have to do anything with the map.

Open Unity3d The childhood Lin model and map to import, the childhood Lin model dragged into the game scene, because the model size has not been adjusted, so the model may be relatively small at the beginning, we can make local adjustments in the Unity3d. Next we will find that the model has no mapping, just select the model and attach the S049_1.dds map file to it in the Properties window. Here is the effect of the model of childhood Lin after Unity3d:

Analysis of the assets file of "new Paladin ol"

Unlike Assetbundle, the assets file is a packaged collection of project resources throughout the Unity3d project, such as the resources under asset files are packaged here, so it's possible to have a bigger harvest of parsing assets files! Because all Unity3d games have such files, assetbundle files are only available in game projects that use the technology. For example, there is an important resource folder in Unity3d, and this folder is packaged and packaged into resources.assets files. Here we take the Xianjian_data/resources.assets file as an example. First perform the naming:

disunity extract C:\Users\Robin\Desktop\resources.assets

Next we will generate a resources folder on the desktop, open this folder we will find three subfolders, respectively, shader, Textasset and texture2d. The results of the analysis seemed a bit disappointing, However, under the Textasset folder we will find a file called ResourceFiles.txt, which is a plain text file, we can open it, we open it, we find its content is an XML file, and in this XML file defines the various resources used in the game path, but these resources are Defined in the form of Assetbundle. What does that mean? This shows that the "new Chinese paladin" scene and interface resources are loaded into the game by dynamic loading, and these resources are configured and managed through this XML file, which conforms to our usual ideas and methods in the development of Unity3d games. Through this file, we found the Assetbundles/config/movieconfig.unity3d file, a file that is responsible for maintaining the in-game scene transitions. Here we try to parse this file, but the game maker to the Config folder content is encrypted, because in this folder is two assetbundle files, bloggers try to use extract and bundle-extract two commands to parse, But it's just text files that don't help us to continue our research. Well, now we can parse only the Xinjian_data/sharedassets0.assets file:

disunity extract C:\Users\Robin\Desktop\sharedassets0.assets

This solution out of the words is not a use of stickers files, it seems that if you want to extract music or pictures, but also need to carry out more in-depth study.

Analysis of the assets file of the rain blood prequel. Mirage House

Because the resolution of the "new Paladin ol" assets file did not get anything useful, so we will try to analyze the "rain Blood prequel. Mirage" of the assets file. This game is a blogger's favorite game, based on the Unity3dy engine, and this game is unity3d as an official example to promote, so the study of this game for us to improve the Unity3d resource packaging mechanism will be more helpful. OK, let's get started:

disunity extract C:\Users\Robin\Desktop\resources.assets

Haha, this game did not let us down, we got what?

Summarize
    • The different game uses the resource disposition scheme to be different, but generally can start from resources.assets this file as the breakthrough point.
    • If we can get the data configuration scheme in the game, it will be helpful for us to extract the material in the game, because the directionality will be stronger.
    • It is best to use a configuration table to configure the Assetbundle dynamically loaded into the scene so that we can manage and maintain the entire game project.
    • Without the intervention of the server segment, in theory, as long as the local Assetbundle file can be modified to achieve the game content and data changes, in other words, can do plug-ins and modifiers.
Disclaimer: I'm not teaching you to crack the game, I'm just studying assetbundle packaging!

Unity3d game development Using disunity extract Unity3d game resources

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.