ID:2577254
 
Was there at some point a BYOND update that messed with statpanels by any chance? I never used to notice jittering/stuttering/choppiness in older versions using statpanel, but now it's quite present even when simply displaying some basic info about the player's character.

https://streamable.com/8l0c7v
It's somewhat noticeable in the webm, but running the test project first-hang really exemplifies the issue properly.
Code is as bare-bones as could be just for some testing
/world
icon_size = 32
fps = 40
turf = /turf/water

/turf
icon = 'turfs.dmi'
grass
icon_state = "grass"
water
density = 1
icon_state = "water"

/mob
icon = 'player.dmi'
step_size = 4

var
health = 100
maxhealth = 1000
mana = 10
maxmana = 100
strength = 50
defense = 30
fatigue = 0
experience = 50
level = 1000
hunger = 25
hydration = 100
tmp
move_time
move_state

verb
test()
set category = "blank tab"
// only exists to add a mostly-blank tab in the statpanel

movekey(dir as num, state as num)
set hidden = 1, instant = 1
if(state)
move_state |= dir
if(!move_time)
moveloop()
else
move_state &= ~dir

proc
moveloop()
set waitfor = 0
move_time = world.time
while(move_state)
step(src, move_state)
sleep(world.tick_lag)
move_time = null

Stat()
if(statpanel("test"))
stat("Level", "[level]")
stat("Experience", "[experience]/100")
stat("","")
stat("Health", "[health]/[maxhealth]")
stat("Mana", "[mana]/[maxmana]")
stat("Strength", "[strength]")
stat("Defense", "[defense]")
stat("","")
stat("Fatigue", "[fatigue]%")
stat("Hunger", "[hunger]%")
stat("Hydration", "[hydration]%")
stat("","")
stat("Location", "[x],[y],[z]")

/client
view = "18x18"
perspective = EDGE_PERSPECTIVE

https://a.pomf.cat/wrgdlo.7z
Link to download the 7z of the test project.

I hope I'm not just dumb as hell?
I definitely notice more stuttering when moving in this test project with the test statpanel open. (40fps is also not as smooth as it could be, but that's an entirely different discussion.)

I've seen something similar (worse) before: having a stat that changes (like "Location") inside a statpanel displaying a list of graphical objects (like an inventory) causes much worse stutter.

My theory has been that it's because of the Location stat label updating whenever your coordinates change, causing the entire statpanel to redraw in some extremely inefficient way.

More frequent statpanel updates = more frequent stutter.
More information displayed = longer stutter.

As always, steer clear of statpanels whenever possible, but an optimization here would definitely help a lot.
In response to Kaiochao
Kaiochao wrote:
(40fps is also not as smooth as it could be, but that's an entirely different discussion.)
Feel free to elaborate unless it's completely out of the scope of this issue, always willing to absorb info.

I've seen something similar (worse) before: having a stat that changes (like "Location") inside a statpanel displaying a list of graphical objects (like an inventory) causes much worse stutter.

My theory has been that it's because of the Location stat label updating whenever your coordinates change, causing the entire statpanel to redraw in some extremely inefficient way.
Just tested without that, and the choppiness has definitely seemed to mostly subside.

More frequent statpanel updates = more frequent stutter.
More information displayed = longer stutter.
Yeah absolutely, was more so just perplexing to me because it never seemed to be this bad in the past.

As always, steer clear of statpanels whenever possible, but an optimization here would definitely help a lot.
Oh yes, definitely. In any actual project/game hud based info displays (you really don't need most of that info always being shown) is the go-to, but I noticed this issue with statpanels so I figured I'd ask.

Thanks for replying so quickly, Kaiochao.
In response to Dayoak
Dayoak wrote:
Kaiochao wrote:
(40fps is also not as smooth as it could be, but that's an entirely different discussion.)
Feel free to elaborate unless it's completely out of the scope of this issue, always willing to absorb info.
I just meant that since my monitor has a 60hz refresh rate, games look smoothest at 60fps.

In theory, on a 60hz monitor:
- At 10fps, every rendered frame lasts 6 refreshes. This is consistent, but very choppy.
- At 40fps, every other frame lasts two refreshes. This is less consistent than 10fps, but it's a lot faster.
- At 60fps (or higher), every refresh shows a new frame. Consistent and as fast as possible.

Unfortunately, there's no way to actually achieve a perfectly smooth, high framerate on BYOND, due to precision issues (and especially network conditions, for online, though "network conditions" also seem to be in effect when joining your own local server). Still, 60 definitely looks smoother than 40 to me. By setting client.fps high and world.fps low, you can make the client do the work of smoothing animations between world ticks... but that doesn't work perfectly either.

It might be worth bumping my "Vsync/Unlimited FPS" feature request from almost a year ago:
http://www.byond.com/forum/post/2490606
I noticed this on other games as well, I think its just a BYOND issue (with the latest version maybe)