User Tools

Site Tools


modding:particle_generator_examples

Particle generator examples

This articles contains a number of particle generator definition examples.

(The syntax of these DED examples is not the most exemplary. The Stages in particular should be made more readable.)

Lost Soul flames

This generator is used to create the effect of flames for the Lost Soul in jDRP 1.1 I have used the Mobj type so that all Lost Souls share the same number of particles. This is important, otherwise Doomsday might slow to a crawl if there are 100 Lost Souls in view and it's trying to spawn eg 200 particles for each. Furthermore because of the generator limit (256 active generators) I have used the mobj type as Doomsday treats all Lost Souls as THE SAME generator. So 100 Lost Souls == 1 generator when using the mobj type.

Generator {
  Mobj = "SKULL"
  Flags = blend | srcvel | srcdir | static
  Center { -1 0 22 }
  Speed = .6
  Speed rnd = .4
  Spawn radius = .8
  Spawn age = -1
  Max age = -1
  Particles = 600
  Spawn rate = 1.2
  Vector { 0 -2 0}
  Vector Rnd = 4

  Stage { Type= point Flags= bright Tics= 1 Radius= 12 Bounce= 0 Resistance= .1 Color { 1 .9 .7 .7 } }
  Stage { Type= tex07 Flags= bright Force { 0 0 .04 } Tics= 20 Radius= 12 Bounce= 0 Color { 1 .9 .4 .7 } }
  Stage { Type= tex07 Flags= bright Force { 0 0 .04 } Tics= 10 Radius= 15 Color { .6 .2 0 .5 } }
  Stage { Type= tex07 Flags= bright Force { 0 0 .04 } Radius= 20 Tics= 40 Color { .4 0 0 .01} }
  Stage { Type= tex07 Flags= bright Force { 0 0 .04 } Radius= 20 Tics= 2 Color { 0 0 0 0} }
}

Barrel explosion

This generator is used to create the effects of pieces of broken barrel bouncing around after a barrel is destroyed. It is only one of several generators used for the Barrel Explosion. It is a good example of a generator that uses model particles (note the models are defined elsewhere) and the Alt Start to create two different pieces of barrel using the same generator. This helps to cut down the number of active generators so we don't go over the limit. Notice the empty stage 6, this stops particles in the first group of stages from “rolling over” into the second group.

Generator {
  State = "BEXP3"
  Flags = static | srcdir | srcvel | extra | modelonly
  Max age= 1550
  Particles = 9
  Speed = 30
  Speed Rnd = .8
  Spawn Age = 2
  Spawn rate = 4
  Spawn Rnd = .1
  Vector Rnd = 2
  Center { 0 0 15 }
  Distance = 1792
  Alt start = 7
  Alt Rnd = .8

  Stage {Type= model03 Flags= rndyaw | rndpitch | stagetouch 
    Tics= 600 Radius= 1 Color {1 1 1 1} Bounce= .5 Spin {16 18} 
    Resistance= .04 Gravity= .85}
  Stage {Type= model03 Tics= 80 Radius= 1 Color {1 1 1 1}
    Bounce= .3 Resistance= .1 Gravity= 2}
  Stage {Type= model03 Tics= 20 Radius= 1 Color {1 1 1 1} 
    Bounce= .2 Resistance= .1 Gravity= 3}
  Stage {Type= model03 Tics= 800 Radius= 1 Rnd= .3 Color {1 1 1 1} 
    Resistance= .4 Gravity= 4 }
  Stage {Type= model03 Tics= 40 Radius= 1 Color {1 1 1 1}}
  Stage {Type= model03 Tics= 1 Radius= 1 Color {1 1 1 .001}}
  Stage {}
  Stage {Type= model04 Flags= rndyaw | rndpitch Tics= 100 
    Radius= 1 Color {1 1 1 1} Bounce= .6 Spin {16 18} Resistance= .2 Gravity= .85}
  Stage {Type= model04 Tics= 80 Radius= 1 Color {1 1 1 1} 
    Bounce= .6 Resistance= .2 Gravity= 2}
  Stage {Type= model04 Tics= 20 Radius= 1 Color {1 1 1 1} 
    Bounce= .5 Resistance= .3 Gravity= 3}
  Stage {Type= model04 Tics= 800 Radius= 1 Rnd= .3 Color {1 1 1 1} 
    Resistance= .4 Gravity= 4}
  Stage {Type= model04 Tics= 40 Radius= 1 Color {1 1 1 1}}
  Stage {Type= model04 Tics= 1 Radius= 1 Color {1 1 1 .001}}
}

Rain

This generator is used to create the effect of rain. The rain will be visible in all sectors with flat “F_SKY1” as the ceiling. This generator provides a good example of how flat based generators work. Notice that it makes use of the density flag to produce an even distribution of particles in 128×128 blocks rather than per sector. Without this flag particles would “bunch up” in small sectors. Also, notice that we make use of the distance property to reduce the amount of rain being rendered to particles that are within 1024 world units of the camera, because this generator produces somewhat heavy rainfall it is not noticeable that the particles in the distance are not being drawn.

Generator {
    Flat = "F_SKY1"
    Flags = ceiling | density
    Speed = 20.0
    Speed Rnd = 0.1
    Vector { 0, 0, -1}
    Vector Rnd = 0.05
    Distance = 1024
    Spawn age = -1
    Max age = -1
    Particles = 96
    Spawn rate = 0.5
    Spawn Rnd = 0.3
    Presim = 175
    Stage {
        Type = line
        Tics = 30000
        Color = { .6, .6, .6, .6}
        Radius = 6
        Flags = stagetouch
    }
    Stage {
        Type = line
        Tics = 30
        Color = { .6, .6, .6, 1}
        Radius = 2
	Bounce = 0.9
	Resistance = 0.3
    }
    Stage {
        Type = line
        Tics = 2
        Color = { .6, .6, .6, 0}
        Radius = 0
        Resistance = 1
    }
}

Particle Generators added to jHeretic teleporters

This is included as an example of tying particle generators to stationary mobjs (as opposed to the lost souls which were mobile). Additionally it also shared in the benefit of reducing the total number of generators used.

#---PickleBro's Heretic Teleporter Particles
#---inspired by BAM's Doom Teleporter Particles
#---and by jaquboss/deus-ex's teleporter smoke in XccP

#red teleporters
Generator {
  Mobj = "TELEGLITGEN"
  Flags = blendadd | static | floor
  Speed = 2;
  Speed rnd = 1;
  Spawn age = -1;
  Spawn radius = 30
  Max age = -1;
  Particles = 300;
  Spawn rate = 10;
  Vector { 0 0 1 };
  Presim = 70;
  Stage {
    Type = "pt_point";
    Flags = "ptf_bright ptf_dietouch";
    Tics = 10;
    Rnd = 1;
    Bounce = 0;
    Gravity = 0;
    Radius = 4;
    Color { 1 .7 .6 .5 };
  };
  Stage {
    Type = "pt_point";
    Flags = "ptf_bright ptf_dietouch";
    Tics = 70;
    Rnd = 1;
    Bounce = 0;
    Gravity = -1;
    Radius = 3;
    Color { 1 .4 .3 .5 };
  };
    Stage {
    Type = "pt_line";
    Flags = "ptf_bright ptf_dietouch";
    Tics = 35;
    Rnd = 1;
    Bounce = 0;
    Gravity = -1;
    Radius = 1;
    Color { 1 0 0 .5 };
  };
}

Generator {
  Mobj = "TELEGLITTER"
  Flags = blendadd | static | floor
  Speed = 2;
  Speed rnd = 1;
  Spawn age = -1;
  Spawn radius = 30
  Max age = -1;
  Particles = 200;
  Spawn rate = 10;
  Vector { 0 0 1 };
  Presim = 70;
  Stage {
    Type = "pt_point";
    Flags = "ptf_bright ptf_dietouch";
    Tics = 10;
    Rnd = 1;
    Bounce = 3;
    Gravity = 0;
    Radius = 4;
    Color { 1 .7 .6 .5 };
  };
  Stage {
    Type = "pt_line";
    Flags = "ptf_bright ptf_dietouch";
    Tics = 70;
    Rnd = 1;
    Bounce = 0;
    Gravity = -1;
    Radius = 3;
    Color { 1 .4 .3 .5 };
  };
    Stage {
    Type = "pt_line";
    Flags = "ptf_bright ptf_dietouch";
    Tics = 35;
    Rnd = 1;
    Bounce = 0;
    Gravity = -1;
    Radius = 1;
    Color { 1 0 0 .5 };
  };
}

#blue teleporters
Generator {
  Mobj = "TELEGLITGEN2"
  Flags = blendadd | static | floor
  Speed = 7
  Speed Rnd = 0.6
  Vector { 0 0 1 }
  Vector Rnd = 0.2
  Spawn radius = 30
  Spawn age = -1
  Max age = -1
  Particles = 300
  Spawn rate = 1
  Spawn Rnd = 0.2
  Stage {
    Type = "pt_point"
    Flags = "ptf_bright";   
    Tics = 10
    Rnd = 1
    Bounce = 2;
    Color { 0.4 0.4 1 0.3 }
    Radius = 30
    Flags = bright
    Gravity = -0.6
    Resistance = 0.15
  }
  Stage {
    Type = "pt_point"
    Flags = "ptf_bright";
    Tics = 30
    Rnd = 1
    Bounce = 20;
    Color { 0.4 0.4 1 0.3 }
    Radius = 10
    Gravity = 0.6
    Resistance = 0.15
  }
  Stage {
    Type = "pt_point"
    Flags = "ptf_bright";
    Tics = 8
    Rnd = 1
    Bounce = 0
    Color { 0.5 0.4 1 0.3 }
    Radius = 5
    Flags = bright
    Resistance = 0.05
  }
    Stage {
    Type = "pt_line";
    Flags = "ptf_bright ptf_dietouch";
    Tics = 35;
    Rnd = 1;
    Bounce = 0;
    Gravity = -1;
    Radius = 2;
    Resistance = 0.25
    Color { 0.3 0.4 1 0.3 }
  };
}

Generator {
  Mobj = "TELEGLITTER2"
  Flags = blendadd | static | floor
  Speed = 2;
  Speed rnd = 1;
  Spawn age = -1;
  Spawn radius = 30
  Max age = -1;
  Particles = 200;
  Spawn rate = 10;
  Vector { 0 0 1 };
  Presim = 70;
  Stage {
    Type = "pt_point";
    Flags = "ptf_bright ptf_dietouch";
    Tics = 10;
    Rnd = 1;
    Bounce = 0;
    Gravity = 0;
    Radius = 4;
    Color { 0.4 0.4 1 0.3 };
  };
  Stage {
    Type = "pt_line";
    Flags = "ptf_bright ptf_dietouch";
    Tics = 70;
    Rnd = 1;
    Bounce = 0;
    Gravity = -1;
    Radius = 3;
    Color { 0.4 0.4 1 0.3 };
  };
    Stage {
    Type = "pt_line";
    Flags = "ptf_bright ptf_dietouch";
    Tics = 35;
    Rnd = 1;
    Bounce = 0;
    Gravity = -1;
    Radius = 1;
    Color { 0.4 0.4 1 0.3 };
  };
} 
modding/particle_generator_examples.txt · Last modified: 2017-03-20 06:36 by skyjake