Page 1 of 1
Client side spawning
Posted: Wed Jan 27, 2016 4:28 pm
by dbthanatos
Hello there. Im very new to zandronum in the sense that I've never done multiplayer mods before. Yet, Im farily familiar with (g)zdoom modding.
I have some questions regarding client side spawning.
I've made a Q4 mod and im trying to figure out how to optimize it for MP. I was reading about the ClientSideOnly flag. Im not all that familiar with this stuff, so I dont get what's the idea behind this flag.
I read somewhere that it's for decorations, say, like sprite particles in a explosion, but does that mean the other players cant see them? Or they spawn in their side (and might look a bit different given the randomness used via A_SpawnItemEx)
Also, I have a sprite based lightning gun, which is just 1 tic rails with sprites instead of particles. So Im worried that's a lot of actors spawning. Or is that really not a big deal?
Im probably going to be pestering here with a ton of questions like this :P
RE: Client side spawning
Posted: Wed Jan 27, 2016 5:11 pm
by Ænima
You should always make PURELY DECORATIVE actors (ie things that don't affect the players or monsters in any way) clientside.
And to answer your other question, all players can see clientside actors. They're spawned on every client, they're just not sync'd with the server. So from different player's viewpoints, they might fly in different directions or a_jump to different states, which is probably fine if they're just particles.
Btw you made Æons of Death, right? Welcome to Zandronum.
RE: Client side spawning
Posted: Wed Jan 27, 2016 7:43 pm
by dbthanatos
Thank you very much. I understand that a little better now.
So, I suppose it would be fine to make the lightning gun (rail) sprites CLIENTSIDEONLY, since players will see them just fine in their side, there's nothing random about them, and in that way the game wouldnt have to sync 10+ actors per tic per second just for that weapon alone.
And yep, Im the guy who made that mod :P Thanks for the welcome. Im looking forward to release my first Zandronum compatible mod ever.
RE: Client side spawning
Posted: Thu Jan 28, 2016 2:03 am
by ZzZombo
That's right, that's the perfect use case for +CLIENTSIDEONLY.
RE: Client side spawning
Posted: Sat Jan 30, 2016 10:39 am
by Torr Samaho
FYI, Zandronum also has a built-in way of measuring bandwidth usage by actor types and ACS scripts, which simplifies finding the source of excessive network traffic. You can activate it with "sv_measureoutboundtraffic 1" and display the information gathered about the traffic since the measurement was started with "dumptrafficmeasure". "cleartrafficmeasure" resets the measurements, if you want to start fresh. EDIT: See
Measuring_outbound_traffic.
RE: Client side spawning
Posted: Sat Jan 30, 2016 5:02 pm
by Catastrophe
Torr Samaho wrote:
FYI, Zandronum also has a built-in way of measuring bandwidth usage by actor types and ACS scripts, which simplifies finding the source of excessive network traffic. You can activate it with "sv_measureoutboundtraffic 1" and display the information gathered about the traffic since the measurement was started with "dumptrafficmeasure". "cleartrafficmeasure" resets the measurements, if you want to start fresh. EDIT: See
Measuring_outbound_traffic.
Never realized that existed, awesome.
RE: Client side spawning
Posted: Mon Feb 08, 2016 3:33 am
by dbthanatos
Thank you very much Torr.
I just have another question.
If I have, say, an imp, and I make the DoomImpBall to have a trail with random particles, when I add the flag to the particles, that's telling to the game that whatever the particles are going to do by themselves (as in, the code they carry, which may or may not do extra stuff like resizing them randomly), that's gonna be calculated in the client side, and the server does not have to care at all about it. However, the DoomImpBall will still be having to sync every A_SpawnItemEx bit of data and having to sync that every tic? In that case, would it be bad/better if I were to add the flag to the actual DoomImpBall? I read that the flag is only for cosmetic stuff, however I wonder how it really works.
I ask this because a lot of monster's projectiles have trails, and I wonder in a coop game how much is that going to affect in the long run
RE: Client side spawning
Posted: Mon Feb 08, 2016 3:37 am
by Catastrophe
Don't do +CLIENTSIDEONLY to anything that affects the game in any form aside from a visual standpoint.
RE: Client side spawning
Posted: Tue Feb 09, 2016 9:19 pm
by SwordGrunt
The trails will work fine clientsided, but each client will have their own calls to random that will likely make them see the particles in a different way - within whatever randomization you set. Which is usually what you want anyway.
Generally unless you're doing absurdly complex trails and playing on large maps with hundreds of monsters, there will be no noticeable difference if they are client-sided or not. But it's just considered good pratice to clientside effects that do not interact with gameplay at all.
RE: Client side spawning
Posted: Tue Feb 09, 2016 11:59 pm
by ZZYZX
dbthanatos wrote:Also, I have a sprite based lightning gun, which is just 1 tic rails with sprites instead of particles. So Im worried that's a lot of actors spawning. Or is that really not a big deal?
Spawning approximately 1000 NOINTERACTION actors is a big deal already. 20-30-100 is okay as long as they don't get spawned every tic. Make the lightning gun less solid if you want that.
Overall, SPAWNING and DELETING (not even moving) actors is laggy. Especially deleting due to how garbage collection works, according to some tests (for details, poke Monsterovich). Moving actors is less laggy, especially for NOINTERACTION as this won't require blockmap linking.