Home   Help Search Login Register  

Author Topic: Server <-> Client: What should they do  (Read 1180 times)

0 Members and 1 Guest are viewing this topic.

EXS

  • Guest
Server <-> Client: What should they do
« on: 30 Jul 2004, 11:48:26 »
Hi there,

I'm a little bit confused.

I have read Snypirs rules on howto do mp scripting and as he say "... do all calculations and difficult things on the server..."  I keep this in mind.

Now I have read tacticans ctf and C&H tutorial and he do scoring things on the server and the clients do "difficult" things like changing the flag and so on

My Question now is, what should the server really do? Should it only do scoring things?

The Problem is, that I do something similar to UT2004 OnSlaught, which means there are two teams and both have to capture some flags in a special order. I run into some trouble if both teams capture some flags at the same time. So I have to check which of the teams is allowed to capture a flag.

For that reason I think the server should decide which team is allowed to capture the flag!

But if the server decide this, then the team with the servermachine on their side will always take the flag...

thanks for any answers

EXS

olseric

  • Guest
Re:Server <-> Client: What should they do
« Reply #1 on: 01 Aug 2004, 05:38:59 »
I'm guessing that nobody has responded to this because we really don't know what the answer is.

Yes, make the server do most of the work, but remember, lag issues may be involved with stuff like that.

MP stuff is sometimes tricky...I learned the hard way that actions in the action menu will only execute locally whereas radio triggers always execute globally.

My suggestion...make it server-side.  If it so happens that the 1/1000th time both take it at the exact same moment, that's the benefit of hosting. ;)

Offline KTottE

  • Former Staff
  • ****
Re:Server <-> Client: What should they do
« Reply #2 on: 01 Aug 2004, 09:59:56 »
I don't understand why one team would always score if the server handled the flag-management, that must be some weird scripting.

The thing is, if you do a calculation on a client, that client has to propagate the changes through the network manually, it has to send the results to the other clients. If you do the same calculation on the server, the client/server netcode model in OFP will handle the propagation of the changes through the network. Basically, if it's on the server, the script needs to run once, if it's on the clients, the script needs to run on each client, multiplying the amount of data sent around.

To keep track of who is supposed to take the flag, have a variable on the server which holds the side of the team eligible to take the flag, such as EAST or WEST. Then you can check the side of any unit trying to capture the flag, and if it doesn't belong to the appropriate side, he won't be able to capture it.
"Life is not a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside, thoroughly used up, totally worn out, and loudly proclaiming 'WOW What a Ride!'"