• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Sarkurd

Sprite, Texture, image and bitmap. confused

7 posts in this topic

Hi

I started to make game but i really don't understand whats Sprite, Texture,  and bitmap images vs normal png and jpeg images

sorry but i really don't know :D

 

 

Thanks

 

0

Share this post


Link to post
Share on other sites

I suspect the exact definitions depend on the context. Where did you read about these things? Was it when learning SFML?

0

Share this post


Link to post
Share on other sites

I suspect the exact definitions depend on the context. Where did you read about these things? Was it when learning SFML?

yes i'm about to learn SFML

0

Share this post


Link to post
Share on other sites

If you're using SFML,  you need to load a texture, then bind it to a sprite. A texture can be many formats, among them the jpeg and png formats you mentioned. Formats all vary, but there are important differences, but the most likely important difference for you is that a .png file can hold transparency information (so, if you don't want your sprite to look like a square or rectangle, you'll possibly use a png format). So, in simple terms,  you load a texture and stick it onto a sprite. The sprite will be an object you create.

 

So, think of the different formats as ways of storing the information of the "picture" that you want to use. They all store different information (such as transparancy) and store it in different ways. with SFML you don't need to be concerned with the way it stores the  information at this point, but be aware of what information it can store.

 

the SFML site has some pretty simple but also really useful tutorials on this.

 

http://www.sfml-dev.org/tutorials/2.1/graphics-sprite.php

 

and if that's feeling a bit abstract still, this video will walk you through it step by step:

 

https://www.youtube.com/watch?v=WFts4-62F6U

Edited by Misantes
1

Share this post


Link to post
Share on other sites

I don't quite like Misantes's answer because it isn't precise enough, although perhaps you don't need more precision at this point. A texture is an object in memory that contains an image. You will typically read the image data from a file, and that's where the different formats come in. But the format is just a convention of how an image is represented in a file: Once you have loaded that image into a texture, it doesn't even make sense to talk about what format the texture uses.

 

I like the recommendation of using the PNG format for images that describe sprites, because of the availability of a transparency channel and because it doesn't use lossy compression, so you won't get funky compression artifacts.

 

I was also going to post a link to this SFML tutorial page: http://www.sfml-dev.org/tutorials/2.1/graphics-sprite.php

 

 

 

1

Share this post


Link to post
Share on other sites

@Alvaro,

 

You're totally right :) I just didn't want to overload him/her with too much technicality as it can be a bit confusing for a beginner (I know half the answers I get to questions on here tend to go over my head :P). But, your explanation definitely touches on some important points I glossed over, that if learned incorrectly at the start can cause problems later on in the learning process. Especially, that of the texture being an object in memory to be accessed later. Which, is important to note that you can use the same texture for multiple sprites.

1

Share this post


Link to post
Share on other sites

A sprite is whatever you want it to be, typically an image or part of an image shown on the screen. Bitmap is a term for a stored (binary) image. It could be on disk, stored as bits or in memory. When you load a PNG file its decompressed and stored in memory as a bitmap. From there you can store it on the GPU as a texture. A texture can be used when drawing. If you treat parts of a texture as a sprite, you have a spritesheet - there are many sprites on it.

 

Here's an example:

http://www.fabiobiondi.com/blog/wp-content/uploads/2012/08/runningGrant.png

 

As you can see, the texture coordinates you use when drawing is important: They define which portion of the spritesheet you are drawing from.

Imagine you assigned boundries around one of the characters shown in the spritesheet, and we will call that a frame. The boundries for a specific frame is defined by you, by specifying texture coordinates. You can animate the character by changing frames back and forth.

 

Here's an example of frames being changed over time, which makes a running animation:

http://www.pixeljoint.com/files/icons/full/sol_run_sprite_0.gif

 

As you can see, the frames boundries aren't optimal, but that doesn't really matter here because the character in the animation is completely visible.

1

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  
Followers 0