Author Topic: Question: BASIC + xLib limitations  (Read 5335 times)

0 Members and 1 Guest are viewing this topic.

Offline Zera

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 737
  • Rating: +82/-7
  • Monochrome Artisan
    • View Profile
Question: BASIC + xLib limitations
« on: April 08, 2010, 09:42:51 pm »
I'm a bit curious about some of the limitations with projects that use BASIC + xLib. More specifically:

 - Say you have a monochromatic tileset of 16x16 tiles. Would there be any map resolution constraints to consider?

 - Is map-looping possible? This might be most useful for RPG world maps where a player has access to a ship or transport of some kind.

 - Would it be possible to animate tiles in some fashion? (i.e., water) What kind of animation is most feasible?

 - With the sprite-routine, what sort of limitations are we looking at? How many sprites on screen at a single time?

 - Any specific constraints on the number of tiles that can be fit into a single tileset? (or total memory)

Offline Raylin

  • Godslayer
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1392
  • Rating: +83/-25
  • I am a certifiable squirrel ninja.
    • View Profile
    • Ray M. Perry
Re: Question: BASIC + xLib limitations
« Reply #1 on: April 08, 2010, 09:48:56 pm »
- Say you have a monochromatic tileset of 16x16 tiles. Would there be any map resolution constraints to consider?

Yes. Just the screen edges, though. 6*4 map at the largest.

- Is map-looping possible? This might be most useful for RPG world maps where a player has access to a ship or transport of some kind.

Yes, but you'd move the coordinate of the transport, not the map itself IIRC.

- Would it be possible to animate tiles in some fashion? (i.e., water) What kind of animation is most feasible?

You could but, the game would be horribly slow...

- With the sprite-routine, what sort of limitations are we looking at? How many sprites on screen at a single time?

You can fill the screen with non-moving sprites. But, when you animate them, the game will lag (if you use the real(1) command).

- Any specific constraints on the number of tiles that can be fit into a single tileset? (or total memory)

Just memory. :)
« Last Edit: April 08, 2010, 09:49:49 pm by Raylin »
Bug me about my book.

Sarah: TI-83 Plus Silver Edition [OS 1.19]
Cassie: TI-86 [OS 1.XX]
Elizabeth: TI-81 [OS 1.XX]
Jehuty: TI-83 Plus Silver Edition [OS 1.19]
Tesla: CASIO Prizm







Offline cooliojazz

  • Support Staff
  • LV7 Elite (Next: 700)
  • *******
  • Posts: 619
  • Rating: +66/-9
  • I omnoms on your soul
    • View Profile
    • Unreal Phantasies
Re: Question: BASIC + xLib limitations
« Reply #2 on: April 08, 2010, 10:27:37 pm »
If by Tilesets you mean a single picture, then its inly 256, but because of the fact that xlib is awesome, the 257th tile is the first tile from the next picture # eg. pic 10 to pic 11, so thats how the constraint is just memory.  Just wanted to make sure that was explained. =P
Spoiler For Random signess:
You can not beat my skills.
Trust me.
So don't even try.
And remember never to trust someone who says, "Trust me."

TI File Editor Progress: Remade in java like a boss. 50% we'll call it? IDK =P
Java Libraries: JIRC - 90% JTIF - 5%
TI Projects: Unreal Notator - -5000%
Nomcraft, a Bukkit mod
Some of the music I write can be found here | The Rest Should Be Here (Bandcamp)

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Question: BASIC + xLib limitations
« Reply #3 on: April 08, 2010, 10:29:01 pm »
If by Tilesets you mean a single picture, then its inly 256, but because of the fact that xlib is awesome, the 257th tile is the first tile from the next picture # eg. pic 10 to pic 11, so thats how the constraint is just memory.  Just wanted to make sure that was explained. =P
Well, 256 tiles don't fit into one Pic file. But it still wraps after 96 (or I suppose 24 for 16x16 tiles)
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline cooliojazz

  • Support Staff
  • LV7 Elite (Next: 700)
  • *******
  • Posts: 619
  • Rating: +66/-9
  • I omnoms on your soul
    • View Profile
    • Unreal Phantasies
Re: Question: BASIC + xLib limitations
« Reply #4 on: April 08, 2010, 10:33:28 pm »
o wait, sorry, thats what i meant, wasnt thinking and just decided to put a 1 byte # for some reason =P
Spoiler For Random signess:
You can not beat my skills.
Trust me.
So don't even try.
And remember never to trust someone who says, "Trust me."

TI File Editor Progress: Remade in java like a boss. 50% we'll call it? IDK =P
Java Libraries: JIRC - 90% JTIF - 5%
TI Projects: Unreal Notator - -5000%
Nomcraft, a Bukkit mod
Some of the music I write can be found here | The Rest Should Be Here (Bandcamp)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Question: BASIC + xLib limitations
« Reply #5 on: April 08, 2010, 11:09:09 pm »
- Say you have a monochromatic tileset of 16x16 tiles. Would there be any map resolution constraints to consider?

Yes. Just the screen edges, though. 6*4 map at the largest.

Mhmm actually it's possible to have maps wider than the screen. I think 32x32 should be the max to use. A 32x32 tilemap, when loaded in a matrix, takes 9227 bytes of RAM plus another 9227 to be stored (since it updates Ans variable in the process).

Also for tileset limit, it depends. If your maps are in Axe format, it's 16 tiles if you use half-bytes, 256 if each tiles takes one byte, 65536 if each takes two. In xLIB, the max is 256 I think, but I could be wrong. I remember back then tr1p1ea wanted it to be 65536 but Idk if he implemented this anymore.

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Question: BASIC + xLib limitations
« Reply #6 on: April 08, 2010, 11:11:07 pm »
Also, keep in mind that smooth-scrolling is not supported -- tilemaps are only drawn aligned to the nearest multiple of 8 or 16 pixels, depending on the tile size.
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Question: BASIC + xLib limitations
« Reply #7 on: April 08, 2010, 11:18:33 pm »
Well you can cheat by doing some tricky scrolling and pic recalling ^^ although i dont know how fast it would be :P

Offline Zera

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 737
  • Rating: +82/-7
  • Monochrome Artisan
    • View Profile
Re: Question: BASIC + xLib limitations
« Reply #8 on: April 08, 2010, 11:31:16 pm »
I'm a bit confused about map resolution constraints. 6x4 would only be a single screen. We're talking about entire dungeon and town maps, here. I know I've seen much larger maps, unless I'm mistaken.

32x32 sounds fairly reasonable. I'm just not sure if that would be adequate for a world map, on the other hand.

New question: What if the tileset were 24x24px? Would this affect any resolution constraints?

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Question: BASIC + xLib limitations
« Reply #9 on: April 08, 2010, 11:35:04 pm »
I'm a bit confused about map resolution constraints. 6x4 would only be a single screen. We're talking about entire dungeon and town maps, here. I know I've seen much larger maps, unless I'm mistaken.

32x32 sounds fairly reasonable. I'm just not sure if that would be adequate for a world map, on the other hand.

New question: What if the tileset were 24x24px? Would this affect any resolution constraints?
I think "resolution" was a confusing word to use, because it generally refers to screen size. And xLib only supports tilesets of 8x8 and 16x16 (and 24x24 would be far too large in the screen to have any good view anyway)
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Question: BASIC + xLib limitations
« Reply #10 on: April 08, 2010, 11:36:05 pm »
for a world map, it may be best to store the map in a string, at the expense of speed. I think Celtic III has string tilemaps but they are very hard to use IIRC. However if you use basic plus xlib for it, it would scroll the screen 16 pixels in the direction you want and display the next row/column of tiles. It would be slower than normal maps but a world map is often slower anyway. With strings, assuming you use 1 byte characters, you could fit a 96x96 map in 9200 ish bytes

Since there are no 24x24 tilemappers, you would need to display tiles by tile if you used such large tiles. However, the tile size doesn,t make any difference on the tilemap layout memory usage. Just the tiles data itself will be larger
« Last Edit: April 08, 2010, 11:38:54 pm by DJ Omnimaga »