Jump to content

How/Why to stop using setElementData and getElementData


aintaro

Recommended Posts

I would expect that exporting methods for accessing a table would be more expensive than using un-synced element data. Calling methods between resources is a relatively expensive thing to do.

setElementData and getElementData are great for syncing little bits of data easily. Unsynced, they're also a good way to share data between resources. If you don't care about doing either of those things, then the method described in the original post is obviously the best way to go - you're keeping your data inside the LUA virtual machine, which is much faster.

Overusing synced element data - when you don't actually want to sync that data - is actually going to have quite a bit more of an impact than the original post states as it'll increase the amount of data that has to be sent (increasing bandwidth usage), increase the load on the clients and increase the load on the server (as some of the networking will be asynchronous).

  • Thanks 1
Link to comment

It depends what the data is. If you can put it on the server, you probably should, especially if it's something where the player would gain some advantage by change it.

That's generally the principle of multiplayer networking - don't trust the client.

Link to comment
  • 2 months later...
  • 2 weeks later...
  • Recently Browsing   0 members

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