Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-16-2006, 11:08 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
Giving the Illusion of Reduced Lag

The best way to give an illusion of reduced lag is to have a serverside instance of something and a clientside instance of something. When dealing with player->NPC lag, it's quite easy. All you need to do is make a local version of something and a global version of something.

Ex: A bush NPC.
You slash it, put leaps down for the client (local), trigger the server to put leaps there globally, handling it by using putnpc2 with a clientside script that isn't visible to the local version of the script.

Since data is coming from the server, watching other players interacting with serverside scripts there should be no lag. However, the client sending and receiving information from the server lags.

How do we handle player interactions then?
Let's say you're on a server with serverside hit-detection, yet all the gani manipulation and movement for players are done clientside. There are going to be problems with giving illusions of reduced lag.

The position of the player serverside, is often different from the position of the player clientside. You can be hit regardless where you are if the server thinks your in a certain location.

The only tactic you can really use against this is to base the damage placement on the serverside location of the player sending it. The rest depends on the receiving player's own serverside position.

For spectators a battle won't seem laggy at all. When two players are fighting, it takes time for a server to receive a trigger, and it takes time to send that to the other client. I believe that this is negligable, and would be the same as clientside hit detection. The only real problem I'm having is that a player's position on the server is different from their position on the client.

What illusion could handle if they're hit on the client and not the server?
Make it look like the player didn't hit them on the client? How would I go about doing this though.

What illusion could handle if they're hit on the server and not the client?
Same situation, except the inverse. Make it so the player did hit them on the client... but once again, how to go about doing this?
Reply With Quote
  #2  
Old 06-16-2006, 11:15 PM
Polo Polo is offline
Classic Systems Admin
Join Date: Sep 2002
Location: Vancouver, Canada
Posts: 735
Polo is on a distinguished road
Send a message via AIM to Polo
You've just made me think of somthing very interesting as to why our hit detections come across differently. !
__________________
Be good little players, or Master Storm will ban you!



Proof that the staff are crazy..
*Ghost Pirate: I'm a little teacup short and stubbe here is my raygun here is my butt
DragonX: Jumping jack rabbits Batman! Our eggo waffles have been stolen! To the batmobile Robin!
X-Mann (RC): I have a head ache
Reply With Quote
  #3  
Old 06-16-2006, 11:24 PM
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
Only thing is, if there were lots of lag you would throw a bush and it would explode, then it would explode again a few seconds later x-x

Same with a bomb.

Also, which would deal damage? Clientside or serverside?
Reply With Quote
  #4  
Old 06-16-2006, 11:32 PM
Polo Polo is offline
Classic Systems Admin
Join Date: Sep 2002
Location: Vancouver, Canada
Posts: 735
Polo is on a distinguished road
Send a message via AIM to Polo
In serverside hit detection, the delay is split 50/50 between attacker and deffender, so only if they are both low lag does the attacking look right. If only one is low lag, then it looks 'good' for that person, as they are pretty much seeing what the server does.

In clientside HD, the lag is ALL on the attackers end. They have to pre-empt the position of the defender by the ammount of both players lag combined. This means that the defender always gets hit when they think they are, but the attacker will feel laggy if either player is.

The problem is that in a fight, both players are attackers and both are defenders, so in clientside hit detection, if either player lags, the attacking is lagged for both of them. In serverside HD, only the laggy person feels lagged.


There are more complications than this (security, abuse, packet racing) which need to be considered when deciding on hit detection systems, but that gives the general difference between the two.
__________________
Be good little players, or Master Storm will ban you!



Proof that the staff are crazy..
*Ghost Pirate: I'm a little teacup short and stubbe here is my raygun here is my butt
DragonX: Jumping jack rabbits Batman! Our eggo waffles have been stolen! To the batmobile Robin!
X-Mann (RC): I have a head ache
Reply With Quote
  #5  
Old 06-17-2006, 01:05 AM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by jake13jake
Ex: A bush NPC.
You slash it, put leaps down for the client (local), trigger the server to put leaps there globally, handling it by using putnpc2 with a clientside script that isn't visible to the local version of the script.
Your system may be a cosmetic fix, but it seems overkill to do it once for you and then again for everyone else.

Lag is unavoidable. It'll look weird if one person is working on things they are seeing from the clientside before everyone else can even see it.
__________________
Skyld
Reply With Quote
  #6  
Old 06-17-2006, 02:20 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 Skyld
Your system may be a cosmetic fix, but it seems overkill to do it once for you and then again for everyone else.

Lag is unavoidable. It'll look weird if one person is working on things they are seeing from the clientside before everyone else can even see it.
Yes, I just now implemented a change for the damage system on Classic to give an illusion of less lag. There's a possible bug with it that I'll need to talk to stefan about. It warps the player back to the position the player was detected serverside at the time of being damaged. This caused the default camera to jump slightly in most cases, but I worked around that by adding temporary focus disorientation after getting hit. For a player in a lag spike, it could be like some kind of nightmare. For a player with regular lag, they will probably notice every once in a while, but for the most part it won't be too noticable.

The only difference in a serverside damage system and a clientside damage system should be on how the player receives the damage. The lag when sending exists with a clientside system also, and you can't really do anything about it (exists in any online game). The goal with this tweak is to give the illusion that the receiving end lag doesn't exist quite as much. That way it seems more like a clientside damage system, even if it means having to force the player into a disorientation mode if they're using the default camera.
Reply With Quote
Reply


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 09:50 AM.


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