Jump to content
  • Advertisement
Sign in to follow this  
Lode

visibility list for sprites

This topic is 5473 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I'm planning to make a game using a raycasting engine (like Wolfenstein 3D), but with bigger levels and much more sprites. Such levels are 2D grids of square walls, and with sprites in it of course. Currently, for each frame, each of the sprites has to be sorted and drawn (if it's visible). If there are a few thousands of sprites, I find that's it's quite a waste to be testing every sprite that's in every room of the map for drawing each frame, because usually you won't see more than a few sprites (or maybe up to 100 or so in very busy scenes). Many of the sprites aren't static but should be able to move around (monsters), and items should be able to be dropped at any location, so it's not possible to make a sort of static visibility list beforehand, except for the static sprites which are only a small part of the total number of sprites. Currently if a sprite is behind a wall it's still testing for each vertical stripe of that sprite if it's visible or not. So, what's a good way to have a raycasting level with tons of sprites in it, but where the engine mostly only does calculations for the sprites which are visible to you?

Share this post


Link to post
Share on other sites
Advertisement
Look into quadtree's, they should be highly suitable for the two dimensional nature of your geometry.
This way you will only need to test tree nodes, then any sprites within a given non visible node can be deemed non visible also.

Share this post


Link to post
Share on other sites
Hmm that looks interesting, I've only found tutorials about quadtrees for terrain engines though.

What do games like Doom use (Doom I and II)?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!