Jump to content
  • Advertisement
Sign in to follow this  
P@u1

Running scripts on server only?

This topic is 2637 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hallo everyone,

it is common practice to run parts of the actual game logic in scripts written in some scripting language like lua.

I wondered, if it will work out, if I run these scripts on the server only and the clients only see the effects of the scripts through state updates. Or do I have to run (parts of) the scripts on the clients too, or maybe use and send some events to control things?

Share this post


Link to post
Share on other sites
Advertisement
It depends on your game. In general, the "dumber" the client is, the more pressure you put the network under, and the more sensitive the client will be to latency. The more the client can predicate, interpolate and extrapolate, the more options you have to save network bandwidth and to better hide the effects of latency.

Have a look at how Unreal works. They use a specialised scripting language which runs partially on both systems. I haven't actually used this system, only read about it, but it might be worth taking a look at for ideas. Just remember to scale your solution appropriately to the size and scope of your game.

Share this post


Link to post
Share on other sites

It depends on your game. In general, the "dumber" the client is, the more pressure you put the network under, and the more sensitive the client will be to latency. The more the client can predicate, interpolate and extrapolate, the more options you have to save network bandwidth and to better hide the effects of latency.

Have a look at how Unreal works. They use a specialised scripting language which runs partially on both systems. I haven't actually used this system, only read about it, but it might be worth taking a look at for ideas. Just remember to scale your solution appropriately to the size and scope of your game.


You can also say that the dumber the client is, the harder it is for cheaters to hack the client. The less the client do, the less you have do update/patch it when adding/changing features in the game.

There are pro's and con's with both ways.
If you do an RPG or RTS were latency is nog a big issue, you might go for dumb client, if you have an FPS which is very dependent on low latency, you might favor smarter clients.

Share this post


Link to post
Share on other sites

Hallo everyone,

it is common practice to run parts of the actual game logic in scripts written in some scripting language like lua.

I wondered, if it will work out, if I run these scripts on the server only and the clients only see the effects of the scripts through state updates. Or do I have to run (parts of) the scripts on the clients too, or maybe use and send some events to control things?





You may have different kinds of scripts on either end (client/server) - example:

Animation on a client may script a bunch of coordinate shifts and animation clips together in different combinations
in response to a single (possibly parameterized command from the server. The client takes care of the graphics the server
only cares about in a non-graphical way.

The server would send that command (and expect it to be carried out graphicly) but its scripting was the object behaviors and game mechanics that decided
what animations were supposed to be shown to the user on that client BUT it doesnt do all the exact animation pixels calculated --
it orders the client to do that.

Same goes for showing any data - the client creates the pixels/colors/positions that it builds from the server telling it a number to display in acertain way.

There are 'contexts' that both the server and client keep track of so that the data being sent is relative to it, but that context on either end
is the result of a cohesive flow of command/data previously going back and forth (which is why you usually have to make sure most of the data gets thru consistantly).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!