Is it always best generally, to fire off effects, like Particles , smoke, beam , via a localscript trigger , so that it is fired from the client?
Is there a better way to do it , so it is still client based, but is still seen by other players?
If it is fired from the server, and if steaming is on… does it not really matter because the effect from the server firing off from other players (that say got hit and an effect fires server side), is not seen outside your steaming viewing area?
In a general script / localscript sense / remoteevent triggers or other logic… what would you recommend the logic be…
Example:
-Set up remoted events
-have server scripts that kick off remove events to the player that got triggered, such as on hits, touches etc
-have client localscript connected, when remote events trigger, to set off effects , such as on hit on parts, extra effects that are welded to the startercharacter / player that emit particles, beams smoke etc
In the above example, if the localscript kicks of an enable on a particle, is it seem by all the other players , or do you need further code to kick if off to the other clients so that they see the effect on the other player that got hit.
if the above is seen by other players, does this relate to bogging down the server,
if the above above is an issue, (with steaming enabled) is it only and issue to the player in the range other their global steaming setting… (( meaning player that are not near or can see the effect, do not get ‘server’ lag potential issues.))
any other thoughts you have about how VFX should be kicked off.
If you are still here, one reason why I was asking this , is because there is a cool effects resource that ThunderDaNub made, and the effects are Server bases, so I was asking them about that… and then thought hey, lets gets some VFX wizards comments into this topic…
Bonus Jeopardy round, if you posted logic or some answers that kick it off by the client, but via XXX other code, and thusly is by other clients… how is this better , then just kicking it off from the server?
A. For some reason the Emit method replicates faster than setting the Parent of the particles, so you end up having to yield every time you want to emit something on the server… else the particles never end up emitting. Which is obviously not an ideal concept.
B. Having all of those VFX instances on the server is a waste of memory
C. VFX usually features moving parts. Replicating those directly through the server instead of replicating once and letting the client handle it will drastically hurt your networking stats.
D. Performance aside, visual effects will always be smoother visually on the client. Effects on the server are visually choppy.
So, yes, it is always recommended to have VFX on the client. Since VFX is used… well… everywhere you’ll want to modularize your effects and rely on a single LocalScript to play them as opposed to having all of your effects in one LocalScript. You can fire back to all clients from the server (or, ideally & if viable, fire only to nearby clients to not waste performance).
Speaking in terms of ability VFX, since that’s what VFX is most used for right now (trends and all…) my general flow is:
Client input > Client ability module > Server input handler > Server ability module > Replicated ability module
This gives you the freedom to decide how each effect is replicated, and if it needs to be on the server at all. Obviously you’ll want to adjust the above example to your usecase but it shouldn’t be too different.
Relating to your comment of ’ (or, ideally & if viable, fire only to nearby clients to not waste performance).’ , how would you logically determine what players are nearby,
and what if after you have determined that, players teleport into that area… would they then somehow be picked up also as see VFX effect playing that might already have been kicked off before they got there?
what if you did not try to do the logic above, and do the ’ You can fire back to all clients from the server’… if the game has streaming on, would players that are not in the visual range of the VFX that was trigger by another player, not be effected by the ‘fire back to all clients’ performance hit, because they are not in the visual streaming area range? (meaning if thought their client gets the signal, it does not show the effect, since they cannot see it.
OR does it still fire off the VFX , even tho they are not in range, and thusly takes up client cpu playing it somewhere where they do not even see it?
no they would not, you can keep track of vfx being played but its not worth it
yes the client would still process that vfx. theres also the networking cost.
side note pls dont rely on streaming for anything gameplay related
also honestly for most effects its fine to just fire to all clients, unless your vfx has 5 bazillion beams its not going to add up to anything noticeable. fire to specific clients if the effect is especially laggy but otherwise its fine to just go the easy route