(Created page with "{{TOC|right}} == Preface == The <code>resolver</code> JSON is responsible for assigning a Pokémon <code>species</code> its <code>model</code>, <code>textures</code>, and <code>poser</code>. It is also responsible for assigning <code>aspects</code> to a pokemon to create variants like regional forms. Just about anything related to visuals is linked to the resolver file in some way. The <code>resolver</code> file was previously known as the...")
 
No edit summary
Line 14: Line 14:
* Vulpix: Very common format for resolvers
* Vulpix: Very common format for resolvers
  {
  {
   "species": "cobblemon:vulpix",
   "<abbr title="Here you are saying what Pokémon species will get the following assets">species</abbr>": "<abbr title="In this example, Vulpix will get the following assets.">cobblemon:vulpix</abbr>",
   "order": 0,
   "<abbr title="This is the load order of the forms in this file. Since this file contains the default variants for this Pokémon, load order should be 0. Addons may create more forms later, and they will use a higher number. This is what '0_' and '_base' in the file name represent. '0_' represents the load order, and '_base' represents that these are the default forms.">order</abbr>": <abbr title="Because this file is for the base form of Vulpix, we want this value to be 0.">0</abbr>,
   "variations": [
   "<abbr title="Here you will list all of your Pokémon's visual variations. This is how the shiny version uses the same model but with a different texture.">variations</abbr>": [
     {
     {
       "aspects": [],
       "<abbr title="'Aspects' are traits a Pokémon has. In this section, we are determining what the Pokémon will look like if it has no aspects. This can be considered the 'default' assets. If another aspect does not specify a poser, model, or texture, then it will use these default assets.">aspects</abbr>": <abbr title="These brackets are left blank since we are defining the default assets.">[]</abbr>,
       "poser": "cobblemon:vulpix",
       "<abbr title="Here you are telling the Pokémon what poser file to use.">poser</abbr>": "<abbr title="In this example, vulpix's model will use the vulpix poser file to assign animations.">cobblemon:vulpix</abbr>",
       "model": "cobblemon:vulpix.geo",
       "<abbr title="Here you are telling the Pokémon what model file to use.">model</abbr>": "<abbr title="In this example, vulpix will use the vulpix model.">cobblemon:vulpix.geo</abbr>",
       "texture": "cobblemon:textures/pokemon/0037_vulpix/vulpix.png",
       "<abbr title="Here you are telling the Pokémon what texture PNG to use.">texture</abbr>": "<abbr title="This points towards the vulpix textures. If your model shows up in game with purple and black textures, then it could not find the PNG that you specified in this line.">cobblemon:textures/pokemon/0037_vulpix/vulpix.png</abbr>",
       "layers": []
       "<abbr title="This can be used to add additional textures on top of the main texture like with emissive textures or Arbok's chest patterns.">layers</abbr>": <abbr title="Since we have no texture layers to add, these brackets are left empty.">[]</abbr>
     },
     },
     {
     {
       "aspects": [
       "<abbr title="In this section, we are determining what the Pokémon will look like if it is 'shiny'.">aspects</abbr>": [
         "shiny"
         "<abbr title="Here you are specifying that any shiny Vulpix will use the following texture. If you don't list a model or poser like this example, then it will use the 'default' ones that you created above.">shiny</abbr>"
       ],
       ],
       "texture": "cobblemon:textures/pokemon/0037_vulpix/vulpix_shiny.png"
       "<abbr title="Here you are telling the shiny Pokémon what texture PNG to use. The texture will be applied to the default model in this example.">texture</abbr>": "<abbr title="In this example, it will use 'vulpix_shiny.png' from the '0037_vulpix' folder.">cobblemon:textures/pokemon/0037_vulpix/vulpix_shiny.png</abbr>"
     }
     }
   ]
   ]
Line 37: Line 37:
** The Alolan <code>aspect</code> comes from the alolan [[Species_Features|species feature]].
** The Alolan <code>aspect</code> comes from the alolan [[Species_Features|species feature]].
  {
  {
   "species": "cobblemon:vulpix",
   "<abbr title="Here you are saying what Pokémon species will get the following assets. We are targeting vulpix again to assign its alolan form new assets.">species</abbr>": "<abbr title="In this example, Vulpix will get the following assets assigned to its alolan form.">cobblemon:vulpix</abbr>",
   "order": 1,
   "<abbr title="This is the load order of the forms in this file. Since this file contains the alolan variants for Vulpix, load order should be 1. We want the alolan assets to be loaded after the default assets. This is what '1_' and '_alolan' in the file name represent. '1_' represents the load order, and '_alolan' represents that these are the alolan forms assets.">order</abbr>": <abbr title="Because this file is for the alolan form of Vulpix, we want this value to be 1.">1</abbr>,
   "variations": [
   "<abbr title="Here you will list all of your Pokémon's visual variations.">variations</abbr>": [
     {
     {
       "aspects": [
       "<abbr title="In this section, we are determining what Vulpix will look like if it is 'alolan'.">aspects</abbr>": [
         "alolan"
         "<abbr title="Here you are specifying that normal alolan Vulpix will use the following model and texture. If you don't list a poser like this example, then it will use the 'default' one from the 'base' resolver file.">alolan</abbr>"
       ],
       ],
       "model": "cobblemon:vulpix_alolan.geo",
       "<abbr title="Here you are telling alolan Vulpix what model file to use.">model</abbr>": "<abbr title="In this example, alolan vulpix will use the alolan vulpix model.">cobblemon:vulpix_alolan.geo</abbr>",
       "texture": "cobblemon:textures/pokemon/0037_vulpix/vulpix_alolan.png"
       "<abbr title="Here you are telling the alolan vulpix what texture PNG to use. The texture will be applied to the alolan model in this example.">texture</abbr>": "<abbr title="In this example, it will use 'vulpix_alolan.png' from the '0037_vulpix' folder.">cobblemon:textures/pokemon/0037_vulpix/vulpix_alolan.png</abbr>"
     },
     },
     {
     {
       "aspects": [
       "<abbr title="In this section, we are determining what Vulpix will look like if it is 'alolan' and 'shiny'!">aspects</abbr>": [
         "alolan",
         "<abbr title="Here you are specifying that shiny alolan Vulpix will use the following texture. The alolan aspect must be written before the shiny aspect. If you don't list a model like this example, then it will use the 'default' one from the 'alolan' variation that is written above.">alolan</abbr>",
         "shiny"
         "<abbr title="The shiny aspect must always be listed last. This is just the way it works.">shiny</abbr>"
       ],
       ],
       "texture": "cobblemon:textures/pokemon/0037_vulpix/vulpix_alolan_shiny.png"
       "<abbr title="Here you are telling the shiny alolan vulpix what texture PNG to use. The texture will be applied to the default alolan model in this example.">texture</abbr>": "<abbr title="In this example, it will use 'vulpix_alolan_shiny.png' from the '0037_vulpix' folder.">cobblemon:textures/pokemon/0037_vulpix/vulpix_alolan_shiny.png</abbr>"
     }
     }
   ]
   ]
Line 59: Line 59:
* Charizard: Charizard uses both animated and emissive textures!
* Charizard: Charizard uses both animated and emissive textures!
  {
  {
   "species": "cobblemon:charizard",
   "<abbr title="Here you are saying what Pokémon species will get the following assets">species</abbr>": "<abbr title="In this example, Charizard will get the following assets.">cobblemon:charizard</abbr>",
   "order": 0,
   "<abbr title="This is the load order of the forms in this file. Since this file contains the default variants for this Pokémon, load order should be 0. Addons may create more forms later, and they will use a higher number. This is what '0_' and '_base' in the file name represent. '0_' represents the load order, and '_base' represents that these are the default forms.">order</abbr>": <abbr title="Because this file is for the base form of Charizard, we want this value to be 0.">0</abbr>,
   "variations": [
   "<abbr title="Here you will list all of your Pokémon's visual variations.">variations</abbr>": [
     {
     {
       "aspects": [],
       "<abbr title="'Aspects' are traits a Pokémon has. In this section, we are determining what the Pokémon will look like if it has no aspects. This can be considered the 'default' assets. If another aspect does not specify a poser, model, or texture, then it will use these default assets.">aspects</abbr>": <abbr title="These brackets are left blank since we are defining the default assets.">[]</abbr>,
       "poser": "cobblemon:charizard",
       "<abbr title="Here you are telling the Pokémon what poser file to use.">poser</abbr>": "<abbr title="In this example, charizard's model will use the charizard poser file to assign animations.">cobblemon:charizard</abbr>",
       "model": "cobblemon:charizard.geo",
       "<abbr title="Here you are telling the Pokémon what model file to use.">model</abbr>": "<abbr title="In this example, charizard will use the charizard model.">cobblemon:charizard.geo</abbr>",
       "texture": "cobblemon:textures/pokemon/0006_charizard/charizard.png",
       "<abbr title="Here you are telling the Pokémon what texture PNG to use.">texture</abbr>": "<abbr title="This points towards the Charizard textures. It will use the 'charizard.png' in the '0006_charizard' folder.">cobblemon:textures/pokemon/0006_charizard/charizard.png</abbr>",
       "layers": [
       "<abbr title="This section will let charizard apply layers of textures over the main texture listed above. You can use this layer system to make animated, emissive, and/or translucent textures!">layers</abbr>": [
         {
         {
           "name": "flame",
           "<abbr title="Here we will create the name of this layer">name</abbr>": "<abbr title="This layer will be called 'flame'. It will be used to create charizard's animated tail flame.">flame</abbr>",
           "texture": {
           "<abbr title="Here you will list the texture(s) to use in this layer. In this example, we are going to list multiple textures as frames for charizard's animated tail texture.">texture</abbr>": {
             "frames": [
             "<abbr title="When you want to create an animated texture layer, you must list all the png files as frames. This is considered frame by frame animation and the frames will play in the order listed below.">frames</abbr>": [
               "cobblemon:textures/pokemon/0006_charizard/flame/tail1.png",
               "<abbr title="This is the first frame of the animation and its folder location. ">cobblemon:textures/pokemon/0006_charizard/flame/tail1.png</abbr>",
               "cobblemon:textures/pokemon/0006_charizard/flame/tail2.png",
               "<abbr title="This is the second frame of the animation and its folder location. ">cobblemon:textures/pokemon/0006_charizard/flame/tail2.png</abbr>",
               "cobblemon:textures/pokemon/0006_charizard/flame/tail3.png",
               "<abbr title="This is the third frame of the animation and its folder location. ">cobblemon:textures/pokemon/0006_charizard/flame/tail3.png</abbr>",
               "cobblemon:textures/pokemon/0006_charizard/flame/tail4.png"
               "<abbr title="This is the fourth frame of the animation and its folder location. ">cobblemon:textures/pokemon/0006_charizard/flame/tail4.png</abbr>"
             ],
             ],
             "fps": 10,
             "<abbr title="Here you will set the frames per second of this animation. You can change this value until the animation looks good to you.">fps</abbr>": <abbr title="In this example, the animation will play at 10 frames per second. Since there are only 4 frames, the animation will play 2.5 times per second.">10</abbr>,
             "loop": true
             "<abbr title="Controls whether or not the texture animation will loop">loop</abbr>": <abbr title="This animation will loop. You probably want to set this to true always!">true</abbr>
           },
           },
           "emissive": true
           "<abbr title="Controls whether or not the texture is emissive. Meaning whether or not this texture will glow when its dark.">emissive</abbr>": <abbr title="Since this is an animated flame, it will be set to true so the flame will always appear bright. Just like real fire!">true</abbr>
         },
         },
         {
         {
           "name": "glow",
           "<abbr title="Here we will create the name of this second layer">name</abbr>": "<abbr title="This layer will be called 'glow'. It will be used to create the illusion of light from charizard's flame on its tail.">glow</abbr>",
           "texture": "cobblemon:textures/pokemon/0006_charizard/charizard_emissive.png",
           "<abbr title="Here you will list the texture to use in this layer. In this example, we are going to list a single texture which will add some light around charizard's tail flame">texture</abbr>": "<abbr title="Here we are pointing to charizard's emissive PNG.">cobblemon:textures/pokemon/0006_charizard/charizard_emissive.png</abbr>",
           "emissive": true,
           "<abbr title="Controls whether or not the texture is emissive. Meaning whether or not this texture will glow when its dark.">emissive</abbr>": <abbr title="Since this texture is meant to create the illusion of light, it is set to true.">true</abbr>,
           "translucent": true
           "<abbr title="Controls whether or not the texture is translucent. Meaning you can see through this layer if the texture is not at 100% opacity. The texture listed above is not at full opacity. The opacity gets lower the further away it gets from the flame, creating the illusion of bright lights on the tail.">translucent</abbr>": <abbr title="Since this texture was designed to be translucent, it will be set to true.">true</abbr>
         }
         }
       ]
       ]
     },
     },
     {
     {
       "aspects": [
       "<abbr title="In this section, we are determining what the Pokémon will look like if it is 'shiny'.">aspects</abbr>": [
         "shiny"
         "<abbr title="Here you are specifying that any shiny Charizard will use the following texture. If you don't list a model or poser like this example, then it will use the 'default' ones that you created above.">shiny</abbr>"
       ],
       ],
       "texture": "cobblemon:textures/pokemon/0006_charizard/charizard_shiny.png",
       "<abbr title="Here you are telling the Pokémon what texture PNG to use.">texture</abbr>": "<abbr title="This points towards the Charizard shiny textures. It will use the 'charizard_shiny.png' in the '0006_charizard' folder.">cobblemon:textures/pokemon/0006_charizard/charizard_shiny.png</abbr>",
       "layers": [
       "<abbr title="This section will let Charizard apply layers of textures over the main shiny texture listed above. You need to change the 'glow' layer because the colors wont match if you use the normal textures.">layers</abbr>": [
         {
         {
           "name": "glow",
           "<abbr title="Here we will create the name of this shiny layer">name</abbr>": "<abbr title="This layer will be called 'glow'. It will be used to replace default glow for this shiny variant.">glow</abbr>",
           "texture": "cobblemon:textures/pokemon/0006_charizard/charizard_shiny_emissive.png",
           "<abbr title="Here you will list the texture to use in this layer. In this example, we are going to use a shiny version of an emissive texture.">texture</abbr>": "<abbr title="Here we are pointing to charizard's shiny emissive PNG.">cobblemon:textures/pokemon/0006_charizard/charizard_shiny_emissive.png</abbr>",
           "emissive": true,
           "<abbr title="Controls whether or not the texture is emissive. Meaning whether or not this texture will glow when its dark.">emissive</abbr>": <abbr title="Since this texture is meant to create the illusion of light, it is set to true.">true</abbr>,
           "translucent": true
           "<abbr title="Controls whether or not the texture is translucent. Meaning you can see through this layer if the texture is not at 100% opacity. The texture listed above is not at full opacity. The opacity gets lower the further away it gets from the flame, creating the illusion of bright lights on the tail except its shiny this time.">translucent</abbr>": <abbr title="Since this texture was designed to be translucent for the shiny, it will be set to true.">true</abbr>
         }
         }
       ]
       ]

Revision as of 11:02, 12 October 2023

Preface

The resolver JSON is responsible for assigning a Pokémon species its model, textures, and poser. It is also responsible for assigning aspects to a pokemon to create variants like regional forms. Just about anything related to visuals is linked to the resolver file in some way.

The resolver file was previously known as the asset species file or similar. This was changed to prevent confusion between this file and the species files in the data folder. Because of this, many addons created before Cobblemon version 1.4 are using the species folder to hold resolver files.

Resolver File Breakdown

The resolver controls just about everything regarding a Pokémon's assets. Besides the model, animations, and form assets, it is also where you apply the data for animated and emissive textures!

While you can keep all of a Pokémon's resolver data inside of one file, separating resolver data for different forms or variants can help keep things organized. It will also prevent potential conflicts if another addon creator wants to modify something you have made.

Here is a breakdown of three different types of resolver file.

  • Vulpix: Very common format for resolvers
{
 "species": "cobblemon:vulpix",
 "order": 0,
 "variations": [
   {
     "aspects": [],
     "poser": "cobblemon:vulpix",
     "model": "cobblemon:vulpix.geo",
     "texture": "cobblemon:textures/pokemon/0037_vulpix/vulpix.png",
     "layers": []
   },
   {
     "aspects": [
       "shiny"
     ],
     "texture": "cobblemon:textures/pokemon/0037_vulpix/vulpix_shiny.png"
   }
 ]
}


  • Alolan Vulpix: A second resolver for vulpix to assign its regional form assets
    • Due to its naming scheme, the alolan vulpix resolver loads after the previous vulpix resolver.
    • The Alolan aspect comes from the alolan species feature.
{
 "species": "cobblemon:vulpix",
 "order": 1,
 "variations": [
   {
     "aspects": [
       "alolan"
     ],
     "model": "cobblemon:vulpix_alolan.geo",
     "texture": "cobblemon:textures/pokemon/0037_vulpix/vulpix_alolan.png"
   },
   {
     "aspects": [
       "alolan",
       "shiny"
     ],
     "texture": "cobblemon:textures/pokemon/0037_vulpix/vulpix_alolan_shiny.png"
   }
 ]
}


  • Charizard: Charizard uses both animated and emissive textures!
{
 "species": "cobblemon:charizard",
 "order": 0,
 "variations": [
   {
     "aspects": [],
     "poser": "cobblemon:charizard",
     "model": "cobblemon:charizard.geo",
     "texture": "cobblemon:textures/pokemon/0006_charizard/charizard.png",
     "layers": [
       {
         "name": "flame",
         "texture": {
           "frames": [
             "cobblemon:textures/pokemon/0006_charizard/flame/tail1.png",
             "cobblemon:textures/pokemon/0006_charizard/flame/tail2.png",
             "cobblemon:textures/pokemon/0006_charizard/flame/tail3.png",
             "cobblemon:textures/pokemon/0006_charizard/flame/tail4.png"
           ],
           "fps": 10,
           "loop": true
         },
         "emissive": true
       },
       {
         "name": "glow",
         "texture": "cobblemon:textures/pokemon/0006_charizard/charizard_emissive.png",
         "emissive": true,
         "translucent": true
       }
     ]
   },
   {
     "aspects": [
       "shiny"
     ],
     "texture": "cobblemon:textures/pokemon/0006_charizard/charizard_shiny.png",
     "layers": [
       {
         "name": "glow",
         "texture": "cobblemon:textures/pokemon/0006_charizard/charizard_shiny_emissive.png",
         "emissive": true,
         "translucent": true
       }
     ]
   }
 ]
}


Resolver File Examples

When creating your own resolvers, it would be easiest to use resolvers similar to what you need as a template.

Here are some examples from the Gitlab you can reference. You may also want to reference the models of each example in game so you can see the effects that their resolver file create.