Jump to content
  • Advertisement
Sign in to follow this  
nimrodson

What is the difference between "Entity" and "Sprite"?

This topic is 1988 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

Advertisement

Well, both are fairly abstract terms, so there isn't strictly a definition of either.

 

Generally a sprite is a visual object drawn to the screen, often a single texture or image contains multiple sprites ( called a spritesheet ).  Sprites can represent the visual representation of all kinds of things... the score, the player, enemies in the world, etc...

 

Entity generally is at a higher level.  Let's take PacMan as an example, there might be a dozen sprites repesenting PacMan in his various frames of animation.  The Entity would be PacMan itself, but in addition to graphic information, it could also hold values like number of lives remaining, current facing direction, current frame of animation, etc.

Share this post


Link to post
Share on other sites

Depends on the context wink.png

 

An "entity" is a thing. Usually in game engines, every object in the world is an "entity".

 

A "sprite" is a 2d image. Some game engines might have a sprite-entity, which is a thing that can be drawn using a picture.

 

So should I mantain these concepts separated? Or for the sake of simplicity, can I manage them together?. I mean if I could "mix" graphics issues with game object logic...

Share this post


Link to post
Share on other sites

Depends on the context wink.png

 

An "entity" is a thing. Usually in game engines, every object in the world is an "entity".

 

A "sprite" is a 2d image. Some game engines might have a sprite-entity, which is a thing that can be drawn using a picture.

 

So should I mantain these concepts separated? Or for the sake of simplicity, can I manage them together?. I mean if I could "mix" graphics issues with game object logic...

 

Definitely separate.  While an entity may have a sprite, the doesn't mean all entities will be sprites, nor necisarily that all entities will even have a sprite and quite possibly an entity will have a number of sprites.. 

 

At the end of the day though, entity is whatever you make it, if you choose to use such a class at all.  ( While sprite has a pretty well defined meaning, and shouldn't really be used to be anything other than a 2d image ).

Share this post


Link to post
Share on other sites
Spawners are a great example of an entity that is not a sprite.

Doors/portals, waypoints, and other invisible things are all game objects without visible components.

Share this post


Link to post
Share on other sites

A "sprite" is a 2d image. Some game engines might have a sprite-entity, which is a thing that can be drawn using a picture.

 

But, as mentioned, it depends. Some games don't consider 2D tiles to be 'sprites', but will consider character and NPC animations to be composed of sprites. A GUI button might not be considered a sprite, but the particle effect image for a fireball might be. So it really is vague and varies from game engine to game engine.

Share this post


Link to post
Share on other sites

Typically, and as simply as possible: These terms can and will be redefined, reused, and used interchangeably by other users and any engines.

In pong, the paddles and the ball are entities. A paddle entity would consist of a size and a position. The ball entity would be a size, position, and a velocity.

The sprites are the images that are drawn to the screen to represent those entities visually.

*Sprites are also soft-drinks and fairy like creatures. biggrin.png

Share this post


Link to post
Share on other sites

Typically, and as simply as possible: These terms can and will be redefined, reused, and used interchangeably by other users and any engines.

In pong, the paddles and the ball are entities. A paddle entity would consist of a size and a position. The ball entity would be a size, position, and a velocity.

The sprites are the images that are drawn to the screen to represent those entities visually.

*Sprites are also soft-drinks and fairy like creatures. biggrin.png

 

And how can i managed sprites and entities in separated way? I think I need to read some resources about entities, and how interconnect it with sprites.

Share this post


Link to post
Share on other sites

And how can i managed sprites and entities in separated way? I think I need to read some resources about entities, and how interconnect it with sprites.

That's entirely up to you. Everyone's implementation is different.

If you are writing a simple game, they might not know about each other at all. Your rendering code will just loop through the list of things you want to draw, and hardcode everything.

If you were writing an engine, or a had a system with a generic entity that could be used for anything, you'd have a pointer or reference to a sprite to be used, along with all the other data that entity needed.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!