1 like 0 dislike
156 views

I'm trying to make edits to some game files for a custom map, and I've narrowed it down to these PKB files. The files contain mostly garbled code when opened in something like notepad, but at the bottom there are variables like texture paths I can change.

The problem is I want to change the color information and I can't find where that is. The textures being referenced are usually black and white, so the color information is somewhere else, and it's definitely in the file, because when I swap out the PKB file for another, that other file pulls in different color effects.

I tried opening these files somehow in popcornFX but couldn't figure that out. What am I missing here, any help would be appreciated. I'll paste some of the code below from one of these files, excluding the garbled stuff you can't read.

And to clarify, I'm just trying to make an effect that's blue.. be red, or green. If that's as simple as adding a line of rgb values that's basically what I'm after. Thanks!

CParticleEffectCParticleAttributeListCParticleAttributeDeclarationGame.Global.SpawningCLayerGraphCompileCache!CLayerGraphCompileCache_EntrySlotRoot!CLayerGraphCompileCache_EventSlotSignalTriggerChildOnDeath!CLayerGraphCompileCache_LayerSlotCLayerCompileCacheCLayerCompileCacheFieldself.lifeRatioself.invLifeEffectIDSelfID _DRandCtxPrevAge

EventAccumCLayerCompileCacheSamplerEventStream$CParticleNodeSamplerData_EventStreamCLayerCompileCacheEventCCompilerBlobCacheCCompilerBlobCacheExternalfloatint2CCompilerBlobCacheEntryPointscene.dtParticleContextSpCtxSParticleContextIpCtxIRandContextRandCtx

particleEventsamplerEventStreamCCCompilerBlobCacheFunctionDefgenerateCCompilerBlobCacheFunctionArgdurationinitPayloadintint3kickeffect.isRunning

effect.ageinternal_vr1_floattriggerboolinternal_vr66_int2CLayerCompileCacheAttribinternal_sr286_float3internal_vr105_int2CLayerCompileCacheEventPayloadPositionColorSizeEmittedCount

SpawnCountfloat3xform_masked

appendPayloadbuildPayloadElementfloat4

n36__Rotationn36__NormalAxisinternal_sr544_float4internal_sr549_float3internal_sr550_float3internal_sr14_float3internal_sr667_float

n36__Position n36__Size n36__Axis

n36__Color__sampler_3CParticleNodeSamplerData_ShapeShape__sampler_4CParticleNodeSamplerData_CurveColorControl__sampler_5__sampler_6*CURVE*CLayerCompileCacheRenderer>Popcorn/Library/PopcornFXCore/Materials/Default_Billboard.pkma'CLayerCompileCacheRendererParticleInput"CLayerCompileCacheRendererPropertyGeometryBillboardTransparentDiffuseLit

SoftParticlesFlipUVs

AlphaRemapAtlas

NormalWrap LegacyLitBillboardingModeTransparent.TypeTransparent.SortModeDiffuse.DiffuseMap0_HD.w3mod/Textures/FX/Flare/FlareSimple02_BW.tifsamplerShape_3CrandsamplePositionsamplerCurve4CsamplerCurve1CsampleVelocityOrientation LifeRatio

n30__Rotationn30__NormalAxisinternal_sr360_float4internal_sr477_float3internal_sr478_float3internal_sr589_float4internal_sr333_float

n30__Position n30__Size n30__Axis

n30__Color__sampler_1__sampler_2)_HD.w3mod/Textures/FX/Flare/Flat_Glow.tifrgb2hsvhsv2rgb

n22__Position n22__Axisn22__NormalAxisn22__SortValuesinternal_vr48_floatinternal_sr173_float4internal_sr170_float n22__Size

n22__Rotation

n22__Color__sampler_0(_HD.w3mod/Textures/FX/Smoke/CloudsA1.tifextractPayloadElementF1extractPayloadElementF4 n35__Axisn35__SortValuesinternal_sr327_float3internal_sr328_float3internal_sr541_float4internal_sr653_float4internal_sr508_floatinternal_sr659_float

n35__Position n35__Size

n35__Rotation

n35__Colorn35__TextureID TextureID4_HD.w3mod/Textures/FX/Flipbooks/FB_Liquid_BW_8x8.tifAtlas.SourceAtlas.DefinitionAtlas.SubDivAtlas.BlendingsamplerShape_2C

by riptor7364 (140 points)

1 Answer

2 like 0 dislike
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.
by dudule19937 (190 points)
Maybe one other question would be what about labels like this?

n35__Color

That just have no values defined after them? My thought was if there was a hard RGB value for those, that's where it would show up, and if I knew how that was supposed to be formatted, I could try and see if that could override other color values.

All of these files have these types of color labels in the file, with nothing after them, eventually followed by a texture path.

Do you maybe have an example of what these rgb values would look like in those fields?
These are more likely the name of some particle storages, stored in a string table at the end of the file.
It's not unusual for binary file formats to separate strings from bytecode data, into a string table at the beginning or end of the file, which seems to be the case here. So you won't find any color value next to it, just the next (probably unrelated) string in the list of all strings the file uses.

Here's their first tutorial effect in the PopcornFX editor, showing the storage used by the particle, you can see similar names:
https://i.imgur.com/JJa4nD2.png
Here, "n14__Color"


From the texture paths you pasted, I take it this is an effect from War3 reforged?

If that's the case, I just found this page here: https://wowdev.wiki/MDX#CORN
which seems to indicate they exposed a 'colorMultiplier' and 'teamColor' which might be easier for you to change than changing the compiled effects.
Correct, it's for Reforged, although I'm not sure I follow what you're saying about colorMultiplier and teamColor.

Are you saying this would be written out somewhere else, as in avoid these PKB files entirely? Not sure where that would be.

I feel like I'm getting closer though.. I did see instances of 'teamColor' in some of those PKB files.
Well it looks like they exposed those as external "parameters" to effects, to easily change some colors. So yes this definitely looks like it's written in some data chunks inside the .mdx files.
I'm not familiar at all with the MDX files so I can't help you much there.
Edit: Thanks for the help. I've come to the conclusion it might just be easier to create new effects from scratch, rather than trying to backdoor the existing ones.

I guess the last question would be how do you create PKB files from popcornfx?
You can create .pkb files by baking them from the editor.
They have some pages on their documentation on baking, but it seems to be only for the C++ SDK users, nothing on the editor: https://www.popcornfx.com/docs/popcornfx-v2/baking/

When you are in the editor's content-browser, right-click on an effect file and select "quick bake".

You'll need to have a bake target setup in the project settings before attempting that.
Their example "Tutorials" project which you can get from the "Online packages" tab of the project launcher has 3 bake targets setup:

https://i.imgur.com/bsxI6Wn.png

It's a path relative to the root of the project.
Also, the editor will produce baked files with the "pkfx" extension, not "pkb", you probably can just rename them to "pkb", unless blizzard made some custom modifications to them? that I don't know.
Awesome. Thanks for the fast responses. Much appreciated!
...