Total Miner Forums

Total Miner => Questions and Answers => Topic started by: Palladeonix on December 18, 2016, 12:52:34 PM

Title: question about loading in stuff
Post by: Palladeonix on December 18, 2016, 12:52:34 PM
Is there anyway to load particles in only when they're close enough, and they're in your view.
Personally, I use the proximity detector to activate the particles when you get in a certain distance. Is there any way for them to only activate if they're also in my FOV?
Title: Re: question about loading in stuff
Post by: crazytater94 on December 18, 2016, 01:05:00 PM
Particle blocks have a proximity option. Set them to like 100
Title: Re: question about loading in stuff
Post by: AlienizdPixel on December 18, 2016, 01:15:11 PM
Particle blocks have a proximity option. Set them to like 100
The question was if there is a way to activate both when close enough and within a players vision.
Title: Re: question about loading in stuff
Post by: Dryym on December 18, 2016, 01:57:57 PM
Yes, This is possible. But it would take some advanced scripting to make it work, And it wouldn't be efficient or accurate for everyone due to differences in their FOV.


This is honestly not worth it for the amount of script latency you would receive by having a looping script constantly checking the view directions of every player in proximity.


If you are curious, You could probably get away with this by first creating a vector from the player's eyes to the proximity detector block, Then you would extend the player's view vector to the same length as the other vector you created. Then you would create another vector from the end point of the first vector to the second and measure the distance between them.


Then you just need to check if that distance is less than a certain value. The problem with this is that because you are checking a set distance, And not just whether or not it's in your FOV, This will make the particle still spawn if you get close enough to it.


I may try to work out a solution for this, But it's honestly not worth it for the small efficiency bonus you would get by removing particles that aren't on screen.
Title: Re: question about loading in stuff
Post by: Craig on December 18, 2016, 03:35:50 PM
Like Tater said, for distance you don't need to use a Proximty block, there is a Proximity field directly on the Particle Emitter block.

For Field of View, I considered adding this in 2.5 but decided against it because it caused popping to the point it wasn't useful.

i.e. The particles only start emitting once the emit position is in view, so what happens is you can see them start to emit (they pop in), then you look away, they stop, then you look back, they start again. This causes popping. And in the case of say a smoke stack, it leaves holes in the stack. The immersion was constantly being broken.
Title: Re: question about loading in stuff
Post by: Dryym on December 18, 2016, 04:17:05 PM
Particle blocks have a proximity option. Set them to like 100

To add on to this, 100 will not always be ideal depending on what you are doing.

For the ideal particle proximity you have to figure out what the max distance that you can actually see the particles and make them out is.

If you have the particles in a sealed room, The emitter proximity should be set high enough that it can be activated from anywhere in the room where you can see the particles, And then set ever so slightly higher so you don't see the particles pop into existence when you enter the room.



Like Tater said, for distance you don't need to use a Proximty block, there is a Proximity field directly on the Particle Emitter block.

For Field of View, I considered adding this in 2.5 but decided against it because it caused popping to the point it wasn't useful.

i.e. The particles only start emitting once the emit position is in view, so what happens is you can see them start to emit (they pop in), then you look away, they stop, then you look back, they start again. This causes popping. And in the case of say a smoke stack, it leaves holes in the stack. The immersion was constantly being broken.

To be fair though, Particle emitters will occasionally skip particles when the particle limit isn't even close to being reached. This isn't so much a bother with things like smoke stacks, But it's super annoying with anything that has a long emit frequency.


It does ruin immersion when you know something should be there, But it either isn't, Or just looks broken.
Title: Re: question about loading in stuff
Post by: crazytater94 on December 19, 2016, 12:51:29 AM
Particle blocks have a proximity option. Set them to like 100

To add on to this, 100 will not always be ideal depending on what you are doing.

For the ideal particle proximity you have to figure out what the max distance that you can actually see the particles and make them out is.

If you have the particles in a sealed room, The emitter proximity should be set high enough that it can be activated from anywhere in the room where you can see the particles, And then set ever so slightly higher so you don't see the particles pop into existence when you enter the room.



Like Tater said, for distance you don't need to use a Proximty block, there is a Proximity field directly on the Particle Emitter block.

For Field of View, I considered adding this in 2.5 but decided against it because it caused popping to the point it wasn't useful.

i.e. The particles only start emitting once the emit position is in view, so what happens is you can see them start to emit (they pop in), then you look away, they stop, then you look back, they start again. This causes popping. And in the case of say a smoke stack, it leaves holes in the stack. The immersion was constantly being broken.

To be fair though, Particle emitters will occasionally skip particles when the particle limit isn't even close to being reached. This isn't so much a bother with things like smoke stacks, But it's super annoying with anything that has a long emit frequency.


It does ruin immersion when you know something should be there, But it either isn't, Or just looks broken.

Well, yeah, that's what I was thinking when typing, but I'm lazy and had to rush to work
Title: Re: question about loading in stuff
Post by: Palladeonix on December 19, 2016, 05:48:18 AM
I know there's a proximity parameter on the particle block, but I thought the particle block only allowed 1 particle to emit at a time, which is useless in my case.
Title: Re: question about loading in stuff
Post by: .ok on December 19, 2016, 05:54:11 AM
I know there's a proximity parameter on the particle block, but I thought the particle block only allowed 1 particle to emit at a time, which is useless in my case.
just make a script for each particle/effect that you wanna use and tie them all to a main script,then use a prox detector to the script block if you wanna have multiple particles to happen
Title: Re: question about loading in stuff
Post by: Palladeonix on December 19, 2016, 06:14:36 PM
yeah that's what i do, thanks man :D