More optimizations, and some nice graphs
3D Collisions in GameMaker » Devlog
I’ve picked apart the system a little more to make a few different kinds of collision checks faster. Some of this was done using fancy new features that GameMaker recently added, others were good old fashioned GML abuse.
Some numbers:
- OBB/AABB: +65%
- OBB/OBB: +40%
- OBB/triangle: +35%
- AABB/triangle: +30%
- AABB/plane: +55%
- Sphere/plane: +14%
- Quad/octree traversal has been transformed from a recursive algorithm to an iterative one, plus a few early-out checks
- A bunch of these also yield improvements in checking against triangle meshes or world partitions, but the degree to which you see improvements depends on the content of your game
- Triangle mesh checks are still slow so avoid them if you can
- This also means adding objects (especially OBBs) to world partitions and building triangle meshes from scratch should be substantially faster
- Frustum culling now uses GameMaker’s sphere_is_visible function, which is faster than the one I wrote myself
The changes I’ve made only work on 2024.14 and later, so I left the old version up and made this a separate download; when LTS2026 comes out I’ll ditch the old ones and make this the default.
I’ve also added some fun little performance readout graphs to the demo.
Files
3dcollisions.yymps 57 kB
Dec 12, 2024
3dcollisions_14.yymps 41 kB
18 days ago
3DCollisionTestWorld-Web.zip Play in browser
18 days ago
3DCollisionTestWorld-Windows.zip 3.4 MB
18 days ago
Get 3D Collisions in GameMaker
Download NowName your own price
3D Collisions in GameMaker
3D collision detection in native GML
| Status | Released |
| Category | Other |
| Author | Dragonite |
| Tags | 3D, collision, collision-detection, GameMaker, sourcecode |
More posts
- The Optimization Update™Jun 25, 2024
Leave a comment
Log in with itch.io to leave a comment.