Actions

SCHG

Difference between revisions of "Sonic Heroes/Particle Editing"

From Sonic Retro

m (Text replacement - " Settings==" to " settings==")
m (Text replacement - " Modes==" to " modes==")
 
Line 184: Line 184:
 
The binary files use texture names to call for the texture that is in the cmn_effect.txd files. Stage textures use the "sLL_effect.txd" and/or "stgLL_effect.txd" for textures that are imported into those archives. Not only stage particle binary files can read textures stored in the stage particle texture archives, it can also read the texture names in the common effect archive for the specific particle being customized. Textures made as particles can be imported into the files using a TXD archive editor such as Magic.TXD. If you have added a texture to one of the effect archives with another texture name, type the name in at the entry where the name is read in and then the EXE will read the imported texture when the particle starts emitting.
 
The binary files use texture names to call for the texture that is in the cmn_effect.txd files. Stage textures use the "sLL_effect.txd" and/or "stgLL_effect.txd" for textures that are imported into those archives. Not only stage particle binary files can read textures stored in the stage particle texture archives, it can also read the texture names in the common effect archive for the specific particle being customized. Textures made as particles can be imported into the files using a TXD archive editor such as Magic.TXD. If you have added a texture to one of the effect archives with another texture name, type the name in at the entry where the name is read in and then the EXE will read the imported texture when the particle starts emitting.
  
==Custom Blend Modes==
+
==Custom Blend modes==
 
Blend types can be customized by editing the codes that provides the source and destination factors based on the type of alpha the particle uses. There are three blend types stored in the EXE.
 
Blend types can be customized by editing the codes that provides the source and destination factors based on the type of alpha the particle uses. There are three blend types stored in the EXE.
  

Latest revision as of 16:47, 24 March 2020

SCHG: Sonic Heroes
Main Article
Mechanic Editing

DOL Editing
EXE Editing
Music Pointers
Object Parameter Data
Relocatable Editing (PC)
File Offsets

Model Editing
Collision Format
Model Format
Level Editing

Camera Editing
Event Editing
ID list
Indirect Editing
Light Editing
Level List
Object Editing
Object Porting
Spline Editing
Texture Animation Editing
Visibility Editing

Particle Editing
Particle Editing
Sound Editing
Music List

Sound Editing
Voices

SCHG How-Tos

Custom Object Material Effect Tutorial
Level Editing Tutorial

Particle effects for certain objects are set in the cmn_ptcl.bin and sLL_ptcl.bin files located in the dvdroot folder. They are big endian binary files that defines particles assigned to the object by the EXE.

Heroes Power Plant includes a Particle Editor tool which allows you to edit these files, albeit the tool is a bit incomplete as not everything is known about them.

File layout

Each _ptcl.bin files contains 0x80 byte entries for a variety of different effects that emit when something has triggered or as a background object.
The entry for the files follows this:

00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 05 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Offset Type Description Notes
0x00 Byte Spread/UV Type
0x01 Byte UV Frame type?
0x0C Long RBGA Color
0x0F Byte Fade time?
0x11 Byte Particle birth delay
0x13 Byte Amount of particles
0x15 Byte Unknown
0x17 Byte Unknown
0x19 Word Unknown
0x1C Word Particle Velocity
0x20 3 Bytes Always 00 05 00
0x23 Byte Blend Mode
0x24-0x27 Byte Particle rotation
0x28 Word Rotate animation speed
0x2A Word Rotate animation
0x2C Float Particle Life time The lower the float value is, the more time the particles will stay; higher float values will make the particles disappear quicker.
0x30 Float Particle Life threshold?
0x34 Float Unknown
0x38 Float Unknown
0x3C Float Unknown
0x40 Float Spread speed rate
0x44 Float Velocity rate
0x48 Float Unknown
0x4C Float Unknown
0x50 Float Unknown
0x54 Float Unknown
0x58 Float Particle Size
0x5C Float Unknown
0x60 Float Spread Size?
0x64 Float Same as above
0x68 Text Particle texture name to be used. Although the maximum length of the texture is 0x20, particle names in each entry are limited to 0x18 in length.

Particle settings

There are some options for one or more items in the files. A list of settings are available to any particle files and the EXE:

Offset Parameter Type Hex Values Options Result
0x23 Blend Mode 00


02


04


06


08


10
Alpha (Z-buffered)


Alpha (with Alpha Testing)


Additive Alpha


Additive Alpha (with Alpha Testing)


Alpha


Subtractive Alpha
SH Particle Z-buffered Example.png

SH Particle Alpha Test Example.png

SH Particle Additive Example.png

SH Particle Additive Alpha Test Example.png
SH Particle Alpha Example.png

SH Particle Subtractive Example.png

Importing Textures as Particles

The binary files use texture names to call for the texture that is in the cmn_effect.txd files. Stage textures use the "sLL_effect.txd" and/or "stgLL_effect.txd" for textures that are imported into those archives. Not only stage particle binary files can read textures stored in the stage particle texture archives, it can also read the texture names in the common effect archive for the specific particle being customized. Textures made as particles can be imported into the files using a TXD archive editor such as Magic.TXD. If you have added a texture to one of the effect archives with another texture name, type the name in at the entry where the name is read in and then the EXE will read the imported texture when the particle starts emitting.

Custom Blend modes

Blend types can be customized by editing the codes that provides the source and destination factors based on the type of alpha the particle uses. There are three blend types stored in the EXE.

Address (EXE) Address (RAM) Blend Factor Default (Hex) Blend Type
3131E
3132E
43131E
43132E
Source
Destination
05
02
Additive
31381 431381 Destination 04 Subtractive
313A9
313B9
4313A9
4313B9
Source
Destination
05
06
Alpha

If you'd like to customize the blend factors for your desired blend combination, replace one of the bytes with your value. The Renderware engine supports the following blend factors used in this EXE:

Value Blend Factor (RW name) Blend Factor (Standard Name)
01 rwBLENDZERO Zero
02 rwBLENDONE One
03 rwBLENDSRCCOLOR Source Color
04 rwBLENDINVSRCCOLOR Inverse Source Color
05 rwBLENDSRCALPHA Source Alpha
06 rwBLENDINVSRCALPHA Inverse Source Alpha
07 rwBLENDDESTALPHA Destination Alpha
08 rwBLENDINVDESTALPHA Inverse Destination Alpha
09 rwBLENDDESTCOLOR Destination Color
0A rwBLENDINVDESTCOLOR Inverse Destination Color
0B rwBLENDSRCALPHASAT Source Alpha Saturate

Note: The source factor for the subtractive mode requires a code injected in the EXE in-order to be customized with your own mixing modes on that section.

Address (EXE) Address (RAM) Original Bytes Replace With
31521 431521 CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC C7 82 A4 00 00 00 01 00 00 00 E9 45 FE FF FF
3136F 43136F 89 9A A4 00 00 00 E9 AD 01 00 00 90

The highlighted byte shown below is where the blend factor will be located once you have paste written the code at 0x31521 in this array:
C7 82 A4 00 00 00 01 00 00 00 E9 45 FE FF FF

EXE defined particle settings

See Sonic Heroes/EXE Editing for information about particle settings that are stored in the EXE.

Special Stage particle blend options

See Sonic Heroes/EXE Editing for information about blend options for the particles in special stages.

References


Sonic Community Hacking Guide
General
SonED2 Manual | Subroutine Equivalency List
Game-Specific
Sonic the Hedgehog (16-bit) | Sonic the Hedgehog (8-bit) | Sonic CD (prototype 510) | Sonic CD | Sonic CD (PC) | Sonic CD (2011) | Sonic 2 (Simon Wai prototype) | Sonic 2 (16-bit) | Sonic 2 (Master System) | Sonic 3 | Sonic 3 & Knuckles | Chaotix | Sonic Jam | Sonic Jam 6 | Sonic Adventure | Sonic Adventure DX: Director's Cut | Sonic Adventure DX: PC | Sonic Adventure (2010) | Sonic Adventure 2 | Sonic Adventure 2: Battle | Sonic Adventure 2 (PC) | Sonic Heroes | Sonic Riders | Sonic the Hedgehog (2006) | Sonic & Sega All-Stars Racing | Sonic Unleashed (Xbox 360/PS3) | Sonic Colours | Sonic Generations | Sonic Forces
Technical information
Sonic Eraser | Sonic 2 (Nick Arcade prototype) | Sonic CD (prototype; 1992-12-04) | Dr. Robotnik's Mean Bean Machine | Sonic Triple Trouble | Tails Adventures | Sonic Crackers | Sonic 3D: Flickies' Island | Sonic & Knuckles Collection | Sonic R | Sonic Shuffle | Sonic Advance | Sonic Advance 3 | Sonic Battle | Shadow the Hedgehog | Sonic Rush | Sonic Classic Collection | Sonic Free Riders | Sonic Lost World
Legacy Guides
The Nemesis Hacking Guides The Esrael Hacking Guides
ROM: Sonic 1 | Sonic 2 | Sonic 2 Beta | Sonic 3

Savestate: Sonic 1 | Sonic 2 Beta/Final | Sonic 3

Sonic 1 (English / Portuguese) | Sonic 2 Beta (English / Portuguese) | Sonic 2 and Knuckles (English / Portuguese)
Move to Sega Retro
Number Systems (or scrap) | Assembly Hacking Guide | 68000 Instruction Set | 68000 ASM-to-Hex Code Reference | SMPS Music Hacking Guide | Mega Drive technical information