particle system...?
I read in source forge something about it...
here is it... I see it as hard probablity, but I will try to learn how to program for AO...
Gimme your thought about it
Particle System
Currently Aleph One has support for enemies, scenery,
players and projectiles. It only has limited support
for secondary effects though. (Stationary animated
effects, primarilly in the form of weapon contrails and
the impact sprites)
What I propose is a particle system. Where certain in
game elements can spawn multiple objects that are
animated, affected by physics, and which have no effect
on gameplay. (Turning particles on or off should have
no effect on gameplay)
[Note: This means that all random numbers associated
with particles should probably use the local random
number generator instead of game_random]
Overview:
I see someone taking the likes of projectile.cpp and
from it creating a particle.cpp to handle the animating
and physics of particles.
Particle Definition:
A single particle references many of the same elements
that other aspects of Alpeh One use. For instance the
collection and shape ids of the graphical objects. It
would also specify physical properties like some of the
projectiles have.
For instance gravity values of: -half gravity (floats
up), no gravity, half gravity (drifts down), normal gravity
Other elements a particle may have include: Does it
bounce? Duration? Contrail effect(expressed as particle
effect)? Detonation effect(expressed as particle
effect)? Media effect(for instance do the particles
splash when entering the water?)
Initial implementation may only wish to worry about
bounces on floors and treat all hits on walls as
impacts, for now.
Particle Effect (PEffect) Definition:
A PEffect defines the way a single batch of particles
are generated.
A spark effect might be defined as a single yellow
square graphic with normal gravity, that bounces and
which lasts for 90 ticks.
A PEffect determines the number of particles produced.
And the way particles are produced.
For instance a gunshot could produce a spray of 5 spark
paticles. Initial velocity for all could be specified
as an explicit velocity, in the direction of the
ricochet from the wall. With a horizontal and vertical
variance of 75 degrees (where a variance of 0 is in the
exact direction of the richochet)
I also think a container PEffect would be interesting.
Where one PEffect refers to multiple singular effects.
Consider for instance a 'machine explosion' PEffect
which in turn calls for a 'shower of sparks' PEffect
and a 'machine shrapnel' PEffect.
Particle Source (PSource) Definition:
A PSource is the glue between various elements in the
game and the generation of calls to instantiate a new
PEffect in the game.
Each different form of PSource is a different hook in
the game code. For instance a detonation PSource would
connect the impact effect of a gunshot to the 5 sparks
PEffect above. And a contrail PSource could associate
dripping sparks with the fusion blast projectile.
The creation of different forms of PSource could also
be expanded over time. Some other possibilities include:
'impact sources' - for when a player/monster jumps down
from one level and hits the floor below. (Say a ring of
5 dust clouds at the point of impact)
'point sources' - A source that resides at a specific
point in the map and continually spews its particle
effect every so often. (Think sparks spewing from a
control panel, a damaged light or steam issuing from a
hose)
'media/polygon sources' - A source that specifies the
creation of a particle effect over an area. (Where
within the area doesn't matter so much, but could be
specified to be in a certain spread before the camera,
as long as it remains within the polygon, the visible
media surface, or the player is under the media's
surface.) for instance, while underwater, bubble
particles occasionall rise from floor to surface randomly.