- Joined
- Apr 19, 2008
- Messages
- 2,562
Hey guys, one of the things I enjoyed on Warcraft 3 for many years was being able to easily modify the graphics of spell effects. Maybe I want to make Immolation blue instead of Green, for example.
But on Reforged as many people know the spells are often stored in a binary format called PKB. We are told that these files are the output of a program from popcornfx.com and during Reforged Beta when someone posted on that website asking how to change the color, this is what they were told:
While I was thinking about this topic I was reminded that someone else already asked something similar on Hive as well. I had forgotten about myself responding to this long ago. But as I was reviewing this topic when wanting to create my thread, here it was: (Resolved) Frost Immolation Model (For Reforged)
As you can see here on our modding site we took my word as final and apparently marked this fellow's topic as "Resolved" because I told him to give up on modding Reforged because it was too difficult, basically...
But that's not good enough. I tried doing a binary search and replace in the file for data containing 4 bytes in a row where the 3 of them were loosely in the shape of RGB yellow-green. Then I had my program muck about with what it thought were the colors. It replaced binary values in hundreds of places and I do not really understand what it did. But it created an interesting version of immolation that is different.
Does anyone else know anything about how to edit PKB? Do we have any Hive tutorials on this or anyone else who tried to do it?
Yes, in that other thread I trollishly said that we should not try, but I was watching Wtii play the Chronicles of the Second War on YouTube and I realized that not everyone is just going to give up on modding Reforged and try to write their own game like I have been doing. Apparently some people are actually still in this thing.
So, in honor of how crazy they are, I wanted to be able to mod PKBs color values, that was what I was thinking.
I found that by looking at PKB files -- literally just looking at what I see in the binary -- I was able to discern some things (I am not affiliated with PopcornFX company in any way and I did not use their tools to learn anything about this, I was just looking at the binary files from my Reforged installation).
Based on what I was seeing, I wrote a program with a UI that can open the PKB and it shows two parts, the "nodes" and the "strings" and we can edit any string and save the PKB again. This is kind of nifty since I made it change the metadata defining the length of the string as well, but otherwise not much better than a hex editor.
I tried and I was able to open the purple PKB effect below and make it blue by changing its texture reference:
And this really was as simple as
But in this same program I started trying to analyze the nodes and it gets really confusing. And for models like the Immolation effect, if we want to turn it blue, we need to understand the nodes. It is using a white texture with a color applied!
So I started tagging nodes in my UI based on what they might be since I have no idea. I found what seems to be a correspondence between the first binary integer in the node and the string table, and after parsing this every file begins with a node labelled "Particle Effect" followed by "Particle Attribute List" followed by numerous "CLayerGraphCompileCache" and then a bunch of EntrySlot and EventSlot for it.
Notably the blue and yellow stuff on the right hand-side is guesswork and most of the time is labelled incorrectly.
But as I continued down this rabbit hole into the late hours of last night, I got to the point where I felt like I was seeing a Color field as a Layer Cache Field.
But when I looked at the binary contents of the
Has anyone else ever attempted anything like this? Is there an easy way to make Immolation be blue?
But on Reforged as many people know the spells are often stored in a binary format called PKB. We are told that these files are the output of a program from popcornfx.com and during Reforged Beta when someone posted on that website asking how to change the color, this is what they were told:
These are compiled binary files, so you won't be able to open them in the PopcornFX editor, which only opens the source assets, and does not provide a "decompile" functionality AFAIK.
Depending on how the effect is made, the colors can be anything from an actual constant RGB value, to a texture lookup, to a curve lookup with the curve control-points saved somewhere in the file, to a mathematical expression depending on particle age, to countless other things.
One thing that might work would be to replace the .pkb file entirely from one you made, but how it's baked can depend on some specific things the game engine expects (some special attributes, special sim interfaces, a special renderer material, and so on), which also makes it very painful to do unless you know the exact process they used.
Frankly your best bet might be to ask the developers directly ? perhaps they're opened to the community modding the effects and would be willing to provide some of that information ?
Other than that, I'm afraid you're going to have an extremely hard time changing that color.
While I was thinking about this topic I was reminded that someone else already asked something similar on Hive as well. I had forgotten about myself responding to this long ago. But as I was reviewing this topic when wanting to create my thread, here it was: (Resolved) Frost Immolation Model (For Reforged)
As you can see here on our modding site we took my word as final and apparently marked this fellow's topic as "Resolved" because I told him to give up on modding Reforged because it was too difficult, basically...
But that's not good enough. I tried doing a binary search and replace in the file for data containing 4 bytes in a row where the 3 of them were loosely in the shape of RGB yellow-green. Then I had my program muck about with what it thought were the colors. It replaced binary values in hundreds of places and I do not really understand what it did. But it created an interesting version of immolation that is different.
Does anyone else know anything about how to edit PKB? Do we have any Hive tutorials on this or anyone else who tried to do it?
Yes, in that other thread I trollishly said that we should not try, but I was watching Wtii play the Chronicles of the Second War on YouTube and I realized that not everyone is just going to give up on modding Reforged and try to write their own game like I have been doing. Apparently some people are actually still in this thing.
So, in honor of how crazy they are, I wanted to be able to mod PKBs color values, that was what I was thinking.
I found that by looking at PKB files -- literally just looking at what I see in the binary -- I was able to discern some things (I am not affiliated with PopcornFX company in any way and I did not use their tools to learn anything about this, I was just looking at the binary files from my Reforged installation).
Based on what I was seeing, I wrote a program with a UI that can open the PKB and it shows two parts, the "nodes" and the "strings" and we can edit any string and save the PKB again. This is kind of nifty since I made it change the metadata defining the length of the string as well, but otherwise not much better than a hex editor.
I tried and I was able to open the purple PKB effect below and make it blue by changing its texture reference:
And this really was as simple as
File->Open
, typing in war3mapImported/OrganicBlobs_Blue.tif
and then doing File->Save
.But in this same program I started trying to analyze the nodes and it gets really confusing. And for models like the Immolation effect, if we want to turn it blue, we need to understand the nodes. It is using a white texture with a color applied!
So I started tagging nodes in my UI based on what they might be since I have no idea. I found what seems to be a correspondence between the first binary integer in the node and the string table, and after parsing this every file begins with a node labelled "Particle Effect" followed by "Particle Attribute List" followed by numerous "CLayerGraphCompileCache" and then a bunch of EntrySlot and EventSlot for it.
Notably the blue and yellow stuff on the right hand-side is guesswork and most of the time is labelled incorrectly.
But as I continued down this rabbit hole into the late hours of last night, I got to the point where I felt like I was seeing a Color field as a Layer Cache Field.
But when I looked at the binary contents of the
CLayerCompileCacheField "n42__Color"
node, it has something in there about being a "float4" that it is labelled but then I don't find the floating point values for me to tinker with. And it got late so I had to stop and sleep for the night, even though this view was able to display substantially more information for me after a few hours of hacking than I would have expected. This program is able to click on the nodes and modify single bytes within the nodes, much like a hex editor, so if we could determine what part of the CLayerCompileCacheField "n42__Color"
node or related information actually defined the color, then I think that we could change it. But it's unclear to me whether this node is a variable declaration or something that would actually define it to hold a value. Like I said the contents of the node do not quite make sense to me.Has anyone else ever attempted anything like this? Is there an easy way to make Immolation be blue?