Quote:Original post by KG_Brad
You're making an MMO that's a sidescroller? I've never seen any before, so hopefully you're the first!
I've actually seen a few before. Surprisingly, they work pretty well...
Quote:Original post by KG_Brad
You're making an MMO that's a sidescroller? I've never seen any before, so hopefully you're the first!
Quote:Original post by KG_Brad
You're making an MMO that's a sidescroller? I've never seen any before, so hopefully you're the first!
Quote:Original post by Captain P
With 100 moving objects, you end up with 10.000 checks per frame already.
Quote:Original post by catch
I was thinking of doing a grid-based system. My game (2d) has tiles that are 256x256. The server maintains a list of tiles in the game space, and within those tile squares there is a list of object IDs.
Only those object IDs, if there's more than 1, are tested against each other (and there are more filters from there, certain flags... such as stationary objects or non-collidable objects).
Quote:Original post by Sc4FreakQuote:Original post by Captain P
With 100 moving objects, you end up with 10.000 checks per frame already.
It isn't quite 10,000. It's about half that. That's because if Object A has been checked against Object B, then Object B doesn't need to do the check again against Object A. So for 100 objects the number of checks would be 5050.
Quote:Original post by OrangyTangQuote:Original post by catch
I was thinking of doing a grid-based system. My game (2d) has tiles that are 256x256. The server maintains a list of tiles in the game space, and within those tile squares there is a list of object IDs.
Only those object IDs, if there's more than 1, are tested against each other (and there are more filters from there, certain flags... such as stationary objects or non-collidable objects).
The problem with this method is when objects start to overlap multiple tiles. Do you add them into multiple tile lists? Possible, but tricky and time-consuming to manage. Or you can check in a fixed radius of tiles around each object, but that puts an upper limit on the size of any object within your world.
You could try putting objects that don't fit into another list, one covering several tiles at a time. But you'd still end up with cases where they don't fit all the time, so you'd have to do it again recursively. And then what you've got is a regular quadtree. [grin]
As a side note, pixel-perfect collision is overrated and creates a nasty dependancy between your gameplay and your art. You really don't want an artist to draw you a nice new sprite with a big fancy hat/haircut and suddenly find that the collision area stops you walking into confined spaces. If you must do pixel based collision, then use an entirely separate, non-visible, set of images.