Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send particlespawners on load mapblock #6121

Closed
octacian opened this issue Jul 11, 2017 · 13 comments
Closed

Send particlespawners on load mapblock #6121

octacian opened this issue Jul 11, 2017 · 13 comments
Labels
Duplicate Feature request Issues that request the addition or enhancement of a feature

Comments

@octacian
Copy link
Contributor

octacian commented Jul 11, 2017

When a particlespawner is added to the world, it only affects clients that have the mapblock loaded at the time when the particlespawner was added. If a particular client does not have the mapblock in which the particlespawner was added loaded, then that client will not see any particles as a result of that spawner. However, if the client had the mapblock loaded at the time at which the particlespawner was added, particles are shown.

I am not suggesting that particlespawners be sent to all players, but rather that particlespawners be somehow attached to each mapblock and sent to each individual player as they load the particular block.

@paramat
Copy link
Contributor

paramat commented Jul 11, 2017

Seems expected behaviour. Did this not happen before that commit?
My commit did not change the sending of particlespawners to clients,
When a particlespawner is activated it is sent to clients which then spawn the particles, ~~~if the mapblock is not loaded for a certain client then the particlespawner is not sent.~~ EDIT not sure now.
If this situation is a problem individual particles should be used instead, which are sent individually to clients.

@octacian
Copy link
Contributor Author

I'm not sure, will have to test. Why would that behavior be expected? In the case of a particlespawner I'd personally expect it to be applied to all clients in the area, considering that it is just a continuous spawning of particles (i.e. if I were to simply use an ABM or nodetimer to spawn the particles individually, they are shown to all players in the area, so I'd expect that particles added with a particlespawner would also be shown to all players in the area whether they were there when the particlespawner was added or not).

@paramat paramat added the Not a bug The behaviour is working as intended and won't be changed. label Jul 11, 2017
@paramat
Copy link
Contributor

paramat commented Jul 11, 2017

Updated my comment to explain.

@octacian
Copy link
Contributor Author

octacian commented Jul 11, 2017

hmmm, I understand the current setup now. However, would it not make more sense for particlespawners to be sent to the client when they enter the mapblock, whether they were there when it was added or not? My understanding is that a particlespawner would be more efficient than using an ABM to spawn individual particles, so I'd expect that this would be the better solution.

Maybe I should edit my initial post and change this to a feature request?

@raymoo
Copy link
Contributor

raymoo commented Jul 11, 2017

@paramat Individual particles are too inefficient to be a general solution for particle spawners. I thought that particle spawners used to be sent to all players, but if not then it wouldn't be a big change to do so.

Particle spawners spawned before a player joins could also be sent to the player if the particle spawner definition is kept around.

@octacian Was the client that didn't see the particles connected to the server when the particle spawner was added?

@paramat
Copy link
Contributor

paramat commented Jul 12, 2017

My commit linked here did origianlly not send particlespawners to distant clients, but was changed on request, so particlespawners are still sent to all clients at whatever distance and the distance checks are done per-particle. So i doubt my commit has caused a problem.

I'm not sure if a mapblock needs to be loaded in a client for a particlespawner to be sent to that client.

Individual particles are too inefficient to be a general solution for particle spawners.

Well, less efficient but for some situations a better method.

Generally though, particlespawners are not meant to be used for long periods due to the issues this causes.

@paramat paramat added Unconfirmed bug Bug report that has not been confirmed to exist/be reproducible and removed Not a bug The behaviour is working as intended and won't be changed. labels Jul 12, 2017
@ghost
Copy link

ghost commented Jul 12, 2017

This makes sense now. We had fireworks displays for 4th of July that many people complained they couldn't see. They must of been teleporting into the area "during" the already started show.

@paramat
Copy link
Contributor

paramat commented Jul 13, 2017

It's possible that particle spawners have never been sent to clients that do not have that mapblock loaded, i'm not sure, could you test? if so there may be a good reason.

For example if every particle spawner created on a server is sent to every connected player whether they have the mapblock loaded or not, those particle spawners are then running on those clients invisibly and unnecessarily.
I feel it's good to avoid every particle spawner on a server running invisibly on a client, but this issue is the downside to that and infinite-life particlespawners are affected the most.

Loading aparticlespawner when the mapblock is loaded is problematic because they have a lifespan and a number of particles, so a custom particle spawner would have to be created with the remaining amount of time and particles, quite complex.

Generally particlespawners are best having short lifetimes, like less than a minute.

@paramat paramat added Not a bug The behaviour is working as intended and won't be changed. Possible close Feature request Issues that request the addition or enhancement of a feature and removed Unconfirmed bug Bug report that has not been confirmed to exist/be reproducible Possible close Feature request Issues that request the addition or enhancement of a feature labels Jul 13, 2017
@raymoo
Copy link
Contributor

raymoo commented Jul 13, 2017

It's not that complex to send a particle with less time / particles left. The server keeps track of the lifetime of particle spawners already (for id allocation purposes) and you could obtain the time and particles easily from that and the particle spawner definition (which is not saved in the current code as far as I know). The particle spawner definition also includes the extent of particle spawning area, so you could determine how close a player is using it.

It doesn't really matter for this issue whether implementing sending old particle spawners is tricky or hard, it's still a desirable feature and if it gets in people will be able to use it over and over. And it doesn't seem that tricky or hard.

@paramat
Copy link
Contributor

paramat commented Jul 13, 2017

octacian if you intend this issue to be a request for the feature described in the previous post i'll add the label.

@octacian
Copy link
Contributor Author

@paramat That'd be good, I will try to edit the initial post.

@octacian octacian changed the title Particlespawners broken Send particlespawners on load mapblock Jul 13, 2017
@paramat paramat added Feature request Issues that request the addition or enhancement of a feature and removed Not a bug The behaviour is working as intended and won't be changed. labels Jul 13, 2017
@paramat
Copy link
Contributor

paramat commented Jan 4, 2018

Related #4624

@SmallJoker
Copy link
Member

This is a duplicate of #4624

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate Feature request Issues that request the addition or enhancement of a feature
Projects
None yet
Development

No branches or pull requests

4 participants