Jump to content
  • Advertisement
Sign in to follow this  
RPR

Trouble with tile image

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

Hello everyone

I been working on game but I'm not very good with draw sprites and all of this.

So I use the SpriteLib the Ari Feldman, but I have a trouble with one image that contains some tile image for the background.

http://i50.tinypic.com/2wolxub.jpg

When I pass this image to Mappy, the white lines makes each tile much larger that I need, so maybe there is a way to erase al these white lines and leave each tile without any space between them.

Like this: http://i49.tinypic.com/s47u6x.jpg

Thanks beforehand.

Share this post


Link to post
Share on other sites
Advertisement
The white lines are used by some sprite libraries. Rather, they are used so that the artist can clearly see the bounds of the tile images and are ignored by the sprite library.

I downloaded Mappy and there doesn't seem to be a way to compensate for this. This is a very common tile sheet technique and I find this omission odd. You'll have to open the image in an image editor and manually remove the lines. However, in doing so, you'll need to make sure the sprite library is (re)configured to handle the change.

[edit]
I was unfamiliar with SpriteLib. When I mentioned "sprite library" above, I was referring to code libraries. SpriteLib is a library of sprite and tile images.
[/edit]

[Edited by - maspeir on July 1, 2010 9:51:23 AM]

Share this post


Link to post
Share on other sites
So the only way to erase this is take each tile and paste in new image.

Or in any software exists the possibility of erase all of them with special feature?

Thanks

Share this post


Link to post
Share on other sites
Quote:
Original post by rufiopunkrock
So the only way to erase this is take each tile and paste in new image.

Or in any software exists the possibility of erase all of them with special feature?

Thanks


I don't know of any software that does it, but I'm sure it exists. However, what you propose is far more time consuming than needed. Open the file in any image editor and select the entire image. Move it up and to the left by two pixels to remove the top and left borders. Then, select all of the columns from the second to the last and shift them over 2 pixels, go to the third and do the same and so on. Once the columns are collapsed, do the same thing with the rows. This is *MAYBE* a 5 minute operation.

[edit]
I'd recommend that you do this your self with the BMP included with SpriteLib. Converting to jpg added a lot of artifacts.


[/edit]

[Edited by - maspeir on July 1, 2010 11:45:43 AM]

Share this post


Link to post
Share on other sites
Thank you so much, I already do that, but I have another problem and maybe you can help me with that.

I'm reading the Game Progamming All In One and they use Mappy for create the mapswith their tiles, I wanna create a level with this tiles that I show you before, but as they have the background black, when I design the level, these tiles don't merge with background leaving a part in the design in black.

There is a way to make the background of these tiles transparent for this purpose?

Thanks

Share this post


Link to post
Share on other sites
I'm not familiar with that book or with Mappy. What I will tell you is that Mappy appears to be nothing more than a level editor. If that book does not show you how to make a sprite/tile engine with openGL and/or DirectX, set it aside and learn either of those APIs.

The black pixels are designed as a color key. In other words, when your software blitter encounters the index for black, it is skipped. This is a very old technique that has given way to alpha blending now that alpha blending is fully supported in hardware. Software blitters are no longer used (or used very rarely) since all modern PCs have hardware accelerated graphics.

Those images are very old. I remember these tiles from a level editor written for the SpriteWorld game library for the Mac back in the early 90's. They are 8-bit and originally designed for an old DOS display mode (13h, if I remember correctly) that had a screen resolution of 320x240. If you notice, the tiles are scaled up 200%. They were originally 16x16 pixels.

My point is that you seem to be taking a path that is 5 - 10 years in the past. Modern 2D game engines use OpenGL or DirectX 3D APIs to do 2D rendering directly in hardware, typically by ignoring the z axis. If that book is not teaching you this, it is taking you down a very dark and dangerous path full of peril.

Share this post


Link to post
Share on other sites
I been looking after you said that for information about OpenGL and DirectX in 2D, and it's really hard to fine.

you know where I can learn more about that?

So I been learning allegro because I don't feel prepared for this kind of library in 3D, then I preffer this one for learning more about game programming.

Share this post


Link to post
Share on other sites
Quote:
Original post by rufiopunkrock
I been looking after you said that for information about OpenGL and DirectX in 2D, and it's really hard to fine.

you know where I can learn more about that?

So I been learning allegro because I don't feel prepared for this kind of library in 3D, then I preffer this one for learning more about game programming.


With OpenGL and DirectX, you are not working with images. You are drawing texture mapped geometry. You load the texture and apply it to a quad or two triangles. OpenGL and DirectX are 3D, however, setting the z axis to 0 and using an orthographic projection will give you a hardware accelerated 2D renderer. You are still using a 3D renderer, but you are effectively ignoring the depth.

Allegro uses DirectX as a back end renderer, so it is doing what I said. This should work fine. I would still recommend that you learn OpenGL or DirectX. This message board is a great place to find information.

Share this post


Link to post
Share on other sites
Thank you so much for the advice.

I will seek the best book for begin in this topic. And then go on my own.

Share this post


Link to post
Share on other sites
Quote:
Original post by rufiopunkrock
Thank you so much for the advice.

I will seek the best book for begin in this topic. And then go on my own.


Don't waste your time and money on books. First, this is a topic that you'll be hard pressed to find. 2D games are still considered by many to be obsolete. All of the books on game programming I've seen are written for 3D games. Second, the state of technology changes so fast these days that most of the books in print (3D or otherwise) are or are becoming obsolete.

This message board and Google will provide you with any information you could possibly want and for free. Check out the DirectX and OpenGL forums. Ask lots of questions.

Also, as a side note, this thread has turned into one of my pet peeves. There are exactly two posters in this entire thread (myself and the OP). I wish someone else would bother to chime in here. I may very well be wrong and it is always a good idea to get multiple opinions / views.

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!