Page 1 of 1
[✔] How safe is it to use SetActorPosition or SetActorVelocity continously online?
Posted: Thu Oct 16, 2014 3:38 pm
by Konda
I made a wad where I used SetActorPosition continuously (continuously = every 5 or less tics) on some actors and it worked all fine. However, I heard that the function can make the server lag if it is used continously like that. I once hosted a server on BestEver to see if this will happen (since it already didn't happen when I hosted using my own machine) but everything went fine.
I want to sort this out, since I'm planning on utilizing this in one of my projects. Just how safe is it to use a function such as SetActorPosition or SetActorVelocity every few tics on certain actors? I can realize the idea I have with either of these two functions, so it would help to know which one is more optimized for use in the manner I described. Also, what if I used this method on 20 - 40 actors simultaneously?
RE: How safe is it to use SetActorPosition or SetActorVelocity continously online?
Posted: Thu Oct 16, 2014 3:42 pm
by Cruduxy
You can just simulate it by having it active on a lot of dummy actors instead of relying on untested theory crafting :P.
Dunno if there is a command to make bots idle and stop their cpu stravage but if you manage to do that -maybe very small map- you'd have almost certain results spawning a lot of them. -Might want to ask Jenova for permission to use bots in tests first on BE.
RE: How safe is it to use SetActorPosition or SetActorVelocity continously online?
Posted: Thu Oct 16, 2014 3:44 pm
by Konda
I don't think zandronum-server handles bots in the same way it handles clients.
RE: How safe is it to use SetActorPosition or SetActorVelocity continously online?
Posted: Thu Oct 16, 2014 4:10 pm
by Watermelon
It should be fine to use. If there is any performance issues doing that, it should be reported on the tracker since the function is very lightweight.
I could see it lagging people out if it's used every tic on 1000+ monsters, as it'd need to spam the netcode for all the monster position updates.
RE: How safe is it to use SetActorPosition or SetActorVelocity continously online?
Posted: Thu Oct 16, 2014 4:30 pm
by Konda
It's lightweight? Awesome.
cheers m8
RE: How safe is it to use SetActorPosition or SetActorVelocity continously online?
Posted: Thu Oct 16, 2014 6:45 pm
by Torr Samaho
Well, each call to either of the two functions will need network bandwidth (at least if the function actually changes a property of the actor, otherwise the engine may be able to discard the calls to safe traffic). So there is a limit on how many such calls you can make before you'll start lagging. Since the function is rather lightweight, the limit may be high enough for your cases. Using this for a few actors certainly should be fine, but, as Water already hinted, using this for thousands of actors is not going to work online.
As a general rule of thumb for all function calls that need network bandwidth, if you can easily reduced the number of calls, you should.
RE: How safe is it to use SetActorPosition or SetActorVelocity continously online?
Posted: Thu Oct 16, 2014 7:14 pm
by Konda
Alright, thanks for the info. I'm pretty sure I don't need to use the function on that many actors.
RE: [✔] How safe is it to use SetActorPosition or SetActorVelocity continously online?
Posted: Fri Oct 17, 2014 12:18 am
by ibm5155
I used SetActorVelocity on flappy lost every 1 tic, it works, but, it's not as smooth as offline, if you have lag it'll be a pain i the ass to control it.
I still need to test another method for flappy lost soul to use less set actor velocity (only send this command when a player press a key, and let the rest with the gravity