Wanting to create a "Retro" IF system in a retro language, BASIC

Sounds interesting. I hope to check it out in the near future. I guess the most simple of all might be a pseudo-code interpreter if it exists or perhaps something like Matlab or Matlab clones which can create web pages.

2 Likes

A classic intro text is Starting Forth. It is available on the net as a pdf. A commercial version is available on the online bix box store.

Systems that I find most useful are gForth and win32forth.

A very nice SBC is available from Udomonic in Australia.

4 Likes

We currently only have one game listed on CASA as being made with Forth. I’d love to hear if there are any more… sounds like a niche waiting to be filled. :slight_smile:
http://solutionarchive.com/game/id%2C1114/Black+Island+Adventure.html

I can definitely see the attracting of directly using BASIC. I definitely don’t dispute that. However, from comments by the OP, it would seem he’s looking at making an “IF tool” with BASIC. So you’re not necessarily directly using BASIC as the end-user or have any more control that with any other IF tool.

It’s all very theoretical at the moment, anyway. Whether it’s BASIC or Forth. I’ve used BASIC-powered adventure creators in the past (and BASIC-powered creators that generated fast machine code) but they were always really lacking in the “easy-to-use” department. So getting that aspect right is going to be key.

2 Likes

Most Basics would need the software installed. Microsoft Small Basic creates an .exe so that the end-user does not need the software installed.

2 Likes

A benefit of programming in Forth is that one creates their own library of routines. If I could ever get my head around using a stack, it,s an option.

3 Likes

It might definitely be worth looking into SpiderBasic given TheGlassFractal’s comments in the other thread… BASIC programs producing playable web pages good enough? - #21 by TheGlassFractal

2 Likes

It’s not exactly the same but, there is an interpreter for GAC games on the Cambridge Z88 called ‘WhatNow?’ which was written in CamelForth. (Considering that GAC used a stack for its conditions this was probably a good choice.) It also includes a game called ‘Puzzle Of The Pyramid’ which may well be an original title.
As has been brought up before, it does require Forth to be installed but, it takes advantage of this to even have a stab at reproducing the graphics, which is a complete pig on the Z88 using assembler.

3 Likes

SpiderBasic would be a paid option.

1 Like

Yes, Garry Lancaster’s Puzzle of the Pyramid should definitely be added to double the CASA list of Forth adventures!
https://worldofspectrum.org/z88forever/camelforth/buildingapps1.html

3 Likes

Perhaps you are right but I more read it as a accessible framework as opposed to a closed IF tool where you cannot access the internal parts of the tool.

I agree, this is very important.

I took a very brief look at Forth and the only thing I really noticed was that it was a VERY old description - not sure if it has been updated much since the seventies? Anyway, I don’t think an easy-to-use programming language should force the programmer to use concepts like stacks. I think such concepts are remnants from when speed and memory was an issue. They can still be an issue for top professional programmers of course but it should not be necessary for making a text adventure in 2023. A similar case: In some BASIC dialects you must “DIM” your arrays before using them. As far as I remember, on the C64 you could use up to 10 places in your arrays before you were forced to use DIM. Would be great if modern BASIC programs had a much higher limit or perhaps could avoid using DIM completely. The easier the better.

Forth is definitely beyond me. There are some additional simple examples of text adventure systems in it, though.
http://forthworks.com:8080/retro-language/file?name=library/fiction.rx&ci=tip
http://forthworks.com:8080/retro-language/file?name=examples/games/cloak-of-darkness.rx&ci=tip

3 Likes

The languages I’m familiar with that can target the z-machine (Inform6, ZIL & Dialog) all have the parser-code in a library that is written in the same language. It isn’t hidden in an internal part of the tool. If you know the language you can certainly change everything you want. Wouldn’t be much different with a framework written in Basic, in my opinion.

1 Like

Arrays usually occupies a continuous slice of memory. Reserving, for example, more than 10 slots for undimmed arrays would be quite wasteful on a limited resource, especially on an 8-bit machine. A linked list have esier to grow and shrink, and as long as the garbage collection is working the memory is retrieved. Never dialects often have support for this with collections and other similar datatypes.

2 Likes

I don’t remember if I commented this before (it doesn’t look like I did, at least), but part of the fun of writing games for retro systems is the set of constraints they impose. How would I deal with a system that gives me very few objects, but plenty of actions? Or vice versa, all the objects I want but no custom actions at all?

I’d say thinking about these constraints is a good way to make your system interesting. As a bonus, these constraints are what make it easier to build the system in the first place.

7 Likes

// using a stack

Not too bad if you are familiar with HP RPN calcs. :wink:

1 Like

Very nice resource. Thank you.

1 Like

Kenneth, you remember well. OTOH, DIMensioning arrays allows a very easy memory management: example, if you have 15 items, so with an one-liner like this:

20 IT=15-1:DIM IL(IT),IS(IT),IN$(IT),ID$(IT)

(note that arrays start from 0, hence the -1 in the first statement); if one later adds or remove an item, all what is needed in increasing/decreasing the IT value, plus add in or delete from the data statements (or external data file) the relevant definition (in the case above Location, Status, Name, Description (the latter can be the offset of a calculated GOSUB instead of a string…) )

Best regards from Italy,
dott. Piergiorgio

1 Like

Nice idea! There is no problem in “over-dimensioning” the arrays a bit on modern systems. Of course, on the C64 and other 8-bit computers it matters a great deal.
EDIT: It is probably good to dimension most arrays exactly, at least during testing, so you get an error message if you by accident try to manipulate the wrong array element.

1 Like

Have you had a look at the new BASIC Anywhere Machine - seems an ideal starter and no dowloads

https://basicanywheremachine.neocities.org/BAM_IDE

Would be extremely interested to see your parser code - been trying to get to grips with Infocom’s method with a view to converting to BASIC. I’m sure it’s possible as a purely programming exercise but have run out of skill trying to figure out the syntax lookup part

1 Like