Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-20-2006, 01:58 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Using clientr, client, serverr, server vars wisely.

All of these vars need to be sent to the player on update serverside. This can create lag. Also, client and server vars being updated constantly clientside can create a lot of output to the server.

Alt+4 shows input/output bytes for the player.

A few of the old reused damage functions on Classic have been updating constantly clientside, and there were a lot of variables being sent to the player from the serverside of the damage system. Variables that the player didn't need to have immediate access to. If the player doesn't need immediate access to a variable clientside, just set the variable as a player.var serverside. The variable will save in the flags when you set a player.var as a non-prefixed var.

Hope people take some wisdom from this.

Still need to work it out of the drunk movement system, but need to approach how.
Reply With Quote
  #2  
Old 06-20-2006, 03:51 AM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Non-prefixed variables in the flags are not able to be read clientside, are they?
__________________


[06:24:19] * Parts: Skyld ([email protected]/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #3  
Old 06-20-2006, 03:57 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by ApothiX
Non-prefixed variables in the flags are not able to be read clientside, are they?
No, but clients can still access them with triggeractions. If you don't need immediate access to a flag, it's usually better to use non-prefixed flags (though not really necessary). You'd definitely want to do this in the case that you're setting a lot of variable at once so you don't overload the player with data with things that you don't really need to.
Reply With Quote
  #4  
Old 06-20-2006, 04:13 AM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by jake13jake
No, but clients can still access them with triggeractions. If you don't need immediate access to a flag, it's usually better to use non-prefixed flags (though not really necessary). You'd definitely want to do this in the case that you're setting a lot of variable at once so you don't overload the player with data with things that you don't really need to.
Ah, triggeractions for the win.
__________________


[06:24:19] * Parts: Skyld ([email protected]/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #5  
Old 06-20-2006, 04:39 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Also, if you need data to be visible from one player's clientside to the rest, attr vars are the only way to do that. However, you can minimize the number of attr vars you have to modify by using bitflags (unless you need to send a string)

...Yea, now my damage system is doing a lot better.

Last edited by jake13jake; 06-20-2006 at 07:03 AM..
Reply With Quote
  #6  
Old 06-20-2006, 12:01 PM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
Quote:
Originally Posted by jake13jake
No, but clients can still access them with triggeractions. If you don't need immediate access to a flag, it's usually better to use non-prefixed flags (though not really necessary). You'd definitely want to do this in the case that you're setting a lot of variable at once so you don't overload the player with data with things that you don't really need to.
That and for storing variables that will only be read/wrote to only serverside ;o
Reply With Quote
  #7  
Old 06-20-2006, 04:18 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by jake13jake
Also, if you need data to be visible from one player's clientside to the rest, attr vars are the only way to do that.
If you want to access the data all the time, yes. But if you only need it during certain situations (ie: a custom profile) then using a triggeraction is far better than updating player.attr[] flags.
__________________


[06:24:19] * Parts: Skyld ([email protected]/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #8  
Old 06-20-2006, 11:44 PM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
Quote:
Originally Posted by jake13jake
All of these vars need to be sent to the player on update serverside. This can create lag. Also, client and server vars being updated constantly clientside can create a lot of output to the server.
Not sure if you were just being careless, but there are some things wrong with that.

You implied that server. varsare sent to the client, which is just wrong; they are only seen serverside. serverr. strings are sent to the clients, but as read-only. Your post also implied that server vars can be written to clientside, which is just plain wrong.
Reply With Quote
  #9  
Old 06-21-2006, 12:46 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by Python523
You implied that server. varsare sent to the client, which is just wrong; they are only seen serverside. serverr. strings are sent to the clients, but as read-only. Your post also implied that server vars can be written to clientside, which is just plain wrong.
Yea, I am careless because I never use server or serverr.vars. I always use DB NPCs for that kind of stuff because it's just a lot more organized.
Reply With Quote
  #10  
Old 06-21-2006, 03:44 AM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
Quote:
Originally Posted by jake13jake
Yea, I am careless because I never use server or serverr.vars. I always use DB NPCs for that kind of stuff because it's just a lot more organized.
I am pretty sure serverr. variables are sent to the client when the player logs on and when the variables are updated. Server. variables are just read/written to serverside.
__________________
Reply With Quote
  #11  
Old 06-21-2006, 04:03 PM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
Quote:
Originally Posted by ZeLpH_MyStiK
I am pretty sure serverr. variables are sent to the client when the player logs on and when the variables are updated. Server. variables are just read/written to serverside.
Im pretty sure about that one too.
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #12  
Old 06-23-2006, 06:47 AM
Warcaptain Warcaptain is offline
Banned
Warcaptain's Avatar
Join Date: Jun 2001
Location: Virginia, USA
Posts: 2,086
Warcaptain is on a distinguished road
Send a message via ICQ to Warcaptain Send a message via AIM to Warcaptain Send a message via Yahoo to Warcaptain
Hey give me some credit here for helping you figure all this out
Reply With Quote
  #13  
Old 06-23-2006, 08:32 PM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by Warcaptain
Hey give me some credit here for helping you figure all this out
You told me what Alt+4 meant, thank you.

You can also use client.vars to reduce lag instead of having to use triggeractions.
Reply With Quote
  #14  
Old 06-24-2006, 07:39 AM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by jake13jake
You can also use client.vars to reduce lag instead of having to use triggeractions.
If you don't want it to be secure, yeah.
__________________


[06:24:19] * Parts: Skyld ([email protected]/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #15  
Old 06-24-2006, 04:39 PM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by ApothiX
If you don't want it to be secure, yeah.
Well, as for attr vars, if they are changing constantly, then you'd want to use them. Also, being secure doesn't always matter enough to not be using client.vars.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 12:59 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.