Creating and Editing Particle Systems

Avatar
TopHATTwaffle
113 Posts
Posted Apr 12, 2013
Replied 54 minutes later
Hey guys, for those having issues packing them into a level because of the manifest. Here is what I'd suggest. Simple make your particles in an existing stock PCF file, then pack that. Because it's already in the manifest, when called on loading a BSP it should load the packed PCF.
Advertisement
Registered users don’t see ads! Register now!
Avatar
josepezdj
2,386 Posts
Posted Apr 12, 2013
Replied 15 minutes later
Doug, isn't that what I was saying? :biggrin:
Avatar
TopHATTwaffle
113 Posts
Posted Apr 12, 2013
Replied 7 minutes later

josepezdj wrote:
Doug, isn't that what I was saying? :biggrin:

Did you know, I'm stupid and should read! :lol:

Avatar
FelixGriffin
2,680 Posts
Posted Apr 12, 2013
Replied 8 hours later
But remember, VPK'd files are loaded before BSP'd ones. That's why custom skins are so much harder to use now.
Avatar
josepezdj
2,386 Posts
Posted Apr 13, 2013
Replied 13 hours later
Well, I've been trying, and so far no luck :sad:

Even though I'm using the same name than an already existing particle and packing the pcf file inside the bsp, it seems to be using the stocked particle (inside the vpk) instead... Ofc I used the path-fixup...

I'll continue figuring out a way though...

Avatar
reepblue
894 Posts
Posted Apr 13, 2013
Replied 1 hour later

josepezdj wrote:
Well, I've been trying, and so far no luck :sad:

Even though I'm using the same name than an already existing particle and packing the pcf file inside the bsp, it seems to be using the stocked particle (inside the vpk) instead... Ofc I used the path-fixup...

I'll continue figuring out a way though...

Try a custom DLC folder? That seems to be the only way I get stuff to work...

What you can also do is copy the PCF, rename that, and have your edits of the particle(s) in there. This way, it reads a "new" PCF instead of one that shipped with the game.

Again, never tried to ship a map with particles, all I ever did was make edits to particles in DLC folders...

Avatar
josepezdj
2,386 Posts
Posted Apr 13, 2013
Replied 4 hours later

reepblue wrote:
What you can also do is copy the PCF, rename that, and have your edits of the particle(s) in there. This way, it reads a "new" PCF instead of one that shipped with the game.

No no no, what I was trying is right that :biggrin: I did extract all partciles from the vpk to local folders, editted some particles and packed them into the bsp... In game I could only see the usual particle, not the editted one. It doesn't seem to work like sounds, scripts and the rest of stuff that's "packable". My final conclusion is that Valve, when they updated the game engine and established the searching/precaching priority, apart from loading the VPKs on atartup (and getting rid of the addons folder and VPKs inside them), they only left out some exceptions, like for materials, sounds or the scripts, for which the game can load both inside the VPK and outside and if you pack them inside the bsp, they acquire priotity over the VPK...

About a DLC folder, yeah I know that will works, same as a sourcemod, but my interest is to make a standalone map, in order to distribute that only file.

Avatar
reepblue
894 Posts
Posted Apr 13, 2013
Replied 4 hours later
Make sure the actual particle name is not the same as an existing one. rename the PCF AND the actual particle.

For Example: portal_projectile.pcf would be portal_projectile_myedit.pcf ; and portal_1_projectile_3rdperson would be portal_3_projectile_3rdperson.

Have the map load portal_3_projectile_3rdperson and the manifest portal_projectile_myedit.pcf.Never override with Portal 2, you can only 'hex' it. If that is your goal, maybe a vscript can swap out the stock with yours. (Like if you were actually wanting to replace the projectile ball.)

Avatar
josepezdj
2,386 Posts
Posted Apr 13, 2013
Replied 56 minutes later
Thanks Reep, I just tried. What you describe only allows me to use the newly created particles in the map. But they only appear if the particle plus the particle_manifest files are in the /particles folder; I tried to pack both into the bsp and remove both files locally, and then they don't appear anymore.

reepblue wrote:
If that is your goal, maybe a vscript can swap out the stock with yours

Haha yeah! I was searching for some script functions to achieve it right a moment ago :biggrin: I think this would be the only way :thumbup:

Avatar
sicklebrick
876 Posts
Posted Feb 23, 2014
Replied 10 months later
I know this thread is nearly a year old, but I've been looking into it recently for source mods and am just beginning to understand why it's going to be so bloody hard to pull this off.

First of course, as mentioned, the manifest is loaded at runtime (not when the map's loaded) so even if you'd hexed a .pcf to point at a different texture you're screwed.

But even if you were trying to rename one, say paint_bomb_fx.pcf, and you renamed it to paint_bomb_fx_hexed.pcf, and added that to the manifest, and then made a sourcemod to load it, hexed the name of the particle emitters inside to make new ones, or hexed the texture names inside, there's an issue with the file format that's going to just cause the game to crash.

Every table element has a globally unique ID, 16 bytes long and apparently random. Thus if you try and load what is essentially the same .PCF with two different file names there will be a conflict and p2 will crash.

Few options here:

1- Override+hex an existing one in a pak01_dir.vpk inside a higher priority folder.
2- Override+hex an existing one in a sourcemod (also must be in a pak01_dir.vpk )
3- Rename one + Manually alter all the IDs. Which sounds fairly easy and laborious, but remember, table elements can reference eachother by their indexes internally. So good luck with that.

4- Bit of a cheat... there are tons of particles already there which have missing textures, you can just add those manually and pack them into your map

Unfortunately, it doesn't look terribly likely that you'd be able to pack a new one into a map :\

Avatar
josepezdj
2,386 Posts
Posted Feb 25, 2014
Replied 1 day later

sicklebrick wrote:
4- Bit of a cheat... there are tons of particles already there which have missing textures, you can just add those manually and pack them into your map.

Well, undoubtedly this is the way to go... This is a job I already did some time ago using the Alien Swarm particle editor and I don't mind to share it here :wink: These are the missing materials for the 'broken' particles:

BROKEN PARTICLES AND THEIR MISSING TEXTURES
command_target_ping_arrow2 => material: "particle\coop\command_target_particle_arrow_beam.vmt"
command_target_ping_flash => material: particle\coop\command_target_particle_arrows.vmt
fire_incinerator_constant => material: "particle\fire_particle_4\fire_particle_4.vmt"
fire_incinerator_door => material: "particle\smoke1\smoke1.vmt"
fire_incinerator_door_heatwaver => material: "particle\warp1_warp.vmt"
fire_incinerator_heatwaver => material: "particle\warp1_warp.vmt"
fire_incinerator_heatwaver_constant => material: "particle\warp1_warp.vmt"
fire_incinerator_window_base => material: "particle\fire_particle_4\fire_particle_4.vmt"
fire_incinerator_window_constant_flames => material: "particle\fire_particle_6\fire_particle_6.vmt"
fire_incinerator_window_constant_flames2 => material: "particle\fire_particle_6\fire_particle_6.vmt"
fire_large_02 => material: "particle\fire_particle_6\fire_particle_6.vmt"
fire_large_02_warp => material: "particle\warp1_warp.vmt"
fire_medium_01 => material: "particle\fire_particle_6\fire_particle_6.vmt"
fire_medium_01_fillerb => material: "particle\fire_particle_2\fire_particle_2.vmt"
fire_medium_01_fillerb Version #2 => material: "particle\fire_particle_2\fire_particle_2.vmt"
fire_ploom_01 => material: "particle\fire_particle_2\fire_particle_2.vmt"
robot_point_beam_b => material: "particle\whitebeam.vmt"
robot_point_beam_core => material: "particle\whitebeam.vmt"
robot_point_beam_core_RED => material: "particle\whitebeam.vmt"

Few considerations:

  • Some of those .VMT files the particles need are inside the (/portal 2/portal2/) pak01_dir.VPK file, but others aren't.

  • The .VTF files that those .VMTs listed above are pointing to are mostly missing though. Even thought there are still some of them inside the pak_dir01.VPK, they seem to be buggy. Examples: fire_particle_4.vtf and smoke1.vtf. Why? looks like Portal2 needs the previous versions of them (from HL2), the main difference to the ones shipped with the game is the texture's size and images' distribution inside them.

  • All working materials needed (except those first 2 in the list) are attached to this post :wink: Just unzip the file under your /materials/ folder. There should appear a new folder called 'particle' under /materials/ with those required files. Once you restart the game the particles should be working (again, except the first 2).

  • THESE ATTACHED FILES (again, plus the first 2 ones in that list >.<) are the ones to edit if you want some custom particles in your map, all you have to do is to pakrat them before publishing to the workshop. And due to the mentioned above, remember to respect the textures' file format/size in order to make them to work properly.

  • Regarding those 2 first missing materials, a further research is needed in order to know what texture size is needed in order to make the particles to work properly. However, due to their purplecheckerboard-look, I think there are some already existing textures from other particles that could fit, it's just trial an error :p I'll do some further testing myself and post whatever I find.

  • After putting these missing materials under your materials/particle folder, the broken entities 'func_dustmotes' or 'func_dustcloud' will be magically fixed :wink:

Cheers!

Attachments
missing_materials.7z
0.52 MB 29 downloads
Avatar
sicklebrick
876 Posts
Posted Feb 25, 2014
Replied 4 hours later
Damn O_o Good work Jose!

By size, do you mean some of them require a very specific texture size in terms of width/height (which would be kinda weird) or that the placement of the graphics inside the texture are important?

Edit: Seriously though... thanks :smile:

Avatar
josepezdj
2,386 Posts
Posted Feb 25, 2014
Replied 16 minutes later

sicklebrick wrote:
Damn O_o Good work Jose!

Thanks, man! You too! :thumbup:

Well, I know it might be weird... however, even not knowing at all how the textures for particles work, if I think about models and UV-mapping, and how the placement inside of the texture is used by the different parts on the model, I guess this should be similar to that... or not :p

This is what I mean for example:

img

Avatar
sicklebrick
876 Posts
Posted Feb 25, 2014
Replied 14 minutes later
Yeah, that's what I thought. I know VTF supports multiple frames, but it seems like it would be more efficient to UV map small animations into one large texture atlas :smile:
Advertisement
Registered users don’t see ads! Register now!
Avatar
josepezdj
2,386 Posts
Posted Feb 27, 2014
Replied 2 days later
Hmmmm.... sorry, but it seems that the func_dustcloud also needs some sprites not present in Portal2. Whenever I put it in a map, the console outputs 2 missing sprites.

I found them in old games and attached them for anyone interested. I can't see any difference/improvement in its appearance in game though >.<

They are meant to be into the materials/sprites folder

Attachments
sprites.7z
0.02 MB 24 downloads