Open SanyaShanin opened 1 day ago
I used latest beta and 2024.8 version for testing. Results are same
The documentation does mention: "Please note that this is simply a target value, as some operations still need to run completely in one frame and may sometimes take longer than the target time."
Whether your situation is one of those cases, however, I don't know.
The documentation does mention: "Please note that this is simply a target value, as some operations still need to run completely in one frame and may sometimes take longer than the target time."
Whether your situation is one of those cases, however, I don't know.
Indeed, you are right. But there is no mention that due to the large amount of garbage, the collector can create freezes for 0.1-0.3 seconds. And more. For people without experience working with structures and the garbage collector, this can become a headache at the final stage of creating a game.
Description
We actively use structures in our project, it is quite large, contains a lot of graphics and sounds. But we ran into a problem: the running game freezes for a fraction of a second stably every 15-20 seconds. Looking at the time schedule of the garbage collector, there is clearly a similarity between the peaks on the graph and the moments when the game freezes. We used the gc_target_frame_time function with different values, from 100 to 2000 microseconds, but the garbage collector still makes the game hang, instead of distributing the load between frames I hope there is something that can help, besides "don't use structures so often". Of course, we will work to reduce the number of structures being created, but this is a job that takes time. Initially, there is no warning in the help that the garbage collector may reduce performance when creating textures frequently. If this is not solvable, it would be nice to mention it in the documentation.
https://api.gamemaker.io/api/github/downloads/73952591-6e9f-4111-8d36-700d30f227fa
Expected Change
Can you fix this, or explain what we need to do to make the garbage collector work more smoothly?
Steps To Reproduce
this code can reproduce the problem we have: ` CREATE: frames_timer = 0; parent_garbarge = {}; next_garbarge = parent_garbarge;
STEP: frames_timer+=1; if (frames_timer > 250) { frames_timer = 0; parent_garbarge = {}; next_garbarge = parent_garbarge; } repeat 2000 { var old = next_garbarge; next_garbarge = {} old.child = next_garbarge; } ` I used it in the sample test project in the Camera object
How reliably can you recreate this issue using your steps above?
Always
Which version of GameMaker are you reporting this issue for?
2024.8.1 (Monthly)
Which platform(s) are you seeing the problem on?
Windows
Sample Package Attached?
Sample Project Added?