Combining (Batching) 3D Objects - Optimizing 3D Games in GameMaker
Possibly the best and most dependable 3D optimization trick that you can do in GameMaker is combining many small 3D vertex buffers into a single large one. GML is a comparatively slow language, and if you can do less work to draw the same number of triangles and vertices you can mitigate the usual CPU bottleneck considerably. Here's how you can do that! With that said, this is not a one-size-fits-all solution: objects that you combine can't move around independently of each other, and they have to all use the same texture page. This means this trick is better for stationary objects such as trees or buildings or terrain, and less useful for mobile entities such as players or NPCs or monsters. I'll be running a lot of these tests on a Raspberry Pi. If you don't have one of those, don't worry; GameMaker games operate pretty much the same on them as it does on a desktop PC, performance bottlenecks notwithstanding. The only thing I'm going to be using it for is comparing performance on different devices, and using it to track down performance bottlenecks on weaker devices. In this case, you may notice that being smart about matrix use isn't quite as good about boosting performance as it is on my desktop computer, mainly because the Pi has a considerably weaker GPU and will bottleneck in different places than a desktop computer. All the same, if game development on a Raspberry Pi is something that interests you, I've made a video on that: https://youtu.be/OH6LskFeD8Q Here's the repository where I'll be putting the demo code: https://github.com/DragoniteSpam-GameMaker-Tutorials/3DOptimizationDemos The changes made in this video are on the optimization-matrices branch. https://github.com/DragoniteSpam-GameMaker-Tutorials/3DOptimizationDemos/tree/optimization-batching 3D optimization playlist: https://www.youtube.com/playlist?list=PL_hT--4HOvrf_CJSA7fVU1tkjGVv5Sq2t Vertex buffers - advanced stuff: https://youtu.be/MzMafBgs4oE The thumbnail icon is a combination of: optimization by IconPai from the Noun Project Time by libertetstudio from the Noun Project #GameMaker3D #GameMaker3DOptimization #GameMaker3DBatching - - - - - I've now made that Patreon: https://www.patreon.com/wizardragon That promised social media link spam. https://twitter.com/DragoniteSpam Transition / idle music is by my old friend Kamex: https://www.youtube.com/user/GreatGabite/about Rate, comment, subscribe, watch more, enjoy!
Download
1 formatsVideo Formats
Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.