OpenClonk Bugtracker - OpenClonk
View Issue Details
0001198OpenClonkEngine - C4Scriptpublic2014-12-30 15:182017-06-20 13:19
Assigned ToZapper 
PrioritynormalSeverityfeatureReproducibilityhave not tried
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0001198: Radial distribution for CreateParticles()
DescriptionThere is no way to create particles, which spread out radially, with CreateParticles()-parameters or PV_*s only. With the old particle-system you could easily do CastParticles().

Zapper mentioned one way to fix this would be set a fixed seed in PV_Random(). That way you could use the same returned array of PV_Random() for both parameters:

var rnd = PV_Random(0, 360);

CreateParticles([...], PV_Sin(rnd, p_speed), PV_Sin(rnd, p_speed, 90[?]),[...]);
Additional InformationA workaround until there is a consistent way:

for(var i = 0; i < p_amount; i++)
 var angle = Random(360);
 CreateParticles([...], Sin(angle, p_speed), -Cos(angle, p_speed), [...]);
TagsNo tags attached.
Attached Files

2014-12-30 22:11   
(Last edited: 2014-12-30 22:12)
>Zapper mentioned one way to fix this would be set a fixed seed in PV_Random(). That way you could use the same returned array of PV_Random() for both parameters:

I was talking about some sort of seed-parameter for PV_Random (which then is particle-dependant). Then you could use the same random number for two values in a particle.

CreateParticles(..., PV_Cos(PV_Random(..,SEED1), PV_Random(..,SEED2)), PV_Sin(PV_Random(..,SEED1), PV_Random(..,SEED2)), ...)
.. which would make both Cos and Sin have the same radius and angle because of the same particle-local seed

2014-12-31 09:22   
Ah. then I missunderstood you. But that sounds to be an even nicer solution to implement afterwards, I guess.
2015-06-16 20:15   
Is this then resolved?
2015-06-17 12:28   
(Last edited: 2015-06-17 12:29)
As long as nobody fixed this without updating this bug entry, no.
I only missunderstood Zapper in the way he proposed to fix this. The problem is still alive.

2015-06-17 19:55   
Ah, I see, PV_Random does not have a seed.

Then we need a seed for that :)
2016-02-27 11:40   
Hi! There's been a check-in that references this bug. For more information you can visit the repository browser at this address:

Changeset 3d71dfb by David Dormagen <>
Particles: added a "seed" parameter to PV_Random (0001198)

2016-02-27 11:41   
This is implemented via a seed for PV_Random now.

See the docs for an example:

Issue History
2014-12-30 15:18ApfelclonkNew Issue
2014-12-30 22:11ZapperNote Added: 0003299
2014-12-30 22:12ZapperNote Edited: 0003299bug_revision_view_page.php?bugnote_id=3299#r717
2014-12-31 09:22ApfelclonkNote Added: 0003300
2015-06-16 20:15MaikelNote Added: 0003673
2015-06-16 20:15MaikelStatusnew => feedback
2015-06-17 12:28ApfelclonkNote Added: 0003677
2015-06-17 12:28ApfelclonkStatusfeedback => new
2015-06-17 12:29ApfelclonkNote Edited: 0003677bug_revision_view_page.php?bugnote_id=3677#r879
2015-06-17 19:55MaikelNote Added: 0003678
2016-01-27 14:34MaikelProduct Version => 7.0
2016-01-27 14:34MaikelTarget Version => 7.2
2016-01-27 14:34MaikelSummaryRadial destribution for CreateParticles() => Radial distribution for CreateParticles()
2016-01-27 14:34MaikelAssigned To => Zapper
2016-01-27 14:34MaikelStatusnew => assigned
2016-01-29 16:27ZapperStatusassigned => new
2016-01-29 16:29ZapperAssigned ToZapper =>
2016-02-27 11:40occNote Added: 0005004
2016-02-27 11:41ZapperNote Added: 0005005
2016-02-27 11:41ZapperStatusnew => resolved
2016-02-27 11:41ZapperResolutionopen => fixed
2016-02-27 11:41ZapperAssigned To => Zapper