rickbatka / co-op-engine

A prototype engine for our planned co-op game. This is where we will make it work, make it network, and make it feel fun. No AI, level design, etc.
2 stars 0 forks source link

Proper draw order / Z-index (walking in front of / behind objects) #20

Closed rickbatka closed 10 years ago

rickbatka commented 10 years ago
reddenx commented 10 years ago

There is probably a quick and easy traversal we can do on the quadtree to get an ordered draw list.

reddenx commented 10 years ago

ERMAGERD!! we can just query the tree for the view area, adjust the order in which the items are retrieved to NW NE SW SE and just draw them in the order of the received query! This may have some edge cases where objects could overlap where they should, but it would be a huge step forward just to get basic drawing order and culling

rickbatka commented 10 years ago

Haha! So easy. Draw depth is owner.Location.Y / Camera.ViewBounds.Bottom.

It means that some particles will draw behind an object because the object's center is lower, but whatever. Works so easily for the 90% that there's no need to fret over a more robust solution.