[Staff][Beta] Pure TI-le

Here you can find side projects of the staff and great projects which we think should get extra support. (Note that featured projects are not projects by staff members of MaxCoderz)

Moderator: MaxCoderz Staff

Post Reply
DarkAuron
Maxcoderz Staff
Posts: 1349
Joined: Sat 18 Dec, 2004 6:53 pm

[Staff][Beta] Pure TI-le

Post by DarkAuron »

Made in pure TI-BASIC and not even using Pic files, I made a graphical tilemapper engine that supports hit detection and warp events at a decent speed. Included are 3 'maps' (or rooms, screens, whatever you want to call them) with a total of 11 tiles, one of which isn't used yet. It's the first bit of programming I've managed to do recently, and I pretty much did all of it yesterday. The screenshot and the demo itself is self-explanatory, all you have to do is prgmTILES.

Image
Download!
Last edited by DarkAuron on Sun 19 Aug, 2007 3:02 am, edited 3 times in total.
[Gridwars Score] - E: 1860037 M: 716641 H: 261194
User avatar
Loki
Extreme Poster
Posts: 314
Joined: Thu 18 Aug, 2005 7:01 pm
Location: My world is in grayscale, but if i stand still long enough, i see it in black and white.
Contact:

Post by Loki »

Like i've said before, very nice ^_^;
Image
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post by Timendus »

How does it work then? Can you explain the idea behind it in a few words?
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
DarkAuron
Maxcoderz Staff
Posts: 1349
Joined: Sat 18 Dec, 2004 6:53 pm

Post by DarkAuron »

Basically I have all the image data stored into TILEDATA, and when I want to draw a tile I store the tile number into T, and call TILEDATA. Each tile is drawn with a series of Line(), PixelOn(), and PixelOff() commands. PixelOff is only used when patterns would require it for optimization.

The same thing is done for the map data. I just store a map number into M and call TILEMAPS, which clears the tile area with a random clearing effect, stores the map data into [J], and then runs through the array, calling TILEDATA for each tile until it's all drawn. And at the end, it sets C to 5, which is just merely a way of updating the character's image, as values from 1 to 4 are movement (SENW in that order), any value other than 1-4 won't have a movement check. I use the same technique in Tankies for updating.

TILEEVTS is the events subroutine. It's run everytime the player's position changes, and right now I just have warp events.

If you'd like to play around with it, I'll list the variables and what they're used for:

A - Player's Map X position
B - Player's Map Y position
C - Change in player (nonzero will run through update routine at end of main loop)
I - Temporary variable used for loops
K - getKey value
L - Event availible (0 or 1, only one event may be run at once so I need a switch)
M - Map #
N - Tile X when drawing the screen
O - Tile Y when drawing the screen
T - Tile #
X - Tile's Screen X coordinate
Z - Tile's Screen Y coordinate

[J] - Current map array

And possibly another variable or two that I may have missed.
[Gridwars Score] - E: 1860037 M: 716641 H: 261194
User avatar
kalan_vod
Calc King
Posts: 2932
Joined: Sat 18 Dec, 2004 6:46 am
Contact:

Post by kalan_vod »

I enjoyed playing this and think it is very fast! I really think this is an high point in basic. Fast and looks good!
User avatar
DJ_O
Calc King
Posts: 2323
Joined: Mon 20 Dec, 2004 6:47 pm
Location: Quebec (Canada)
Contact:

Post by DJ_O »

OMG awesome work, you should make a game with this ^^
ImageImageImageImage
User avatar
Loki
Extreme Poster
Posts: 314
Joined: Thu 18 Aug, 2005 7:01 pm
Location: My world is in grayscale, but if i stand still long enough, i see it in black and white.
Contact:

Post by Loki »

Thats what I keep telling him
Image
DarkAuron
Maxcoderz Staff
Posts: 1349
Joined: Sat 18 Dec, 2004 6:53 pm

Post by DarkAuron »

If I did that though, I probably wouldn't finish it; I'd probably set up high expectations that I wouldn't be able to meet, and I'd get y'alls hopes up. Plus I'd distract myself from Tankies, and probably add another project to the 'unfinished and will never be touched again' list, which is kinda big to be honest..

But yes, it would be neat as a game, and I might make it a good enough engine so that someone could make a game with it, without worrying too much about the engine programming itself.. just events, story, and modifications here and there.

I thought of a decent way to make either one massive (but not that massive) or at least split map lists. Since a list element can store up to 14 lossless digits, and I have more than 10 tiles, I can store an entire column of a map/screen in one list element, and then theres 9 rows, so 9 elements per screen. If I had 100 screens that'd be 9*9*100, or 8100 bytes, plus the list's header data. Not too bad especially if I split it up and archived/unarchived when needed. Whether I'd directly read from the list or if I'd copy to an array first I'm not sure, it would depend.

Who knows what I'll do with it. I just know that next I'll be changing the map data system and probably make a map editor since typing in maps' data by hand takes awhile and gets to be annoying, plus I have to make them on my computer first if I don't have a map editor, and I want to do this stuff portably.

Edit: Oh and maybe a numbered command system built into lists so that larger graphics can be archived without using a program or a Pic file. I'll explain that later if it doesn't make sense.
[Gridwars Score] - E: 1860037 M: 716641 H: 261194
Spengo
Calc Master
Posts: 1116
Joined: Sat 15 Jan, 2005 3:56 am
Location: ooga booga land
Contact:

Post by Spengo »

Very uebersome man! Hope this turns out to be a good game. :)
EDIT: yeah, that's almost illusiat speed- some ascii rpgs I enjoyed. Good work!
bananas... o.o
DarkAuron
Maxcoderz Staff
Posts: 1349
Joined: Sat 18 Dec, 2004 6:53 pm

Post by DarkAuron »

[At school]

This morning I made the map editor; it does 12 PixelOff's onto the corners of the currently selected tile in the map, and the - and + buttons are used to change the tile you're placing, which has a 5x2 arrow above it to show which one you're currently using. I'll make a screenshot later today.

Next I'll create the new map system, and using it will allow the map editor to quickly and easily edit and change any and all maps. I could also make the editor's flexibility span enough to be able to resize the map list, so if I wanted to add more maps, I could just make it expand the list and create space for a new one, or vice-versa to delete some. Plus I'll add a few extra functions like filling the entire map with a single tile by the press of a button or horizontal and vertical fills like the Tankies Landscape Editor can.

As for the events, I'm going to have to find a quicker way of doing them, since the way I'm trying it out now will be extremely slow once map events are built up. Maybe do a number system where I could give a single number that would tell me the map #, x coord, and y coord all at once.. it'd require far less checks, but it'd be even harder to figure out when editing. Could be worth the insanity though.

And by numbered system, I mean like this: M*100+B*9+A. No two places would ever have the same number, every single tile in every map has its own number. Nifty eh? All I'd have to do is calculate and save that number into a variable (probably theta) at the beginning of the EVENTS routine, then do numbered checks. It'd save space, and I'd never have to do If M=4 and A=3 and B=5:Then:End; I'd just have to do If theta=448:Then:End. Also if I wanted to know the direction that the player attempted to move (like say if I wanted to talk to an npc that I obviously can't walk onto), I could add C (the character's attempted direction) onto that numbered system, either as another digit or as a decimal placeholder. Like, 448.2 would be Map 4 (3,5) - attempt at moving east.

Lost yet? I love programming. 8)
[Gridwars Score] - E: 1860037 M: 716641 H: 261194
User avatar
kalan_vod
Calc King
Posts: 2932
Joined: Sat 18 Dec, 2004 6:46 am
Contact:

Post by kalan_vod »

DarkAuron wrote:Lost yet? I love programming. 8)
Nope, and glad to hear! Looks great.
User avatar
Shadow Phoenix
Calc Guru
Posts: 835
Joined: Mon 03 Jan, 2005 7:54 pm
Location: out there. seriosly.

Post by Shadow Phoenix »

Looks Great DarkAuron! :D
Life is getting better.
User avatar
KermMartian
Calc Wizard
Posts: 549
Joined: Tue 05 Jul, 2005 11:28 pm
Contact:

Post by KermMartian »

Very nice; it's hard to do an efficient tilemapper in BASIC. :)
Image Image Image
DarkAuron
Maxcoderz Staff
Posts: 1349
Joined: Sat 18 Dec, 2004 6:53 pm

Post by DarkAuron »

And now the map editor is released, along with the modifications for the game engine. Changes are not final and are subject to change.

Use arrow keys to move the cursor around, 2nd to place the tile, - and + to select tile you're going to place, TRACE and GRAPH to change the map (from 0 to 19), and LN to save the current map. Finally, MODE to exit. When prompted press N or Y for saving when you're leaving the map. I'll make readmes later when I'm closer to finalizing these things.

Image
Download!
Last edited by DarkAuron on Sun 19 Aug, 2007 3:03 am, edited 2 times in total.
[Gridwars Score] - E: 1860037 M: 716641 H: 261194
User avatar
DJ_O
Calc King
Posts: 2323
Joined: Mon 20 Dec, 2004 6:47 pm
Location: Quebec (Canada)
Contact:

Post by DJ_O »

:excited: :excited: :excited: :excited: :excited: :excited: :excited: :excited: :excited:

Awesome (art)work darkauron I love it, i guess its SE only right?
ImageImageImageImage
Post Reply