ID:1896315
 
(See the best response by Ter13.)
Hello. The step size for my game is set to 6 which is what I'd like it to be. I also want it in pixel movement mode. The small problem however is that when I move in any direction for the first time there is a slight lag before it starts moving smoothly. Anytime I start walking after stopping it happens. Is this how it's suppose to be? Or is there any way to fix it.
Have you profiled it to see if this is CPU lag or something else?
How would I do that? And if it is CPU lag, would it affect 32 step size as well? Because that works perfectly along with your smooth tile movement. The only lag I get is from pixel movement.

I also don't enable your smooth tile movement when testing pixel mode.

EDIT: Actually...testing again just now, the movement is in no way smooth at all, it's choppy in general. I also just profiled it aswell, there is no impact on the CPU at all.
Smooth tile movement doesn't work in pixel mode. So there's that. There is no movement smoothing in pixel movement mode. All transitions from one place to another are instantaneous.

As for profiling, right click on the title bar for your game and select server->Profile...

The profiler will give you information on what every proc is taking up CPU wise measured in seconds. Self CPU tells you how much that specific proc has taken in blocking CPU time. Total tells you how much that proc and all procs triggered by it take in blocking CPU seconds. Real Time tells you how long has passed from the time the proc was called to the time it finished in real time seconds. What you really want to pay attention to is Self CPU. Don't use average time, use total time to inform targets for optimization.


What you are describing sounds like key-repeat behavior. What version of BYOND are you using? The key repeat was changed in 469, so if you are using a really old version of BYOND, the initial repeat time for macros is tuned to standard windows key-repeat time rather than repeating every individual frame.
I'm on the latest beta version of BYOND
Okay, great. I think what you are experiencing is just the effects of pixel movement being instantaneous. What FPS is your world running at?
25..could that be it?

Edit: Well...what would be a decent speed to put it at? I want something of a slow speed for walking
Best response
Yep, 25 fps is really genuinely terrible at the client side. Lummox has mentioned detatching client fps from server fps by introducing interpolation (read: smooth gliding) to pixel movement on the client-side.

This will allow you to make really slick-looking games while significantly reducing the impact that pixel movement and smooth animation have on your server.

I tend to work at 40fps, but 30 also looks nice. As for step_size, I stick to 2 or 4 depending on the game. Then again, I use nothing even remotely resembling the default movement or collision code BYOND comes packaged with, so my experiences are going to be totally different from yours.

Be aware, though, that working at 40fps gives you about a 25ms threshold for each frame's work to happen, so you need to remember that one frame is too small a time for your players to be able to react to actions in the game. Generally allow a minimum response threshold of 100-200ms, and also that working at 40fps is going to decrease the amount of work your world can do in a single frame. You need to be a tighter programmer to work in 30/40fps than you do at less than 30.
I believe one of the things that you may be seeing is that the default macros in the default skin are "old-style". They use the actual keyboard repeat delay. In a pixel movement game, you'll either want to define the movement macros yourself which forces them into the new mode, or you may want the more common approach of having key-down and key-up macros for each movement key and handling your movement with a loop.