Skip to main content
gamedev.net
🔒 Locked

Sprite Drawing Order

Started by Thought Jun 20, 2007 at 6:04 AM 1 replies 950+ views
Original Post
Thought
Thought
How does one determine the drawing order of the sprites in an isometric engine? In other words how must the display list be created so that the sprites correctly occlude each other according to their depth from the screen? The engine being developed does not make use of 3D hardware so no z-buffering techniques can be used. Also, the images used in the engine are not uniform in size so simply tiling cells on the screen will not work. What type of sorting algorithm would they have used in a game such as "Crusader: No Regret / No Remorse"?
Wyrframe
Wyrframe
I don't know what they would have actually used in No Remorse, but I do know they didn't update every frame; just on motion events. But for some real fun, play it and hold down the "re-center" key while running around. The framerate (on release hardware) drops into the dirt; it's an easy way to get some better reaction time in tight firefights.

So... I'm gonna guess the map is probably quadtree-sorted by world coordinate, and when a new screen is built they build a doubly linked list sorting by camera coordinates from back to front; to update, they take the updating object's rectangle and push it backwards re-drawing the updating section until it has been completely re-drawn, and then walk forwards re-drawing anything which intersects with that rectangle.

Their update process is thus probably four-step; erase an item by doing the push-back and walk-forward steps on its old rectangle, move it (possibly changing its location in the list), draw it, then obscure it by doing the walk-forward step.

Overall, there may be better ways to do it. The on-screen list needs to be updated every time the camera moves, with more work involved for horizontal scrolling than for vertical scrolling.
RIP GameDev.net: launched 2 unusably-broken forum engines in as many years, and now has ceased operating as a forum at all, happy to remain naught but an advertising platform with an attached social media presense, headed by a staff who by their own admission have no idea what their userbase wants or expects.Here's to the good times; shame they exist in the past.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.