Tutorials/Multiple Visual Variants

Revision as of 11:42, 14 October 2023 by Blob (talk | contribs) (added back Category:Tutorial)

Preface

This tutorial will teach you how to create Pokémon that have multiple visual aspects. An example of these would be the Arbok skin patterns, the Pumpkaboo sizes, or the many different variants of Alcremie and Spinda. Due to the variable nature of this system, this guide will only show you how to create and apply extra aspects to a Pokémon. Knowledge of creating custom Pokémon and regional forms is highly recommended.

Step 1: Decide how your variants will function

There are a number of factors that can go into Pokémon variants. You can have it be a purely visual thing like Arbok or you can assign stats to each variant with form data like Pumpkaboo or Basculin. You can also take things a step further and create multiple species features for a Pokémon with unique textures that are applied as multiple layers on the model. This is the case for Alcremie and Spinda. They have a small set of texture PNGs that are then mixed and matched in the resolver file to allow for dozens of variants as a result. You can even create unique models and animations for each variant if desired.

Decide how your variant will function first so you know what choices to pick later in this guide. If you'd like some examples, you can reference the species and resolver files of the following Pokémon. Also be sure to check out the <species_features> folder of the mod to see how their feature files look and function. Here are some great examples of the variant system at its best:

  • Grotle & Torterra: Grotle uses the evolution process to evolve into different variants of Torterra using saplings. Certain saplings will allow it to evolve into a matching Torterra! Each evolution method results in the different Torterra models and textures!
  • Milcery & Alcremie: Milcery also uses the evolution process to apply different aspects in the resulting Alcremie. The difference is that one aspect depends on the Sweet that is held, and the second aspect depends on the time of day that it was evolved. The evolution data that makes this possible for Milcery includes over 1600 lines of data...
  • Spinda: Spinda has 5 features, each with their own random pool of choices, that are assigned to it. These features apply some spot textures from a pool of 37 unique textures. This becomes 74 if you include the shiny textures. There are over 47,000 unique forms of Spinda as a result.
  • Arbok: Arbok has a pool of randomly chosen aspects that affect the pattern on it's snake hood. Although the aspect is chosen at random, each pattern is assigned unique spawn data. You can reference this and create different spawn locations for each variant you make!
  • Pumpkaboo & Gourgeist: Pumpkaboo uses form data to apply the different HP stat changes to each of its sizes. Each size form can then be applied with one of the aspect choices so they can have unique models and textures.

Step 2: Arrange the folders for this addon

Due to some files sharing the same names later in this guide, you will be creating the folder structure and pack.mcmeta now. This is to prevent confusion going forward.

  1. Create a series of folders arranged like the following example:

Folder Structure

  • (addon name)
    • pack.mcmeta
    • assets
      • cobblemon
        • bedrock
          • pokemon
            • animations
              • <target pokemon folder>
            • models
              • <target pokemon folder>
            • posers
            • resolvers
              • <target pokemon folder>
        • textures
          • pokemon
            • <target pokemon folder>
    • data
      • cobblemon
        • spawn_pool_world
        • species_feature_assignments
        • species_features


  1. Create your pack.mcmeta file
    • Remember to write the necessary data into this file.
  2. Place this new file into the first folder of your addon next to assets and data

After this folder tree for your addon is made, you can simply drop the files into the associated folders as you create them. Remember that the pack.mcmeta is a file, not a folder to add. It must be one folder deep in order for Minecraft to recognize this pack as a resource pack or data pack when in the appropriate game folders.

Step 3: Create your assets

It's best that you create all your assets first so you can assign them later. Create any models, textures, or animations that you want in Blockbench. Most visual variants are just a set of extra texture PNGs that are applied to the same model using layers.

  1. Create the assets your Pokémon needs in Blockbench
  2. Save these assets in their associated folders

Remember to create a poser file if you made any new animations. Needing new animation and poser files for variants isn’t a common thing. Unless your variant is vastly different, like Alolan Exeggutor, then you most likely don't need to make new animations.

Step 4: Create a “species feature”

You will be creating as many species features as you need to make your variants work. There are 2 types of species features you can make. The flag type feature has a single choice and is used for things like regionals. The choice type feature has a pool of choices and can be either randomized or have one choice set as the default. For the purpose of this guide, you will be creating a choice type feature with multiple variants.

  1. Create a new text file and name it after your idea. Include the extension of.json
    • Example: Arbok's species feature is named snake_pattern.json
    • Remember to use lowercase and make sure that the file does not end in any other extension like ".txt"
  2. Insert the data for a choice species feature into this new species feature JSON:
    • Remember to change "custom_feature" to match your file name! It must stay in quotes.
    • You can create as many choices as you want and name them whatever you want.
    • The value for "default" can be set to "random" or any one of the choices you list. You usually want it on random.
{
  "type": "choice",
  "keys": ["custom_feature"],
  "default": "random",
  "choices": [
    "choice1",
    "choice2",
    "choice3"
  ],
  "isAspect": true,
  "aspectFormat": "custom-feature-{{choice}}"
}
  1. Save the file
  2. Place this new species feature file into the species_feature folder of your addon

Even though the choice is randomized, a Pokémon will maintain its aspects when evolving if the entire evolutionary line is assigned the feature. A "heart" Ekans will always evolve into a "heart" Arbok by default. Aspect choices can also be assigned in the evolution data to change or control the resulting aspect of the next evolution. This is the case with Grotle and Pumpkaboo evolutions.

Step 5: Create a “species_feature_assignments” file

The species_feature_assignments file is a very short JSON that has a list of one or more Pokémon which will receive one or more features. If you also want your variants to have different stats like Pumpkaboo, then you'll want to make a species_addition file with form data. Step 4 from the regional forms guide.

  1. Create a new text file and name it after your idea. Include the extension of .json
    • Example: spinda_spots.json
  2. Insert the following data into this new species_addition JSON:
    • You can list as many Pokémon or features as you need
{
  "pokemon": ["<target_pokemon_1>", "<target_pokemon_2>"],
  "features": ["<feature_1>", "<feature_2>"]
}
  1. Change "<target_pokemon_#>" to reference the Pokémon you want to add the features to. It must remain in quotes.
    • Example: ["bulbasaur", "ivysaur", "venusaur"]
  2. Change "<feature_#>" to the feature(s) you made earlier. It must remain in quotes.
  3. Save the file.
  4. Place this new file into the species_feature_assignments folder of your addon.

Step 6: Create special spawns for your variants (optional)

This is an optional step to show you how to create unique spawns for each variant choice. If you do not specify any choices in the "pokemon" string, then the "default" choice from your feature will spawn as a result. It's highly recommended that you review the spawn files for Pokémon with regional forms, Pumpkaboo, and Arbok. Those spawn files can be found on the Gitlab.

You will mostly be using the Arbok file as a template for your Pokémon's spawn files. Even though Arbok's multiple spawns all have the same conditions, they can be changed so the different skins appear in different conditions. You can change the other spawn properties to whatever you like. A list of spawn conditions can be found here. The list of biome tags can be found here.

  1. Obtain Arbok's spawn_pool_world file.
  2. Rename it after your Pokémon
  3. Open the file and locate the data under "spawns"
  4. Change the "id" value to the format of <pokemon>-<choice#>-<id #>
  5. Change the "pokemon" value to the format of <pokemon> <aspectFormat>=<choice#>
    • You'll need to reference your own aspect format you wrote earlier.
  6. Change the other spawn properties as desired.
  7. Repeat steps 4-6 to create more spawns for each choice of your species feature.
  8. Save the file.
  9. Place this new file into the spawn_pool_world folder of your addon.

Your list of spawns should now look something like Arbok's:

"spawns": [
        {
            "id": "arbok-classic-1",
            "pokemon": "arbok snake-pattern=classic",
            "presets": [
                "natural"
            ],
            "type": "pokemon",
            "context": "grounded",
            "bucket": "common",
            "level": "22-45",
            "weight": 0.45,
            "condition": {
                "canSeeSky": true,
                "biomes": [
                    "#cobblemon:is_arid"
                ]
            }
        },
		{
            "id": "arbok-legacy-1",
            "pokemon": "arbok snake-pattern=legacy",
            "presets": [
                "natural"
            ],
            "type": "pokemon",
            "context": "grounded",
            "bucket": "common",
            "level": "22-45",
            "weight": 0.03,
            "condition": {
                "canSeeSky": true,
                "biomes": [
                    "#cobblemon:is_arid"
                ]
            }
        }...

Step 7: Create the resolver file for your variants

Back in step 3, you should have already made the files for models, textures, animations, and posers that you needed. The last thing you need to do is assign them to your variant by creating a new resolver file.

If you do not specify a model or poser file for each aspect, then they will use whatever was assigned to the variation with no aspects assigned. This is why some variations do not list every property.

Due to the many different ways variants can be made, there are many different ways to create the resolver. What you will do for this step is pick a comparable Pokémon feature and use that Pokémon as a template for your resolver file. You will be applying the aspect from your species_feature the same way they do.


  1. After creating your resolver(s), place them in the resolvers folder for your addon.

Step 8: Test your addon in game

Load your addon in game to see if your variants looks different from each other. You can have Blockbench open to edit any relevant asset file in the resourcepacks folder if needed.

  1. Copy your addon folder and place it in the "resourcepacks" and "datapacks" folder in the Minecraft root directory.
  2. Start up Minecraft and click on Options, then Resource Packs. Select your pack to load it.
  3. Load/create a Creative world save that contains your addon in the "datapack" folder.
  4. Once in the world, you can run the command /pokespawn <target pokemon> <species feature>=<choice#1>.
  5. Repeat for every variant you created.
  6. Ensure your new variants are working properly.
  7. Check if your variants spawn where you assigned them to. You can use /checkspawn <rarity> when in the assigned biome. The different aspects are not shown in checkspawn.
    • You can run the command /locate biome <assigned biome> to get coordinates to the assigned biome. You can then click on the coordinates it gave you and be teleported instantly.
  8. Make any desired edits to the asset files and save. Refresh resource packs with F3+T to see the changes you make.
  9. Make any desired edits to the data files and save. You need to quit to main menu, and load the world again if you want to see those changes.
    • The command for /reload does not work with Cobblemon addons unfortunately.

You should now have a functional set of variants! If your addon is not working properly at this stage, you can seek help in the Cobblemon Discord.