Game Development Community

Background + particles disappear when lots on screen

by Rob Evans · in Torque X 2D · 11/27/2008 (7:14 am) · 2 replies

Hey,

Does anyone know why I might be getting issues when displaying lots of particles on screen?

Setup:

Split screen game into 4 screens.

Ships fly around and shoot at each other.

As bullets hit walls etc they "explode" with two more bullet particles that die when colliding with any walls but do not produce any further particles.

If a player gets killed, a spray of bullets is released from the center of the ship in all different directions (maybe 40 of them) that simply die when colliding with anything and do not produce any further particles.


The background and most of the particles on screen simply disappear when more than (roughly) 200 particles are on screen at once.

Is this normal?

Is there a solution without turning down the number of particles?

It is also interesting to note that this did not happen when I had the code working in TX 1 beta.

In order to get the code to work in TX 2, I had to comment out the line referencing .Anchor in GUIStyle, it no longer exists apparently:

private GUIControl _SetupPlayScreen()
{

_playStyle = new GUIStyle();
//_playStyle.Anchor = AnchorFlags.Top | AnchorFlags.Left;
GUIControl playScreen = new GUIControl();

playScreen.Style = _playStyle;

return playScreen;

}

Would that have anything to do with it?

#1
11/27/2008 (11:07 am)
Yes. Two issues. The number of sprites is limited by the camera far plane - try searching for the camera far plane. If the particle emitter is not on screen any more the particles are not displayed. You have to increase the rect of the particle system.
#2
11/27/2008 (11:40 pm)
Quote:The background and most of the particles on screen simply disappear when more than (roughly) 200 particles are on screen at once.

T2DSceneCamera cam = TorqueObjectDatabase.Instance.FindObject<T2DSceneCamera>("Camera");
cam.FarDistance = 10000f;

www.garagegames.com/mg/forums/result.thread.php?qt=71127