Author Topic: Bitmaps or sprites?  (Read 4427 times)

0 Members and 1 Guest are viewing this topic.

Offline V1mes

  • LV3 Member (Next: 100)
  • ***
  • Posts: 83
  • Rating: +7/-0
  • Ma-Heki!
    • View Profile
Bitmaps or sprites?
« on: August 30, 2012, 01:34:37 pm »
Question: which is faster - bitmaps or a 8x8 sprite array of similar size?
I know this question has been asked before but that was before ver 1.1.2 wasn't it?
Nom nom nom

Spoiler For Do a barrell roll:

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Bitmaps or sprites?
« Reply #1 on: August 30, 2012, 01:39:47 pm »
I'm guessing it's bitmaps, otherwise the bitmap routine would just use sprites.




Offline V1mes

  • LV3 Member (Next: 100)
  • ***
  • Posts: 83
  • Rating: +7/-0
  • Ma-Heki!
    • View Profile
Re: Bitmaps or sprites?
« Reply #2 on: August 30, 2012, 01:42:16 pm »
 ;D
That's an excellent point...

Slightly off topic, is there a tool where you can edit bitmaps like in tileIt! ?
Nom nom nom

Spoiler For Do a barrell roll:

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Bitmaps or sprites?
« Reply #3 on: August 30, 2012, 01:46:02 pm »
The best tool for drawing stuff is probably the graph screen, using the drawing commands.

That's what I've always used. To convert part of it to a bitmap I would usually just write a quick TI-BASIC program on the fly—I never bothered to save it because it's pretty easy to make again when I needed it. I'll come up with something for ya in a bit :)




Offline V1mes

  • LV3 Member (Next: 100)
  • ***
  • Posts: 83
  • Rating: +7/-0
  • Ma-Heki!
    • View Profile
Re: Bitmaps or sprites?
« Reply #4 on: August 30, 2012, 01:47:18 pm »
*bows

EDIT: I think I'll write an anim tool then. I was considering a fighting game, hence the large sprites, and these games are pretty anim intense
« Last Edit: August 30, 2012, 01:48:24 pm by V1mes »
Nom nom nom

Spoiler For Do a barrell roll:

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: Bitmaps or sprites?
« Reply #5 on: August 30, 2012, 02:04:48 pm »
You can also draw them with the software you want on your PC, then save them in png and convert them into hex code using SourceCoder on Cemetech ;)
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Bitmaps or sprites?
« Reply #6 on: August 30, 2012, 02:10:35 pm »
I think the speed results may not be what you expected. In the following table, DrwXX is a custom routine that draws the image as a series of 8x8 sprites using Pt-On(), and BmpXX draws the image using Bitmap(). The numbers under each of these columns is cycles taken (fewer is faster).


X       Y       Drw16   Bmp16   Drw24   Bmp24   Drw32   Bmp32   Drw64   Bmp64
0       0       3647    12881   9574    24981   14986   41013   75653   144460
1       1       6599    13799   13797   26814   20944   44068   89311   153035
7       7       11414   21017   18544   41256   29823   68137   89382   215672


As you can see, bitmap drawing is actually much slower than drawing a series of 8x8 sprites, because the routine has to keep track of more values, it uses a variable drawing mode, and other things. However Deep Thought raises a good point that there's no reason this should be slower than cobbling together a bunch of smaller sprites. I've made a note to attempt to vastly improve this routine.
« Last Edit: August 30, 2012, 02:16:37 pm by Runer112 »

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Bitmaps or sprites?
« Reply #7 on: August 30, 2012, 02:11:15 pm »
USAGE: {<x1>,<y1>,<x2>,<y2>:prgmBITMAP

Quote from: TI-BASIC
Ans→L1
"[
For(A,L1(2),L1(4))
Ans→Str1
For(B,L1(1),L1(3),8)
For(C,0,1)
0
For(D,0,3)
2Ans
If B+4C+D≤L1(3
Ans+pxl-Test(A,B+4C+D
End
Str1+sub("0123456789ABCDEF",Ans+1,1→Str1
End
End
Ans+"][
End
sub(Ans,1,length(Ans)-1
« Last Edit: August 30, 2012, 02:11:30 pm by Deep Thought »




Offline V1mes

  • LV3 Member (Next: 100)
  • ***
  • Posts: 83
  • Rating: +7/-0
  • Ma-Heki!
    • View Profile
Re: Bitmaps or sprites?
« Reply #8 on: August 31, 2012, 12:53:47 pm »
Excellent!
Though can it be done in axe, especially without the sub( command...?

I await the bitmap update  ;D
« Last Edit: August 31, 2012, 12:53:59 pm by V1mes »
Nom nom nom

Spoiler For Do a barrell roll:

Offline merthsoft

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 241
  • Rating: +63/-1
    • View Profile
Re: Bitmaps or sprites?
« Reply #9 on: August 31, 2012, 12:56:04 pm »
You can also draw them with the software you want on your PC, then save them in png and convert them into hex code using SourceCoder on Cemetech ;)
For what it's worth, TokenIDE will do this as well if you want an offline solution.
Shaun

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: Bitmaps or sprites?
« Reply #10 on: August 31, 2012, 01:04:37 pm »
You can also draw them with the software you want on your PC, then save them in png and convert them into hex code using SourceCoder on Cemetech ;)
For what it's worth, TokenIDE will do this as well if you want an offline solution.
It depends ;)
For big bitmaps in greyscale, I find it better to draw with Paint.NET (for example) and convert them with SourceCoder.
But yes, I use TokenIDE's sprite editor for little sprites or for bigger sprites when they are black and white. It is really useful because I can include the hex code directly to the source :D
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline merthsoft

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 241
  • Rating: +63/-1
    • View Profile
Re: Bitmaps or sprites?
« Reply #11 on: September 04, 2012, 04:27:59 pm »
Ah, yes, good point. On top of all the other things I should add to it, I should add greyscale sprite editing.
Shaun