1. Manurocker95

    OP Manurocker95 Game Developer & Pokémon Master
    Member

    Joined:
    May 29, 2016
    Messages:
    1,399
    Country:
    Spain
    Hello! As I saw so many people complaining about it (even me), I'm here to post a tutorial on how to dump your files from Pokémon Sun and Moon and rip them so you can see them in Unity Engine. i don't really know if this should go here or in 3DS threads but as Unity is the aim of this tutorial, let's place it here and a mod may move it if needed.

    [​IMG]

    Here we go!

    First, we will follow the first three steps from @Rosieplier's tutorial for extracting the needed binary files. Please, go to the original thread for more info: (https://gbatemp.net/threads/wip-ult...okemon-models-textures-and-animations.490365/).

    PREPARATION

    1. Dumping your game (source: https://3ds.hacks.guide/godmode9-usage.html)


    For cartridge dumping:
    a. Launch GodMode9 by holding (Start) during boot
    b. Navigate to [C:] GAMECART
    c. Press (A) on [TitleID].trim.3ds to select it, then select “NCSD image options…”, then select “Build CIA from file”
    d. The .cia file will be outputted to the /gm9/out/ folder on your SD card

    For digital dumping:
    a. Launch GodMode9 by holding (Start) during boot
    b. Hover over [A:] SYSNAND SD
    c. Hold (R) and press (A) at the same time to open the drive options
    d. Select “Search for titles”
    e. Press (A) to continue
    f. Press (A) on the .tmd file to select it, then select “TMD file options…”, then select “Build CIA (standard)”
    g. The .cia file will be outputted to the /gm9/out/folder on your SD card

    2. Extracting your game

    a. I recommend HackingToolKit3DS for this. The thread on this software has its own guide, so I suggest following it here. Once you are done, move the extracted files to a separate folder.

    3. Getting the files

    a. Turn off your 3DS and insert your SD card into your computer.
    b. Download pk3DS if you haven't already
    c. This is optional, but if you want to do more than just texture edits, go to "File/Open.." and select the folder your extracted game is in. This allows you to edit encounters, trainers, game text and a lot more!
    d. Open "Tools/Misc Tools/(un)Pack+BCLIM. Open a separate window of your extracted game folder, then go into "ExtractedRomFS\a\0\9. Drag "4" to the first box in pk3DS. You need to hold CTRL while doing this!
    e. A new folder will be created called "4_g". Inside are all the,bin files listed below, with 5 digit numbers as their name.

    4. Ohana3DS

    a. Get Ohana from the original thread or from github. If you go to the tutorial I mentioned, there's a link for it.
    b. Unzip it anywhere you want.

    5. Unity Engine 3D Setup

    a. Download Unity Engine from the official website.
    b. Install it.
    c. Open Unity and create a new project.

    6. Blender

    a. Download Blender from the official website.
    b. Install it.
    c. Download .smd plugin for Blender on Valve's website. https://developer.valvesoftware.com/wiki/Blender_Source_Tools
    d. Open Blender and follow this steps:
    1. Select File > User Preferences
    2. Move to the Addons tab
    3. Click Install From File... in the bottom of the window
    4. Find the downloaded zip file and select it (Double click)
    5. Under 'Categories' on the left, click 'Import-Export'
    6. Find 'Blender Source Tools' in the list and check the box to the right. Wait a moment for activation to complete.
    7. Click Save User Settings and close the window.
    7. Photoshop

    a. Get photoshop. It's not free, so do it as you wish.
    b. Install it.

    EXPORT THE POKEMON

    1. Export models and animations

    a. Open Ohana3DS.
    b. Select File > Open and look for the Pokemon you'd like to export. Yes, you need to do it one by one.
    c. Select the File 0. This is the model. It won't have textures nor animations.
    d. Select (+) on Textures and click on Import. Select file 1 for normal textures or 2 for shiny textures.
    e. Select (+) on Skeletal animations and import files 5, 6, 7. A play mode will allow you to play animations such as this:

    [​IMG]

    f. Click on Models > Export
    g. Set a name for the model, the path where the model will be saved and be sure SMD and Export with all animations are checked.
    h. Click on Ok and the model will be exported in .smd format.

    [​IMG]

    i. Now, select (+) Textures and export them in the same folder (the folder doesn't matter but it's better to have them all in one place).
    j. Export one by one, every animation. You can play the animations and set a proper name for each one.
    k. Open Blender and create a new scene.
    l. Delete the cube, the lamp and the camera as they are not needed.
    m. Click on File > Import > SMD Files > Select the model.smd
    n. You will see the model already rigged in your scene.

    [​IMG]

    ñ. If you export it now, the animations won't fit as it will think you have different rigging. However, this is fixed if you now import in blender all the animations. Scale the model and translate it to your desired transform after importing (as it solves issues that happen when doing so before importing the animations). Pokémon Models are rotated -90º in the X axis, so you will need to rotate it 90º in the X axis to get them properly rotated. Also, TPC made 3DS models in hectometers. If you are making a Pokémon game with real scales, you can downscale it now to 0.01 in the 3 axis.
    o. You will see you can play just one animation but don't worry. Every animation is in your file. Now, export your model as .fbx.

    [​IMG]

    2. Modify the textures

    a. Open Photoshop and open albedo (color) textures with it. We need to duplicate the texture next to the original and mirror it. Game Freak uses shaders that only use half of the textures and mirrors them. (yeah, pokémon are simetric). Do it for every texture.

    From this:

    [​IMG]

    To this:

    [​IMG]

    As this tutorial is meant to be used in Unity, you can either use Texture Mirroring option in texture settings or make a shader that mirrors the half textures.

    The function for mirroring by shader (in case you want to do it instead) in X and Y axis is:

    Code:
    float2 uv = 1.0 - abs(frac(i.uv * 0.5) * 2.0 - 1.0);
    fixed4 col = tex2D(_MainTex, uv);

    As you only need it for U and not V, you can modify the function for working on one axis.

    IMPORTING INTO UNITY

    a. Open the project we created during the preparation proccess.
    b. Drag the .fbx exported from blender and the textures to the resources folder inside assets.
    c. Select the model and change the Avatar definition from No Avatar to Create from this model. Drag the model to your scene.

    [​IMG]

    d. Create a material for each texture and use the texture as albedo. Drag the materials to the model. (you can use the normal maps exported by ohana if you wish.

    [​IMG]

    e. Open the fbx on unity and duplicate (cntrl+D) all the animations inside it.

    [​IMG]

    f. Drag the animations to the controller window and set it to the animator component.
    h. hit play and that's it!

    [​IMG]

    And thanks to @Demothene who is making with me PLGU, you can see what you can do with this (with a little work):



    TROUBLESHOOTING AND TRICKS

    - Not animated parts: @reidarG pointed out that sometimes, some models like Bulbasaur or Blastoise have parts that are broken during some animations and it was due to the scale. Check if they have correct scale in the frames where they appear and disappear, because that might fix the animation.



    - Spica animations are broken but Ohana ones aren't: You can export the high-poly model from Spica, export the animations with ohana and use the animations in the spica model without issues. This fixes Mega-Metagross animations that are not correctly parsed with Spica.

    - How to setup real scale (in meters): It seems the pokémon company exported badly meters in hectometers, so the real size is 0.01 per axis. Pokémon Lets Go and SwSh use same models as 3DS. However, the scale in PLGPE is 0.025 (supposed to be inches).

    - Some animations are deformed on export: (By ReidarG): Charmeleon's right shoulder MAY BE deformed in animation. To fix this, subtract weight paint on the right shoulder. Butterfree and Beedrill wings are broken upon import into engine. Not sure of a fix.

    DEV COMMUNITY

    I created a Discord where some of the best Unity and Unreal pokémon fanmade devs discuss and help each other. Wanna join? https://discord.gg/pYBWwAa

    OTHER USEFUL LINKS

    If you want to get Let's Go Models and animate them with Mixamo, check my tutorial: https://gbatemp.net/threads/tutoria...ainer-models-and-rig-them-with-mixamo.547159/

    Do you want Gen 8 models and animations? No problem! : https://gbatemp.net/threads/tutoria...o-switch-to-unity-engine.564842/#post-9050880

    Need help with shaders?? https://gbatemp.net/threads/tutorials-discussion-how-to-make-pokemon-shaders.547875/
     

    Attached Files:

    Last edited by Manurocker95, Aug 2, 2020
    CodenameD, reidarG, Albond and 7 others like this.
  2. Manurocker95

    OP Manurocker95 Game Developer & Pokémon Master
    Member

    Joined:
    May 29, 2016
    Messages:
    1,399
    Country:
    Spain

    Attached Files:

    Last edited by Manurocker95, Mar 5, 2019
  3. Mythical

    Mythical GBAtemp Advanced Maniac
    Member

    Joined:
    May 11, 2017
    Messages:
    1,949
    Country:
    United States
    I know someone who coded the battle system for Pokemon in unity but couldn't get textures for it. good shit definitely gonna run it by em
     
  4. Manurocker95

    OP Manurocker95 Game Developer & Pokémon Master
    Member

    Joined:
    May 29, 2016
    Messages:
    1,399
    Country:
    Spain
    After ending pokemon snap, I will release an open source demo with the battle system. Can you link me their work? :3
     
  5. Vhestal

    Vhestal Advanced Member
    Member

    Joined:
    Feb 16, 2019
    Messages:
    74
    Country:
    Philippines
    Welp, off to VR chat we go...
     
    PanTheFaun, Searinox and Essometer like this.
  6. Mythical

    Mythical GBAtemp Advanced Maniac
    Member

    Joined:
    May 11, 2017
    Messages:
    1,949
    Country:
    United States
    It was an old coqorker of mine. I'll try to see if they have a github equivalent next time I see them :)
     
  7. Manurocker95

    OP Manurocker95 Game Developer & Pokémon Master
    Member

    Joined:
    May 29, 2016
    Messages:
    1,399
    Country:
    Spain
    It’s a nice way to have fun hahahaah
     
  8. Vhestal

    Vhestal Advanced Member
    Member

    Joined:
    Feb 16, 2019
    Messages:
    74
    Country:
    Philippines
    Yea, walking through the park with Quagsire as your avatar feels liberating lol
     
  9. Twippet

    Twippet Newbie
    Newcomer

    Joined:
    Nov 18, 2018
    Messages:
    2
    Country:
    United States
    Does anyone know how to get the eyes and iris textures to work properly?

    upload_2019-3-7_16-9-31.png
     
  10. Manurocker95

    OP Manurocker95 Game Developer & Pokémon Master
    Member

    Joined:
    May 29, 2016
    Messages:
    1,399
    Country:
    Spain
    If you see the meshrenderer component, some models use 3 textures. You need to create a shader that uses the white rgb as transparent color, so the eye is visible... or add it by yourself with Photohop

    — Posts automatically merged - Please don't double post! —

    Transparent if it has something behind. I just added the iris directly for Pokemon Snap Unity
     
  11. Demothene

    Demothene Member
    Newcomer

    Joined:
    Mar 14, 2019
    Messages:
    45
    Country:
    France
    Hello ! Do you know how to fix the flamme effect on charmander etc ... ?
    (Just registered so i can't post any link -_-)
     
    Last edited by Demothene, Mar 14, 2019
  12. Manurocker95

    OP Manurocker95 Game Developer & Pokémon Master
    Member

    Joined:
    May 29, 2016
    Messages:
    1,399
    Country:
    Spain
    Do you mean this? upload_2019-3-14_13-18-45.png

    — Posts automatically merged - Please don't double post! —

    it is better rendered in SPICA.

    upload_2019-3-14_13-20-37.png

    — Posts automatically merged - Please don't double post! —


    As you can see it is part of the model so you would need to delete that part of the model mesh in blender so you can add fire particles.
     
  13. Demothene

    Demothene Member
    Newcomer

    Joined:
    Mar 14, 2019
    Messages:
    45
    Country:
    France
    Yeah, i Use Spica to extract models/animations/textures, then i import in Unity without using blender coz it can mess up bones/UVs/animations especially with ohana.

    In my case, i want to fix the flamme as it is, a stylized toony fire. Can you achieve the same result with fire particles ?

    I did some progress using shaders and shader graph, but i need to blend the 2 shaders on the core.
    (how many posts do i need to link screenshots ? :P)
     
    Last edited by Demothene, Mar 14, 2019
  14. Demothene

    Demothene Member
    Newcomer

    Joined:
    Mar 14, 2019
    Messages:
    45
    Country:
    France
    I finally can link screenshots !

    As you can see the yellow shell need to appear on the red core... that's what i'm missing.
    If you have any idea ;)

    (Click to play the gif)
    [​IMG]
     
    Last edited by Demothene, Mar 14, 2019
  15. Manurocker95

    OP Manurocker95 Game Developer & Pokémon Master
    Member

    Joined:
    May 29, 2016
    Messages:
    1,399
    Country:
    Spain
    It seems to be a visibility issue. If you export pidgey, it has 4 wings instead of 2 and shows some of them based on the visibility animations, however I didn't manage to export them correctly. I guess this works in the same way.

    Btw, Wow, did you replicate the water shader? It looks awesome.
     
    Last edited by Manurocker95, Mar 14, 2019
  16. Demothene

    Demothene Member
    Newcomer

    Joined:
    Mar 14, 2019
    Messages:
    45
    Country:
    France
    Atm The water shader isnt as detailed as lets go, i'll try to improve it later on when everything else is fixed

    I just tried with pidgey and as you said it has 4 wings... Seems to be easier to fix than other visibility animations (can't wait to fix gastly -_-). But, it would be awesome to know if some ppl found a way to get it working out of Spica/ohana.

    Well, i'll come back later if i find something interresting.
     
  17. Manurocker95

    OP Manurocker95 Game Developer & Pokémon Master
    Member

    Joined:
    May 29, 2016
    Messages:
    1,399
    Country:
    Spain
    Sure, me too. I’ll try to modify the animation itself in Unity’s animator but I’d like to have gastly and charmander working properly for my Pokémon Snap too
     
  18. Manurocker95

    OP Manurocker95 Game Developer & Pokémon Master
    Member

    Joined:
    May 29, 2016
    Messages:
    1,399
    Country:
    Spain
    @Demothene did you get gastly or brids working?
     
  19. Manurocker95

    OP Manurocker95 Game Developer & Pokémon Master
    Member

    Joined:
    May 29, 2016
    Messages:
    1,399
    Country:
    Spain
    Okay, I have gastly but I ripped it from Let's Go instead of SuMo. Seems to be the same model.

    upload_2019-3-20_17-44-10.png
     
    Last edited by Manurocker95, Mar 20, 2019
  20. Manurocker95

    OP Manurocker95 Game Developer & Pokémon Master
    Member

    Joined:
    May 29, 2016
    Messages:
    1,399
    Country:
    Spain
    upload_2019-3-20_18-6-47.png

    SUMO gastly works in the same way.
     
Draft saved Draft deleted
Loading...

Hide similar threads Similar threads with keywords - [TUTORIAL], Pokémon, animated