Game Development Community

Shape Replicator Placement

by Taylor Petrick · in Torque Game Engine · 06/28/2008 (2:59 am) · 3 replies

When I place a shapeReplicator, it randomly places the objects based on the seed value, correct? If my game is loaded on a different computer, will the replicated shapes always be in the exact same spot, or are they assigned new spots every time the game is loaded?

#1
06/28/2008 (3:17 am)
It would all depend on the seed. The results will be different if you are using a dynamic seed:
setRandomSeed(%time)

Your results should be the same every time if you seed it with a static seed:
$SEED_CONSTANT=8675309;
. . .
setRandomSeed($SEED_CONSTANT)

Just remember that other functions that jump in and use the random seed during the shape replication may very well cause inconsistancy between multiple runs.

Results may be inconsistant between platforms as well (i.e. Windows may return different results than Linux or Mac), perhaps someone else can validate...
#2
06/28/2008 (3:21 am)
I'm using TGEA, incase that matters. The only reason I posted here was that I thought the fxShapeReplicator was kind of general SDK topic. Anyway, the reason I asked was I intend to use percipitation or particles to simulate leaves falling from trees. I was thinking of placing emitters below each tree, but now that I think about it, it would probably be easier to code them into the replicator instead.
#3
06/28/2008 (4:06 am)
You might try both aproaches and test performance. While ease of implementation and graphical accuracies are valid reasons to chose an implementation path, the bottom line is unless the leaves are critical to the game play, you might be willing to sacrifice accuracy for performance. I don't know the engine well enough to know which of the choices would perform better.