Graphic Adventure Creator (GAC) programming

Discuss all aspects of programming here. From 8-bit through to modern architectures.
User avatar
tautology
Posts: 365
Joined: Wed Sep 01, 2010 2:26 pm
Contact:

Re: Graphic Adventure Creator (GAC) programming

Postby 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: 978
Joined: Thu Aug 06, 2015 6:47 am
Contact:

Re: Graphic Adventure Creator (GAC) programming

Postby 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.
BBC model B 32k issue 4, 16k sideways RAM, Watford 12 ROM board, Retroclinic Datacentre + HDD, Viglen twin 40/80 5.25" discs, acorn cassette, Acorn 6502 coproc
BBC model B 32k issue 7, turboMMC, Opus Challenger 3 512k, Pi 3 coproc
BBC Master

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

Re: Graphic Adventure Creator (GAC) programming

Postby 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.
BBC model B 32k issue 4, 16k sideways RAM, Watford 12 ROM board, Retroclinic Datacentre + HDD, Viglen twin 40/80 5.25" discs, acorn cassette, Acorn 6502 coproc
BBC model B 32k issue 7, turboMMC, Opus Challenger 3 512k, Pi 3 coproc
BBC Master

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

Re: Graphic Adventure Creator (GAC) programming

Postby 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: 1517
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

Re: Graphic Adventure Creator (GAC) programming

Postby 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: 5985
Joined: Thu Oct 02, 2008 4:51 pm
Location: Manchester
Contact:

Re: Graphic Adventure Creator (GAC) programming

Postby 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: 978
Joined: Thu Aug 06, 2015 6:47 am
Contact:

Re: Graphic Adventure Creator (GAC) programming

Postby 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’?
BBC model B 32k issue 4, 16k sideways RAM, Watford 12 ROM board, Retroclinic Datacentre + HDD, Viglen twin 40/80 5.25" discs, acorn cassette, Acorn 6502 coproc
BBC model B 32k issue 7, turboMMC, Opus Challenger 3 512k, Pi 3 coproc
BBC Master

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

Re: Graphic Adventure Creator (GAC) programming

Postby 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: 978
Joined: Thu Aug 06, 2015 6:47 am
Contact:

Re: Graphic Adventure Creator (GAC) programming

Postby 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.
BBC model B 32k issue 4, 16k sideways RAM, Watford 12 ROM board, Retroclinic Datacentre + HDD, Viglen twin 40/80 5.25" discs, acorn cassette, Acorn 6502 coproc
BBC model B 32k issue 7, turboMMC, Opus Challenger 3 512k, Pi 3 coproc
BBC Master

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

Re: Graphic Adventure Creator (GAC) programming

Postby 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: 1517
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

Re: Graphic Adventure Creator (GAC) programming

Postby 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: 978
Joined: Thu Aug 06, 2015 6:47 am
Contact:

Re: Graphic Adventure Creator (GAC) programming

Postby 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!
BBC model B 32k issue 4, 16k sideways RAM, Watford 12 ROM board, Retroclinic Datacentre + HDD, Viglen twin 40/80 5.25" discs, acorn cassette, Acorn 6502 coproc
BBC model B 32k issue 7, turboMMC, Opus Challenger 3 512k, Pi 3 coproc
BBC Master

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

Re: Graphic Adventure Creator (GAC) programming

Postby 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: 978
Joined: Thu Aug 06, 2015 6:47 am
Contact:

Re: Graphic Adventure Creator (GAC) programming

Postby 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.
BBC model B 32k issue 4, 16k sideways RAM, Watford 12 ROM board, Retroclinic Datacentre + HDD, Viglen twin 40/80 5.25" discs, acorn cassette, Acorn 6502 coproc
BBC model B 32k issue 7, turboMMC, Opus Challenger 3 512k, Pi 3 coproc
BBC Master

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

Re: Graphic Adventure Creator (GAC) programming

Postby 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.?
BBC model B 32k issue 4, 16k sideways RAM, Watford 12 ROM board, Retroclinic Datacentre + HDD, Viglen twin 40/80 5.25" discs, acorn cassette, Acorn 6502 coproc
BBC model B 32k issue 7, turboMMC, Opus Challenger 3 512k, Pi 3 coproc
BBC Master