Sign in to follow this  
Mr. Moon

preloaded Images vs. rotated Images

Recommended Posts

Hello everyone,

 

I'm programming a 2D zombieshooter with a perspective like GTA or Hotline Miami and I'm thinking about how to manage rotating the sprites. I don't know if it's better to create an image for every direction and preload them or rotating the images at runtime and have a more complicated collision detection. But in the first case maybe I have an overflow of RAM if the game has many moving objects.

 

Can you help me?

 

Cheers,

 

Mr. Moon

Edited by Mr. Moon

Share this post


Link to post
Share on other sites

I don't think RAM is going to be an issue. Let's say you have 5 different zombie sprites, and you put up 100 zombies on the screen, 20 of each type. There's only 5 copies of the sprite in memory with 20 references to each.

 

Performance won't be an issue either since computers are so darn fast. Rotating a sprite with a matrix operation vs. having different direction sprites will be negligible. You'll be better off making this decision based on other factors such as: look and feel, art resource complexity, etc.

 

- Eck

Share this post


Link to post
Share on other sites

I don't think RAM is going to be an issue. Let's say you have 5 different zombie sprites, and you put up 100 zombies on the screen, 20 of each type. There's only 5 copies of the sprite in memory with 20 references to each.

 

Performance won't be an issue either since computers are so darn fast. Rotating a sprite with a matrix operation vs. having different direction sprites will be negligible. You'll be better off making this decision based on other factors such as: look and feel, art resource complexity, etc.

 

- Eck

 

^^^^ This.  Programmers are really bad at guessing where the problems are going to be in our software.  Do the simple thing and test the FPS.  

Share this post


Link to post
Share on other sites

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