Omnimaga

Calculator Community => TI Calculators => TI-BASIC => Topic started by: Zera on April 08, 2010, 09:42:51 pm

Title: Question: BASIC + xLib limitations
Post by: Zera 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)
Title: Re: Question: BASIC + xLib limitations
Post by: Raylin 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. :)
Title: Re: Question: BASIC + xLib limitations
Post by: cooliojazz 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
Title: Re: Question: BASIC + xLib limitations
Post by: calc84maniac 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)
Title: Re: Question: BASIC + xLib limitations
Post by: cooliojazz 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
Title: Re: Question: BASIC + xLib limitations
Post by: DJ Omnimaga 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.
Title: Re: Question: BASIC + xLib limitations
Post by: calc84maniac 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.
Title: Re: Question: BASIC + xLib limitations
Post by: Builderboy 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
Title: Re: Question: BASIC + xLib limitations
Post by: Zera 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?
Title: Re: Question: BASIC + xLib limitations
Post by: calc84maniac 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)
Title: Re: Question: BASIC + xLib limitations
Post by: DJ Omnimaga 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