CEMETECH
Leading The Way To The Future
Login [Register]
Username:
Password:
Autologin:

Don't have an account? Register now to chat, post, use our tools, and much more.
Latest Headlines
Online Users
There are 105 users online: 7 members, 65 guests and 33 bots.
Members: Alebcay, Ashbad, DHerls, flyingfisch, jackklaus, lafferjm, ordelore.
Bots: Spinn3r (1), MSN/Bing (1), Magpie Crawler (4), VoilaBot (8), Googlebot (18), MSN/Bing (1).
RSS & Social Media
SAX
You must log in to view the SAX chat widget
Author Message
Raylin


Expert


Joined: 05 May 2008
Posts: 567
Location: Illinois Institute of Technology

Posted: 02 Oct 2011 08:07:05 pm    Post subject: Most efficient way to store a lot of text?

How do you do it in pure BASIC?
Subroutines and archiving?
_________________



The Labyrinthine Chronicles
Prophecy: 0% (planning)
The Journalist: 0%
Image of Imperfection: 0%
Phantom Sanctuary: 0%
Godslayer: 0%
Back to top
tifreak8x


Guru


Joined: 16 Mar 2005
Posts: 9063
Location: Sol System

Posted: 02 Oct 2011 08:07:49 pm    Post subject:

Depends, what kind of text are we talking? Dialogue? Data?
_________________
Projects: AOD Series: 70% | FFME: 80% | Pokemon: 18% | RPGSK: 60% | Star Trek: 70% | Star Trek 83+: 40% | TI-City: 5%

Look here for Assembly Resources.
Back to top
Raylin


Expert


Joined: 05 May 2008
Posts: 567
Location: Illinois Institute of Technology

Posted: 02 Oct 2011 08:11:16 pm    Post subject:

Dialogue and map data.
And some UI elements.
_________________



The Labyrinthine Chronicles
Prophecy: 0% (planning)
The Journalist: 0%
Image of Imperfection: 0%
Phantom Sanctuary: 0%
Godslayer: 0%
Back to top
elfprince13


OVER NINE THOUSAND!


Joined: 23 May 2005
Posts: 10234
Location: A galaxy far far away......

Posted: 02 Oct 2011 08:17:49 pm    Post subject:

"Most efficient" really depends on
a) The content of the data
b) What you mean by efficient in terms of time/memory tradeoffs.
_________________
StickFigure Graphic Productions || VSHI: Vermont Sustainable Heating Initiative


Back to top
tifreak8x


Guru


Joined: 16 Mar 2005
Posts: 9063
Location: Sol System

Posted: 02 Oct 2011 08:18:07 pm    Post subject:

What kind of assembly/library do you plan on using? I could easily explain how to do this with Celtic2 (I'd have to set up a download for you to grab it from, since I don't think there's a release anywhere of the working version) though I think Celtic3 has the same libraries, just different ways to call the commands.

Anyways, you can store large blocks of dialogue into an appvar using a format similar to what is found in http://www.ticalc.org/archives/files/fileinfo/409/40966.html

Map data can just be stored to a single line per map and recalled with celtic. I could probably pull some sample code out of pokemon somewhere to show how C2 handles it.
_________________
Projects: AOD Series: 70% | FFME: 80% | Pokemon: 18% | RPGSK: 60% | Star Trek: 70% | Star Trek 83+: 40% | TI-City: 5%

Look here for Assembly Resources.
Back to top
Raylin


Expert


Joined: 05 May 2008
Posts: 567
Location: Illinois Institute of Technology

Posted: 02 Oct 2011 08:19:55 pm    Post subject:

elfprince13 wrote:
"Most efficient" really depends on
a) The content of the data
b) What you mean by efficient in terms of time/memory tradeoffs.


Efficient memory-wise.
Content is text only.

And this is in pure BASIC.
_________________



The Labyrinthine Chronicles
Prophecy: 0% (planning)
The Journalist: 0%
Image of Imperfection: 0%
Phantom Sanctuary: 0%
Godslayer: 0%
Back to top
souvik1997


Guru-in-Training


Joined: 19 Apr 2010
Posts: 2870

Posted: 02 Oct 2011 08:31:52 pm    Post subject:

You could use RLE compression to save some space, but I don't think it would be very helpful for dialogue. Without an assembly library, storing large amounts of text efficiently is going to be fairly difficult, since there are only 10 string variables. If you do end up using an assembly library like Celtic, you could create appvars that hold text and archive and unarchive them when you need to.
_________________
CALCnet Tournament-38%


deviantArt
Back to top
_player1537


Guru-in-Training


Joined: 25 Nov 2009
Posts: 2958

Posted: 02 Oct 2011 08:36:08 pm    Post subject:

You could go the list route for it. Where you use every element of a list, with each digit of accuracy to store data. ie, you could have a list that was: {0805121215}, which would stand for the world "HELLO" ('H' being 08, 'E' 05, 'L' 12, etc), and then just decompress that list when you need to. The benefits are: you can have an arbitrary name for the data and you can archive the data. The downsides are: you have to have all the data in RAM and it is difficult to edit/find specific letters in (ie, character 212 to 218).
_________________
http://tanner.myserverathome.com
Back to top
elfprince13


OVER NINE THOUSAND!


Joined: 23 May 2005
Posts: 10234
Location: A galaxy far far away......

Posted: 02 Oct 2011 09:44:54 pm    Post subject:

Raylin wrote:
Content is text only.

That doesn't answer the question. Being able to compress something efficiently depends on data to have some structure or patternedness that can be exploited to shrink the amount of memory required for storage without losing data.

Text generated by a random number generator probably won't be very amenable to compression (unless you know the algorithm + seed, and have a lot of spare CPU cycles). 1MB of the letter A has insane redundancy and perfect order. Human language, or ascii art, or pretty much anything meaningful, will probably fall somewhere between those two.
_________________
StickFigure Graphic Productions || VSHI: Vermont Sustainable Heating Initiative


Back to top
Raylin


Expert


Joined: 05 May 2008
Posts: 567
Location: Illinois Institute of Technology

Posted: 02 Oct 2011 11:16:10 pm    Post subject:

Context is dialogue and map data plus some UI elements.
_________________



The Labyrinthine Chronicles
Prophecy: 0% (planning)
The Journalist: 0%
Image of Imperfection: 0%
Phantom Sanctuary: 0%
Godslayer: 0%
Back to top
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 55760
Location: Earth, Sol, Milky Way

Posted: 03 Oct 2011 02:33:51 am    Post subject:

I just noticed that Raylin writes ridiculously short posts that are not full sentences, with one thought per line. Razz RLE does not succeed well at compressing text. Something like LZO would be much better at text, but implementing an LZO algorithm is nontrivial if you've never done it before (I have Wink but not in BASIC or ASM; it was C). Breaking it up into the map in appvars, the dialog in related appvars, and the UI in its own appvar would probably be good. It might also be a smart idea to combine related map and dialog areas together in appvars.
_________________


Back to top
Raylin


Expert


Joined: 05 May 2008
Posts: 567
Location: Illinois Institute of Technology

Posted: 03 Oct 2011 07:58:42 am    Post subject:

KermMartian wrote:
I just noticed that Raylin writes ridiculously short posts that are not full sentences, with one thought per line. Razz


Hush yo face.

KermMartian wrote:
RLE does not succeed well at compressing text. Something like LZO would be much better at text, but implementing an LZO algorithm is nontrivial if you've never done it before (I have Wink but not in BASIC or ASM; it was C). Breaking it up into the map in appvars, the dialog in related appvars, and the UI in its own appvar would probably be good. It might also be a smart idea to combine related map and dialog areas together in appvars.


But then, the program ends up being hybrid BASIC.
Then, I cry because hybrid BASIC can't compete with Axe.
_________________



The Labyrinthine Chronicles
Prophecy: 0% (planning)
The Journalist: 0%
Image of Imperfection: 0%
Phantom Sanctuary: 0%
Godslayer: 0%
Back to top
Ashbad


... I think redheaded girls are kind of cool


Joined: 01 Dec 2010
Posts: 2418
Location: Stomp Stomp Stomp, The Idiot Convention

Posted: 03 Oct 2011 08:18:35 am    Post subject:

Raylin wrote:
Then, I cry because hybrid BASIC can't compete with Axe.


And then we cry because we don't care if it competes with Axe or not, as long as your output program is cool and fun.
_________________
-Ashbad
Back to top
Raylin


Expert


Joined: 05 May 2008
Posts: 567
Location: Illinois Institute of Technology

Posted: 03 Oct 2011 09:02:57 am    Post subject:

This is for the contest.
I will lose if I enter Hybrid BASIC with a program intended for pure BASIC.
That's the opposite of winning.
_________________



The Labyrinthine Chronicles
Prophecy: 0% (planning)
The Journalist: 0%
Image of Imperfection: 0%
Phantom Sanctuary: 0%
Godslayer: 0%
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
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are GMT - 5 Hours

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© Copyright 2000-2013 Cemetech & Kerm Martian :: Page Execution Time: 0.035376 seconds.