This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's TI-BASIC subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. TI-Basic => TI-BASIC
United-TI Archives -> TI-Basic
 
    » Goto page 1, 2  Next
» View previous topic :: View next topic  
Author Message
Arcane Wizard
`semi-hippie`


Super Elite (Last Title)


Joined: 02 Jun 2003
Posts: 8993

Posted: 29 Sep 2003 06:20:31 am    Post subject:

I'm completely lost in storing map data to a list. (each screen is 15*10 and I want more than 6.66 screens)

I can't even think of anything remotely usefull besides using a random map generator. But I want to have proper maps, not random ones, so does anybody have any ideas?
Back to top
tr1p1ea


Elite


Joined: 03 Aug 2003
Posts: 870

Posted: 29 Sep 2003 07:10:22 am    Post subject:

It might be a better idea if you store your map data as a string.

Last edited by Guest on 29 Sep 2003 07:10:39 am; edited 1 time in total
Back to top
JesusFreak
JesusFreak


Active Member


Joined: 17 Jun 2003
Posts: 537

Posted: 29 Sep 2003 05:53:17 pm    Post subject:

i got an idea, but you might not like it...

I would use a matriz, that is 15 by 10, then you could just save what sprites to use in another file, and then designate the screen as LSC(1)=1 or 2 or 3 + or what not, tell me if you need me to explain more...
Back to top
Arcane Wizard
`semi-hippie`


Super Elite (Last Title)


Joined: 02 Jun 2003
Posts: 8993

Posted: 30 Sep 2003 02:45:06 am    Post subject:

tr1p1ea wrote:
It might be a better idea if you store your map data as a string.

Yes, strings are nice and all, but there are only 10 and they get overwritten/changed all the time.

Jesusfreak wrote:
designate the screen as LSC(1)=1 or 2 or 3 + or what not

What do you mean with that? Store a number in LSC(screen#) that holds further data on the contents of that screen? And a 15*10 matrix is huge in memory.

I'm currently using a random map generator, that stores random numbers in the map list. Each element represents 1 screen, and the value that is stored in that element is used as a seed to generate the content of that screen.

Then, if you enter a lone building or cave or city, it uses the fractational part of what's stored for that plot as a seed to generate the content of that building or cave or city.

So, I'll have 2 lists, 1 for the world data with the seeds for each screen, and one that actually holds temporary data of what's on the screen.

I'd give the player an option to play a random map or play the campaign, problem is that the campaign shouldn't use a random world.
Back to top
Ben Trettel


Member


Joined: 17 Jul 2003
Posts: 153

Posted: 30 Sep 2003 03:32:39 pm    Post subject:

Quote:
Yes, strings are nice and all, but there are only 10 and they get overwritten/changed all the time.

Well, in Final Conflict I use about half of the strings. I just store all of the screens in one sector(about 1/4 the entier map) in one string. To extract a screen, it just sub(s it out. It's not very complicated.
Back to top
JesusFreak
JesusFreak


Active Member


Joined: 17 Jun 2003
Posts: 537

Posted: 30 Sep 2003 05:00:39 pm    Post subject:

the matrix would only be 1361 bytes, and would be temp., you would store the data in to a file, that can hold tons of screens in it for very little memory.

Quote:
designate the screen as LSC(1)=1 or 2 or 3 + or what not


What do you mean with that? Store a number in LSC(screen#) that holds further data on the contents of that screen? And a 15*10 matrix is huge in memory.


opps. bad thought, the file could load the data right to the matrix, all you need to do is a For( command

i will write a simple one today, and send you it later, you might need to use a temp, list, but what ever,

again, e-mail me if you want faster answers
Back to top
Ben Trettel


Member


Joined: 17 Jul 2003
Posts: 153

Posted: 30 Sep 2003 05:23:41 pm    Post subject:

Well strings would be much smaller. Razz
Back to top
Adm.Wiggin
aka Tianon


Know-It-All


Joined: 02 Jun 2003
Posts: 1874

Posted: 30 Sep 2003 09:07:31 pm    Post subject:

ill say, cause with a list/matrix, it is 9 bytes per number, plus any the list/matrix needs for dimentions/other stuff... in a string, it is just 1 byte for each character. 9 to 1 is a very good ratio Smile
Back to top
62 52 53 53
Formerly known as 62 52 53 53


Active Member


Joined: 30 May 2003
Posts: 607

Posted: 01 Oct 2003 04:45:28 pm    Post subject:

ONLY 10! no, there are 256. Just because it's requires a complicated process to get hte other 246, doesen't mean they don't exist. Um, I think it's 5CXX or something like that that you type into an asm program, compile the prog, unlock it, and copy the string character.
Back to top
Ben Trettel


Member


Joined: 17 Jul 2003
Posts: 153

Posted: 01 Oct 2003 05:59:45 pm    Post subject:

Even if there are only 10 I personally think that they are the best choice. Final Conflict will only use 6 strings, 5 for the 5 "sectors" and one for the current screen.
And if you took the time to look, you would see that there are only 10 matrixes, too. Lists are infinite(almost), so most people choose them. Maybe the TI83II or whatever would improve on this?
Back to top
Adm.Wiggin
aka Tianon


Know-It-All


Joined: 02 Jun 2003
Posts: 1874

Posted: 01 Oct 2003 06:47:50 pm    Post subject:

yes, maybe something like Nameable strings Very Happy just like the lists, how precious Smile
Back to top
Arcane Wizard
`semi-hippie`


Super Elite (Last Title)


Joined: 02 Jun 2003
Posts: 8993

Posted: 02 Oct 2003 08:46:45 am    Post subject:

Matrices -> Only 10 and take too much memory, I can't think of a reason to use them.
Lists -> Custom names (yay) but still take quite some memory. Are just as easy to use as matrices (L(X+Xdimensions(Y-1))). Lists make matrices pretty much useless.
Strings -> Only 10 available without asking everybody that wants to play your game to mess with their calcs. They are also overwritten by all kinds of programs which makes them ill-suted for long time data storage. Custom named strings would be perfect, though. But then again custom named variables be nice.

Problem with using a program to hold all the map data would be that you can't actually change any of that, but might be able to work around that with a list to keep track of all the changes (weapons picked up, quests solved, enemy's killed, etc.).

JesusFreak wrote:
I will write a simple one today, and send you it later, you might need to use a temp, list, but what ever

Thanks, but no thanks, I'm quite capable of writing my own routine for that so you shouldn't waste your time with doing that for me.

I'll probably use something like:
MAINGAME:
1->Ø:prgmMAPPRGM //screen number in Ø
//load changes from LSAVE into LMAP
//draw screen from LMAP
//play

MAPPRGM:
If Ø=1:{12,34,56,78,90}->LMAP
If Ø=1:Return
If Ø=2:{34,56,78,90,12}->LMAP
If Ø=2:Return
If Ø=3:{34,56,78,90,12}->LMAP

I just hoped somebody had thought of a very good way of storing lots of data without using 9 times as many bytes as it should take or other limiting factors. =/


Last edited by Guest on 02 Oct 2003 08:48:13 am; edited 1 time in total
Back to top
62 52 53 53
Formerly known as 62 52 53 53


Active Member


Joined: 30 May 2003
Posts: 607

Posted: 04 Oct 2003 10:52:16 am    Post subject:

Woah! Nameable Vars! I'd buy that! They should make a OS that has support for creating/using them if a certificate is installed, so that people who want to program with them can make them, and everybody can run them!

00000.....00000.....00000
00000.....00000.....00000
00000.....00110.....00000
01100.....01000.....00000
01010.....00100.....01010
01100.....00010.....10101
01010.....01100.....10001
Real........String.......Matrix


Last edited by Guest on 04 Oct 2003 10:52:39 am; edited 1 time in total
Back to top
Darth Android
DragonOS Dev Team


Bandwidth Hog


Joined: 31 May 2003
Posts: 2104

Posted: 04 Oct 2003 11:18:23 am    Post subject:

i have a prgm that uses one string but is the equivilant of unlimited nameable strings Cool

name of string in Str2
prgm queries Str5 and returns string named Str2 into Str5
Back to top
JesusFreak
JesusFreak


Active Member


Joined: 17 Jun 2003
Posts: 537

Posted: 06 Oct 2003 05:10:22 pm    Post subject:

ahhh, but then you could make updates, like a new file that has 20 extra screens, but you can't with strings, once they are all gone, they are gone.

also you only use one matrix, and it is faster (at least for me) to use a matrix, if you align your up/down, left/right cords, to the matrix, you don't have to search for the cord, in a string, or list, which could be time costly. I feel the extra memory take is okay, if you use flash gordon, or some prgm, that archives prgms, and not just lists, that way you could creat a prgm, that has a "planet" of 20 screens in one file, and archive 128+K of other planets.
Back to top
Ben Trettel


Member


Joined: 17 Jul 2003
Posts: 153

Posted: 06 Oct 2003 05:18:27 pm    Post subject:

You don't have to search the string. You can calculate the location of the data in the string. Razz
Back to top
JesusFreak
JesusFreak


Active Member


Joined: 17 Jun 2003
Posts: 537

Posted: 06 Oct 2003 05:23:40 pm    Post subject:

with the matrix, the search is all ready done, no need for calculations Razz it is aligned
Back to top
Ben Trettel


Member


Joined: 17 Jul 2003
Posts: 153

Posted: 06 Oct 2003 05:50:45 pm    Post subject:

I still would rather use strings. Matrixes are for newbies, as they are much easier to use than strings. Strings are pretty much the same speed as matrixes, too. Don't try to convince me, as I'm too fixed on using strings as a permanent data storage unit thing.
Back to top
Adm.Wiggin
aka Tianon


Know-It-All


Joined: 02 Jun 2003
Posts: 1874

Posted: 06 Oct 2003 09:30:12 pm    Post subject:

strings are also smaller, (as was stated)...
Back to top
Arcane Wizard
`semi-hippie`


Super Elite (Last Title)


Joined: 02 Jun 2003
Posts: 8993

Posted: 07 Oct 2003 06:27:03 am    Post subject:

Ben Trettel wrote:
I still would rather use strings.  Matrixes are for newbies, as they are much easier to use than strings.  Strings are pretty much the same speed as matrixes, too.  Don't try to convince me, as I'm too fixed on using strings as a permanent data storage unit thing.

All I'd like to know is why you choose strings even though they don't have custom names and there are only 10 of them so if another program happends to use the same string as your program does, poof! there went all your valuable data.

You can align lists to x,y coordinates by using the formula I posted above so lists should always replace matrices, simply because matrices have no advatage whatsoever on lits.
Back to top
Display posts from previous:   
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
    » Goto page 1, 2  Next
» View previous topic :: View next topic  
Page 1 of 2 » All times are UTC - 5 Hours

 

Advertisement