My next BASIC coding project is to squeeze a very simplified version of the classic text adventure game “The Hobbit” by Veronika Megler, Philip Mitchell and David Johnston into a BBC Basic program. This would be for a 32K BBC Model B. I’ll be using the Owlet editor in the main and cross checking the code on my own BBC Micro.
See this Stardot forum post for progress on this project
Like many of you, I enjoyed this landmark game and it stuck in memory. I coded some of my own text adventures at the time and was fascinated with the process….certainly nudging me towards a database programming career later on in life. Let me know some of your own memories, experiences with this game – I’d like to hear them.
This project is mostly for nostalgia, but also taking on the challenge of squeezing a very simplified form of this landmark game into a BBC Basic version. Like many retro coding projects you think …. “Why not?”
My objectives are:-
1. To represent every location in the game in BBC basic, using tokens for the common words to save space.
2. To navigate between all the locations using the original mappings (though I may exclude the random-like maddening mazes such as the Dark Stuffy Passage)
3. To emulate the split screen user interface that the Hobbit had, with input text in the bottom quarter of the screen and output text in the top.
4. To keep everything in one program, not reading other files.
If there’s any memory left (I’ll use MODE 7) then we’ll see what else could be added. It would be fantastic to include NPCs wandering around the game map randomly, such as Thorin and/or Gandalf, so you could meet them as you wander.
My objectives are not:-
1. To have a clever parser. It’s just to input directions, to allow an easy exploration of the Wilderland.
Resources
The book “The Guide to Playing the Hobbit” by David Elkan (which I used to own) which gives a great breakdown of the game (from the internet archive)
https://archive.org/download/guide-to-p … Hobbit.pdf
Veronikia Megler’s website (one of the original authors of the game) includes some really useful information:-
http://veronikamegler.com/WL/wl.htm
– A map
– Room Database dump of the locations
– Even a rudimentary Spectrum emulator, displaying the state of the elements in the game
Using ChatGPT (ver 4)
For this project I’ve been using ChatGPT to start to compile the word tokens and the locations converted into text with token indexes inserted. It’s done quite well with this. I asked ChatGPT to look at this list of locations and pull out all common words that are greater than two characters:-
Beorn’s house
The Bewitched gloomy place
A big cavern with torches along the walls
A bleak barren land that was once green
The cellar where the king keeps his barrels of wine.
A comfortable tunnel-like hall.
A dark dungeon in the elven king’s halls.
The dark stuffy passage
The dark winding passage
The east bank of a black river
The elven king’s great halls
An elvish clearing with levelled ground and logs
The empty place
The forest
A forest of tangled smothering trees
The forest road
The forest road
Forest river
The front gate of the Lonely Mountain
The gate to Mirkwood
A gloomy empty land with dreary hills ahead
The goblins’ dungeon
The great river
The green forest
The halls where the dragon sleeps
A hard dangerous path in the Misty Mountains
A hidden path with trolls’ footprints
Inside the goblins’ gate
A large dry cave which is quite comfortable
A little steep bay, still and quiet, with an overhanging cliff.
The Lonely Mountain
Long Lake
The mountains
A narrow path
A narrow dangerous path
A narrow place with a dreadful drop into a dim valley
Outside goblins’ gate
A place of black spiders
Rivendell
The ruins of the town of Dale
The running river
A smooth straight passage
A strong river
The treeless opening
The troll’s cave
The troll’s clearing
The waterfall
The west bank of a black river
The west side of Ravenhill
A wooden town in the middle of Long Lake
Common words (tokens) that ChatGPT found (here shown stored in DATA statements):-
800 DATA “the”,”with”,”river”,”forest”,”place”,”gate”,”path”,”dark”,”passage”
810 DATA “black”,”goblins'”,”narrow”,”gloomy”,”land”,”green”,”where”,”comfortable”,”dungeon”
820 DATA “elven”,”king’s”,”bank”,”great”,”halls”,”clearing”,”and”,”empty”,”lonely”
830 DATA “mountain”,”dangerous”,”mountains”,”cave”,”long”,”lake”,”town”,”troll’s”,”west”
…and the resulting location descriptions with indexes inserted representing the word token (this was also generated by ChatGPT):-
900 DATA Beorn’s house,01 Bewitched 13 04,A big cavern 02 torches along 01 walls,A bleak barren 14 that was once 15,01 cellar 16 01 king keeps his barrels of wine.
910 DATA A 17 tunnel-like hall.,A 18 dungeon in 01 elven king’s halls.,01 18 stuffy 09,01 18 winding 09,01 east 20 of a 10 03
920 DATA 01 elven king’s 22 halls,An elvish 24 02 levelled ground 24 logs,01 25 04,01 05,A 05 of tangled smothering trees
930 DATA 01 05 road,01 05 road,05 03,01 front 20 of 01 Lonely Mountain,01 20 to Mirkwood
940 DATA A 13 25 14 02 dreary hills ahead,01 goblins’ dungeon,01 22 03,01 15 05,01 halls 16 01 dragon sleeps
950 DATA A hard 18 20 in 01 Misty Mountains,A hidden 20 02 trolls’ footprints,Inside 01 goblins’ 20,A large dry 31 02 is quite 17,A little steep bay, still and quiet, 02 an overhanging cliff.
960 DATA 01 Lonely Mountain,Long Lake,01 mountains,A 12 20,A 12 18 20
970 DATA A 12 04 02 a dreadful drop into a dim valley,Outside goblins’ 20,A 04 of 10 spiders,Rivendell,01 ruins of 01 34 of Dale
980 DATA 01 running 03,A smooth straight 09,A strong 03,01 treeless opening,01 troll’s 31
990 DATA 01 troll’s 24,01 waterfall,01 west 20 of a 10 03,01 west side of Ravenhill,A wooden 34 in 01 middle of Long Lake
Location Exit Data
Each location has data in this format:-
“01202807506605103”
The first two digits are the location, followed by at least one group of 3 digits.
Each 3-digit block represents an exit, with the first digit for the direction (1 for North, 2 for Northeast, etc., 0 for Down, and 9 for Up) and the next two digits for the destination location number
I had ChatGPT read “The Guide to Playing the Hobbit” and had a go at creating the exit data, but it’s pretty bad – and this needs redoing by hand!
I need to:-
a) Resolve a bug with unpacking the room descriptions properly. It doesn’t convert the token value that lies at the end of a location description string into the corresponding word.
b) Go through all the exit data to check and replace as required (done)
c) Allow the input of directions to include shorthand as well as longhand for the directions (North and N for example).
d) Cross check the common word token replacements. I think ChatGPT has made some mistakes.