Mirage Source http://web.miragesource.net/forums/ |
|
Client-side timers http://web.miragesource.net/forums/viewtopic.php?f=207&t=5509 |
Page 1 of 1 |
Author: | Xlithan [ Fri Apr 17, 2009 3:05 am ] |
Post subject: | Client-side timers |
I want to add hunger/thirst. Would using client-side timers be a bad idea? |
Author: | GIAKEN [ Fri Apr 17, 2009 3:07 am ] |
Post subject: | Re: Client-side timers |
Yes... |
Author: | Rian [ Fri Apr 17, 2009 5:41 am ] |
Post subject: | Re: Client-side timers |
Midgard has a hunger system. Client side is definitely a bad idea. What I did in midgard was use the existing (and unused) SP stat. The code already exist server side for regenerating HP, MP, and SP periodically. All I did was reverse the formula for SP to make it go backwards. Pretty much just as easy as changing a + to a - |
Author: | Jacob [ Fri Apr 17, 2009 12:16 pm ] |
Post subject: | Re: Client-side timers |
You never want anything controlled by the client. It is easily hackable. |
Author: | Robin [ Fri Apr 17, 2009 2:46 pm ] |
Post subject: | Re: Client-side timers |
Anything client side is bad, unless it's only used to make the client smoother, and the actual calculations and checks are done server-side. |
Author: | Matt [ Fri Apr 17, 2009 3:30 pm ] |
Post subject: | Re: Client-side timers |
You can have the timer count down on the client, but make sure there's another one counting down on the server as well. Saves packets and what not from being sent every single time it needs to drop a bit. |
Author: | Xlithan [ Fri Apr 17, 2009 7:56 pm ] |
Post subject: | Re: Client-side timers |
I figured as much. I think copying the HP stuff and using the regen code to take it away is probably my best option. Thanks Rian. |
Author: | Xlithan [ Fri Apr 17, 2009 8:28 pm ] |
Post subject: | Re: Client-side timers |
Rian wrote: Midgard has a hunger system. Client side is definitely a bad idea. What I did in midgard was use the existing (and unused) SP stat. The code already exist server side for regenerating HP, MP, and SP periodically. All I did was reverse the formula for SP to make it go backwards. Pretty much just as easy as changing a + to a - Could this same method be applied to stat buffs? When the buff is activated, the SP (for example) starts to decrease, when it reaches 0, the buff is removed. |
Author: | Matt [ Fri Apr 17, 2009 8:39 pm ] |
Post subject: | Re: Client-side timers |
Yupp. |
Author: | Rian [ Fri Apr 17, 2009 8:50 pm ] |
Post subject: | Re: Client-side timers |
Well, I wouldn't want to remove the buff based on a stat reaching 0. Rather go straight to the source using a gettickcount in the server loop. |
Page 1 of 1 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |