chris Posted July 19, 2008 Report Share Posted July 19, 2008 Nowhere else to post this, so here goes: Well, having entered in the second week of the RetroChallenge with only a vague idea of what I was going to do, I've finally actually gotten some work done on my Challenge. I've been furiously coding at my Olivetti M-10, and I've finally gotten the bugs worked out of a very simple, but easy to use and easily extensible, text game engine. Sadly Teeny doesn't like the Olivetti very much, but I've been working on this and hope to have it uploaded here sometime soon. For now: The game engine is a very simple text engine. Current commands understood by it are: n, s, e, w look clear (clears screen) talk (talks to person in current room) vars (prints the current values of all variables used by the game - debugging tool) help (prints a short explanation of the game) q(uit) I'm working on adding an inventory system, and hope to have that finished by the time I upload the game. A brief synopsis of how it works(non-programmers can skip, or programmers who are bored easily ) Basically, the rooms are arranged in a grid, currently 2x2, though that's easily changeable. Each room has a set of variables including a binary value for each direction indicating whether you can go in that direction. Thus, while rooms still must be arranged in a rectangular grid(for reasons which will be explained shortly) not all rooms must be available, thus allowing simulation of a non-rectangular area. Movement is done by adding to or subtracting from the room variable, with east adding one, west subtracting one (these are constant) and currently north subtracting 2, south adding 2 (these change based on the playing area. For instance, if the playing area was 4x2, north would subtract 4 and south would add 4) There is no advanced text parser, so all commands must have no trailing or leading spaces, and unless they are two words as one command (like "go south" as opposed to "get apple"; neither is implemented as of now) then two-word-commands are not yet implemented. I'm working on making a better parser to split up the commands, and I also hope to get this working before I upload. Quote Link to post Share on other sites
equant Posted July 19, 2008 Report Share Posted July 19, 2008 Why don't you just ports TADS? What are you writing the interactive fiction engine in? Quote Link to post Share on other sites
chris Posted July 20, 2008 Author Report Share Posted July 20, 2008 1) Because I feel like writing a new one, and TADS is quite large. Plus, it's a Tandy 100. The only languages available are BASIC and assembly, and I can't code assembly. 2) BASIC. Quote Link to post Share on other sites
dbraverman88 Posted July 20, 2008 Report Share Posted July 20, 2008 Writing a text adventure game is a great idea. How much RAM does the machine have? What kind of device are you saving data to? (cassette tape, another computer over a null modem cable, or a disk system) --David Quote Link to post Share on other sites
Bunsen Posted July 20, 2008 Report Share Posted July 20, 2008 Does the BASIC in the machine have the ability to handle arrays? A 2-D array would be a much easier way of handling the room variables. Quote Link to post Share on other sites
chris Posted July 20, 2008 Author Report Share Posted July 20, 2008 dbraverman88: This particular machine has a whopping 24k of RAM. The game is currently about 1k, I think. I've been saving data to my EEEPC through the mic and headphone ports(emulating a cassette tape system, but much more reliable) If I can get null-modem transfers working properly (currently they work PC -> Olivetti but not Olivetti -> PC) then I'll save the game that way. Bunsen: It does have arrays, but I didn't use one. Quote Link to post Share on other sites
arfink Posted July 21, 2008 Report Share Posted July 21, 2008 Sweet idea! Welcome to the Model T club. A few of us around here using them for the challenge, it's quite fun. Teeny is no good on the M-10 huh? That stinks. There are other methods of file transfer though, like converting the .BA to a .DO and doing a file transfer in ASCII through the serial port. Quote Link to post Share on other sites
equant Posted July 21, 2008 Report Share Posted July 21, 2008 The TADS comment was a joke. I appreciate your efforts, and enjoy the technical post. Quote Link to post Share on other sites
chris Posted July 21, 2008 Author Report Share Posted July 21, 2008 arfink; I've been trying to do that; for some reason (following the instructions here: http://www.club100.org/library/twe/c2c01.html , section "Model T to Desktop" and using a Toshiba T2110CS with DOS and kermit 3.14) I can transfer from the Toshiba to the Olivetti but not vice versa. EDIT: WOO! IT WORKS! OK, I'm going to upload the code here at some point in the near future. A few other general comments about the project: My primary goal for this project is making the code easily understandable and clear. It's well-commented, and is constructed in a way that makes beginners able to look at the code and easily see what it does and how it does it. Thus, some things are not coded the best or the fastest way or the most memory-efficient way. Another goal is to make it easily expandable. Rooms can be added by adding a few variables on, following a simple and again easy to understand pattern. These variables are: RD$ - Room Description - what the player sees when they enter the room N, S, E, W - Determines whether the player can go in each of these directions (binary values.) OB$ - Object - tells what items are in the room. Having some trouble with this one because there's no WHILE loops, which makes it hard to code a proper inventory system. Working on it though. Quote Link to post Share on other sites
chris Posted July 21, 2008 Author Report Share Posted July 21, 2008 Well, as promised, here is the code for the game thus far. Note that there is no inventory system up yet (there's the beginning of one, but I removed it from this version so it's not clogging it up - doesn't work yet) and basically all you can do is walk around the 4 pretty rooms I inserted for testing. Regardless, it works. Here it is, all 21 lines of it. 10 CLS:PRINT:PRINT "Simple Extensible Text Game by Chris - ? for help." 20 LET N=0:LET S=0: LET E=0:LET W=0:LET RD$="":LET A$="": LET R=0:LET SD=1 'clears all variables 30 GOSUB 3000 'goes to the rooms sub 40 LET A$="" 50 IF SD=1 THEN PRINT RD$ 'only shows room description if sd(show desc) is 1 60 INPUT "What now"; A$ 70 IF A$="n" AND N=1 THEN LET R=R-2:LET SD=1:GOTO 30 80 IF A$="s" AND S=1 THEN LET R=R+2:LET SD=1:GOTO 30 90 IF A$="e" AND E=1 THEN LET R=R+1:LET SD=1:GOTO 30 100 IF A$="w" AND W=1 THEN LET R=R-1:LET SD=1:GOTO 30 110 IF A$="q" OR A$="quit" THEN END 120 IF A$="help" OR A$="?" THEN PRINT "This engine uses mainly 1-letter commands. Commands implemented thus far are n, s, e, w, q(uit), help or ?, l(ook), clear. All commands are lowercase. Thanks for playing.": LET SD=0:GOTO 30 130 IF A$="l" OR A$="look" THEN LET SD=1:GOTO 30 140 IF A$="vars" THEN PRINT A$: PRINT "room #:" R: PRINT "room desc:"; RD$: PRINT "n ";N:PRINT "s ";S:PRINT "e " E: PRINT "w ";W:LET SD=0: GOTO 30 150 IF A$="clear" THEN CLS: LET SD=0: GOTO 30 3000 IF R=0 THEN LET RD$="You are standing in a red sandstone room. The walls are striped orange and red, and spectacularly beautiful. There is a wide, natural arch to the east and a low crack in the stone to the south.": LET N=0:LET S=1: LET E=1:LET W=0 3001 IF R=1 THEN LET RD$="This room is made of shining metal, almost blindingly bright because of glowing orbs on the ceiling. There is a thick automatic door to the south and a threshold to red sandstone to the west.": LET N=0:LET S=1: LET E=0:LET W=1 3002 IF R=2 THEN LET RD$="This room is merely a tiny hole in the red sandstone of the cave. Water drips from the ceiling and runs off into a low passage to the east. There is also a crack in the rock to the north.": LET N=1: LET S=0: LET E=1: LET W=0 3003 IF R=3 THEN LET RD$="This is a giant natural cavern, with a mirror-flat pool of perfectly black water occupying most of the floor. There is a heavy automatic door to the north and a low passage to the west.": LET N=1: LET S=0: LET E=0: LET W=1 3050 GOTO 40 EDIT: Wow, looks really small here... The code looks a lot longer on the Olivetti screen. Quote Link to post Share on other sites
arfink Posted July 21, 2008 Report Share Posted July 21, 2008 Ooooooo... so cool... My Tandy game isn't that cool yet. No seriously, it's neat. Lots of fun stuff you can do with only a few lines of code. Remember, with the Model T's you can never make your programs too small, you've got only 32k of RAM tops! BTW, how did you transfer it to a PC without Teeny, or did you get Teeny working? Just curious how you managed it. Quote Link to post Share on other sites
chris Posted July 22, 2008 Author Report Share Posted July 22, 2008 Used a Kermit terminal session on the PC side and SAVE"COM:58N1E on the Olivetti side. Quote Link to post Share on other sites
chris Posted July 22, 2008 Author Report Share Posted July 22, 2008 Also, if anyone can tell me why RETURN doesn't work on line 3050 (as you can see, there's a GOSUB on line 30) I'd be much obliged. Quote Link to post Share on other sites
luddite Posted July 22, 2008 Report Share Posted July 22, 2008 Well, I don't have a Tandy, but I did a quick Apple II port and it seems to work fine. Good start! Quote Link to post Share on other sites
arfink Posted July 22, 2008 Report Share Posted July 22, 2008 Hmm, you sure you spelled it right? I just checked my Tandy manual and it would seem that Gosub and Return should work OK. Oh wait, I see what it is: you don't have an END statement before the subroutine. If you don't have one then it will crash. I think... try it. like this, line 160 160 END Also remember that the RETURN sends it back to the line AFTER the GOSUB function gets called. You can do (for example) a RETURN 200, for example, to specify it to return to line 200, instead of the phrase right after GOSUB. Quote Link to post Share on other sites
dbraverman88 Posted July 24, 2008 Report Share Posted July 24, 2008 That's a great start. What do you think about using parallel arrays and read / data statements? --David Quote Link to post Share on other sites
chris Posted August 11, 2008 Author Report Share Posted August 11, 2008 Sadly, since I was on vacation for the last week of the RC and forgot to bring my Olivetti, this is as far as it got during the RC, and this is how it'll be judged. However, I will still be working on it as a personal project and I'll keep you guys posted on its progress. I'd love to see someone make an actual game out of it when it's a little further along - anyone is welcome to. Contact me if you need any help with any features. Also, I'd suggest removing the vars command if you want a game of it, that's just for debugging. Luddite brings up a good point; this will work on any machine with MS-BASIC or similar on it, not just the Tandy. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.