Infinite Space in Cube

I have a space-like game, and you control a spaceship in this space. I have a particle system in this scene, at 0,0,0 and it is 100x100 in scale.

I would like my particle system to expand or to be duplicated, when near a side of this cube of particle system. It’s formed as a cube, so theres 6 sides you can enter from or exit.

An example of this can be played here: http://difficultystudios.com/games/play.php?id=5

I’ve tried some solutions, like test if the players position is near a wall of the cube side, doesn’t really work well, to be honest.

Any ideas?

I think you should make the particle system smaller in size, because you don’t see the whole thing through anyway. Also, think of a setup like this:

alt text

This is 3x3x3 = 27 cubes. The middle cube is where the character always should be. This implies that if the character moves to another cube, the system must be adjusted so the player is in the middle cube again. This can be achieved by repositioning the “left behind” cubes so the system is in the correct state again.

This way there’s no strange immediate change of the particle system, because the immediate surroundings of the player remain in their place, only cubes that are more far away need to be replaced, making the transition smooth.

I hope I explained it clearly enough.

From what I’ve seen i would suggest a way easier approach. Just move the particlesystem along with your space ship. Just make sure the particles are simulated in worldspace so they don’t move along with your ship.

You could even make the particle system a child of your ship and use a sphere area around your ship.