Difference between revisions of "ELSC (File Format)"

From Retro Modding Wiki
Jump to: navigation, search
m (ELSC Keys)
(Properties)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{research|2|Parameter keys need reverse-engineering}}
+
{{research|1|Properties beyond MP1 need to be discovered and documented}}
The '''ELSC''' [[Effect Script|effect script]] format is used to build electric effects in the ''Metroid Prime'' series.
+
The '''ELSC''' [[Particle Script|particle script]] format is used to build electrical effects in the ''Metroid Prime'' series.
Electric effects are commonly used to dynamically-render lightning and electrical arcs.
+
Electrical effects are commonly used to dynamically draw lightning and electrical arcs.
  
== ELSC Keys ==
+
Whenever a new ''particle instance'' is generated, a [[wikipedia:Bézier curve|Bézier curve]] is subdivided into segments.
 +
The central vertices are then displaced using a [[wikipedia:Fractal|random fractal algorithm]].
 +
The instance's color and line-width is updated over its lifetime.
  
'''Scope''' is one of (''Constant'', ''System'')
+
== Properties ==
  
* ''Constant'' parameters are evaluated once initially and retained within the system.
+
Particle generator properties are assembled into a [[Particle Script|particle script]]
* ''System'' parameters are evaluated per-system, per-frame.
+
file tagged with <code>ELSM</code>. Any of the following properties are loaded into a
 +
''description'' class for constructing an arbitrary number of ''particle generators''.
  
 
{| class="wikitable"
 
{| class="wikitable"
!FourCC
+
! FourCC
!Scope
+
! Type
!Data Type
+
! Description
!Description
+
! Scope
!Notes
+
! Notes
 +
! MP1
 +
! MP2
 +
! MP3
 +
! DKCR
 +
! DKCTF
 
|-
 
|-
|<code>ZERY</code>
+
{{ParticlePropertyRow|LIFE|IntElement|Particle System Lifetime|System Init|Count of frames to emit new particle instances|{{check}}|{{nocheck}}|{{nocheck}}|{{nocheck}}|{{nocheck}}}}
|
+
{{ParticlePropertyRow|SLIF|IntElement|Segment Lifetime|Particle Creation|Count of frames for newly generated instance to last|{{check}}|{{nocheck}}|{{nocheck}}|{{nocheck}}|{{nocheck}}}}
|<code>bool</code>
+
{{ParticlePropertyRow|GRAT|RealElement|Generation Rate|System Update|Count of particles to generate per frame; remainder is accumulated across updates|{{check}}|{{nocheck}}|{{nocheck}}|{{nocheck}}|{{nocheck}}}}
|
+
{{ParticlePropertyRow|SCNT|IntElement|Instance Count|System Init|Maximum count of particle instances and child generators for system|{{check}}|{{nocheck}}|{{nocheck}}|{{nocheck}}|{{nocheck}}}}
|
+
{{ParticlePropertyRow|SSEG|IntElement|Segment Count|System Init|Maximum count of line segments per instance|{{check}}|{{nocheck}}|{{nocheck}}|{{nocheck}}|{{nocheck}}}}
|-
+
{{ParticlePropertyRow|COLR|ColorElement|Swoosh Color|Particle Creation and Update|Modulation color evaluated for swoosh-based instances|{{check}}|{{nocheck}}|{{nocheck}}|{{nocheck}}|{{nocheck}}}}
|<code>EPSM</code>
+
{{ParticlePropertyRow|IEMT|EmitterElement|Initial Emitter|Particle Creation|Position source for instance start-point; Velocity is used to form Bézier points to curve instance|{{check}}|{{nocheck}}|{{nocheck}}|{{nocheck}}|{{nocheck}}}}
|
+
{{ParticlePropertyRow|FEMT|EmitterElement|Final Emitter|Particle Creation|Position source for instance end-point; Velocity is used to form Bézier points to curve instance|{{check}}|{{nocheck}}|{{nocheck}}|{{nocheck}}|{{nocheck}}}}
|<code>int</code> ([[PART (File Format)|PART]] ref)
+
{{ParticlePropertyRow|AMPL|RealElement|Length Amplitude|Particle Creation|Randomized coefficient of fractal displacement as product of recursive segment length|{{check}}|{{nocheck}}|{{nocheck}}|{{nocheck}}|{{nocheck}}}}
|
+
{{ParticlePropertyRow|AMPD|RealElement|Direct Amplitude|Particle Creation|Separately randomized coefficient of fractal displacement|{{check}}|{{nocheck}}|{{nocheck}}|{{nocheck}}|{{nocheck}}}}
|
+
{{ParticlePropertyRow|LWD1|RealElement|Line Width 1|Particle Creation and Update|Enables line 1 (overdrawn with same verts) and specifies its width in 480p pixels|{{check}}|{{nocheck}}|{{nocheck}}|{{nocheck}}|{{nocheck}}}}
|-
+
{{ParticlePropertyRow|LWD2|RealElement|Line Width 2|Particle Creation and Update|Enables line 2 (overdrawn with same verts) and specifies its width in 480p pixels|{{check}}|{{nocheck}}|{{nocheck}}|{{nocheck}}|{{nocheck}}}}
|<code>LCLn</code>
+
{{ParticlePropertyRow|LWD3|RealElement|Line Width 3|Particle Creation and Update|Enables line 3 (overdrawn with same verts) and specifies its width in 480p pixels|{{check}}|{{nocheck}}|{{nocheck}}|{{nocheck}}|{{nocheck}}}}
|
+
{{ParticlePropertyRow|LCL1|ColorElement|Line Color 1|Particle Creation and Update|Specifies line 1's color|{{check}}|{{nocheck}}|{{nocheck}}|{{nocheck}}|{{nocheck}}}}
|<code>float4</code>
+
{{ParticlePropertyRow|LCL2|ColorElement|Line Color 1|Particle Creation and Update|Specifies line 2's color|{{check}}|{{nocheck}}|{{nocheck}}|{{nocheck}}|{{nocheck}}}}
|Something n:[1-3]
+
{{ParticlePropertyRow|LCL3|ColorElement|Line Color 1|Particle Creation and Update|Specifies line 3's color|{{check}}|{{nocheck}}|{{nocheck}}|{{nocheck}}|{{nocheck}}}}
|
+
{{ParticlePropertyRow|SSWH|[[SWHC (File Format)|SWHC]]|Child Swoosh|System Init|Use swoosh system to draw effect; computed fractal points are set into swoosh's history; Omitting LWD* properties will only draw the swoosh|{{check}}|{{nocheck}}|{{nocheck}}|{{nocheck}}|{{nocheck}}}}
|-
+
{{ParticlePropertyRow|GPSM|[[PART (File Format)|PART]]|Start Child Particle|System Init|Draw particle system positioned at instance's start-point|{{check}}|{{nocheck}}|{{nocheck}}|{{nocheck}}|{{nocheck}}}}
|<code>LWDn</code>
+
{{ParticlePropertyRow|EPSM|[[PART (File Format)|PART]]|End Child Particle|System Init|Draw particle system positioned at instance's end-point|{{check}}|{{nocheck}}|{{nocheck}}|{{nocheck}}|{{nocheck}}}}
|
+
{{ParticlePropertyRow|ZERY|bool|Zero Y|Particle Creation|Zero Y component of newly created particle vertices|{{check}}|{{nocheck}}|{{nocheck}}|{{nocheck}}|{{nocheck}}}}
|<code>float</code>
+
|}
|Something n:[1-3]
+
|
+
|-
+
|<code>GPSM</code>
+
|
+
|<code>int</code> ([[PART (File Format)|PART]] ref)
+
|
+
|
+
|-
+
|<code>SSWH</code>
+
|
+
|<code>int</code> ([[SWHC (File Format)|SWHC]] ref)
+
|
+
|
+
|-
+
|<code>AMPD</code>
+
|
+
|<code>float</code>
+
|
+
|
+
|-
+
|<code>AMPL</code>
+
|
+
|<code>float</code>
+
|
+
|
+
|-
+
|<code>FEMT</code>
+
|
+
|<code>SEMR</code>, <code>SPHE</code>
+
|
+
|
+
|-
+
|<code>IEMT</code>
+
|
+
|<code>SEMR</code>, <code>SPHE</code>
+
|
+
|
+
|-
+
|<code>COLR</code>
+
|
+
|<code>float4</code>
+
|
+
|
+
|-
+
|<code>SSEG</code>
+
|
+
|<code>int</code>
+
|
+
|
+
|-
+
|<code>SCNT</code>
+
|
+
|<code>int</code>
+
|
+
|
+
|-
+
|<code>GRAT</code>
+
|
+
|<code>float</code>
+
|
+
|
+
|-
+
|<code>SLIF</code>
+
|
+
|<code>int</code>
+
|
+
|
+
|-
+
|<code>LIFE</code>
+
|
+
|<code>int</code>
+
|
+
|
+
  
 
[[Category:File Formats]]
 
[[Category:File Formats]]

Latest revision as of 00:08, 11 June 2017

Morphball render.png This file format is almost completely documented
Properties beyond MP1 need to be discovered and documented

The ELSC particle script format is used to build electrical effects in the Metroid Prime series. Electrical effects are commonly used to dynamically draw lightning and electrical arcs.

Whenever a new particle instance is generated, a Bézier curve is subdivided into segments. The central vertices are then displaced using a random fractal algorithm. The instance's color and line-width is updated over its lifetime.

Properties

Particle generator properties are assembled into a particle script file tagged with ELSM. Any of the following properties are loaded into a description class for constructing an arbitrary number of particle generators.

FourCC Type Description Scope Notes MP1 MP2 MP3 DKCR DKCTF
LIFE IntElement Particle System Lifetime System Init Count of frames to emit new particle instances
SLIF IntElement Segment Lifetime Particle Creation Count of frames for newly generated instance to last
GRAT RealElement Generation Rate System Update Count of particles to generate per frame; remainder is accumulated across updates
SCNT IntElement Instance Count System Init Maximum count of particle instances and child generators for system
SSEG IntElement Segment Count System Init Maximum count of line segments per instance
COLR ColorElement Swoosh Color Particle Creation and Update Modulation color evaluated for swoosh-based instances
IEMT EmitterElement Initial Emitter Particle Creation Position source for instance start-point; Velocity is used to form Bézier points to curve instance
FEMT EmitterElement Final Emitter Particle Creation Position source for instance end-point; Velocity is used to form Bézier points to curve instance
AMPL RealElement Length Amplitude Particle Creation Randomized coefficient of fractal displacement as product of recursive segment length
AMPD RealElement Direct Amplitude Particle Creation Separately randomized coefficient of fractal displacement
LWD1 RealElement Line Width 1 Particle Creation and Update Enables line 1 (overdrawn with same verts) and specifies its width in 480p pixels
LWD2 RealElement Line Width 2 Particle Creation and Update Enables line 2 (overdrawn with same verts) and specifies its width in 480p pixels
LWD3 RealElement Line Width 3 Particle Creation and Update Enables line 3 (overdrawn with same verts) and specifies its width in 480p pixels
LCL1 ColorElement Line Color 1 Particle Creation and Update Specifies line 1's color
LCL2 ColorElement Line Color 1 Particle Creation and Update Specifies line 2's color
LCL3 ColorElement Line Color 1 Particle Creation and Update Specifies line 3's color
SSWH SWHC Child Swoosh System Init Use swoosh system to draw effect; computed fractal points are set into swoosh's history; Omitting LWD* properties will only draw the swoosh
GPSM PART Start Child Particle System Init Draw particle system positioned at instance's start-point
EPSM PART End Child Particle System Init Draw particle system positioned at instance's end-point
ZERY bool Zero Y Particle Creation Zero Y component of newly created particle vertices