GPU settings ( gpu_set_blendmode, gpu_set_alphaenable, etc.)īatch breaks are inevitable, and different platforms will handle them better than others.Draw settings ( draw_set_font, draw_set_colour, etc.).Shaders ( shader_set_target, shader_reset_target).Surfaces ( surface_set_target, surface_reset_target).Primitives ( draw_rectangle, draw_circle, draw_primitive_begin, etc.).GPUs do a great job at drawing things very quickly when they come grouped up in a single batch, but the more batches you send to the GPU, the more time it has to spend switching between instruction sets, hurting your performance.Ī batch break can occur when you update one of GameMaker’s draw settings, such as changing color/alpha, font, blendmode, among others. A batch is a set of instructions that GameMaker sends to the GPU to draw things. You may have heard the term “ batch breaks” before. Unfortunately, this process is a very loaded subject (and one I am not an expert on), but a basic understanding is critical to avoid common mistakes. Performance drops often stem from a lack of understanding of how drawing actually works under the hood. However, there are still a plethora of ways to improve the code they are running each frame. When I say a lot of instances, I mean… a lot Frustrated, I realized I would have to roll up my sleeves and think a bit more outside the box. Unlike most projects I've seen, almost every single instance in the game seemed to be justified and would be a nightmare to simulate without instances. ![]() If something isn't moving around, isn't being depth sorted, and isn't colliding with stuff, it probably shouldn’t be an object.īut, Forager is different. Understanding how to apply these other methods is important since they can improve performance and make some complex tasks easier. Often people will fall into the trap of using an object rather than learning about other tools, for example: particle systems, data structures, asset layers, etc. Instance count is a common problem in GameMaker games in nearly every project I have worked on, excessive instance counts have been the worst performance drag. This particular genre of game raises a major problem for an optimizer: the player has the ability to create seemingly infinite instances, and somehow we still have to ensure that the game runs smoothly across all platforms. Forager is a massive crafting game where the player can collect resources and build structures on an enormous map, meaning that there could easily be 5000 instances active at a time, if not more. Before I was made the lead programmer of the game, I was contracted for one task: optimization.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |