Resolver: Difference between revisions
(navbox) |
(Resolved some missing property information) |
||
Line 106: | Line 106: | ||
] | ] | ||
} | } | ||
</br> | |||
=== Special Layer Properties And When To Use Them === | |||
Cobblemon's layer system can be used for applying special effects to models through textures. You can use it to apply specially made textures that get layered over the model's main texture while assigning the layer certain properties. Only layers can have these special properties, so keep that in mind when creating textures. | |||
==== Emissive ==== | |||
The <code>emissive</code> property allows the assigned texture to become emissive. [[Tutorials/Emissive_Textures|Emissive textures]] are unaffected by light levels and give off the illusion of glowing in the dark. These textures are enhanced when combined with shaders and the species property for dynamic lighting. | |||
</br>Some basic examples of emissives are: | |||
* Glowing eyes like on Hoothoot or Patrat | |||
* Light emitting body parts like on the Mareep line or Volbeat | |||
* Flames of the many different fire types | |||
</br>The emissive property can also be combined with the other two properties for enhanced lighting effects. The most common example of emissives are the flames on fire type Pokémon. These layers are often combining the emissive property with the properties associated with [[Tutorials/Animated_Textures|animated textures]]. This property combination is not limited to making fire, so try and get creative. | |||
</br>Below is an example of Charizard's "glow" texture layer with the emissive property applied. | |||
{ | |||
"name": "glow", | |||
"texture": "cobblemon:textures/pokemon/0006_charizard/charizard_shiny_emissive.png", | |||
"emissive": true, | |||
"translucent": true | |||
} | |||
<br> | |||
==== Translucent ==== | |||
The <code>translucent</code> property allows the assigned texture to become translucent based on the opacity value of each pixel. The closer this value is to 0, the more translucent it becomes. This property is mainly used to enhance the emissive layer by adding translucent pixels expanding away from the emissive layer's pixels. This creates the effect of light getting dimmer the further you get from a Pokemon's light source. | |||
Translucency has visual bugs when combined with water in game. This has led to it rarely being used to create translucent body parts. While there are some creative solutions to get around these visual bugs, it is simpler to use inverted cubes instead. | |||
Due to the previously mentioned visual bug, there aren't many examples of translucent layers. Some of the few examples of translucency are: | |||
* Secondary emissive textures like those found on Charizard or Umbreon. | |||
</br>Below is an example of Charizard's "glow" texture layer with the translucent property applied. | |||
{ | |||
"name": "glow", | |||
"texture": "cobblemon:textures/pokemon/0006_charizard/charizard_shiny_emissive.png", | |||
"emissive": true, | |||
"translucent": true | |||
} | |||
<br> | |||
==== Frames, FPS, and Loop ==== | |||
The <code>frames</code>, <code>fps</code>, and <code>loop</code> properties are required in order to create [[Tutorials/Animated_Textures|animated textures]]. Cobblemon's animated textures use frame-by-frame animation, so you will want to use all three of these together. | |||
* <code>frames</code> is where you will list each frame of the animation. You need to create an array of textures to use. | |||
* <code>fps</code> is where you will assign how many frames will player per second. Requires a number value. | |||
* <code>loop</code> is where you will define if the animation will loop or not. Boolean. There's probably no reason you'd want this set to false. | |||
</br>These three properties can be combined with both <code>emissive</code> and <code>translucent</code> to create animated light effects on Pokémon. The most common example of animated textures are the flames on fire Pokémon. Currently, the only other example of animated textures are Elgyem's and Beheeyem's color changing fingers. | |||
Below is an example of Charizard's animated flame texture layer. You can hover over the underlined text to see more details. | |||
{ | |||
"<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>", | |||
"<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>": { | |||
"<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>": [ | |||
"<abbr title="This is the first frame of the animation and its folder location. ">cobblemon:textures/pokemon/0006_charizard/flame/tail1.png</abbr>", | |||
"<abbr title="This is the second frame of the animation and its folder location. ">cobblemon:textures/pokemon/0006_charizard/flame/tail2.png</abbr>", | |||
"<abbr title="This is the third frame of the animation and its folder location. ">cobblemon:textures/pokemon/0006_charizard/flame/tail3.png</abbr>", | |||
"<abbr title="This is the fourth frame of the animation and its folder location. ">cobblemon:textures/pokemon/0006_charizard/flame/tail4.png</abbr>" | |||
], | |||
"<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>, | |||
"<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> | |||
}, | |||
"<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> | |||
} | |||
</br> | </br> | ||
=== Resolver File Examples === | === Resolver File Examples === |
Latest revision as of 12:57, 3 March 2024
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 } ] } ] }
Special Layer Properties And When To Use Them
Cobblemon's layer system can be used for applying special effects to models through textures. You can use it to apply specially made textures that get layered over the model's main texture while assigning the layer certain properties. Only layers can have these special properties, so keep that in mind when creating textures.
Emissive
The emissive
property allows the assigned texture to become emissive. Emissive textures are unaffected by light levels and give off the illusion of glowing in the dark. These textures are enhanced when combined with shaders and the species property for dynamic lighting.
Some basic examples of emissives are:
- Glowing eyes like on Hoothoot or Patrat
- Light emitting body parts like on the Mareep line or Volbeat
- Flames of the many different fire types
The emissive property can also be combined with the other two properties for enhanced lighting effects. The most common example of emissives are the flames on fire type Pokémon. These layers are often combining the emissive property with the properties associated with animated textures. This property combination is not limited to making fire, so try and get creative.
Below is an example of Charizard's "glow" texture layer with the emissive property applied.
{ "name": "glow", "texture": "cobblemon:textures/pokemon/0006_charizard/charizard_shiny_emissive.png", "emissive": true, "translucent": true }
Translucent
The translucent
property allows the assigned texture to become translucent based on the opacity value of each pixel. The closer this value is to 0, the more translucent it becomes. This property is mainly used to enhance the emissive layer by adding translucent pixels expanding away from the emissive layer's pixels. This creates the effect of light getting dimmer the further you get from a Pokemon's light source.
Translucency has visual bugs when combined with water in game. This has led to it rarely being used to create translucent body parts. While there are some creative solutions to get around these visual bugs, it is simpler to use inverted cubes instead.
Due to the previously mentioned visual bug, there aren't many examples of translucent layers. Some of the few examples of translucency are:
- Secondary emissive textures like those found on Charizard or Umbreon.
Below is an example of Charizard's "glow" texture layer with the translucent property applied.
{ "name": "glow", "texture": "cobblemon:textures/pokemon/0006_charizard/charizard_shiny_emissive.png", "emissive": true, "translucent": true }
Frames, FPS, and Loop
The frames
, fps
, and loop
properties are required in order to create animated textures. Cobblemon's animated textures use frame-by-frame animation, so you will want to use all three of these together.
frames
is where you will list each frame of the animation. You need to create an array of textures to use.fps
is where you will assign how many frames will player per second. Requires a number value.loop
is where you will define if the animation will loop or not. Boolean. There's probably no reason you'd want this set to false.
These three properties can be combined with both emissive
and translucent
to create animated light effects on Pokémon. The most common example of animated textures are the flames on fire Pokémon. Currently, the only other example of animated textures are Elgyem's and Beheeyem's color changing fingers.
Below is an example of Charizard's animated flame texture layer. You can hover over the underlined text to see more details.
{ "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 }
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.
- No special visual features - Bulbasaur
- Gender differences - Venusaur
- Regional Forms - Vulpix
- Multiple Variants - Torterra
- Complicated variants using the layer system - Spinda
- Animated Textures - Emboar
- Emissive Textures - Umbreon