Hello everyone, recently I encountered an issue in the project and would like to discuss it with you.
Reproduction Steps:
Press the Z key to generate objects with simple animations and a few state machines (simple objects).
Press the X key to generate objects with complex animations and multiple state machines (complex animation and state machine objects).
Press the C key to generate objects with simple animations but multiple state machines (simple animation and multiple state machine objects).
Test Run:
Comparative testing revealed that objects generated by pressing the X key, which have multiple animations and multiple state machines, have the greatest impact on the game. When generating them, the screen may lag or even exhibit teleportation effects. Objects generated by pressing the C key have a relatively smaller impact, with less noticeable lag.
Conclusion:
The number of animations and state machines are interrelated in their impact on game flow. When both animations and state machines are numerous, the impact on game smoothness is the greatest.
Hypothesis:
Regarding animations, the issue might be related to the number of frames cut from the image or the size of the image itself. During state machine generation, loading all state machines at once could also contribute to the problem.
Additionally, the large number of state machines in the project involve database calls, frequent variable changes, and condition evaluations, which can cause lag and frame drops of nearly 1 second when generating objects.
Current Personal Solution:
Create more new objects and split the main objects into multiple parts for processing.
Hello, I’ve encountered an issue in my recent project and would like to discuss it with everyone.
Reproduction Steps:
Pressing the Z key generates an object with a simple animation and a small number of state machines (simple object).
Pressing the X key generates an object with a complex animation and multiple state machines (object with complex animation and state machines).
Pressing the C key generates an object with a simple animation but multiple state machines (object with simple animation and multiple state machines).
Test Execution:
In comparative testing, the object generated by the X key, which has multiple animations and multiple state machines, has the greatest impact on the game. This causes stuttering during generation, and in severe cases, teleportation-like behavior occurs. The object generated by the C key has a relatively minor impact, with stuttering being barely noticeable.
Summary:
Both the number of animations and the number of state machines have a correlated impact on game flow. When both animations and state machines are numerous, the impact on game smoothness is the greatest.
Hypothesis:
Regarding animations, the issue may be related to the number of frames per image cut or the size of the images themselves. During state machine generation, all state machines are loaded at once, which could cause some impact.
Additionally, many state machines in the project involve operations such as database calls and frequent changes to variables and conditions, which also cause approximately 1 second of stuttering or frame skipping during object generation.
Current Personal Solution:
Create more new objects and split the main objects into multiple parts for processing.
Hello everyone, I recently encountered a problem in my project and would like to discuss it with you.
Reproduction Method:
Press the Z key to generate an object with simple animations and a small number of state machines (simple object).
Press the X key to generate an object with complex animations and multiple state machines (complex animation and state machine object).
Press the C key to generate an object with simple animations but multiple state machines (simple animation and multiple state machine object).
Test Run:
Through comparative testing, it was found that the object with multiple animations and multiple state machines generated by pressing the X key has the greatest impact on the game. When generating, the screen will freeze and even teleport. The object generated by pressing the C key has a relatively small impact, and the lag is not obvious.
Summary:
The number of animations and the number of state machines have a correlated impact on the game flow. When there are many state machines and animations, the impact on the game’s smoothness is the greatest.
Guess:
Regarding animations, it may be related to the number of frames of image cutting or the size of the image itself. When generating state machines, it may cause a certain impact because all state machines are loaded at one time.
In addition, there are operations such as calling the database and frequently changing variables and conditions in many state machines within the project, and these also cause a stutter and frame skip of nearly 1 second when generating objects.
Current Personal Solution:
Create more new objects and split the main objects into multiple parts for processing.
Could this be related to the performance loss when using the bullet settings?
When you create the typical side-scrolling shooter setup of firing bursts of three shots, the game loses a lot of performance, even stuttering due to the FPS drops. In PGM, I did this same thing along with multiple screen scrolls and it worked perfectly, but in AGM, with a project with nothing but a character and some test tiles, it works terribly from the moment you start shooting.
I submitted a project a while ago so you could check what I’m saying.
I’m not using the bullet firing node — I only use object spawning. In AGM, it’s currently confirmed that stuttering occurs when spawning objects, and the root causes are identified as follows:
The number of animations (likely related to either the number of sprite frames or the size of the images themselves)
An excessive number of state machines (including an overload of connection conditions and variable calls within actions)
I hope the official team can optimize this issue in future updates.
I haven’t set up the bullet firing node to fire 3 shots without intervals. The minimum interval is usually 0.06 seconds (which was suitable for the original PGM). Alternatively, since my bullet objects have relatively few state machines and small image sizes, their impact is not significant
There is a similar issue with bullet generation. However, the problem discussed in this post seems to refer to “even when generating just one object,” the time consumed is significantly affected by the number of states and animations of that object. Moreover, this impact appears to be excessively significant.