Every time I jump, reaching the peak, landing, there are frame drops and stuttering. Deleting half of the state machines reduces the stuttering effect, but it still stutters. The project file is here, please take a look at what the issue might be (AD for movement, K for jumping, the health bar in the top left corner follows the camera movement, which is used to determine when the stuttering occurs).
When you hold a direction key and press the L button, the player will dash in eight directions, jump, or fall. This involves a lot of logic, and the action judgment for eight-directional dashes might be related to lag—for example, checking whether the conditions are met every frame, and then switching to eight-directional dash actions.
For example, if you jump and press the upper-right direction along with L, the player will dash diagonally upward to the right; pressing the upper-left direction will make them dash diagonally upward to the left. There are eight such directional dash actions in total. Since the directional keys are typically held down, the game checks each frame whether the conditions for diagonal dashing are met. This is likely the cause of the stuttering, as the game not only checks for dash inputs but also for attack inputs. I hope the developers review the game’s logic and provide some suggestions or adjustments. Additionally, please ensure that compressed files are extracted using UTF-8 encoding to properly handle Chinese characters.
AGMaker Chinese Support Team, did you notice any issues? I’m still experiencing lag. The same state machine doesn’t lag on PixelGameMaker, even though PixelGameMaker’s player character state machine is more complex and has more action blocks, but it doesn’t lag.
The CPU I’m using is a 5800X (8 cores, 16 threads), so theoretically, your CPU shouldn’t be the bottleneck for this issue.
Among the known performance issues with AGM, the performance during “dynamic generation of game objects” is affected by the size of the FSM (according to the producer, this issue should be resolved in future versions).
However, in your case, no game objects are generated when the character jumps. Therefore, the issue likely has a different cause, but I currently cannot reproduce this stutter. Please check whether you can observe FPS fluctuations in “Debugger > Watch”.
Project documents have been updated. Now it can be opened normally. But I couldn’t reproduce this lag; my CPU is an AMD 5800X.
Operating steps:
Start the game with F5
WSAD moves, K key jumps, L key dashes
Pressing the K key to jump causes FPS to drop. (According to the author, he modified the health bar in the upper left UI so that the horizontal position of the health bar shifts during frame drops to help with observation).
Whether it’s UI health bars or the editor’s performance FPS metrics, I couldn’t observe this frame drop. Please try to see if it can be reproduced on your machine.
Is your playable character generated by a specific object? I previously created a complex 8-directional character, and I generated it from an empty object. If there’s an object generation action when a key is pressed, it causes noticeable lag.
I remember that when I was making an 8-directional machine gun, having too many directional conditions also caused noticeable lag.