OBD talk:BINA/PAR3: Difference between revisions

From OniGalore
Jump to navigation Jump to search
m (WP section link fix, various tweaks to other WP links)
 
(35 intermediate revisions by 4 users not shown)
Line 1: Line 1:
__TOC__
=talk=
To value types:
To value types:


What the both values of the normal distribution stand for?
What the both values of the normal distribution stand for?


First value μ (mean) and second value σ (standard deviation)?
First value µ (mean) and second value σ (standard deviation)?


[[User:Ssg|Ssg]] 23:13, 5 December 2007 (CET)
[[User:Ssg|Ssg]] 23:13, 5 December 2007 (CET)
Line 16: Line 13:
Thanks for your answer.
Thanks for your answer.


I've googled  a (long) bit for that "InverseNormalTable". It seems to be okay. This table is also called "inverse standardized normal distribution" (see http://files.hanser.de/hanser/docs/20040419_24419112747-75_3-446-21594-8Anhang2.pdf)
I've googled  a (long) bit for that "InverseNormalTable". It seems to be okay. This table is also called "inverse standardized normal distribution" (see http://web.archive.org/web/20151010142712/http://files.hanser.de/hanser/docs/20040419_24419112747-75_3-446-21594-8Anhang2.pdf)


The equation for the inverse normal distribution is: x = σ * z + μ
The equation for the inverse normal distribution is: x = σ * z + µ


with:
with:
Line 24: Line 21:
:x = result
:x = result
:z = looked up in the z-table (the z-table here is the InverseNormalTable)
:z = looked up in the z-table (the z-table here is the InverseNormalTable)
:μ = mean
:µ = mean
:σ = standard deviation
:σ = standard deviation


Line 84: Line 81:


[[User:Neo|Neo]]
[[User:Neo|Neo]]
:The term "inverse normal" is apparently not conventional, and also rather confusing because it can be mistaken as referring to either the [[wikipedia:Normal-inverse_Gaussian_distribution|normal-inverse Gaussian distribution]] or the [[wikipedia:Inverse_Gaussian_distribution|inverse Gaussian distribution]], both of which are rather exotic and irrelevant here.
:The term "inverse normal" is apparently not conventional, and also rather confusing because it can be mistaken as referring to either the [[wp:Normal-inverse Gaussian distribution|normal-inverse Gaussian distribution]] or the [[wp:Inverse Gaussian distribution|inverse Gaussian distribution]], both of which are rather exotic and irrelevant here.
:What we have here is the inverse of the [[wikipedia:Error_function|error function]] or rather that of [[wikipedia:Normal_distribution#Standard_deviation_and_confidence_intervals|erfc(x/sqrt(2))]]. If you have Java installed, [http://onlinestatbook.com/analysis_lab/inverse_normal_dist.html HERE] is a nice applet that you can toy around with to see just what the table in your PDF link corresponds to.
:What we have here is the inverse of the [[wp:Error function|error function]] or rather that of [[wp:Normal distribution#Standard deviation and coverage|erfc(x/sqrt(2))]]. If you have Java installed, [https://onlinestatbook.com/analysis_lab/inverse_normal_dist.html HERE] is a nice applet that you can toy around with to see just what the table in your PDF link corresponds to.
:As further pointed out [[wikipedia:Normal_distribution#Generating_values_for_normal_random_variables|HERE]], inverting the [[wikipedia:Normal_distribution#Cumulative_distribution_function|standard normal cdf]] gives you a way to generate ''normally'' distributed random variables from a ''uniformly'' distributed random variable, which is exactly what Oni does (see Neo's code sample above).
:As further pointed out [[wp:Normal distribution#Generating values from normal distribution|HERE]], inverting the [[wp:Normal distribution#Cumulative distribution function|standard normal cdf]] gives you a way to generate ''normally'' distributed random variables from a ''uniformly'' distributed random variable, which is exactly what Oni does (see Neo's code sample above).
:The float r is a ''uniformly'' distributed random variable in (-1.0,1.0) (@ Neo: please check). Same for x except the interval is now [0.0,10.0). z is a first approximation of erfc(0.0998 * x / sqrt(2)), interpolated linearly between erfc(0.0998 * floorf(x) / sqrt(2)) and erfc(0.0998 * (floorf(x) + 1) / sqrt(2)). The table is thus sampled uniformly.
:The float r is a ''uniformly'' distributed random variable in (-1.0,1.0) (@ Neo: please check). Same for x except the interval is now [0.0,10.0). z is a first approximation of erfc(0.0998 * x / sqrt(2)), interpolated linearly between erfc(0.0998 * floorf(x) / sqrt(2)) and erfc(0.0998 * (floorf(x) + 1) / sqrt(2)). The table is thus sampled uniformly.
:The result ( v1 + z * v2 ) is, to a good approximation, a ''normally'' distributed random variable, centered at v1 and with standard mean deviation v2. Apart from the approximation arising from the linear interpolation, the distribution is cut off at 99.8% of expectancy, so all the values will be within 3.09023*v2 of v1.
:The result ( v1 + z * v2 ) is, to a good approximation, a ''normally'' distributed random variable, centered at v1 and with standard mean deviation v2. Apart from the approximation arising from the linear interpolation, the distribution is cut off at 99.8% of expectancy, so all the values will be within 3.09023*v2 of v1.
::[[User:Geyser|geyser]] 03:12, 7 December 2007 (CET)
::[[User:Geyser|geyser]] 03:12, 7 December 2007 (CET)


Boy, what a ton of interest this little function generates :). The interval for r is [-0.999, 0.999] to be precise (it originates as [-1, 1] and it is multiplied with 0.999). And yes, it is supposed to be distributed uniformly. Here is the (pseudo)random number generator: [[wikipedia:Linear_congruential_generator|linear congruential generator]], the one from Numerical Recipes.
Boy, what a ton of interest this little function generates :). The interval for r is [-0.999, 0.999] to be precise (it originates as [-1, 1] and it is multiplied with 0.999). And yes, it is supposed to be distributed uniformly. Here is the (pseudo)random number generator: [[wp:Linear congruential generator|linear congruential generator]], the one from Numerical Recipes.




Line 211: Line 208:
:::That is how I learn particles, too. ^_^ [[User:Gumby|Gumby]] 17:20, 22 May 2009 (UTC)
:::That is how I learn particles, too. ^_^ [[User:Gumby|Gumby]] 17:20, 22 May 2009 (UTC)


 
{{OBD}}
=XML section=
 
==file structure==
<?xml version="1.0" encoding="utf-8"?>
<Oni Version="0.9.30.0">
    <Particle Name="''particle_file_name''">
        <Options>
            <Lifetime></Lifetime>
            <DisableDetailLevel>[... see '''[[#options|HERE]]''' for a possible flag]</DisableDetailLevel>
            <Decorative></Decorative>
            [...]
        </Options>
        <Properties>
            [...]
        </Properties>
        <Appearance>
            <DisplayType>[... see '''[[#appearance|HERE]]''' for a possible flag]</DisplayType>
            [...]
        </Appearance>
        <Attractor>
            <Target>[... see '''[[#attractor|HERE]]''' for a possible flag]</Target>
            <Selector>[... see '''[[#attractor|HERE]]''' for a possible flag]</Selector>
            <Class />
            [...]
        </Attractor>
        '''[[#variable storage types|<Variables>]]'''
            [...]
        </Variables>
        <Emitters>
            <Emitter>
                [... see '''[[#emitter|HERE]]''' for emitter data]
            </Emitter>
        </Emitters>
        <Events>
            [... see '''[[#event types|HERE]]''' for '''''<event_type_tag>''''']
[... see '''[[#action types: ID and parameter|HERE]]''' for '''<action_type_tag>''']
                    [... see '''[[#action types: ID and parameter|HERE]]''' for '''''<parameter_tag>[[#parameter value types|value]]</parameter_tag>''''']
''<action_type_tag>''
            ''</event_type_tag>''
        </Events>
    </Particle>
</Oni>
 
 
==options==
{{table}}
!XML tag
!description
!value type / flags plus description
|-
|valign=top|<Lifetime>
|width=50%|particle exist for X seconds; X is float value, so you could write 1.25 if a second is to less and 2 too many; 0 means forever
|float: seconds
|-
|valign=top|<DisableDetailLevel>
|Particle is not created if detail level is too low.
|
: Never
: Medium
: Low
|-
|valign=top|<Decorative>
|Might be a relic from MP days where only essential particles were synced. Otherwise, not sure.
|Yes\No
|-
|valign=top|<CollideWithWalls>
|Needed if the particle uses the HitWall event type.
|Yes\No
|-
|valign=top|<CollideWithChars>
|Needed if the particle uses the HitCharacter event type.
|Yes\No
|-
|valign=top|<InitiallyHidden>
|Hides the particle on creation.
|Yes\No
|-
|valign=top|<DrawAsSky>
|
|
|-
|valign=top|<DontAttractThroughWalls>
|Particle will not detect attracters if there is a wall between it and the potential attracter.
|Yes\No
|-
|valign=top|<ExpireOnCutscene>
|Ends the lifetime of a particle on cutscene start.
|Yes\No
|-
|valign=top|<DieOnCutscene>
|Kills the particle on cutscene start.
|Yes\No
|-
|valign=top|<LockPositionToLink>
|Locks the position of the particle to its link
|Yes\No
|-
|valign=top|<CollisionRadius>
|Distance from which HitWall and HitCharacter events are activated
|float: distance
|-
|valign=top|<AIDodgeRadius>
|Distance from which AI will avoid this particle
|float: distance
|-
|valign=top|<AIAlertRadius>
|Distance from which AI will be aware of the danger of the particle
|float: distance
|-
|valign=top|<FlyBySoundName />
|Sound used when the particle passes by you. Check: does the engine apply the Doppler effect or is it in the sound file itself?
|SNDD sound name?
|}
 
==properties==
{{table}}
!XML tag
!description
!value type / flags plus description
|-
|valign=top|<HasVelocity>
|
|
|-
|valign=top|<HasOrientation>
|
|
|-
|valign=top|<HasPositionOffset>
|
|
|-
|valign=top|<HasAttachmentMatrix>
|
|
|-
|valign=top|<HasUnknown>
|
|
|-
|valign=top|<HasDecalState>
|
|
|-
|valign=top|<HasTextureStartTick>
|
|
|-
|valign=top|<HasTextureTick>
|
|
|-
|valign=top|<HasDamageOwner>
|
|
|}
 
 
==appearance==
{{table}}
!XML tag
!description
!value type / flags plus description
|-
|valign=top|<DisplayType>
|
|
: Sprite
: RotatedSprite
: Beam
: Arrow
: Flat
: OrientedContrail
: Discuss
: Decal
: Geometry
|-
|valign=top|<TexGeom>
|
|
|-
|valign=top|<Invisible>
|
|
|-
|valign=top|<IsContrailEmitter>
|
|
|-
|valign=top|<ScaleToVelocity>
|
|
|-
|valign=top|<Scale>
|
|
|-
|valign=top|<UseSeparateYScale>
|
|
|-
|valign=top|<YScale>
|needs <UseSeparateYScale>true</UseSeparateYScale> to be enabled
|
|-
|valign=top|<Rotation>
|
|
|-
|valign=top|<Alpha>
|transparency
|
|-
|valign=top|<XOffset>
|
|
|-
|valign=top|<XShorten>
|
|
|-
|valign=top|<Tint>
|R G B A means red green blue alpha
|
|-
|valign=top|<FadeOutOnEdge>
|
|
|-
|valign=top|<OneSidedEdgeFade>
|
|
|-
|valign=top|<EdgeFadeMin>
|
|
|-
|valign=top|<EdgeFadeMax>
|
|
|-
|valign=top|<MaxContrailDistance>
|
|
|-
|valign=top|<LensFlare>
|
|
|-
|valign=top|<LensFlareDistance>
|
|
|-
|valign=top|<LensFlareFadeInFrames>
|
|
|-
|valign=top|<LensFlareFadeOutFrames>
|
|
|-
|valign=top|<DecalFullBrightness>
|
|
|-
|valign=top|<MaxDecals>
|
|
|-
|valign=top|<DecalFadeFrames>
|
|
|-
|valign=top|<DecalWrapAngle>
|
|
|}
 
 
==attractor==
{{table}}
!XML tag
!description
!value type / flags plus description
|-
|valign=top|<Target>
|
|
: None
: Link
: Class
: Tag
: Characters
: Hostiles
: EmittedTowards
: ParentAttractor
: AllCharacters
|-
|valign=top|<Selector>
|
|
: Distance
: Angle
|-
|valign=top|<Class />
|Used when target is "class", right?
|
|-
|valign=top|<MaxDistance>
|
|
|-
|valign=top|<MaxAngle>
|
|
|-
|valign=top|<AngleSelectMin>
|
|
|-
|valign=top|<AngleSelectMax>
|
|
|-
|valign=top|<AngleSelectWeight>
|
|
|}
 
 
==variable storage types==
{{table}}
!XML tag
!description
!value type / flags plus description
|-
|<Float Name="''variable''">''float_value''</Float>
|
|
|-
|<Color Name="''variable''">''R G B''</Color>
|
|
|-
|<PingPongState Name="''variable''">''?''</PingPongState>
|
|? = zero / one ?
|}
 
 
==parameter value types==
Grey is additional for variable section.
{{table}}
|
0 - variable; variable name follows
|
<font color="#777777"><Float Name="''variable''"></font>''variable''<font color="#777777"></Float></font>
|-
|
1 - none (action parameters use this to indicate an unused parameter)
|
?
|-
|
3 - float; constant; 1 float value follows
 
4 - float; random; 2 float values follow (min, max)
 
5 - float; bell curve; 2 float values follow (mean, stddev)
|
<font color="#777777"><Float Name="''variable''"></font>''float_value''<font color="#777777"></Float></font>
 
<font color="#777777"><Float Name="''variable''"></font><Random Min="''float_value''" Max="''float_value''" /><font color="#777777"></Float></font>
 
<font color="#777777"><Float Name="''variable''"></font><BellCurve Mean="''float_value''" StdDev="''float_value''" /><font color="#777777"></Float></font>
|-
|
6 - instance; instance name follows
|
?
|-
|
7 - color; constant; 1 color follows
 
8 - color; random; 2 color follow (min, max)
 
9 - color; bell curve; 2 color follow (mean, stddev)
|
<font color="#777777"><Color Name="''variable''"></font>''R G B''<font color="#777777"></Color></font>
 
<font color="#777777"><Color Name="''variable''"></font><Random Min="''R G B''" Max="''R G B''" /><font color="#777777"></Color></font>
 
<font color="#777777"><Color Name="''variable''"></font><BellCurve Mean="? ? ? ?" StdDev="? ? ? ?" /><font color="#777777"></Color></font>
|-
|
0A - int32; constant; int32 follows
|
?
|-
|
0B - time cycle; 2 float values follow (cycle length, scale)
|
<TimeCycle Length="..." Scale="..." />
|}
 
 
==emitter==
{{table}}
!XML tag
!description
!value type / flags plus description
|-
|<Class>
|valign=top|particle file name without prefix (BINA3RAP) and without suffix (.oni)
|
|-
|valign=top|<Flags>
|
|
: InitiallyOn
: IncreaseParticleCount
: TurnOffAtTreshold
: EmitWithParentVelocity
: Unknown0020
: OrientToVelocity
: InheritTint
: OnePerAttractor
: AtLeastOne
: CycleAttractors
|-
|valign=top|<TurnOffTreshold>
|
Tag contains the number (threshold) of particle which must be reached before emitter becomes turned off. Threshold needs two flags to be set: IncreaseParticleCount and TurnOffAtTreshold.
|
|-
|valign=top|<Probability>
|
Let's say threshold was set to 10 and probability to 0.5 then you might get 5 particle emitted, sometimes less, sometime more, it's an average. (threshold * probability = emitted particle)
|
|-
|valign=top|<Copies>
|
It's actually a multiplier, set it to 0 and no particle will be emitted. Copies doesn't effects the treshold counting. The copies become emitted at the same place as the original particle so you might not see any difference (because they overlay each other) until they have a random movement.
|
|-
|valign=top|<LinkTo>
|
|
: this
: 0
: 1
: 2
: 3
: 4
: 5
: 6
: 7
: link
|-
|valign=top|<Rate>...</Rate>
|valign=top|Interval in seconds.
|
... can be:
 
<Continous>
    <Interval></Interval>
</Continous>
----
<Random>
    <MinInterval></MinInterval>
    <MaxInterval></MaxInterval>
</Random>
----
<Instant />
----
<Distance>
    <Distance></Distance>
</Distance>
----
  <Attractor>
    <RechargeTime></RechargeTime>
    <CheckInterval></CheckInterval>
  </Attractor>
|-
|valign=top|<Position>...</Position>
|
|
... can be:
 
<Point />
----
<Line>
    <Radius></Radius>
</Line>
----
<Circle>
    <InnerRadius></InnerRadius>
    <OuterRadius></OuterRadius>
</Circle>
----
<Sphere>
    <InnerRadius></InnerRadius>
    <OuterRadius></OuterRadius>
</Sphere>
----
cylinder needs to be tested again
<Cylinder>
    <Height></Height>
    <InnerRadius></InnerRadius>
    <OuterRadius></OuterRadius>
<Cylinder>
----
<BodySurface>
    <OffsetRadius></OffsetRadius>
</BodySurface>
----
<BodyBones>
    <OffsetRadius></OffsetRadius>
</BodyBones>
|-
|valign=top|<Direction>...</Direction>
|
|
... can be:
 
<Straight />
----
<Random />
----
<Cone>
    <Angle></Angle>
    <CenterBias></CenterBias>
</Cone>
----
<Ring>
    <Angle></Angle>
    <Offset></Offset>
</Ring>
----
<Offset>
    <X></X>
    <Y></Y>
    <Z></Z>
</Offset>
----
<Inaccurate>
    <BaseAngle></BaseAngle>
    <Inaccuracy></Inaccuracy>
    <CenterBias></CenterBias>
</Inaccurate>
----
<Attractor />
|-
|valign=top|<Speed>...</Speed>
|
|
... can be:
 
<Uniform>
    <Speed></Speed>
</Uniform>
----
<Stratified>
    <Speed1></Speed1>
    <Speed2></Speed2>
</Stratified>
|-
|valign=top|<Orientation>...</Orientation>
|
|
... can be:
 
: LocalPosX
: LocalNegX
: LocalPosY
: LocalNegY
: LocalPosZ
: LocalNegZ
: WorldPosX
: WorldNegX
: WorldPosY
: WorldNegY
: WorldPosZ
: WorldNegZ
: Velocity
: ReverseVelocity
: TowardsEmitter
: AwayFromEmitter
|-
|valign=top|<OrientationUp>...</OrientationUp>
|
|
... can be:
 
: LocalPosX
: LocalNegX
: LocalPosY
: LocalNegY
: LocalPosZ
: LocalNegZ
: WorldPosX
: WorldNegX
: WorldPosY
: WorldNegY
: WorldPosZ
: WorldNegZ
: Velocity
: ReverseVelocity
: TowardsEmitter
: AwayFromEmitter
|}
 
 
==event types==
: Update
: Pulse
: Start
: Stop
: BackgroundFxStart
: BackgroundFxStop
: HitWall
: HitCharacter
: Lifetime
: Explode
: BrokenLink
: Create
: Die
: NewAttractor
: DelayStart
: DelayStop
 
 
{|BORDER=1 CELLSPACING=0 CELLPADDING=2 STYLE="border-style:solid; border-collapse:collapse; empty-cells:show; background-color:#f9f9f9;" WIDTH=100% ALIGN=center
|width=50%|
'''schemata 1'''
|
'''example 1'''
|-
|
            <''Event''>
                <''action_ID_tag_'''without_parameter''''' />
            </''Event''>
|
            <HitWall>
                <Die />
            </HitWall>
|-
|
'''schemata 2'''
|
'''example 2'''
|-
|valign=top|
            <''Event''>
                <''action_ID_tag_'''with_parameter'''''>
                    <''parameter_tag''>''value_or_variable''</parameter_tag>
                </''action_ID_tag_'''with_parameter'''''>
            </''Event''>
|
            <Update>
                <SuperParticle>
                    <Variable>emit_rate</Variable>
                    <VaseValue>0.25</VaseValue>
                    <DeltaValue>-0.1</DeltaValue>
                    <MinValue>0.1</MinValue>
                    <MaxValue>20</MaxValue>
                </SuperParticle>
            </Update>
|}
 
 
==action types: ID and parameter==
 
'''action ID old description|parameter XML action tag XML parameter tag'''
-------------------------------------------------------------------------------------------------------------
0 Linear Change <AnimateLinear>
float var <Target></Target>
float rate <Rate></Rate>
</AnimateLinear>
-------------------------------------------------------------------------------------------------------------
1 Acceler. Change <AnimateAccelerated>
float var <Target></Target>
float anim_vel <Velocity></Velocity>
float accel <Acceleration></Acceleration>
</AnimateAccelerated>
-------------------------------------------------------------------------------------------------------------
2 Random Change <AnimateRandom>
float var <Target></Target>
float min <Min></Min>
float max <Max></Max>
float rate <Rate></Rate>
</AnimateRandom>
-------------------------------------------------------------------------------------------------------------
3 Pingpong Change <AnimatePingPong>
float var <Target></Target>
pingpong_state pingpong <State></State>
float min <Min></Min>
float max <Max></Max>
float rate <Rate></Rate>
</AnimatePingPong>
-------------------------------------------------------------------------------------------------------------
4 Looping Change <AnimateLoop>
float var <Target></Target>
float min <Min></Min>
float max <Max></Max>
float rate <Rate></Rate>
</AnimateLoop>
-------------------------------------------------------------------------------------------------------------
5 Change To Value <AnimateToValue>
float var <Target></Target>
float rate <Rate></Rate>
float endpoint <Value></Value>
</AnimateToValue>
-------------------------------------------------------------------------------------------------------------
6 Color Blend <ColorInterpolate>
color var <Target></Target>
color color_0 <Color0></Color0>
color color_1 <Color1></Color1>
float blendval <Amount></Amount>
</ColorInterpolate>
-------------------------------------------------------------------------------------------------------------
7 -
-------------------------------------------------------------------------------------------------------------
8 Fade Out '''<font color="#0000FF" title="particle becomes killed after X seconds, it fades out during that time"><FadeOut></font>'''
float time_to_die <TimeToDie>''X''</TimeToDie>
</FadeOut>
-------------------------------------------------------------------------------------------------------------
9 Enable Action '''<font color="#0000FF" title="has action X as target in Update event section"><EnableAtTime></font>'''
action_index action <Action>''X''</Action>
float lifetime '''<font color="#999999" title="appears to be useless"><Lifetime></Lifetime></font>'''
</EnableAtTime>
-------------------------------------------------------------------------------------------------------------
10 Disable Action '''<font color="#0000FF" title="has action X as target in Update event section"><DisableAtTime></font>'''
action_index action <Action>''X''</Action>
float lifetime '''<font color="#999999" title="appears to be useless"><Lifetime></Lifetime></font>'''
</DisableAtTime>
-------------------------------------------------------------------------------------------------------------
11 Die '''<font color="#0000FF" title="particle becomes killed now"><Die /></font>'''
-------------------------------------------------------------------------------------------------------------
12 Set Lifetime '''<font color="#0000FF" title="particle becomes killed after X seconds"><SetLifetime></font>'''
float time <Time>''X''</Time>
</SetLifetime>
-------------------------------------------------------------------------------------------------------------
13 Enable Emitter '''<font color="#0000FF" title="starts emitter X"><EmitActivate></font>'''
emitter emitter_num <Emitter>''X''</Emitter>
</EmitActivate>
-------------------------------------------------------------------------------------------------------------
14 Disable Emitter '''<font color="#0000FF" title="stops emitter X"><EmitDeactivate></font>'''
emitter emitter_num <Emitter>''X''</Emitter>
</EmitDeactivate>
-------------------------------------------------------------------------------------------------------------
15 Emit Particles '''<font color="#0000FF" title="starts emitter X, Y particle becomes emitted"><EmitParticles></font>'''
emitter emitter_num <Emitter>''X''</Emitter>
float particles <Particles>''Y''</Particles>
</EmitParticles>
-------------------------------------------------------------------------------------------------------------
16 Change Class <ChangeClass>
emitter emitter_num <Emitter></Emitter>
</ChangeClass>
-------------------------------------------------------------------------------------------------------------
17 KillLastEmitted <KillLastEmitted>
emitter emitter_num <Emitter></Emitter>
</KillLastEmitted>
-------------------------------------------------------------------------------------------------------------
18 ExplodeLastEmit <ExplodeLastEmitted>
emitter emitter_num <Emitter></Emitter>
</ExplodeLastEmitted>
-------------------------------------------------------------------------------------------------------------
19 -
-------------------------------------------------------------------------------------------------------------
20 Start Amb Sound <AmbientSound>
string sound <Sound></Sound>
</AmbientSound>
-------------------------------------------------------------------------------------------------------------
21 End Amb Sound <EndAmbientSound />
-------------------------------------------------------------------------------------------------------------
22 -
-------------------------------------------------------------------------------------------------------------
23 Impulse Sound <ImpulseSound>
string sound <Sound></Sound>
</ImpulseSound>
-------------------------------------------------------------------------------------------------------------
24 -
-------------------------------------------------------------------------------------------------------------
25 -
-------------------------------------------------------------------------------------------------------------
26 Damage Char <DamageChar>
float damage <Damage></Damage>
float stun_damage <StunDamage></StunDamage>
float knockback <KnockBack></KnockBack>
damage_type damage_type '''<font color="#0000FF" title="0 - normal; 1 - minor stun; 2 - major stun; 3 - minor knockdown; 4 - major knockdown; 5 - blownup; 6 - pickup"><DamageType></DamageType></font>'''
boolean self_immune <SelfImmune></SelfImmune>
boolean can_hit_mult '''<font color="#0000FF" title="tag is missing when value is 0"><CanHitMultiple></CanHitMultiple></font>'''
</DamageChar>
-------------------------------------------------------------------------------------------------------------
27 Blast Damage <DamageBlast>
float damage <Damage></Damage>
float stun_damage <StunDamage></StunDamage>
float knockback <KnockBack></KnockBack>
float radius <Radius></Radius>
blast_falloff falloff <FallOff></FallOff>
damage_type damage_type '''<font color="#0000FF" title="0 - normal; 1 - minor stun; 2 - major stun; 3 - minor knockdown; 4 - major knockdown; 5 - blownup; 6 - pickup"><DamageType></DamageType></font>'''
boolean self_immune <SelfImmune></SelfImmune>
boolean damage_environ '''<font color="#DD0000">(Was not listed in extracted file. Missing?)</font>'''
</DamageBlast>
-------------------------------------------------------------------------------------------------------------
28 Explode '''<font color="#0000FF" title="this action triggers Explode event"><Explode /></font>'''
-------------------------------------------------------------------------------------------------------------
29 Damage Environ. <DamageEnvironment>
float damage <Damage></Damage>
</DamageEnvironment>
-------------------------------------------------------------------------------------------------------------
30 Glass Charge <GlassCharge>
float blast-vel <BlastVelocity></BlastVelocity>
                float radius <Radius></Radius>
</GlassCharge>
-------------------------------------------------------------------------------------------------------------
31 Stop '''<font color="#0000FF" title="calls Stop event"><Stop /></font>'''
-------------------------------------------------------------------------------------------------------------
32 -
-------------------------------------------------------------------------------------------------------------
33 Rotate X <RotateX>
coord_frame space <Space></Space>
float rate <Rate></Rate>
boolean rotate_velocity <RotateVelocity></RotateVelocity>
</RotateX>
-------------------------------------------------------------------------------------------------------------
34 Rotate Y <RotateY>
coord_frame space <Space></Space>
float rate <Rate></Rate>
boolean rotate_velocity <RotateVelocity></RotateVelocity>
</RotateY>
-------------------------------------------------------------------------------------------------------------
35 Rotate Z <RotateZ>
coord_frame space <Space></Space>
float rate <Rate></Rate>
boolean rotate_velocity <RotateVelocity></RotateVelocity>
</RotateZ>
-------------------------------------------------------------------------------------------------------------
36 -
-------------------------------------------------------------------------------------------------------------
37 Find Attractor <FindAttractor>
float delaytime <DelayTime></DelayTime>
</FindAttractor>
-------------------------------------------------------------------------------------------------------------
38 Attract Gravity <AttractGravity>
float gravity <Gravity></Gravity>
float max_g <MaxG></MaxG>
boolean horiz_only <HorizontalOnly></HorizontalOnly>
</AttractGravity>
-------------------------------------------------------------------------------------------------------------
39 Attract Homing <AttractHoming>
float turn_speed <TurnSpeed></TurnSpeed>
boolean predict_pos <PredictPosition></PredictPosition>
boolean horiz_only <HorizontalOnly></HorizontalOnly>
</AttractHoming>
-------------------------------------------------------------------------------------------------------------
40 Attract Spring <AttractSpring>
float accel_rate <AccelRate></AccelRate>
float max_accel <MaxAccel></MaxAccel>
float desired_dist <DesiredDistance></DesiredDistance>
</AttractSpring>
-------------------------------------------------------------------------------------------------------------
47 Apply Velocity <MoveLine />
-------------------------------------------------------------------------------------------------------------
48 Apply Gravity <MoveGravity>
float fraction <Fraction></Fraction>
</MoveGravity>
-------------------------------------------------------------------------------------------------------------
49 Spiral <MoveSpiral>
float theta <Theta></Theta>
float radius <Radius></Radius>
float rotate_speed <RotateSpeed></RotateSpeed>
</MoveSpiral>
-------------------------------------------------------------------------------------------------------------
50 Air Resistance <MoveResistance>
float resistance <Resistance></Resistance>
float minimum_vel <MinimumVelocity></MinimumVelocity>
<MoveResistance>
-------------------------------------------------------------------------------------------------------------
51 Drift <MoveDrift>
float acceleration <Acceleration></Acceleration>
float max_speed <MaxSpeed></MaxSpeed>
float sideways_decay <SidewaysDecay></SidewaysDecay>
float dir_x <DirX></DirX>
float dir_y <DirY></DirY>
float dir_z <DirZ></DirZ>
coord_frame space <Space></Space>
</MoveDrift>
-------------------------------------------------------------------------------------------------------------
52 Set Speed <SetVelocity>
float speed <Speed></Speed>
coord_frame space <Space></Space>
boolean no_sideways <NoSideways></NoSideways>
</SetVelocity>
-------------------------------------------------------------------------------------------------------------
53 Spiral Tangent <SpiralTangent>
float theta <Theta></Theta>
float radius <Radius></Radius>
float rotate_speed <Rotate_speed></Rotate_speed>
</SpiralTangent>
-------------------------------------------------------------------------------------------------------------
54 KillBeyondPoint <KillBeyondPoint>
axis direction <Direction></Direction>
float value <Value></Value>
</KillBeyondPoint>
-------------------------------------------------------------------------------------------------------------
55 Create Effect <CollisionEffect>
string classname <Effect></Effect>
float wall_offset <WallOffset></WallOffset>
collision_orient orientation <Orientation></Orientation>
boolean attach <Attach></Attach>
                </CollisionEffect>
-------------------------------------------------------------------------------------------------------------
56 Stick To Wall <SitckToWall />
-------------------------------------------------------------------------------------------------------------
57 Bounce <Bounce>
float elastic_direct <ElasticDirect></ElasticDirect>
float elastic_glancing <ElasticGlancing></ElasticGlancing>
</Bounce>
-------------------------------------------------------------------------------------------------------------
59 Chop Particle <Chop />
-------------------------------------------------------------------------------------------------------------
60 Impact Effect [[OBD_talk:Impt|<ImpactEffect>]]
string impact_type '''<font color="#0000FF" title="Name of impact, registered in ONIE. The looked up material is known from collided particle. Impt and Mtrl file must exist"><ImpactType></ImpactType></font>'''
impact_modifier impact_modifier <ImpactModifier></ImpactModifier>
</ImpactEffect>
-------------------------------------------------------------------------------------------------------------
61 -
-------------------------------------------------------------------------------------------------------------
62 Unhide Particle '''<font color="#0000FF" title="unhide particle"><Show /></font>'''
-------------------------------------------------------------------------------------------------------------
63 Hide Particle '''<font color="#0000FF" title="hide particle, cannot collide with characters anymore, emitters stay active"><Hide /></font>'''
-------------------------------------------------------------------------------------------------------------
64 Set TextureTick <SetTextureTick>
float tick <Tick></Tick>
</SetTextureTick>
-------------------------------------------------------------------------------------------------------------
65 Random TexFrame <RandomTextureFrame />
-------------------------------------------------------------------------------------------------------------
66 .. 69 -
-------------------------------------------------------------------------------------------------------------
70 Set Variable <SetVariable>
float var <Target></Target>
float value <Value></Value>
</SetVariable>
-------------------------------------------------------------------------------------------------------------
71 Recalculate All <RecalculateAll />
-------------------------------------------------------------------------------------------------------------
72 Enable Above <EnableAbove>
action_index action <Action></Action>
float var <Var></Var>
float threshold <Threshold></Threshold>
</EnableAbove>
-------------------------------------------------------------------------------------------------------------
73 Enable Below <EnableBelow>
action_index action <Action></Action>
float var <Var></Var>
float threshold <Threshold></Threshold>
</EnableBelow>
-------------------------------------------------------------------------------------------------------------
74 Enable Now '''<font color="#0000FF" title="enables action X in Update event section"><EnableNow></font>'''
action_index action <Action>X</Action>
</EnableNow>
-------------------------------------------------------------------------------------------------------------
75 Disable Now '''<font color="#0000FF" title="disables action X in Update event section"><DisableNow></font>'''
action_index action <Action>X</Action>
</DisableNow>
-------------------------------------------------------------------------------------------------------------
76 -
-------------------------------------------------------------------------------------------------------------
77 SuperB Trigger <SuperBallTrigger>
emitter emitter_num <Emitter></Emitter>
float fuse_time <FuseTime></FuseTime>
</SuperBallTrigger>
-------------------------------------------------------------------------------------------------------------
78 BreakableStop <StopIfBreakable />
-------------------------------------------------------------------------------------------------------------
79 Avoid Walls <AvoidWalls>
float axis_x <AxisX></AxisX>
float axis_y <AxisY></AxisY>
float axis_z <AxisZ></AxisZ>
float cur_angle <CurrentAngle></CurrentAngle>
float t_until_check <TimeUntilCheck></TimeUntilCheck>
float sense_dist <SenseDistance></SenseDistance>
float turning_speed <TurningSpeed></TurningSpeed>
float turning_decay <TurningDecay></TurningDecay>
</AvoidWalls>
-------------------------------------------------------------------------------------------------------------
80 Random Swirl <RandomSwirl>
float swirl_angle <SwirlAngle></SwirlAngle>
float swirl_baserate <SwirlBaseRate></SwirlBaseRate>
float swirl_deltarate <SwirlDeltaRate></SwirlDeltaRate>
float swirl_speed <SwirlSpeed></SwirlSpeed>
</RandomSwirl>
-------------------------------------------------------------------------------------------------------------
81 Follow Player <FloatAbovePlayer>
float height <Height></Height>
</FloatAbovePlayer>
-------------------------------------------------------------------------------------------------------------
82 Stop BelowSpeed <StopIfSlow>
float speed <Speed></Speed>
</StopIfSlow>
-------------------------------------------------------------------------------------------------------------
83 Super Particle <SuperParticle>
float variable <Variable></Variable>
float base_value <VaseValue></VaseValue>
float delta_value <DeltaValue></DeltaValue>
float min_value <MinValue></MinValue>
float max_value <MaxValue></MaxValue>
</SuperParticle>
-------------------------------------------------------------------------------------------------------------
84 Stop Our Link <StopLink />
-------------------------------------------------------------------------------------------------------------
85 Check Link <CheckLink />
-------------------------------------------------------------------------------------------------------------
86 Break Links To <BreakLink />
-------------------------------------------------------------------------------------------------------------

Latest revision as of 01:00, 20 November 2023

To value types:

What the both values of the normal distribution stand for?

First value µ (mean) and second value σ (standard deviation)?

Ssg 23:13, 5 December 2007 (CET)

No as far as I can tell. The value is interpolated from an "InverseNormalTable" (0, 0.125, 0.2533, 0.3850, 0.5244, 0.6745, 0.8416, 1.0364, 1.2816, 1.6449, 3.0902, 1.6449, 1.2816, ...). The resulting value is multiplied with the second value and the first value is added to the result, so those 2 value are more like "offset" and "scale". I don't know why the table is called "InverseNormal", maybe this is actually normal inverse distribution but it does not look like so.

Neo

Thanks for your answer.

I've googled a (long) bit for that "InverseNormalTable". It seems to be okay. This table is also called "inverse standardized normal distribution" (see http://web.archive.org/web/20151010142712/http://files.hanser.de/hanser/docs/20040419_24419112747-75_3-446-21594-8Anhang2.pdf)

The equation for the inverse normal distribution is: x = σ * z + µ

with:

x = result
z = looked up in the z-table (the z-table here is the InverseNormalTable)
µ = mean
σ = standard deviation

Unfortunately I've no idea what's the basis for Oni's interpolation (IMO Oni needs an entry point for the table), so I haven't got a clue what the result is for.

Ssg 20:26, 6 December 2007 (CET)

The interpolation is easy: it picks a random number between -9.99 and 9.99 and it uses it to interpolate the table (linear interpolation).

And I don't know if you noticed, the WMDD for values says "Bell Curve" :)

Neo

A quick note: I messed up the table, it's (-3.0902, ..., -0.2533, -0.125, 0, 0.125, 0.2533, 0.3850, 0.5244, 0.6745, 0.8416, 1.0364, 1.2816, 1.6449, 3.0902).

Neo

>>it picks a random number between -9.99 and 9.99 and it uses it to interpolate the table (linear interpolation).

I don't get that. Can you give an example, please? Let's say Oni picks up the value 9. How does the interpolation work?

Like this:

-3.0902 = -9.99
-1.6449 = -8.99
...
-0.125 = -0.99
0 = 0
...
3.0902 = 9.99?

>>And I don't know if you noticed, the WMDD for values says "Bell Curve" :)

Yes, I've noticed that. Do you think the first value is not the mean?

>>I messed up the table

No problem. Now it fits much better to the pdf file above. ;-)

Ssg 22:32, 6 December 2007 (CET)

This should clear up everything:

float InverseNormalTable[] = { 0.0f, 0.125f, 0.2533f, 0.3853f, 0.5244f, 0.6745f, 0.8416f, 1.0364f, 1.2816f, 1.6449f, 3.0902f };

float InverseNormalRandom(float v1, float v2)
{
    float r = frnd(); // generates a random number in [-0.999, 0.999]
    float x = fabsf(r) * 10.0f;
    int i = floorf(x);
    float z = InverseNormalTable[i] + (x - i) * (InverseNormalTable[i + 1] - InverseNormalTable[i]);

    if (r < 0.0f)
        z = -z;

    return v1 + z * v2;
}

Neo

The term "inverse normal" is apparently not conventional, and also rather confusing because it can be mistaken as referring to either the normal-inverse Gaussian distribution or the inverse Gaussian distribution, both of which are rather exotic and irrelevant here.
What we have here is the inverse of the error function or rather that of erfc(x/sqrt(2)). If you have Java installed, HERE is a nice applet that you can toy around with to see just what the table in your PDF link corresponds to.
As further pointed out HERE, inverting the standard normal cdf gives you a way to generate normally distributed random variables from a uniformly distributed random variable, which is exactly what Oni does (see Neo's code sample above).
The float r is a uniformly distributed random variable in (-1.0,1.0) (@ Neo: please check). Same for x except the interval is now [0.0,10.0). z is a first approximation of erfc(0.0998 * x / sqrt(2)), interpolated linearly between erfc(0.0998 * floorf(x) / sqrt(2)) and erfc(0.0998 * (floorf(x) + 1) / sqrt(2)). The table is thus sampled uniformly.
The result ( v1 + z * v2 ) is, to a good approximation, a normally distributed random variable, centered at v1 and with standard mean deviation v2. Apart from the approximation arising from the linear interpolation, the distribution is cut off at 99.8% of expectancy, so all the values will be within 3.09023*v2 of v1.
geyser 03:12, 7 December 2007 (CET)

Boy, what a ton of interest this little function generates :). The interval for r is [-0.999, 0.999] to be precise (it originates as [-1, 1] and it is multiplied with 0.999). And yes, it is supposed to be distributed uniformly. Here is the (pseudo)random number generator: linear congruential generator, the one from Numerical Recipes.


Neo

>>HERE is a nice applet

Oh, that's why I couldn't see anything when I found this site. It needs Java.

>>gives you a way to generate normally distributed random variables from a uniformly distributed random variable, which is exactly what Oni does

Ahhhhhh... that's the thought behind that calculation.

Ssg 12:20, 7 December 2007 (CET)

@ Neo & WIMC: "The interval for r is [-0.999, 0.999]"
That's odd because then the interval for x is [0, 9.99],
meaning that they leave out 0.1% of the inverse table
(i.e., they will sample only 99% of the last interval)
The only reason why they'd do this is to avoid i=10...
Anyway, this affects the final distribution very little.
Instead of a cutoff at 98% they have 97.902%: big deal.
geyser 18:04, 7 December 2007 (CET)

>> The only reason why they'd do this is to avoid i=10...

Most likely, they'd need a special case for that and it just doesn't worth it. And guys, let's just stop here. Remember, it is a game and not a scientific program, they might have as well drawn an upside down bell on a napkin, digitize it and put the obtained values in that table and it would still work :).
Neo

notepad

variables

  • storage types: would read it like that
01 00 00 00 - int16
02 00 00 00 - float
04 00 00 00 - string? (16 bytes)
08 00 00 00 - colour (4 bytes)
10 00 00 00 - int32
20 00 00 00 - string? (16 bytes)
40 00 00 00 - string? (16 bytes)
00 00 00 00 - pingpong state
00 10 00 00 - action index
00 20 00 00 - emitter
00 30 00 00 - blast falloff
00 40 00 00 - coord frame
00 50 00 00 - collision orient
00 60 00 00 - boolean
00 70 00 00 - ambient sound
00 80 00 00 - impulse sound
00 90 00 00 - impact modifier
00 A0 00 00 - damage type
00 B0 00 00 - axis

emitted particles

  • 0x68 - why is there a ? behind "can use element 12"

Ssg 00:58, 25 December 2007 (CET)

  • Well, you can read it like that if you want but I'm not sure why does it matter, they're just a bunch of values that identify some types. What you suggest looks more like flags/bitsets but they are not. (Besides don't expect me or any other C/C++ programmer to support such a format for flags/bitset because no one ever treats a 32 bit flags field as 4 separate bytes.)
  • Because I managed to check the usage of all other fields in the executable except these 2 fields (11 & 12).

Neo


There's a "particle_sprite_type.wmm_" that says:

0 - sprite (face camera orient to screen)
1 - rotated sprite (face camera orient to particle)
/ - none
2 - beam (parallel face camera)
3 - arrow (parallel orient to particle)
7 - discus (parallel orient to particle)
/ - none
4 - flat (perpendicular)
/ - none
5 - contrail (orient to particle)
6 - contrail (face camera)

Are these the numbers for the sprite mode mask? Ssg 21:51, 5 February 2008 (CET)

I'll check the code to make sure but it looks like you hit the nail on the head. Thanks!

Neo


Hey Paradox, here is some food for thought. :)

Set a particle to have another particle as an attractor, with a low radius. Then set up something to happen in the <NewAttractor> field. Wouldn't that be simulated Particle\Particle collision detection? Also, if you want it, there is a patch avaliable for disabling events outside of <Update> tags.

Gumby 04:30, 21 May 2009 (UTC)


Your first premise is that the radius works also for particle-particle collision.
Your second premise is that this collision counts as NewAttractor event. Or what was the sense of it?
When both things are correct (which I don't know) then you might have a way to detect particle-particle collision.
"patch avaliable for disabling events outside of <Update> tags" I've no idea what this means. :(
When I don't want consequences (actions) triggered by an event (Update, Pulse, Start, Stop, BackgroundFxStart, ...) then I take these actions out or delete the specific event. Paradox-01 14:23, 21 May 2009 (UTC)
The premise is that when the targeted particle gets within the radius of the *searching* particle, it activates the <NewAttractor> field, and you can then do whatever you like (whatever you would have done when the two particles *collide*).
Don't you sometimes need to use <DisableNow> or the other <Disable* tags? Gumby 16:49, 21 May 2009 (UTC)
And someone might want to do a field test now... I will probably try it out but there must be clear idea first.
No, because I haven't written advanced particle by my own so far. ^_^ I recycle existing stuff and bring in little modifications at suitable places. It's nothing I'm proud of but that's the way I go as a slowly learner. Paradox-01 17:17, 21 May 2009 (UTC)
Well...I can't think of any good application for this offhand, no. :P
Ahh, ok. :) Gumby 18:38, 21 May 2009 (UTC)
Starting building reverse side of the pyramid. On topic:
Gumby: Can't think of application, eh? AE:New_weapons, the last weapon on page maybe finally a reality thanks to this (long awaited by quite a bunch of ONI folks, me included ) ^_^
Anyway, kick@$$ workaround Gumby, big respect and 45° salute especially for you.--Loser 22:00, 21 May 2009 (UTC)
Dox: That is quite a good way how to learn PAR3. Experimenting, trying out stuff. Plus thanks to OniSplit, you don't have to care about used space calculation. On the other hand, handling stuff via HEXeditor diectly in .raw is good ( faster ) for research ^_^ ( when setting some field to various values in order to see in game effect).--Loser 22:00, 21 May 2009 (UTC)
I thought of that, but there is a slight issue, perhaps: how do we stop the animation? Does one of the damage types have a single frame animation?
That is how I learn particles, too. ^_^ Gumby 17:20, 22 May 2009 (UTC)