Assembly language text adventure

Discuss all aspects of programming here. From 8-bit through to modern architectures.
User avatar
lurkio
Posts: 2031
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

Re: Assembly language text adventure

Post by lurkio » Mon May 13, 2019 10:22 pm

fuzzel wrote:
Fri May 10, 2019 4:56 pm
I still have text compression to look forward to at some point
The answer to your prayers..?:
:-k

User avatar
tautology
Posts: 381
Joined: Wed Sep 01, 2010 2:26 pm
Contact:

Re: Assembly language text adventure

Post by tautology » Mon May 13, 2019 11:48 pm

In regards to text compression, there are a number of ways, most of which depend on the source text and can vary. I sort of touched on this when I did my port of the Scott Adams engine (http://www.retrosoftware.co.uk/wiki/ind ... oming_Data).

I end up going compressing with digrams, because I couldn't customise to the messages and you can fit 127 digrams into one page; which made the dictionary small and the code very simple.

Other places have used different tactics. Midge uses a dictionary of words which are looked up, this gets good compression, but makes the rendering slower.

The Quill and Infocom, compress bits, e.g. in Infocom 5 bits are used to represent a character. This offers a guaranteed 3:2 compression, is fast to decompress, but is quite complex.

Superior's Stranded uses a half way approach: most characters are normal, but there is an option to use a dictionary word for common or long words.

fuzzel
Posts: 387
Joined: Sun Jan 02, 2005 1:16 pm
Location: Cullercoats, North Tyneside
Contact:

Re: Assembly language text adventure

Post by fuzzel » Fri May 17, 2019 12:01 pm

I'm now dabbling in text compression but have encountered a problem when trying to run a program to store the compressed location text.
What's happening is that when I try to store the compressed data at &4800 and create a lookup table to the data at &7A00 and &7B00 I'm finding that the data at &7B00 is being overwritten by text from the first game location starting at &7A9D. This shouldn't happen because the memory usage is not that great.
Here's a few details:
Program runs from &1100 to &2500. This includes data statements for all 28 locations and 28 common words which will replace equivalent words in the location text with a single character (130-).
The text array DIM LOC$(28) appears to be stored in memory from &2E10 to &3D00.
There is a gap now to the compressed text which I've stored at &4800 to &5170
Then there's another gap to &7A00 for the lookup table but at &7A9D location text for the first location appears overwriting my &7B00 onwards lookup table.
Is there a reason why a basic program would choose to use &7A9D onwards to store array text ? If so it's pretty annoying. If not noticed this before with similar basic programs I've written.

fuzzel
Posts: 387
Joined: Sun Jan 02, 2005 1:16 pm
Location: Cullercoats, North Tyneside
Contact:

Re: Assembly language text adventure

Post by fuzzel » Fri May 17, 2019 12:47 pm

I'm now dabbling in text compression but have encountered a problem when trying to run a program to store the compressed location text.
What's happening is that when I try to store the compressed data at &4800 and create a lookup table to the data at &7A00 and &7B00 I'm finding that the data at &7B00 is being overwritten by text from the first game location starting at &7A9D. This shouldn't happen because the memory usage is not that great.
Here's a few details:
Program runs from &1100 to &2500. This includes data statements for all 28 locations and 28 common words which will replace equivalent words in the location text with a single character (130-).
The text array DIM LOC$(28) appears to be stored in memory from &2E10 to &3D00.
There is a gap now to the compressed text which I've stored at &4800 to &5170
Then there's another gap to &7A00 for the lookup table but at &7A9D location text for the first location appears overwriting my &7B00 onwards lookup table.
Is there a reason why a basic program would choose to use &7A9D onwards to store array text ? If so it's pretty annoying. If not noticed this before with similar basic programs I've written.

btw - I've found a workaround by loading the program at &4000 and having the date created at a lower address but I'd still like to know what basic was doing.

User avatar
lurkio
Posts: 2031
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

Re: Assembly language text adventure

Post by lurkio » Fri May 17, 2019 1:34 pm

fuzzel wrote:
Fri May 17, 2019 12:47 pm
I'm now dabbling in text compression but have encountered a problem when trying to run a program to store the compressed location text.
It’s hard (for me, at least) to know what’s going on without seeing the full program, but perhaps the BASIC stack is corrupting your stored data?

Have you changed the value of HIMEM? If not, then try lowering the value of HIMEM and storing your data above the new value.

E.g. try setting HIMEM to &7A00, or even to &4800, or to whatever value will create just enough room for you to squeeze your stored data into the space above the new value of HIMEM.

:?:

User avatar
dv8
Posts: 207
Joined: Mon Jun 22, 2009 9:07 pm
Contact:

Re: Assembly language text adventure

Post by dv8 » Fri May 17, 2019 1:49 pm

BASIC's stack grows downwards from HIMEM and is used for storing copies of variables during PROC and FN calls and the intermediate results of string expressions. The latter is why you are seeing string fragments just below HIMEM at &7C00.

A BASIC program has the potential to use all of the memory between PAGE and HIMEM during its run.
To prevent this from happening you need to limit the amount of memory BASIC has access to using one or more of these techniques:

* increase PAGE to use the memory between OSHWM and the new value of PAGE.
* increase LOMEM to use the memory between TOP (the end of the BASIC program) and the new value of LOMEM.
* decrease HIMEM to use the memory between the new value of HIMEM and the start of screen memory.

As lurkio suggested, putting the command HIMEM=&7A00 (immediately after changing to MODE 7) will allow you to store data at &7A00-&7C00 without it getting corrupted.

fuzzel
Posts: 387
Joined: Sun Jan 02, 2005 1:16 pm
Location: Cullercoats, North Tyneside
Contact:

Re: Assembly language text adventure

Post by fuzzel » Fri May 17, 2019 3:52 pm

That's great, thanks guys for the tips. Now to try to get the compression working in LOT Level 1........

fuzzel
Posts: 387
Joined: Sun Jan 02, 2005 1:16 pm
Location: Cullercoats, North Tyneside
Contact:

Re: Assembly language text adventure

Post by fuzzel » Sat May 18, 2019 1:18 pm

After some serious headscratching I've managed to get my text compression routine to work for my test effort, Level 1 of Lords of Time. I analysed the text from the 28 locations sorting each word by frequency to determine the savings by replacing each word with a single character. As it turns out there were only 28 words worth using for compression (the rest only appear once so I would actually lose space by using them as they'd have also taken up a couple of bytes space each in the lookup table). Even so the text reduces to 67% of it's original size, or to put it another way, I could increase the amount of text in the same memory space by 50% by using compression. It also doesn't slow down the displaying of text on screen during game play. I have a few niggles to sort out but will pop a copy of my progress so far in this forum for people to have a look at (and hopefully find any glitches).
Once happy I will then use the stripped back program as a template for developing my own adventure. I'm thinking about either a Zork conversion in Level 9's style (memory constraints will probably scupper this), a Blake's 7 adventure, Lords of Time 2, or something completely different.

User avatar
Lardo Boffin
Posts: 1517
Joined: Thu Aug 06, 2015 6:47 am
Contact:

Re: Assembly language text adventure

Post by Lardo Boffin » Sat May 18, 2019 6:38 pm

Blake’s 7 sounds cool. 8)
Atom, issue 5
BBC model B 32k issue 4, 16k sideways RAM, Watford 12 ROM board, Acorn 6502 coproc
BBC model B 32k issue 7, turboMMC, Opus Challenger 3 512k, Pi 3 coproc
USA Model B
BBC Master, Datacentre + HDD, pi co-proc, econet, NULA

fuzzel
Posts: 387
Joined: Sun Jan 02, 2005 1:16 pm
Location: Cullercoats, North Tyneside
Contact:

Re: Assembly language text adventure

Post by fuzzel » Sat May 18, 2019 8:08 pm

I wrote a Blake's 7 adventure in Basic bitd and I was quite proud of it. It's on a floppy disc in the loft somewhere but time probably hasn't been kind to the disc or to my disc drive. I discovered last year when I tried to play some old games on my beeb proper that a disc had been left in the drive for a good number of years and so had been subjected to the extremes of summer heat and winter cold. I presume neither will have benefited from this cosy long-term relationship. As I recall the game approximately covered the first four episodes of series one where the crew come together and take over the Liberator. Thinking about it, I'd love to find that disc and get the game working again. If not I can start again from scratch (I have Terry Nation's book and the dvds for inspiration).
Last edited by fuzzel on Sat May 18, 2019 8:08 pm, edited 1 time in total.

User avatar
Lardo Boffin
Posts: 1517
Joined: Thu Aug 06, 2015 6:47 am
Contact:

Re: Assembly language text adventure

Post by Lardo Boffin » Sun May 19, 2019 10:00 am

With each of the characters having a unique set of abilities it would make for an interesting multi-character adventure where you have to swap between them to solve puzzles.
Atom, issue 5
BBC model B 32k issue 4, 16k sideways RAM, Watford 12 ROM board, Acorn 6502 coproc
BBC model B 32k issue 7, turboMMC, Opus Challenger 3 512k, Pi 3 coproc
USA Model B
BBC Master, Datacentre + HDD, pi co-proc, econet, NULA

User avatar
Lardo Boffin
Posts: 1517
Joined: Thu Aug 06, 2015 6:47 am
Contact:

Re: Assembly language text adventure

Post by Lardo Boffin » Sun May 19, 2019 10:08 am

Oh and some location graphics featuring Glynis Barber. :D
Atom, issue 5
BBC model B 32k issue 4, 16k sideways RAM, Watford 12 ROM board, Acorn 6502 coproc
BBC model B 32k issue 7, turboMMC, Opus Challenger 3 512k, Pi 3 coproc
USA Model B
BBC Master, Datacentre + HDD, pi co-proc, econet, NULA

fuzzel
Posts: 387
Joined: Sun Jan 02, 2005 1:16 pm
Location: Cullercoats, North Tyneside
Contact:

Re: Assembly language text adventure

Post by fuzzel » Tue May 21, 2019 7:55 pm

Glynis Barber was series 4 which is jumping the gun a bit. Sally Knyvette, however, is a more than adequate replacement in my opinion (at least with my 1970s child's head on).
By the way, this may well come in useful...
Attachments
Blakes7tech2-4.jpg

User avatar
Lardo Boffin
Posts: 1517
Joined: Thu Aug 06, 2015 6:47 am
Contact:

Re: Assembly language text adventure

Post by Lardo Boffin » Wed May 22, 2019 6:45 am

Is that the Millennium Falcon in there?

C23FF1ED-65B8-4FF3-8782-DB2B980822D7.jpeg
Atom, issue 5
BBC model B 32k issue 4, 16k sideways RAM, Watford 12 ROM board, Acorn 6502 coproc
BBC model B 32k issue 7, turboMMC, Opus Challenger 3 512k, Pi 3 coproc
USA Model B
BBC Master, Datacentre + HDD, pi co-proc, econet, NULA

fuzzel
Posts: 387
Joined: Sun Jan 02, 2005 1:16 pm
Location: Cullercoats, North Tyneside
Contact:

Re: Assembly language text adventure

Post by fuzzel » Fri May 24, 2019 8:22 am

Does anyone know if any Blake's 7 games were released for any micros, particularly text adventures ?
I suppose Starship Command partly counts for the BBC, from memory there's a Liberator lookalike in that game.

Post Reply