ID:669626
![]() Apr 14 2012, 10:59 am
|
|
Is there an update() proc in byond? Something that runs every frame. Generally used in 3D games I guess but it could be a good proc in byond too
|
![]() Apr 14 2012, 11:11 am
|
|
BYOND doesn't update faster than world.tick_lag, so just create a loop with a sleep of world.tick_lag and you'll have effectively the same thing.
|
Always has been approximately 8 ticks per update on Stat(), but it will update right away if you force it.
|
Don't try and run a lot of calculations in Stat though if you plan on that. I've seen some games do that and any time the game lagged the game delay would go up causing Stat() to go slower. To fix that during a game you have to keep typing .Configure delay 0
|
I know. I was just wondering if there was anything like that in byond. BTW i think if you dont sleep a while loop it would run every frame. Is that correct? I am not gonna use it but it lags the game so much if you even try to do something as simple as assigning a variable.
|
Dj dovis wrote:
BTW i think if you dont sleep a while loop it would run every frame. Is that correct? I am not gonna use it but it lags the game so much if you even try to do something as simple as assigning a variable. You would want to sleep() for the smallest unit of time that the game is running at, i.e world.tick_lag. If you don't include a sleep, the game will simply try to run the code block as fast as it can. |
I'd add sleep(-1) somewhere in there or make sure you turn off infinite loop check. I can't remember what it's called and I can't check since I'm on a Mac. You can also do set background = 1 I believe.
|
Nadrew wrote:
Always has been approximately 8 ticks per update on Stat(), but it will update right away if you force it. A tad off-topic, but I thought that Stat() was called every seven ticks. |
Nadrew wrote:
Always has been approximately 8 ticks per update on Stat(), but it will update right away if you force it. I've always been curious about this, why 8 ticks? 5 and 10 would make sense for the default tick_lag. 2, 3, 4, and 6 would make sense for having a set number of updates per minute. Having it update every 8 ticks just seems kinda random. |
SuperAntx wrote:
Nadrew wrote: Perhaps create a feature request for this? world.statupdate or something similar ? or embed it in with world.tick.. |
A.T.H.K wrote:
Perhaps create a feature request for this? world.statupdate or something similar ? or embed it in with world.tick..Well, statpanels are hardly relevant to today's BYOND, would probably be a waste of time to update them. I'd just like to know the reasoning behind their update timer. |
SuperAntx wrote:
A.T.H.K wrote: True but they still offer the option of having one even via the Interface manager. I see your point though I have noticed a few rips still have them but more popular games stay clear which is the best option. |