Better spatial partitioning
Last time I had a classic quadtree going for spatial partitioning. Although it worked, it didn't deal with overlaps properly.
I've now reworked it to be based on bounding boxes (AABBs) instead of the classic 'put the overlapping item in multiple parts of the tree' approach. It's less efficient in some ways, but also simpler.
In the video (mild flashing colour warning BTW) you can see a constant 'popping' effect as the split regions grow to occupy the moving objects, and then get split again once there are too many objects in the space.
This is already working for spatial queries (i.e. tell me what objects are in X area so I can test for collision) so I can finally start implementing actual stations and game behaviors
Train game
A work-in-progress game probably featuring trains. Not a puzzle game.
Status | In development |
Author | d w roberts |
Tags | Life Simulation, Trains |
More posts
- Train delayed (or cancelled)Nov 04, 2023
- Back on track(s)Jun 01, 2023
- Train yardsApr 23, 2023
- Frame timing hellApr 21, 2023
- Basic object placementApr 15, 2023
- Spline cleanupApr 10, 2023
- NPCs, shops, inventoriesApr 09, 2023
- Basic gameplay milestoneApr 03, 2023
- Invisible technical workApr 02, 2023
- Putting some more thought into artworkMar 26, 2023
Leave a comment
Log in with itch.io to leave a comment.