Jump to content

Ped control from Server


GhostXoP

Recommended Posts

I've been working on a zombie system spec. It requires Multi theft auto to be able to control Peds from the server. This is so zombies travel around, and they don't just spawn around you like the typical little script does. This one spawns them in areas, and as you pass them they follow you, they make decisions, or group up and raid towns of lives.

Id really like to do this, and make this a possibility, if there was some way the server could control peds from serverside.

If its not available, it would be a pretty nice christmas present.

Link to comment

triggerClientEvent is out of the question, i don't want all the work load to be done on the client, but on the server

Do tell about the set element data, can you move them setting keys? or have a loop client side, checking and reading the keys to move zombies, if the loop then not that either.

Link to comment

Both functions are ways to transfer the data from server to client, so that client could set the control states. setElementData is simpler, triggerClientEvent is more flexible. There's no way for the server to control the peds directly. That would require server-side physics to be implemented and that is not easy. Anyway, what's so wrong with client-side scripts?

Link to comment

If i use clients, it can lag like most zombie scripts will because of the data transfer, it can also lag because of lesser powerful client hosts.

The servers will always be a constant performance, never a different server per session. What i could do is have a client, log in and play the game directly at the server, while the server is hosting, so it uses its performance and host the zombies off the client at the server logged into the server.

Do you see what im getting at? Using a client, but this clients computer IS the server. So the performance is still constant. But not hosting zombies off other players

Link to comment
If i use clients, it can lag like most zombie scripts will because of the data transfer

Simply wrong. Bandwidth is used by syncing and syncing is done when client is the syncer of ped, no matter if client does something with ped control states or not. Setting control states on the client is more efficient than it would be on the server. Using the client, you can just set the target of the zombie in the server and let the clients cope with the rest of the AI, including the control states. Doing everything on the server would require the syncing of different states, such as running and attacking, and that requires additional data transfer. Though if server had physics, players wouldn't need to be syncers and send the ped position data to the server, but that's another topic. So if you want your scripts to be bandwidth-efficient, the best choice is syncing the data smallest possible amount of data (such as target) with players who are near enough, using triggerClientEvent.

it can also lag because of lesser powerful client hosts

That depends a lot on the efficiency of your script. Correct me if I'm wrong, but I doubt if it's easy to make such AI script which couldn't be optimized any more.

Link to comment

I wrote something big and thought out, but because there's an MTASA and multitheftauto used it then skipped and asked for me to log in. I'm done here. Ill leave it at,

I do suppose that syncing does use bandwidth (ofcourse?) my point is, if the client has a slow computer and poor connection speed, why rely on them to host it?

If the server could do it, you would only need a download speed to listen to the server, and send your reactions. Is what im getting at. Constant Internet speed, Constant Processing Performance.

No, it isn't easy, If you have to go through an interpreter to get to the processor, there will be a speed decline.

Link to comment

A big reason is to have zombies move on the map, without having people around them. So you can go and find zombies to kill for example, But they can follow you to your town too and kill your people. Its like a realistic form of a zombie Apocalypse, where you can actually run and hide. where as some scripts spawn them around you and you cant. You can study their movement and go where they arent hording to next. Something interesting. This CAN BE DONE! But it would suck up so much bandwidth if done client side if each host had to do it. if one host (the server) did it, all you would need to do is download, most download speeds now are larger than their upload speed.

Performance too is an issue, lagging zombies are hard to shoot at ;)

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...