Beartikal
|
  |
| Joined: 16 Jan 2012 |
| Total Posts: 275 |
|
|
| 27 Jul 2017 11:11 AM |
When making a Stat-based game, what would be the most efficient way to call functions from local to server. For instance, if I make it to where you punch for Experience, wouldn't I have to fire to the server each time the person punches in order to up their exp? (assuming the Stat folders are in serverstorage and can only be accessed by the server)
|
|
|
| Report Abuse |
|
|
KapKing47
|
  |
| Joined: 09 Sep 2012 |
| Total Posts: 5522 |
|
|
| 27 Jul 2017 11:14 AM |
As soon as u punch u should call the server in general if u want it to hurt someone, so asking about xp makes no sense since both damage and xp handling can be done in 1 trip from client to the server.
|
|
|
| Report Abuse |
|
|
Beartikal
|
  |
| Joined: 16 Jan 2012 |
| Total Posts: 275 |
|
|
| 27 Jul 2017 11:20 AM |
I made damage and exp all in the same one, but is there any more efficient way?
|
|
|
| Report Abuse |
|
|
KapKing47
|
  |
| Joined: 09 Sep 2012 |
| Total Posts: 5522 |
|
|
| 27 Jul 2017 11:25 AM |
Not really. Unless there was some sort of "automatic punch system" where it would keep punching when u click and stop when u lift ur finger of the mouse. That way the server can do everything as soon as u click and then just wait for the client to say "stop", so there is a LOT less client-server communication. But don't be afraid of client-server communication, like... from all I know, FPS games do the projectile calculations on the client and send the data to the server PER BULLET SHOT to see if it hit a person... and that could go upwards of 20 communications per second or more.
|
|
|
| Report Abuse |
|
|
|
| 27 Jul 2017 11:43 AM |
| You should also consider security, if you're going to let the client fire a function to award something the client can very easily spam that request to exploit your game. |
|
|
| Report Abuse |
|
|