Draw Order

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
Kadoba
Party member
Posts: 399
Joined: Mon Jan 10, 2011 8:25 am
Location: Oklahoma

Re: Draw Order

Post by Kadoba »

vrld wrote:Unless you have some information you can (given an object's position) use to tell which object will come next, you won't be able to sort faster than table.sort does. Using a linked list wont make things faster. If it did, you'd had invented a sorting algorithm that can sort faster than in O(n logn), which is not possible*.
The sorting itself is not faster but the number of elements the algorithm would work on would be drastically reduced depending on the structure of the game. Best case scenario is that nothing moves and no sorting is done at all.

Skip lists look pretty neat though. I'll mess around with them a bit.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests