The Daily Click ::. Forums ::. Klik Coding Help ::. Loading Sprite Graphics from Sprite Sheet Files
 

Post Reply  Post Oekaki 
 

Posted By Message

Andy Hull



Registered
  08/07/2002
Points
  111
2nd April, 2007 at 17:12:36 -

I noticed in Pod's Underside demo, that all the sprites are loaded from separate files. I know how to load image files into the active picture object, and even as a frame of an active object. But none of these ways will let me import just a portion of a file into an object, which is what would be required for loading graphics from a sprite sheet.

Any ideas? Is it doable with the text blitter object? That seems like a really... odd way to do it...

Andy

ps-- im using mmf2

 
-astro out

www.astrospoon.com

Tim

I'm on here way too much

Registered
  25/08/2006
Points
  132

You've Been Circy'd!Clickzine StaffSilverNova MemberVIP MemberTurtle Power!Evil klikerWii OwnerHero of TimeGhostbuster!Pokemon Ball!
2nd April, 2007 at 18:44:04 -

I'm really sorry about posting NOTHING in response to your query (he lied ) but! About 4.5 minutes ago, I played a guy on Halo 2 with the gamertag "Andy Hull"... Though I'm gunna guess that there's more than one Andy Hull on the planet and go away


.. Ok and in response to your post; Afraid not, probably, and yes it is

 
http://www.SilverNova.co.uk


Fifth

Quadruped

Registered
  07/05/2003
Points
  5815

VIP MemberGOTW JULY 2010 WINNER!Kliktober Special Award TagGOTW HALLOWEEN 2011 WINNERPicture Me This Round 51 Winner!
2nd April, 2007 at 20:17:24 -

Welll...

Used simply, the Text Blitter is capable of loading an image from an external file and displaying the pieces of the graphics as tiles. This would set each displayed tile next to or beneath the other, all grid-based.

Beyond that, though, the Text Blitter has a "callback" command, where you can specify the x and y co-ordinates, x and y source, transparency, character offset, character map, and a whole bunch of other stuff to each new line, or even new character.
Thus, theoretically, it'd be possible to use callback to blit however many sprites you want to wherever you want on the screen using a single Text Blitter object, provided you could code it appropriately.

...But it's something I've never really tried to that extent, so I don't know how feasible it is to code, or how well it actually works.

So yes, it's possible to use the Text Blitter to do such a thing, but I don't know if that's what Podunkian is using.

Image Edited by the Author.

 
Go Moon!

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
3rd April, 2007 at 04:53:40 -

Active Picture can blit part of an image to the playfield (the Add Backdrop action), which is useful for doing obstacle backdrops, since backdrops don't take as much memory.

Actually Fifth, I'm curious, are you using Text Blitter for backdrop tiles too, in your game? Because having large amounts of Text Blitter objects on-screen at the same time causes several lag on my machine. And I had no problems playing The Underside on this computer.

Image Edited by the Author.

 
n/a

jpSoul



Registered
  25/10/2003
Points
  1714
3rd April, 2007 at 05:38:08 -

for text blitter I think there is just 1 object... it loads the tileset as a character map and display it according to the text you send to it...

 
n/a

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
3rd April, 2007 at 06:01:42 -

Large TB objects (like over 800x800) lag as well.

Or actually I haven't tested that on MMF2 yet, so kthxbai!

Image Edited by the Author.

 
n/a

Fifth

Quadruped

Registered
  07/05/2003
Points
  5815

VIP MemberGOTW JULY 2010 WINNER!Kliktober Special Award TagGOTW HALLOWEEN 2011 WINNERPicture Me This Round 51 Winner!
3rd April, 2007 at 11:06:30 -

Yarr, I'm using Text Blitter objects for the background. I've got no fewer than 9 (of 320x240 size) visible on the screen at any time, with 3 more (of various other sizes) that can show up as well.
I think the reason they all run quickly is because the game's in 256 color mode. If I switch to 16 million, it starts lagging on my machine, too.

It's kind of strange that the difference is so severe, though. I'd always just set the game to 256 colors immediately, so I never really knew they could slow things down so much...

...but this would also mean that Podunkian isn't using Text Blitters like that, because the image files he draws upon are normal-colored (if you want to load an image into the Text Blitter at 256-color mode, the image's colors get really weird).
And come to think of it, it'd be pretty impossible to use a Text Blitter like that when you've got all the different character graphics in all those separate files...

...so unless things've changes drastically on MMF2, he's got to be using a different method.

 
Go Moon!

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
3rd April, 2007 at 11:20:14 -

"I think the reason they all run quickly is because the game's in 256 color mode. If I switch to 16 million, it starts lagging on my machine, too."

That explains a lot then. I'll remember that next time I'm making a level editor. Thankses!

"And come to think of it, it'd be pretty impossible to use a Text Blitter like that when you've got all the different character graphics in all those separate files...

...so unless things've changes drastically on MMF2, he's got to be using a different method."


Perhaps he's using the Active Picture object "add backdrop" thing?

 
n/a

Andy Hull



Registered
  08/07/2002
Points
  111
3rd April, 2007 at 19:18:23 -

IF he is using the active picture for the level art, it still doesn't explain how all the character and sprite art is imported. My best bet now is the overlay object, as you can paste sections of one (with the sprite sheet) into another (the visible sprite...)

just another idea...

 
-astro out

www.astrospoon.com

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
4th April, 2007 at 06:41:00 -

Why couldn't he do that with Active Picture/Text Blitter, then?

 
n/a

Andy Hull



Registered
  08/07/2002
Points
  111
4th April, 2007 at 07:12:43 -

he could do it with the text blitter, but not the active picture object. Active picture object doesnt allow you to only display one section of the whole sprite sheet. You can only PASTE sections, which is no good for actives.

-Andy

 
-astro out

www.astrospoon.com

Andy Hull



Registered
  08/07/2002
Points
  111
4th April, 2007 at 07:12:47 -

he could do it with the text blitter, but not the active picture object. Active picture object doesnt allow you to only display one section of the whole sprite sheet. You can only PASTE sections, which is no good for actives.

-Andy

 
-astro out

www.astrospoon.com

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
4th April, 2007 at 07:20:14 -

Ah, I see now what you mean. But why Overlay? I think it's slower than TB anyway...

 
n/a

Fifth

Quadruped

Registered
  07/05/2003
Points
  5815

VIP MemberGOTW JULY 2010 WINNER!Kliktober Special Award TagGOTW HALLOWEEN 2011 WINNERPicture Me This Round 51 Winner!
4th April, 2007 at 12:25:46 -

Oops... I just went back and chacked the game again, and apparently the use of external graphics wasn't as widespread as I thought. I had thought he'd had them for everything - from the main character to weapons and gunfire to enemies and effects and everything in between, but apparantly the tile-based stuff is only used for the levels' tiles and scripted NPC characters.

So, if that bug concerning creating and destroying objects that store their own graphics (like the Text Blitter) has been fixed in MMF2, it wouldn't be too much of a stretch to create a new (small) Text Blitter object for each NPC. Heck, with the proper control, he wouldn't even have to use callback at all.

And even if the bug hasn't been fixed, he could just be keeping a finite number in reserve (which is a silly way to do it) that he can draw up whenever needed.

Anyway, I'm going back to guessing Text Blitter, although I'm still curious on the speed vs. color mode issue. But then, this IS MMF2.

 
Go Moon!

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
4th April, 2007 at 12:39:38 -

Well, if it's in full-color, then he's probably just using Overlay or Active Picture. I know it works with Active Picture, because I've done it myself.

 
n/a

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
4th April, 2007 at 18:48:53 -

Are you still in Ectoprods fifth?

 
.

viva/volt

Awesome Sauce

Registered
  26/08/2006
Points
  1694

Game of the Week WinnerSilverNova MemberKlikCast StarVIP Member
5th April, 2007 at 04:09:00 -

I couldn't get it to load from a sprite sheet with active picture, well not for animation... I have managed to animate from external images but not from a whole sheet. Textblitter would be able to do it, not that I use it much.

 
Image
http://bfollington.tumblr.com

Fifth

Quadruped

Registered
  07/05/2003
Points
  5815

VIP MemberGOTW JULY 2010 WINNER!Kliktober Special Award TagGOTW HALLOWEEN 2011 WINNERPicture Me This Round 51 Winner!
5th April, 2007 at 23:24:40 -

I don't believe I'm still a part of Ectoprods...
But I wasn't exactly much a part when I was, either.

Why do you ask?

 
Go Moon!
   

Post Reply



 



Advertisement

Worth A Click