• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[3D Art] PopcornFX Basics

⚠️ This thread is outdated! Check out the new one: PopcornFX Editor thread





I should note that this is not a complete guide, but something of a starting point for creating custom PopcornFX particle effects. The purpose of this article is to show that this is possible. You can find a fully-ready example for import into the game in this resource. I still have many misunderstandings and questions, but I hope that there will be people in our community who can continue and complete this research 🙂 Unfortunately, we do not have any documentation, so we have to check this experimentally.

Blizzard Asset Baker​

In a leak of dev software there was a so-called asset baker (PopcornAssetBaker.exe). This is a command-line tool used to bake popcorn effects into a binary files. It works. It throws a ton of errors, but it actually bakes working pkb files in most cases. I haven't delved deep, but I can share some information. However, using this utility is not necessary, and I will show below how to use the built-in "Quick Bake" function in the PopcornFX editor.

CLI Arguments​

Flag
Type
Required
Description
-i <path>string+Input directory
-o <path>string+Output directory
-sflagRecurse through subdirectories
-qflagQuiet mode
-vflagVerbose mode

Config​

Inside the input directory you should have the config file at Popcorn/AssetBaker.pkcf.
Example config contents:
Code:
Version = 2.5.1.63447;
CProjectSettingsBaking    $D857A09F
{
    PlatformSettingsList = {
        "x64:Builded",
    };
    BuildVersions = {
        "PC: desktop, windows",
    };
}

Library​

If I understand correctly, the baker expects to find the PopcornFXCore library in the inputdir/Popcorn location. Typically, a Library directory is created automatically in the project folder, so it needs to be copied to inputdir/Popcorn.

Game attributes​

The particle emitter can receive values from the game at runtime. For example, in pkb files you can find strings like:
Code:
War3
Game.SpeedMultiplier
Game.ColorMultiplier

These are Attributes — a PopcornFX mechanism for passing data from the host application into an effect at runtime. You can declare attributes with the same names in your own effect in PK-Editor, and the game will automatically populate them. Here is the full list with correct types:

AttributeType
Game.LifespanMultiplierfloat
Game.EmissionRateMultiplierfloat
Game.SpeedMultiplierfloat
Game.ColorMultiplierfloat4
Game.TeamColorfloat4
Game.TargetPositionfloat3
Game.Scalefloat
Weather.TileCenterfloat3
Weather.Sizefloat2
Weather.EmissionRatefloat

Looking at the names, it looks like some of them are read from the PopcornFX node from MDX.
Here is an example of getting a team color from the game. See the post below for details in this thread.

1773502174055.png


The War3 string found in baked files remains unclear. It may be a namespace identifier, a platform tag, or some other metadata. It does not appear to be an attribute name.

Also, in two files (wisp.pkb and spiritofvengeance.pkb), you can find the string _pksi_War3.HasTeleported_SI. This isn't an attribute, but a simulation interface. If an object moves more than 200 units between frames, the effect with this interface is immediately destroyed in that frame. Apparently, this was done to avoid having to deal with long-running trails or something like that. Simulation interfaces are a feature of SDK and I'm not sure if this can be worked with in the native PK-Editor.



Here are couple of simple examples, as well longer video of pkb importing process.



Here I replaced the standard Impale effect with a custom Blast effect.


*This is an old clip, I did some unnecessary things there and didn't set up the axis system.

I'll try to explain what's going on here.
  1. We know that Warcraft uses the popcornFX build 2.5.1.63447. That is, we need to bake particles intended for this version. We can download PopcornFX Editor here. It is free for personal, non-commercial use. Unfortunately, this particular build is not available for download, so I tried the two closest to it. We can download any of them and install on PC.
    aa6138d204f9001d.png



  2. Next we need to create a project. Since I have no experience in creating VFX, I used samples available for download in the PK-Editor. They can be imported in one click into your project on the "Online Packages" tab.

    pkeditor1.png


    1. We need to set the baking settings in the project settings. Here is official documentation on how to do this. My example here on pic.

      pkeditor2.png
      For some reason, the build version cannot be specified here. I mean in this menu it is possible to use Load option to set a custom .pkcf config file, where you can explicitly specify build version, but this will not work for quick baking, and the version of the output files will be the same as the version of PK Editor.
    2. It is also necessary to set up the axis system. By default, project has YUp Right Hand enabled, for export to Warcraft it is necessary to set ZUp Right Hand. This can be set in the Scene section.
      1735740356949.png
  3. After setting project, we can use Quick Bake function to bake particle effect into binary format. All necessary files will be built in directory that we specified in baking settings. In my example, this is the Builded folder in the project root.
    pkeditor3.png
  4. Importing files into custom map. Here I will try to describe in more detail.


    1. .PKFX. After baking we get a particle in binary format that Reforged can read. Particle was most likely baked in a different version than the Warcraft PopcornFX version, and if we open ile in hexadecimal format we can see that version does not match version specified in Blizzard's pkb files. This is shown in pic below.
      hexeditor.png

      BUT in this case you can do nothing about it, that is, even despite the slight difference in the build version, file will still be read, apparently there is some compatibility between builds. Optionally, you can replace the bytes responsible for the version.

      Also, it is not necessary to change the extension from pkfx to pkb, game can read both. Optionally, you can also do this. This can be done in Windows Explorer, for example.

      After baking particle can be used in the game. We can replace any default pkb by importing a custom file with the right path, or use it separately. To do this, I highly recommend using TRMS, which has GUI for editing PopcornFX nodes.

    2. Textures. PK-Editor supports different image formats, but I think .dds is the best one to use for Reforged. Diffuse textures must be saved with BC3 compression. I'm not sure about other texture maps. Remember to use the correct path. That is, if the .pkfx file contains a path like "Textures/FX/Diffuse.dds", then we must import it into the map with same path.

    3. .PKAT. This file format can also be read by Warcraft. Something like UV mapping for texture atlas stored in external file. Wiki. This is simple text file that does not require any changes and can be directly imported into Reforged.

    4. .PKMA. These files cause me the most confusion. These are so-called Feature Sets. These are text files, similar to pkfx, and they also contain build version. I'm not sure if they need to be imported into the map. In general, the most of Blizzard particles have links to these files, and it in following format: “Popcorn/Library/PopcornFXCore/Materials/FILENAME.pkma”. In my custom effects baked in popcorn, these links are in the format "Library/PopcornFXCore/Materials/FILENAME.pkma". Yes, we can change this path in Editor project, but is it necessary? I hope that someone will look into this issue in more detail. According to my experiments, presence or absence of these files in map did not affect anything, the “wrong” path also did not prevent effects from working.

    5. Sounds. mp3, flac, wav, etc. I couldn't get the particle sounds to work, maybe PopcornFX sound system is disabled in Warcraft.

    6. Meshes. Baked effects often use references to meshes in the .pkmm format. My attempts to use them resulted in the game crashing. Haven't tested this much. You can use custom FBX mesh as pkmm to get geometry in your effects. See the post below for details in this thread. By the way ball lightning reacted quite well to Riffleman.mdx mesh (you can see it in the video above).

  5. It seems that PopcornFX particles cannot be used on their own and must be referenced in Warcraft MDX models. As it turns out, PopcornFX particles can be used directly in game as models. For example, you can explicitly specify pathtofile.pkb in the Art - Model File field of Object Editor for units or other object types. You can also create special effect instance by specifying path to pkb. For example, code
    Lua:
    AddSpecialEffect("sharedfx\\hero_glow\\hero_glow.pkb", 0, 0)
    will create team glow in the map center.

    However, Blizzard preferred to link pkb to models using special nodes. As I said before, you can replace default pkb file or use TRMS to create your own links.
    trms.png

Test map is available for download. Good luck have fun!​

 

Attachments

Last edited:
In a recent leak of dev software there was a so-called asset baker (PopcornAssetBaker.exe). I tried to use it, it is a CLI tool that takes input and output directories as arguments, and also requires Popcorn\AssetBaker.pkcf file in the import directory to configure baking.

I have no idea how to use it correctly, I mean I started baking process, but console throws tons of errors, and the output is almost empty binary pkfx, several hundred bytes in size.
1735345651571.png
My version of AssetBaker.pkcf (maybe more settings are needed, haven't tested it deeply).
Code:
Version = 2.5.1.63447;
CProjectSettingsBaking    $D857A09F
{
    PlatformSettingsList = {
        "x64:Builded",
    };
    BuildVersions = {
        "PC: desktop, windows",
    };
}

Links to PopcornFX documentation
 
I’m unable to run PopcornFX-Editor_v2.5.2.63604. Only the latest version from the official website can run, but it causes the system to go black. I then followed the workflow to export a .pkfx file, but after importing it into the map, it does not display correctly. Could this be caused by a software version issue?
 

Attachments

Could you share some effects samples (if possible as many as possible) in pkfx format?

I'm currently reverse engineering the format and trying to get better support in NeoDex.
Do you mean the raw text-based ones or the baked ones? Both are in the pkfx format, whereas pkb is an extension Blizzard invented specifically for baked pkfx files.

I could, but honestly, I think reverse-engineering the baked files is a bad idea, as its a rather complex format. Although... we do have a leaked SDK
 
I've been working on a PopcornFX pipeline for Reforged and put together a boilerplate project that handles some setup stuff.
The idea is to have a clean starting point so a user can just clone it and start making effects.


Still a work in progress, I'll be adding more documentation over time. I also feel like the information in this article could be organized in a much better way 🤔
 
Do you mean the raw text-based ones or the baked ones? Both are in the pkfx format, whereas pkb is an extension Blizzard invented specifically for baked pkfx files.

I could, but honestly, I think reverse-engineering the baked files is a bad idea, as its a rather complex format. Although... we do have a leaked SDK
actually both I'm testing right now a script that "unbakes" popcornfx files. So it helps if I can get samples with originals
 
actually both I'm testing right now a script that "unbakes" popcornfx files.
Cool! Although, if I remember correctly, a lot of info is lost during baking, and it's still impossible to restore the graph for editing in PK-Editor.

I've attached an archive containing various examples and tutorials. Not all of this will work in Warcraft due to removed functionality and other issues, but the files are baked with the appropriate build version for the current version of Reforged. The raw particles are in the Particles folder, and the binaries are in the BakedStuff/Particles folder.

Updt: Damn, this file seems too heavy for Hive. Here's the link.
 
Cool! Although, if I remember correctly, a lot of info is lost during baking, and it's still impossible to restore the graph for editing in PK-Editor.

I've attached an archive containing various examples and tutorials. Not all of this will work in Warcraft due to removed functionality and other issues, but the files are baked with the appropriate build version for the current version of Reforged. The raw particles are in the Particles folder, and the binaries are in the BakedStuff/Particles folder.

Updt: Damn, this file seems too heavy for Hive. Here's the link.
I wouldn't say "impossible" just hard.

1775562898852.png

Here's Basic Fountain decompiled by my experimental decompiler. It's not perfect yet, but we are getting there.

Thank you very much for the files. They have bee n very helpful. So far I can decompile half of them with some glitches. I hope I can decompile as most as I can by the end of the week.
 
I hope I can decompile as most as I can by the end of the week.
It would be cool if we could edit and rebake Blizzard effects.

Since this topic got some traction, I decided to organize things a bit. I made a short video tutorial (yes, AI-narrated) on how to quickly bake effects and use my boilerplate. I also tried splitting the info from this article into separate pages and hosted them on GitHub Pages. Here's the link

 
Back
Top