Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: Freyaday on March 29, 2011, 11:08:19 am

Title: Asylum
Post by: Freyaday on March 29, 2011, 11:08:19 am
One of the things I am working on is a text adventure in Axe by the name of Asylum. It's meant to give you the creeps, by the way, something that is aided by the fact that it runs in inverse text mode. There are two problems with it, however: There is no text parser, and, far, far, worse, The program is almost 5k compiled, and it's barely even started.
Title: Re: Asylum
Post by: squidgetx on March 29, 2011, 03:19:24 pm
No text parser? What part of it is giving you problems? The one I wrote in Ash:Phoenix is pretty complex, I think I can help you there

What's making the file so large? Sounds cool by the way :)
Title: Re: Asylum
Post by: Freyaday on March 29, 2011, 03:54:22 pm
I have no Idea what's making it so big. I don't think it's the fact that each line of text has to go all the way to the edge of the screen, because when I changed the program to use the graphscreen instead of the homescreen, it got almost 2kB larger. I only have Axe 0.4.7, so there's no built in string equality check, which is what's flummoxing me on the text parser. I did figure out a way to chop up the input though: loop through the input and change every space into a null, that way Axe sees a bunch of separate strings to check instead of one long one.
Title: Re: Asylum
Post by: squidgetx on March 29, 2011, 03:58:43 pm
Woah, you're wordwrapping? Nice.
Anyway, the way that mine works is something like this....
Code: [Select]
"This is"[01]"text data"->Str1

Run loop for length of Str1
Keep track of the "current character"
If current character is displayable (>32) display it. Then advance the cursor over by 1. If you're at the end of the line newline and reset cursor X

Else
If character=1
do stuff
End
DispGraph
End
Something along those lines...
So like you could write code for the parser so that every time it sees a 1 the program will do something or other, every time it sees a 2 it can do something else...
Title: Re: Asylum
Post by: Munchor on March 29, 2011, 04:01:28 pm
I have no Idea what's making it so big. I don't think it's the fact that each line of text has to go all the way to the edge of the screen, because when I changed the program to use the graphscreen instead of the homescreen, it got almost 2kB larger. I only have Axe 0.4.7, so there's no built in string equality check, which is what's flummoxing me on the text parser. I did figure out a way to chop up the input though: loop through the input and change every space into a null, that way Axe sees a bunch of separate strings to check instead of one long one.

I'd recommend you to use a subroutine made by, IIRC, souvik, but I'm not sure, check the Axe subroutines, it's CS, Compare String, you use it like:

Code: [Select]
sub(CS,"HEY","HELLO

To check if two strings are equal:

Code: [Select]
"HEY"->Str1
If sub(CS,"HEY",Str1
.This will be executed since "HEY" == "HEY"
End

But you have to include Lbl CS (get it from Axe subroutines topic) in your code, meaning larger side.
Title: Re: Asylum
Post by: DJ Omnimaga on March 29, 2011, 04:01:37 pm
Text tends to end up pretty large quick so that might explain it. In Illusiat 13, I think 30% of the code is just text.
Title: Re: Asylum
Post by: Ashbad on March 29, 2011, 04:03:10 pm
Text tends to end up pretty large quick so that might explain it. In Illusiat 13, I think 30% of the code is just text.

Yeah, text can be really a PITA >.< though if you don't use anything past the letter 'Z' then you can compress it somewhat to 3/4 it's size ;)
Title: Re: Asylum
Post by: Freyaday on March 29, 2011, 05:08:24 pm
That might be it. Any ideas on compression? And does anybody know why it gained 2kB when I put it on the graphscreen?
Title: Re: Asylum
Post by: Freyaday on April 12, 2011, 11:32:44 pm
Here's the ASM of what I have of Asylum so far. It's meant to be run on a ~15Mhz calc, btw, and up/down to move the cursor (it's the one that's blinking) and Enter to select/continue. If you wind up back at the beginning screen of inverse text, that means you've fallen comatose again and have to start over. The solution? Choose a different option next time. Also, there is no way to exit the game other than to reach the current end of the story, so if you wanna quit before reaching the end of the game, you're gonna have to do a battery pull. I'm still working on that. Note: Meant to be scary, with the odd dash of humor in it.
Title: Re: Asylum
Post by: Munchor on April 13, 2011, 04:42:01 am
Here's the ASM of what I have of Asylum so far. It's meant to be run on a ~15Mhz calc, btw, and up/down to move the cursor (it's the one that's blinking) and Enter to select/continue. If you wind up back at the beginning screen of inverse text, that means you've fallen comatose again and have to start over. The solution? Choose a different option next time. Also, there is no way to exit the game other than to reach the current end of the story, so if you wanna quit before reaching the end of the game, you're gonna have to do a battery pull. I'm still working on that. Note: Meant to be scary, with the odd dash of humor in it.

Nice! Can you make it go to 6MhZ if the calculator is a 83+ or another non-15MhZ-able class though?
Title: Re: Asylum
Post by: Freyaday on April 13, 2011, 08:18:12 am
I will eventually, because all I have to do for that is adjust the timing. What do you think of the writing?
Title: Re: Asylum
Post by: Munchor on April 13, 2011, 09:05:22 am
Perhaps a screenshot of the program...

I liked it, especially your writing, you write very well! Super adjectives!

EDIT: 4000 posts!!!
Title: Re: Asylum
Post by: Freyaday on April 13, 2011, 11:29:04 am
/me is lost for words.
Uhh, Grazie mille, signore!
Title: Re: Asylum
Post by: BrownyTCat on April 13, 2011, 11:31:31 am
It's funny because you could do it in BASIC. But it would be a tad slower... And not as fast or good visuals.

EDIT: And crappy.
Title: Re: Asylum
Post by: Stefan Bauwens on April 13, 2011, 11:53:19 am
It looks nice. Thanks for the screenshot Scout, I can't play this game, but now I can see it.
Title: Re: Asylum
Post by: Freyaday on April 13, 2011, 12:10:22 pm
Scout, did you reach the end? Also, it seems Wabbit missed a bug: Inverse text on my calc in Axe is super slow, so the cursors actually blink instead of grey out.
Title: Re: Asylum
Post by: DJ Omnimaga on April 13, 2011, 06:31:25 pm
Hmm interesting, but remember that on OS 2.53MP or higher inverted screen sometimes doesn't work well. You'll have to test the game in both 2.43 and 2.55 to make sure. I haven't tried, though, so maybe you might be fine.

By the way are you planning to make some games with tilemaps and such (even if ASCII)? They might actually attract more attention among users here, since text-only games are very common on ticalc.org compared to ones with graphics. Of course you could maybe just add some ASCII graphics at the bottom of the screen to form some small images representing where you are, approximately, or items you found.

Also it's possible to make the text appear instantly I think, by disabling some flags in Axe (with the Fix command). However I don't know if it works well and you must re-enable them on exit.

Title: Re: Asylum
Post by: Freyaday on April 13, 2011, 06:42:07 pm
For the inverse text dealio, I'm running and coding under 2.55MP, and I haven't run across any problems yet. I think I'll put an indicator of which directions you can go in once I get the map working.
Title: Re: Asylum
Post by: DJ Omnimaga on April 13, 2011, 06:45:01 pm
Ok good. In 2.55MP the problem is sometimes random, usually when switching from the graph screen to home screen:

(http://www.omnimaga.org/images/screenshots/reuben253.gif)
Title: Re: Asylum
Post by: Munchor on April 15, 2011, 07:42:47 am
Scout, did you reach the end? Also, it seems Wabbit missed a bug: Inverse text on my calc in Axe is super slow, so the cursors actually blink instead of grey out.

Not sure, I just read and pressed a random option, I was not playing, just showing you guys how it looked like.
Title: Re: Asylum
Post by: Freyaday on April 15, 2011, 12:26:45 pm
Well, judging from the screenie, you only made it halfway through. I'd love to see what you think of the rest of the game, especially seeing as how you haven't reached any of the special effects yet. ;)
Title: Re: Asylum
Post by: Munchor on April 16, 2011, 04:39:10 am
Well, judging from the screenie, you only made it halfway through. I'd love to see what you think of the rest of the game, especially seeing as how you haven't reached any of the special effects yet. ;)

Yeah I have to try it when I get on Windows.
Title: Re: Asylum
Post by: SirCmpwn on April 16, 2011, 10:43:05 am
Word wrapping is easy if you have a character size table (as in the size of each letter in the font).  You just display each character one at a time, and measure the width of the string between your pointer and the next space.  If it is greater than the remaining available distance, wrap to the next line and display the word there.
EDIT: There were another 15 or so posts I neglected to read, weren't there?
Title: Re: Asylum
Post by: Freyaday on April 16, 2011, 12:25:55 pm
Nah, cause in inverse text mode the boarder of the character is on the left, so you have to use the entire row, otherwise you get an ugly white line where you stopped.
Edit in response to edit: Seams like it.
Title: Re: Asylum
Post by: Munchor on April 17, 2011, 05:39:37 am
Nah, cause in inverse text mode the boarder of the character is on the left, so you have to use the entire row, otherwise you get an ugly white line where you stopped.
Edit in response to edit: Seams like it.

Seems*

Regarding word wrapping I think there are subroutines for that in the subroutines topic.
Title: Re: Asylum
Post by: Freyaday on April 17, 2011, 01:13:18 pm
Y'all seem to be slightly confused about where this program takes place:
Asylum operates on the homescreen.
Title: Re: Asylum
Post by: Munchor on April 17, 2011, 01:20:52 pm
Y'all seem to be slightly confused about where this program takes place:
Asylum operates on the homescreen.

I thought it was graph screen, we have greyscale, arrows and menus.
Title: Re: Asylum
Post by: Freyaday on April 17, 2011, 01:27:44 pm
Actually, the cursors are supposed to blink instead of greying out. It's a bug Wabbit missed. Also, if it was on the graphscreen, the whole screen would be black, but on the homescreen the rightmost column is left white.
PS: Scout, have you reached the end yet?
Title: Re: Asylum
Post by: Munchor on April 17, 2011, 01:28:24 pm
Actually, the cursors are supposed to blink instead of greying out. It's a bug Wabbit missed. Also, if it was on the graphscreen, the whole screen would be black, but on the homescreen the rightmost column is left white.
PS: Scout, have you reached the end yet?

I haven't tried it again since I haven't had an opportunity to go to Windows.
Title: Re: Asylum
Post by: Freyaday on April 17, 2011, 01:32:26 pm
Ok. Let me know when you do. I'd love to hear your thoughts on the whole thing. For that matter, I'd love to hear everybody's thoughts on the whole thing.