[✔] How safe is it to use SetActorPosition or SetActorVelocity continously online?

Discuss all aspects related to modding Zandronum here.
Post Reply
Konda
Forum Regular
Posts: 487
Joined: Thu Jun 07, 2012 5:22 pm

[✔] How safe is it to use SetActorPosition or SetActorVelocity continously online?

#1

Post by Konda » Thu Oct 16, 2014 3:38 pm

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?
Last edited by Konda on Thu Oct 16, 2014 8:03 pm, edited 1 time in total.

Cruduxy
Zandrone
Posts: 1059
Joined: Fri Jun 08, 2012 4:24 pm

RE: How safe is it to use SetActorPosition or SetActorVelocity continously online?

#2

Post by Cruduxy » Thu Oct 16, 2014 3:42 pm

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.
[][][][][][][][][][][][][][][]
Nothing to see here
[][][][][][][][][][][][][][][]

Konda
Forum Regular
Posts: 487
Joined: Thu Jun 07, 2012 5:22 pm

RE: How safe is it to use SetActorPosition or SetActorVelocity continously online?

#3

Post by Konda » Thu Oct 16, 2014 3:44 pm

I don't think zandronum-server handles bots in the same way it handles clients.

Code: Select all

<Synert> fuck
<Synert> plugged in my memory stick and got a bsod

Watermelon
Zandrone
Posts: 1244
Joined: Thu Jun 28, 2012 9:07 pm
Location: Rwanda

RE: How safe is it to use SetActorPosition or SetActorVelocity continously online?

#4

Post by Watermelon » Thu Oct 16, 2014 4:10 pm

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.
Last edited by Watermelon on Thu Oct 16, 2014 4:10 pm, edited 1 time in total.

Konda
Forum Regular
Posts: 487
Joined: Thu Jun 07, 2012 5:22 pm

RE: How safe is it to use SetActorPosition or SetActorVelocity continously online?

#5

Post by Konda » Thu Oct 16, 2014 4:30 pm

It's lightweight? Awesome.
cheers m8
Last edited by Konda on Thu Oct 16, 2014 4:30 pm, edited 1 time in total.

Code: Select all

<Synert> fuck
<Synert> plugged in my memory stick and got a bsod

User avatar
Torr Samaho
Lead Developer
Posts: 1543
Joined: Fri May 25, 2012 6:03 pm
Location: Germany

RE: How safe is it to use SetActorPosition or SetActorVelocity continously online?

#6

Post by Torr Samaho » Thu Oct 16, 2014 6:45 pm

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.

Konda
Forum Regular
Posts: 487
Joined: Thu Jun 07, 2012 5:22 pm

RE: How safe is it to use SetActorPosition or SetActorVelocity continously online?

#7

Post by Konda » Thu Oct 16, 2014 7:14 pm

Alright, thanks for the info. I'm pretty sure I don't need to use the function on that many actors.

Code: Select all

<Synert> fuck
<Synert> plugged in my memory stick and got a bsod

User avatar
ibm5155
Addicted to Zandronum
Posts: 1641
Joined: Tue Jun 05, 2012 9:32 pm
Location: Somewhere, over the rainbow

RE: [✔] How safe is it to use SetActorPosition or SetActorVelocity continously online?

#8

Post by ibm5155 » Fri Oct 17, 2014 12:18 am

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
Projects
Cursed Maze: DONE, V2.0
Zombie Horde - ZM09 map update: [3/15/13]
Need help with English? Then you've come to the right place!

<this post is proof of "Decline">

Post Reply