Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  

Sprite drawing order in prboom+

Recommended Posts

Hi, I'm trying to use a very gross hack where I place a few items in one point and the player can only see the bigger item, so when he picks it up it seems like one item did several effects. For example, added one health, one armor and four shells at the same time. It kind of works, I noticed that if that item has lower id (not thing type number but its number on the map) than other items then usually it looks fine. However, not always: I have two piles of stuff in the same room and while the first one always looks like that big item, in the other pile sometimes you see other items above it. So there must be something else that affects the drawing order then. What could it be?

edit: here is a screenshot to make it more clear what I'm trying to do. Each "box" contains 2 health potions: the left and the right one always look like green squares but two in the middle fail to hide the potions sometimes, depending on the player's position and angle...

Share this post

Link to post

Doom's sprite sort is not stable; sprites at the same position may therefore sort in either order with respect to each other and that order may change arbitrarily. Unfortunate but, stable sorting algorithms are slower on average and it's speed that is critical in this code segment that is in question.

Share this post

Link to post

OK, I see, so it isn't really something that can be controlled. Thanks for the response!

Share this post

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this