Jump to content

Photo

All about sprites/tiles


32 replies to this topic

#1 Plastik OFFLINE  

Plastik

    Chopper Commander

  • 144 posts
  • The future is 8-bit
  • Location:New Jersey

Posted Sun Jun 28, 2015 5:02 PM

Made this thread as to not hi-jack the magellan thread anymore as Opry99er suggested. I want to learn as much as possible about using sprites and tiles on the Ti. I'm slowly getting the hang of extended basic and I find the magellan program to be a god send. I create the sprites in magellan then try to turn them into code.

Currently I'm trying to figure out how to repeat a sprite or tile horizontally. I have an example below I made, I have the bottom floor sprites repeating and would like to now try it in code.

 

 

mario.png

 



#2 Iwantgames:) OFFLINE  

Iwantgames:)

    River Patroller

  • 2,350 posts

Posted Sun Jun 28, 2015 5:11 PM

Slightly off topic -

Super Mario TI would be awesome :P

#3 Opry99er ONLINE  

Opry99er

    Quadrunner

  • 9,966 posts
  • Location:Hustisford, WI

Posted Sun Jun 28, 2015 5:16 PM

Nice. Unfortunately, with the way colors are handled in XB, your "ground" is impossible. Those tiles consist of 3 colors and, in XB, colors may only be set as foreground and background. You could use SPRITEs, but the TI has the 4 SPRITE per line limit.

A scaled down version can be done, with fewer colors, fairly easily.

I can make some suggestions, if you are okay with compromising. :)

#4 Plastik OFFLINE  

Plastik

    Chopper Commander

  • Topic Starter
  • 144 posts
  • The future is 8-bit
  • Location:New Jersey

Posted Sun Jun 28, 2015 5:24 PM

Nice. Unfortunately, with the way colors are handled in XB, your "ground" is impossible. Those tiles consist of 3 colors and, in XB, colors may only be set as foreground and background. You could use SPRITEs, but the TI has the 4 SPRITE per line limit.

A scaled down version can be done, with fewer colors, fairly easily.

I can make some suggestions, if you are okay with compromising. :)

 

Well like the dog from before, I can dumb it down to be compatible with the Ti's limitations. Side question with the F18a does the Ti still have the 4 sprite limit? Teach me oh great one :-D  



#5 Opry99er ONLINE  

Opry99er

    Quadrunner

  • 9,966 posts
  • Location:Hustisford, WI

Posted Sun Jun 28, 2015 5:47 PM

I am FAAAR from a great one.  :)  I know only basic BASIC stuff.

 

The F18 can turn off the limitation, by the way.



#6 Opry99er ONLINE  

Opry99er

    Quadrunner

  • 9,966 posts
  • Location:Hustisford, WI

Posted Sun Jun 28, 2015 5:49 PM

Here's a little example of how to use HCHAR, VCHAR, and SPRITE.

 

100 CALL CLEAR
110 CALL CHAR(96,"1028449292FE2010")
120 CALL HCHAR(1,1,96,32)
130 CALL VCHAR(1,1,96,24)
140 CALL HCHAR(24,1,96,32)
150 CALL VCHAR(1,32,96,24)
160 CALL SPRITE(#1,96,9,10,10,4,1)
170 GOTO 170
 
I redefine ONE character.  I use tile placement and a SPRITE here.  You can see how to repeat characters in this code.
 
HCHAR and VCHAR have the same format.  (row,column,character pattern,repetition)


#7 Opry99er ONLINE  

Opry99er

    Quadrunner

  • 9,966 posts
  • Location:Hustisford, WI

Posted Sun Jun 28, 2015 5:59 PM

Ill show some more stuff in a few...when kids go to bed



#8 Opry99er ONLINE  

Opry99er

    Quadrunner

  • 9,966 posts
  • Location:Hustisford, WI

Posted Sun Jun 28, 2015 6:34 PM

Here's how we set the colors...  Add the following lines to the above example.

 

104 CALL SCREEN(16)
105 CALL COLOR(9,2,7)
 
This sets the screen to white and character set 9 to black foreground and red background.
 
Each character set is made up of 8 ASCII codes...  The set that contains character 96 happens to be set #9.


#9 Opry99er ONLINE  

Opry99er

    Quadrunner

  • 9,966 posts
  • Location:Hustisford, WI

Posted Sun Jun 28, 2015 6:46 PM

When using tile graphics, you can get quite elaborate if you are clever and use your sets well. We have 14 available sets in XB, so you can imagine how cool you can get with your tile graphics.

You can also overlay SPRITEs on top of tiles for even more color combinations. In your dog example, you can do your base graphic in tiles and overlay SPRITEs to give you another color (5 instead of 4)

#10 Opry99er ONLINE  

Opry99er

    Quadrunner

  • 9,966 posts
  • Location:Hustisford, WI

Posted Sun Jun 28, 2015 6:49 PM

SPRITE colors are independent of tile colors, so you can have set 9 as black on dark red and use character 96 to define a SPRITE with a different color (I used light red for my SPRITE)...

Again, these are primarily limitations of Graphics Mode 1. Once you get into bitmap, the possibilities are remarkable (as seen in Rasmus's games)

#11 Plastik OFFLINE  

Plastik

    Chopper Commander

  • Topic Starter
  • 144 posts
  • The future is 8-bit
  • Location:New Jersey

Posted Sun Jun 28, 2015 7:30 PM

When using tile graphics, you can get quite elaborate if you are clever and use your sets well. We have 14 available sets in XB, so you can imagine how cool you can get with your tile graphics.

You can also overlay SPRITEs on top of tiles for even more color combinations. In your dog example, you can do your base graphic in tiles and overlay SPRITEs to give you another color (5 instead of 4)

 

Ah yes I was gonna ask about overlaying sprites and tiles for more combos now I have an answer. Thanks for the example code I was finally able to get my ground, well on the ground.

 

 

ground.png

100 CALL CLEAR
110 CALL SCREEN(15)
120 CALL CHAR(138,"FFFFFFF795945208")
130 CALL CHAR(139,"0000000000000000")
140 CALL COLOR(14,13,11)
150 CALL HCHAR(23,1,138,32)
160 CALL HCHAR(24,1,139,32)
170 GOTO 170


#12 Plastik OFFLINE  

Plastik

    Chopper Commander

  • Topic Starter
  • 144 posts
  • The future is 8-bit
  • Location:New Jersey

Posted Sun Jun 28, 2015 7:33 PM

SPRITE colors are independent of tile colors, so you can have set 9 as black on dark red and use character 96 to define a SPRITE with a different color (I used light red for my SPRITE)...

Again, these are primarily limitations of Graphics Mode 1. Once you get into bitmap, the possibilities are remarkable (as seen in Rasmus's games)

 

I'm definitely gonna practice more in graphics mode 1 then move on, but what are the advantages of bitmap mode? Is that what they classified as High res mode on the Ti?



#13 Opry99er ONLINE  

Opry99er

    Quadrunner

  • 9,966 posts
  • Location:Hustisford, WI

Posted Sun Jun 28, 2015 7:34 PM

A fine start, friend. :)

You are becoming an XB coder and don't even know it. ;)

Look forward to watching this progress and if you have any questions, feel free to ask. There are some brilliant minds here who really know their stuff.

I will do my best to help too. :)

#14 Opry99er ONLINE  

Opry99er

    Quadrunner

  • 9,966 posts
  • Location:Hustisford, WI

Posted Sun Jun 28, 2015 7:36 PM

 
I'm definitely gonna practice more in graphics mode 1 then move on, but what are the advantages of bitmap mode? Is that what they classified as High res mode on the Ti?


Yes. You can control every pixel on the screen and do crazy things that should not be spoken of...

XB cannot natively access bitmap mode however... It can be done via assembly.

#15 RXB OFFLINE  

RXB

    River Patroller

  • 3,367 posts
  • Location:Vancouver, Washington, USA

Posted Sun Jun 28, 2015 7:48 PM

Using the TIM card or a 9938 VDP chip with XB on the TI99/4A a XB program call XHI allowed bit map mode from XB.

 

Of course how this worked was the extra 162K of VDP memory.

 

This has always been the big problem with the TI is the total lack of VDP memory to do much of anything idealistically.

 

Everything we do has to be done to save every single byte of space.

 


Edited by RXB, Sun Jun 28, 2015 7:53 PM.


#16 Plastik OFFLINE  

Plastik

    Chopper Commander

  • Topic Starter
  • 144 posts
  • The future is 8-bit
  • Location:New Jersey

Posted Sun Jun 28, 2015 8:01 PM

Yes. You can control every pixel on the screen and do crazy things that should not be spoken of...

XB cannot natively access bitmap mode however... It can be done via assembly.

 

Does XB256 Allow bitmap mode? Thanks again for all the help. I'm really enjoying the challenge when coming up with sprites.

 

 

groundstep.png



#17 Lee Stewart OFFLINE  

Lee Stewart

    River Patroller

  • 3,804 posts
  • Location:Silver Run, Maryland

Posted Sun Jun 28, 2015 9:32 PM

Yes. You can control every pixel on the screen and do crazy things that should not be spoken of...

XB cannot natively access bitmap mode however... It can be done via assembly.

 

...and fbForth.

 

...lee



#18 --- Ω --- OFFLINE  

--- Ω ---

    HexaCoreRunner

  • 13,018 posts

Posted Sun Jun 28, 2015 9:42 PM

 

...and fbForth.

son-this-is-bait.png



#19 Lee Stewart OFFLINE  

Lee Stewart

    River Patroller

  • 3,804 posts
  • Location:Silver Run, Maryland

Posted Sun Jun 28, 2015 9:56 PM

This book might also help:  Smart Programming Guide for Sprites by Craig Miller.

 

...lee



#20 Plastik OFFLINE  

Plastik

    Chopper Commander

  • Topic Starter
  • 144 posts
  • The future is 8-bit
  • Location:New Jersey

Posted Sun Jun 28, 2015 10:24 PM

This book might also help:  Smart Programming Guide for Sprites by Craig Miller.

 

...lee

 

Thanks I'll take a look at it  :)



#21 Tursi OFFLINE  

Tursi

    Quadrunner

  • 5,322 posts
  • HarmlessLion
  • Location:BUR

Posted Mon Jun 29, 2015 3:29 AM

I don't think XB256 gives you bitmap mode in XB, but The Missing Link does. :)

#22 senior_falcon OFFLINE  

senior_falcon

    Stargunner

  • 1,263 posts
  • Location:Lansing, NY, USA

Posted Mon Jun 29, 2015 4:41 AM

I don't think XB256 gives you bitmap mode in XB, but The Missing Link does. :)

Tursi is right - The Missing Link allows you to use the bitmap mode in XB.  There are a few other programs that give a limited version of bitmap, but none that I know of is as thorough as TML.  

XB256 opens up the graphics mode and removes many of the limitations built into XB.  You can use 256 unique characters (XB offers 112).  The 112 characters normally used for XB can be used as sprite patterns (28 16x16 sprites) or used for a second screen which could be a help screen or something else.  XB256 is supported by the compiler so you can write and debug a program in XB, then compile it for a huge speed increase. 



#23 Plastik OFFLINE  

Plastik

    Chopper Commander

  • Topic Starter
  • 144 posts
  • The future is 8-bit
  • Location:New Jersey

Posted Mon Jun 29, 2015 8:56 AM

So many resources so little time, see you guys in a year when I'm done reading everything  :lol:



#24 Tursi OFFLINE  

Tursi

    Quadrunner

  • 5,322 posts
  • HarmlessLion
  • Location:BUR

Posted Mon Jun 29, 2015 10:12 AM

Slightly off topic -

Super Mario TI would be awesome :P


What? Super Marios Bros wasn't enough for you? ;)


Edited by Tursi, Mon Jun 29, 2015 10:12 AM.


#25 TheMole OFFLINE  

TheMole

    Dragonstomper

  • 806 posts
  • Location:Belgium

Posted Mon Jun 29, 2015 10:21 AM

Plastik, I just want to say that I like the graphics you create. Shame the Mario stuff isn't technically possible on the real hardware, but even the simplified stuff is really well done. Kudos.






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users