• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

PKBlaster - Reforged PKB Color Swapper

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
This is a tiny Java program created to allow recoloring/tweaking of PKB files. I am posting it here without a lot of testing yet. It will probably have a lot of bugs in a lot of cases. But I thought that by putting it here, that gives people access to try it out. When I showed some people screenshots of the first PKB files that I was able to successfully recolor, they were immediately asking "how" and rather than try to explain it, I think it is easier if I link them to this small program.

Here's an example video of Flame Strike turned purple with this program:

191503-8a0394278f7a83cfea0b9e9766d4f904.png


This program is open source and you can find the source code here: https://github.com/Retera/PKBlaster
Previews
Contents

PKBlaster - Reforged PKB Color Swapper (Binary)

Reviews
eejin
A utility for coloring PKB files which previously was not possible. The UI does need some work though such as more sane defaults for window sizes, some spacing in the layouts and perhaps tucking the raw data access away a bit as to reduce confusion...
Thanks guys! I updated the download so that if you download the program again, it will have the fix for the "unknown Group 10" exception that Wildone got while testing. After fixing this, i was able to change the color of Blood Mage attack hand glows!

1621661601171.png
 
There was a new update tonight but I didn't want to double post. Within the past hour or two, 0.02 was released. You can check what version you have by looking at the title bar while the program is running.

0.02 fixes support for Group 14 in some PKB files while doing the automated color swapping. Thanks again to @Wildone for finding that this was a bug!
 
Thanks guys! I updated the download so that if you download the program again, it will have the fix for the "unknown Group 10" exception that Wildone got while testing. After fixing this, i was able to change the color of Blood Mage attack hand glows

Hey man, loving this program for editing the pkbs, thought i would let you know i found a particle that is giving errors when trying to change colors, it is the annihilationmissile.pkb, lol ofc i would want to be changing one that i cant, Group 1 it appears for this one. i took a screen of the errors. so yea here lol
i did find some others that dont fully change colors, but that could be because of something else i dont know, just info lol
 

Attachments

  • Screenshot 2021-06-07 170451.png
    Screenshot 2021-06-07 170451.png
    258.4 KB · Views: 99

eejin

Tool Moderator
Level 12
Joined
Mar 6, 2017
Messages
221
A utility for coloring PKB files which previously was not possible. The UI does need some work though such as more sane defaults for window sizes, some spacing in the layouts and perhaps tucking the raw data access away a bit as to reduce confusion.
Eg. the main window being cramped when viewing data:
1623614730791.png

Also the file dialog being tiny
1623614746950.png

And this needs some spacing as it is too cramped:
1623614765670.png


All in all a very useful tool with some rough edges.
 
Level 3
Joined
Nov 5, 2021
Messages
18
@Retera Hey man, awesome work you've done here. I was reading all this shit about pkb files. But what Im searching for is to be able to use this pkb "animations" into models.

Specially I want to use the alchemist purp effect (photo) SharedFX/HEROGoblinALCHEMIST/ChemicalRage.pkfx, but I can't find a way to place it under the morph animation. Then Im looking for to find a way to transfer the mdx finished model to classic.

Thank you for you time, feel free to answer when u want!
 

Attachments

  • Captura.PNG
    Captura.PNG
    4.5 MB · Views: 50
  • Like
Reactions: Kam
Level 6
Joined
Dec 29, 2019
Messages
82
Thanks guys! I updated the download so that if you download the program again, it will have the fix for the "unknown Group 10" exception that Wildone got while testing. After fixing this, i was able to change the color of Blood Mage attack hand glows!

View attachment 380000
Idk why automation recolorize is not working for me... pkb looks recolorized but while loaded in game it still appears vanilla green ... can u check it for me please ? looks like i am still missing something
 

Attachments

  • editedPKBs.rar
    25.4 KB · Views: 34
its sounds no longer sound, and the spheres when hitting do not disappear
Sounds are not a part of PKB files. If you have this problem, then you have an import configuration problem in your Warcraft III map settings. Likewise, the PKBlaster changes very little file information and would most likely not ever change animations.

Try naming the imported PKB file and the MDX file in your Asset Manager to have two different distinct names.

Edit:
can u check it for me please ?
Sorry, no, I can't. I'm too busy. Maybe later.

Then Im looking for to find a way to transfer the mdx finished model to classic.

Sorry I never replied to your inquiry about the purple alchemist effect. It is not even remotely possible to convert a PKB file into classic, unless you have an incredibly complex conversion computer program including several reverse engineered components that I do not have and can only even barely possibly imagine. Even with legality issues aside, I believe such a program will most likely never exist because of technological reasons. So I forgot to reply to you because I thought that what you were asking for was just completely impossible.

I emailed the PopcornFX company who created the pkfx/pkb files about the possibility of me paying them for a plugin to add support for previewing these assets into the Retera Model Studio, but they do not have a technology remotely like that at all. Furthermore, in their email they reiterated that in order to modify a PKB file:
  • This file represents the baked effects and nothing guarantees that it used our standard format. (could be override/modified by the integrator) [Retera: They are referring to the possibility of Blizzard modifying the format. Whether that happened is unknown.]
  • Basically, if you want users to modify some effects, they should edit the source file .pkfx with the exact same editor version matching the sdk version used in the integration.
    And effects need to be baked with the same process & settings. [Retera: Again we have no help from Blizzard on how to do this that I have ever seen, so the idea of even trying is basically a joke to me.]
  • So the first step would be to ensure that generated pkb are compatible/loadable by the game.
  • Regarding the SDK, indeed we don't have any [plugin for Retera Model Studio] that would fit your requirements yet. However, you may check the O3DE plugin. (o3de is an opensource game engine)

I forgot to reply to their email after this, but that is the information that I got. So if you want to modify the animations of your PKB file, please reach out to "the integrator" [in this case Blizzard Entertainment] and then for step 2, you will need "the integrator" [Blizzard Entertainment] to send you the original PKFX format source files so that you can make your modifications.
Thanks. Good luck.
 
Last edited:
Update:

This tool has been updated with a first draft of support for Patch 1.33, so that users can use the recolor functions on Patch 1.33 PKB files.

The attached screenshots were taken in Patch 1.33 with the first test outputs of the updated tool. I didn't test very much, so feel free to post back onto here with any inquiries. This new version might also be able to work on Diablo 2 Resurrected particle files, because there is some code inadvertently included from when I was testing that earlier, but in general I am not interested in tech support because I have not been following if or when Diablo 2 Resurrected got patches. For all I know, the latest Diablo 2 Resurrected emitters might not be working anymore with this.
PKB_orb_blue_pkblaster_133.png
 
Update:

This tool has been updated with a first draft of support for Patch 1.33, so that users can use the recolor functions on Patch 1.33 PKB files.

The attached screenshots were taken in Patch 1.33 with the first test outputs of the updated tool. I didn't test very much, so feel free to post back onto here with any inquiries. This new version might also be able to work on Diablo 2 Resurrected particle files, because there is some code inadvertently included from when I was testing that earlier, but in general I am not interested in tech support because I have not been following if or when Diablo 2 Resurrected got patches. For all I know, the latest Diablo 2 Resurrected emitters might not be working anymore with this.
I downloaded it and it doesn't open the effects, are you sure you didn't upload the 1.32 one? This pkb is in version 0.05 I do not know if this will help you to know if it is correct or not
 
Which file path from ingame are you trying to open? It is very possible also that I updated some code and then it could open some effects on 1.33, but not all of them. For example if there was part of the new format that I only partially understood
fire from the hands of archimonde
 
1664402006044.png

For me changing the fire from the hands of archimonde seemed to work (see image above). I downloaded the program from the link above, then extracted the "WarlockSpell.pkb" file, opened it with the program from the download link above, and then used the "Colorize" on it after picking purple color.

What java version are you using and at what step in doing that does it stop working for you? After taking the screenshot above, I zoomed the camera way out with the mouse wheel to double check that I am absolutely on Patch 1.33.

Edit: attached is my test model. It did not load in 1.33 world editor for me because the 1.33 world editor is bugged due to the problems introduced by Patch 1.33, but in the game itself this particle is working and showing. The file path my model wants on the PKB is literally just the default "war3mapImported\warlockspell_purp.pkb", no need to change it.
Does this attached model work on your machine on patch 1.33 ??
 

Attachments

  • HeroWarlock_PurpleSpell.zip
    1.8 MB · Views: 14

For me changing the fire from the hands of archimonde seemed to work (see image above). I downloaded the program from the link above, then extracted the "WarlockSpell.pkb" file, opened it with the program from the download link above, and then used the "Colorize" on it after picking purple color.

What java version are you using and at what step in doing that does it stop working for you? After taking the screenshot above, I zoomed the camera way out with the mouse wheel to double check that I am absolutely on Patch 1.33.

Edit: attached is my test model. It did not load in 1.33 world editor for me because the 1.33 world editor is bugged due to the problems introduced by Patch 1.33, but in the game itself this particle is working and showing. The file path my model wants on the PKB is literally just the default "war3mapImported\warlockspell_purp.pkb", no need to change it.
Does this attached model work on your machine on patch 1.33 ??

It already works, what if I have this problem that I also had before and that is that with the lords of the pit they don't change their effects, I mean the lords of the pit have 2 fires a small one that is like a light and the big fire changes the small one and not the big one even though it modifies the 2 pkb, besides that azgalor uses a single pkb and exactly the same thing happens









1664473169807.png
 
When part of the color isn't recolored, that means it is a case when the source of the color information is probably from a part of the file that isn't understood by PKBlaster yet, like a group with a different structure. One way to fix this would be to learn how to recolor the particle using a Hex Editor manually, and then if we understood how you did that then we could include it into the PKBlaster in the automatic recolor system.

If you did not have a hex editor but wanted to try this, you can actually use the "Nodes" tab of PKBlaster, which is filled with incorrect information because it tries to provide different possible guesses as what each chunk of data might be. But despite how that might be confusing, it does allow you to click and edit values, so you may be able to manually recolor values if you can find them there... Much like a hex editor.
 
Level 3
Joined
Aug 26, 2019
Messages
16
Need some Help:
I have downloaded the newest version 0.05. Exported for example flamestrike.pkb (with ret model studio) (also tried using the warlockspell.pkb posted in here) and tried to open it with the PKBBlaster.
I can select the file but when i double click or click open simply nothing happens and I am back on the main UI. Any Idea why?
Using Java version 8 Update 341 (build 1.8.0_341-b10). And Windows 11.
 
Level 3
Joined
Aug 26, 2019
Messages
16
I wonder if my computer compiled with Java 17 while trying to retain support for Java 8. Can you get a stacktrace on the exception?
Since my Java dind't want to log anything I got it from eclipse with your GIT repo version:

Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: Illegal magic key1=-905966831
at com.hiveworkshop.pkb.HorriblePkbParser.<init>(HorriblePkbParser.java:32)
at com.hiveworkshop.pkb.HorriblePKBlasterPanel$10.actionPerformed(HorriblePKBlasterPanel.java:746)
at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972)
at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2313)
at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
at java.desktop/javax.swing.AbstractButton.doClick(AbstractButton.java:374)
at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1028)
at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1072)
at java.desktop/java.awt.Component.processMouseEvent(Component.java:6626)
at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3389)
at java.desktop/java.awt.Component.processEvent(Component.java:6391)
at java.desktop/java.awt.Container.processEvent(Container.java:2266)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5001)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833)
at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4948)
at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4575)
at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4516)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310)
at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2780)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:716)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:746)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:744)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:743)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
 
The "illegal magic key1" exception only happens on the out of date version of this program that cannot handle the latest Warcraft III version.
Looking at it, it appears that the GitHub repo was behind the binary on Hive.
So, I have updated the GitHub repo.

Could you try a "git pull" or equivalent to get the newer code from the GitHub repo?

Because of the different possible types of magic keys available, the exception is simplified on the new version and if you hit the same problem it would say "illegal magic keys" plural.
 
Level 3
Joined
Aug 26, 2019
Messages
16
The "illegal magic key1" exception only happens on the out of date version of this program that cannot handle the latest Warcraft III version.
Looking at it, it appears that the GitHub repo was behind the binary on Hive.
So, I have updated the GitHub repo.

Could you try a "git pull" or equivalent to get the newer code from the GitHub repo?

Because of the different possible types of magic keys available, the exception is simplified on the new version and if you hit the same problem it would say "illegal magic keys" plural.
Now I am kind of confused.
Starting it via Eclipse and opening the files there works without any problems. But directly via .jre not. But the Version is both 1.8.
Java.png


Also the only output is:
Some resurrected identifier: 22
Finished reading strings at: 166780
Finished with remaining: 0
firstmagic: 2002
strings offset: 163440
secondmagic: 0
Exception while removing reference.
 
So, I guess I am imagining that if you can run the same compiled Java code through two different pipelines and only one of them works, then either:
  • The failure case is a different implementation of the Java Virtual Machine, such as an Oracle Hotspot JVM vs the OpenJDK JVM, and maybe I was unknowingly using a Java class that only works in one of these two. If this is what is happening, it should be possible to run the "fail" case from command line and I would expect it to be throwing some exception with a longer output than what you pasted from your eclipse run
  • Alternatively maybe my program GUI is visually doing nothing at a time when we would have expected it to do something. Like if it was actually working in both cases, but if I had designed it badly and so then you didn't even know it was working because you couldnt tell, or something

This is just my first brainstorm about what the issue might be. If I had it in front of me or maybe even a video of the sequence of actions causing the problem to happen, maybe I could diagnose more
 
Level 3
Joined
Aug 26, 2019
Messages
16
Maybe some addition to this topic:

Let's assume you have colorized the Annihilation Missile from the spell Orb of Death (Abilities/Spells/Undead/OrbOfDeath/AnnihilationMissile.pkb).

And you want to use that for your spell, you can simply use it in the wc3 editor in the art section and enter under "Custom" the filename.pkb as text.

But what if you want to use a spell which uses multiple pkb files?
For that you need a spell model (mdx/mdl file). This file you can open with a hex editor. My example is a Chaos Orb missile which consists of multiple pkb files for example Annihilation Missile, Spirit of Vengeance Missile, Howl and more.

To change the colour of this spell you open the editor and search for the pkb you want to change (here Annihilation):
ani.png


which has the standard path.

You start here to type your filename:
ani.png


Now change it to your imported Annihilation path in my case annihilationmissle.pkb (I deleted the war3mpq stuff after the import)
progress.png


After that you need to fill the rest with 00.

final.png


After that if you use this mdx, the Annihilation part should be your coloured version.

With this you can actually combine multiple spells to create a new spells.

For example, i changed the annihilation missile to a recoloured fireball.

fireball.png
 

Attachments

  • ChaosOrb_unedited.png
    ChaosOrb_unedited.png
    11.7 KB · Views: 9
  • ChaosOrb.png
    ChaosOrb.png
    10.7 KB · Views: 11
Level 3
Joined
Aug 26, 2019
Messages
16
Using a hex editor to modify MDX files sounds very sadistic to me. I would use an open source MDX library, or a GUI program for this to make it easy. But maybe I'm just that crazy.
Probably a sadistic way :grin: But I have only tried it with a hex editor (wile i was working on something else) and with a normal text editor (which did not work for me) so far.
 
What java version are you using? I think there was an issue some people had where the program worked on some versions and not on others. If I recall, maybe the problem was that it was compiled on a Java 17 environment with Java 8 backwards compatibility, but the compatibility was a lie and the program doesn't work on Java 8. When you try to open a file, there is a NoSuchMethodError on Java 8 that happens silently due to buffer issues. In the future I might be able to upgrade it to have a popup, but it does not do that yet.

Can you try it with a newer version of Java? If you are averse to upgrading, the other option might be if I bundle the program with Java baked in, like what we see on Retera Model Studio, so that all Hive Tools Page users of Retera Model Studio are on the same, included Windows x64 java runtime version 17 that was bundled with jpackage and the "badass runtime plugin" utility.
 
Can you try it with a newer version of Java? If you are averse to upgrading, the other option might be if I bundle the program with Java baked in, like what we see on Retera Model Studio, so that all Hive Tools Page users of Retera Model Studio are on the same, included Windows x64 java runtime version 17 that was bundled with jpackage and the "badass runtime plugin" utility.

ahh that was the problem, i was running java 8, didnt even know, i downloaded java 17 and now it works, thank you sir for solving my problem
 
Level 1
Joined
Apr 2, 2020
Messages
3
Thanks guys! I updated the download so that if you download the program again, it will have the fix for the "unknown Group 10" exception that Wildone got while testing. After fixing this, i was able to change the color of Blood Mage attack hand glows!

View attachment 380000
Hi! I just tried this tool today as my first attempt to mod Warcraft3. I successfully changed the surrounding orb color for the blood mage, but I have no luck on changing the color in the attack animation (include the hand glow and the orb that shoots out). I tried to use automated colorize function, but after that the game seems can't recognize the blood mage model anymore, there's only a small particle cloud loaded. Could you give more insights on how to change this part of it? Thanks in advance!

Also - you may notice that when the blood mage uses his firestorm skill, a series of green cracks will form on the targeted area, before the fire starts. After that, subtle green vortex will converge towards the center of the firestorm. Would be nice to change the color of that part too, do you have any clue about where to look at?
 
Top