Graphic Adventure Creator (GAC) programming

bbc micro/electron/atom/risc os coding queries and routines
User avatar
tautology
Posts: 450
Joined: Wed Sep 01, 2010 3:26 pm
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by tautology » Thu Jan 18, 2018 7:32 am

Nice detective work there. The CPC version contradicts itself:
gac.png
Looks like I'll need to change my code back! Damn 35 year old bugs...

User avatar
Lardo Boffin
Posts: 2216
Joined: Thu Aug 06, 2015 7:47 am
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by Lardo Boffin » Thu Jan 18, 2018 12:23 pm

lurkio wrote:
Lardo Boffin wrote:IF ( VERB ( 20 ) AND NO1 = 1 AND NO2 = 2 ) MESS ( 1 ) END
Try the following instead -- it works for me, for some reason!:
  • Code: Select all

    IF ( NO2 = 2 AND NO1 = 1 AND VERB ( 20 ) ) MESS ( 1 ) END
This works too:
  • Code: Select all

    IF ( NO2 = 2 AND NOUN ( 1 ) AND VERB ( 20 ) ) MESS ( 1 ) END
:idea:
Interestingly these work fine in the simple adventure but no combination of them works in my work in progress adventure.

I have ended up doing this -

IF ( NO2 = 13 ) IF ( NO1 = 18 AND VERB ( 20 ) AND CARR ( 1 ) ) MESS ( 25 ) LF MESS ( 15 ) LF MESS ( 12 ) LF DECR ( 1 ) 0 CSET 8 HOLD ( 1000 ) GOTO ( 1 ) END

So I chained two IF statements together. Which works but if you satisfy the first IF but not the second it gets confused and doesn't give any message at all.

I may try the approach of setting counters based on the noun values and then testing the counters to see if this is more robust.
Adventure Language on GitHub
Atom, issue 5
Elk
A number of econetted (is that a word?) Beebs
BBC Master, Datacentre + HDD, pi co-proc, econet, NULA

User avatar
Lardo Boffin
Posts: 2216
Joined: Thu Aug 06, 2015 7:47 am
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by Lardo Boffin » Thu Jan 18, 2018 1:25 pm

I tried setting counters first

NO1 CSET 9 NO2 CSET 10 IF ( 18 EQU? 9 AND 13 EQU? 10 ....

And this doesn’t work either. I also tried switching the order of EQU? statements :? !
The counters are set correctly according to the diagnostics but the IF checks fail. #-o

Its at this stage I am tempted to take what I have learned about how to structure an adventure game and write my own from scratch in BASIC.
Adventure Language on GitHub
Atom, issue 5
Elk
A number of econetted (is that a word?) Beebs
BBC Master, Datacentre + HDD, pi co-proc, econet, NULA

User avatar
lurkio
Posts: 3037
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by lurkio » Thu Jan 18, 2018 1:27 pm

Lardo Boffin wrote:Its at this stage I am tempted to take what I have learned about how to structure an adventure game and write my own from scratch in BASIC.
I don't blame you!

Do you want to upload or send me the problematic GAC game file you're working on? I'd be interested to see the accursed thing for myself.

:?:

User avatar
lurkio
Posts: 3037
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by lurkio » Thu Jan 18, 2018 3:45 pm

Lardo Boffin wrote:I have ended up doing this -

IF ( NO2 = 13 ) IF ( NO1 = 18 AND VERB ( 20 ) AND CARR ( 1 ) ) MESS ( 25 ) LF MESS ( 15 ) LF MESS ( 12 ) LF DECR ( 1 ) 0 CSET 8 HOLD ( 1000 ) GOTO ( 1 ) END

So I chained two IF statements together. Which works but if you satisfy the first IF but not the second it gets confused
Try this:
  • Code: Select all

    IF ( NO2 = 13 AND NOUN ( 18 ) AND CARR ( 1 ) AND VERB ( 20 ) ) MESS ( 25 ) LF MESS ( 15 ) LF MESS ( 12 ) LF DECR ( 1 ) 0 CSET 8 HOLD ( 1000 ) GOTO ( 1 ) END
:?:

User avatar
danielj
Posts: 8497
Joined: Thu Oct 02, 2008 5:51 pm
Location: Manchester
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by danielj » Thu Jan 18, 2018 3:47 pm

tautology wrote:Nice detective work there. The CPC version contradicts itself:
gac.png

Looks like I'll need to change my code back! Damn 35 year old bugs...
Wee! :D - I just checked my beeb, elk and speccy manuals, the only one that's correct is the elk :) And that still has the issue there with the example being backwards...

d.

User avatar
Lardo Boffin
Posts: 2216
Joined: Thu Aug 06, 2015 7:47 am
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by Lardo Boffin » Thu Jan 18, 2018 4:03 pm

lurkio wrote:
Lardo Boffin wrote:I have ended up doing this -

IF ( NO2 = 13 ) IF ( NO1 = 18 AND VERB ( 20 ) AND CARR ( 1 ) ) MESS ( 25 ) LF MESS ( 15 ) LF MESS ( 12 ) LF DECR ( 1 ) 0 CSET 8 HOLD ( 1000 ) GOTO ( 1 ) END

So I chained two IF statements together. Which works but if you satisfy the first IF but not the second it gets confused
Try this:
  • Code: Select all

    IF ( NO2 = 13 AND NOUN ( 18 ) AND CARR ( 1 ) AND VERB ( 20 ) ) MESS ( 25 ) LF MESS ( 15 ) LF MESS ( 12 ) LF DECR ( 1 ) 0 CSET 8 HOLD ( 1000 ) GOTO ( 1 ) END
:?:
That works and easily adapted to the message 24 variant as well! Please tell me that was not simple and obvious to fix! :oops:
Was there a logical reason for doing it that way or just ‘because’?
Adventure Language on GitHub
Atom, issue 5
Elk
A number of econetted (is that a word?) Beebs
BBC Master, Datacentre + HDD, pi co-proc, econet, NULA

User avatar
lurkio
Posts: 3037
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by lurkio » Thu Jan 18, 2018 7:01 pm

Lardo Boffin wrote:
lurkio wrote:

Code: Select all

IF ( NO2 = 13 AND NOUN ( 18 ) AND CARR ( 1 ) AND VERB ( 20 ) ) MESS ( 25 ) LF MESS ( 15 ) LF MESS ( 12 ) LF DECR ( 1 ) 0 CSET 8 HOLD ( 1000 ) GOTO ( 1 ) END
Please tell me that was not simple and obvious to fix! :oops: Was there a logical reason for doing it that way or just ‘because’?
Here's the relevant bit from the manual:
Just after section 2.7.ii in the Beeb GAC manual, the author wrote:There are several things to note when writing conditions ... Firstly all operations are performed from left to right ... you should be careful about the order in which you enter things. Put any COMPARISONS first, i.e. IF ( VERB > 5 AND NOUN 9 ) QUIT END
That advice isn't very explicit but, going by its meagre logic, your NO2 = 13 comparison should come first, as did a similar equality-comparison in your previous example, where it was followed by the NOUN condition, so I put that next: IF ( NO2 = 13 AND NOUN ( 18 ) ...

(It's possible that it doesn't matter which of CARR ( 1 ) and VERB ( 20 ) comes next, but I haven't checked.)

The point is that GAC seems to be very unforgiving about the order in which it expects to see the component parts of a condition. (That's underlined by GAC-creator Sean Ellis in a recent interview.) So it's a shame that the rules for condition-ordering aren't actually spelt out anywhere!

:!:

User avatar
Lardo Boffin
Posts: 2216
Joined: Thu Aug 06, 2015 7:47 am
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by Lardo Boffin » Thu Jan 18, 2018 9:01 pm

Although I had actually read the manual I had not picked up on the importance of that little sentence... :oops:
Kind of glad it was my fault - gives me the confidence to move on with it. I’m still not sure I can achieve everything I want to with this but should be able to do most of it.
Adventure Language on GitHub
Atom, issue 5
Elk
A number of econetted (is that a word?) Beebs
BBC Master, Datacentre + HDD, pi co-proc, econet, NULA

User avatar
lurkio
Posts: 3037
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by lurkio » Sun Jan 21, 2018 5:08 pm

tautology wrote:Nice detective work there. The CPC version contradicts itself: gac.png
danielj wrote:Wee! :D - I just checked my beeb, elk and speccy manuals, the only one that's correct is the elk :) And that still has the issue there with the example being backwards...
I've created an updated version of the manual for Graphic Adventure Creator (GAC), reflecting the discussion in this thread about GAC bugs and annoyances:
This new version is adapted from a digitisation of the Adventure Creator (AC) manual which was originally done by Dave_E, I think.

:idea:

User avatar
lurkio
Posts: 3037
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by lurkio » Sun Jan 28, 2018 1:17 am

I've corrected some minor errors in the new version of the GAC manual, and I've also uploaded a copy of the GAC Adventure Writer's Handbook:
:idea:

User avatar
Lardo Boffin
Posts: 2216
Joined: Thu Aug 06, 2015 7:47 am
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by Lardo Boffin » Wed Mar 14, 2018 1:43 pm

I have eventually given up on GAC (but not the project I started while learning it).

To summarise how I found the program:-

It makes it very simple to write relatively simple adventures.
It makes it very, very complex to write complex adventures.
It is a superb way to learning how to write and structure adventures.

So I decided to go it alone and write my own in BASIC from scratch. The way it works will borrow very heavily from the structure learned from GAC. :D

Currently I have a working parser framework - next code to display rooms and allow you to move between them.
Everything after that (more or less) is custom code for the specific adventure.
I would very much like to see how possible it is to load room descriptions on the fly from a data file rather than store them in memory. Data compression is not really my thing!
Adventure Language on GitHub
Atom, issue 5
Elk
A number of econetted (is that a word?) Beebs
BBC Master, Datacentre + HDD, pi co-proc, econet, NULA

User avatar
lurkio
Posts: 3037
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by lurkio » Wed Mar 14, 2018 5:10 pm

Lardo Boffin wrote:I would very much like to see how possible it is to load room descriptions on the fly from a data file rather than store them in memory. Data compression is not really my thing!
Have a look at what we did in Raven Wood:
:idea:

User avatar
Lardo Boffin
Posts: 2216
Joined: Thu Aug 06, 2015 7:47 am
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by Lardo Boffin » Wed Mar 14, 2018 7:09 pm

Thanks. I was thinking of an index file for the locations - very similar to your in memory pointers I guess. I spend way too much time working with database!

The index file will have fixed width records so I can use the room number to calculate and then get the correct pointer from it and then jump straight to the correct description record.
Adventure Language on GitHub
Atom, issue 5
Elk
A number of econetted (is that a word?) Beebs
BBC Master, Datacentre + HDD, pi co-proc, econet, NULA

User avatar
Lardo Boffin
Posts: 2216
Joined: Thu Aug 06, 2015 7:47 am
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by Lardo Boffin » Wed Mar 14, 2018 7:34 pm

Are there any limitations, beyond standard DFS and trying to keep to a single SSD that I need to be aware of? E.g. maximum individual file size etc.?
Adventure Language on GitHub
Atom, issue 5
Elk
A number of econetted (is that a word?) Beebs
BBC Master, Datacentre + HDD, pi co-proc, econet, NULA

Commodore
Posts: 170
Joined: Wed Sep 20, 2017 5:56 pm
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by Commodore » Sat Nov 21, 2020 6:59 pm

Apologies for resurrecting such an old thread, but I've recently got back into my old 8 bit computers again and even set my Beeb up last weekend. Whilst I was at it, I had a little look at that GAC adventure I'd been trying to write upthread.
I feel a bit more inspired now to perhaps have another go, but I think I'll do things gradually this time.

Interesting to read that GAC could get to 35 years old and have undetected errors in it! I think I'll stick with it though as it must make things simpler.

Believe it or not, that adventure I was trying to write, was supposed to be a small one, it just kind of mushroomed. I think it only had 4 rooms, but it was already quite unwieldy, and that is all before the real adventure even started!

One thing is sure though, of all the 8 bit, and 64 bit machines that I own, the Beeb is the one that I want to write a text adventure on!

Post Reply

Return to “programming”