Game Development Community

T3D 1.2 - Particle Emitter ejectionPeriodMS has 1000 limit LOGGED (THREED-3122)

by A F · in Torque 3D Professional · 11/28/2011 (11:31 pm) · 1 replies

This is a problem in 1.1 and 1.2 so probably all T3D releases.

This is partially a bug, and partially just a current limitation.

The ejectionPeriodMS for ParticleEmitters is sent over the network with

stream->writeInt(ejectionPeriodMS, 10);

which means any integer over 1023 is sent incorrectly to the client.

Also, in 1.1 (I haven't tried this part in 1.2 yet) if the particleEmitter has an ejectionPeriodMS of 1024 (or probably 2048, 4096 etc), this sends 0 over the network and there is a divide by 0 error and the program terminates on this line:

partListInitSize = maxPartLife / (ejectionPeriodMS - periodVarianceMS);

The number of bits should be increased for larger ejection periods and the amount should be clamped at its max and there should be a check for divide by 0;