Jump to content
IGNORED

Richard "Lord British" Garriott's newest challenge


Bill Lange

Recommended Posts

Starting April 15th 2014, just past one year into the development of Shroud of the Avatar, and running for 1 month through May 15th, Richard via Portalarium will be accepting submissions of D&D1 Resurrections in each of two versions. Submissions may be a Unity Version, and or a no-plug-in Browser Version. Winners will be announced shortly after the submission deadline. All submissions become property of Richard Garriott.

 

Too bad. I was almost thinking of porting it over to the Sega Genesis. I don't know how they expect a BASIC game to be ported to Unity much less a "plug-in"-less browser version.

 

UPDATE: I just realised the source is a PDF that has no text. It's literally just a scan of the source. That's pretty unhelpful if one wants to port it.

Link to comment
Share on other sites

I did read in the instructions that the port for the contest was to be in Unity. It still would be interesting to do it in ATARI BASIC as well. It might be easier to do it in GWBASIC or some other standard basic first because of the string handling, then add comments before porting to ATARI BASIC.

 

I started looking at the listing. I didn't know what line 100 was doing. And I think line 160 is maybe using some kind of CLOCK function to seed the random number generator.

 

Any ways attached is the BASIC source listing pdf and a DEC PDP11 BASIC programming manual if anyone is interested.

 

 

 

 

Link to comment
Share on other sites

Page 1

 

 

10 LET J4=1
30 PRINT
100 BASE 0
110 LET X=0
120 LET J=0
130 LET K=0
140 X1=0
150 LET X3=0
160 LET J9=RND(CLK(J9))
170 DIM C(7),C$(7),W(100),D(50,50),P(100),I$(100),B(100,6),B$(100)
180 DIM E(100),F(100),X5(100),X6(100),X2(100),X4(100)
190 LET G=INT(RND(0)*24+2)
  • Like 1
Link to comment
Share on other sites

C(x) seems to be the character data array

C(1) = hit points

C(7) = gold

 

 

Last page

10500 LET X6(5)=600
10510 LET X6(6)=100
10520 LET X6(7)=200
10530 LET X6(=300
10540 LET X6(9)=200
10550 LET X6(10)=600
10560 IF Q<1 THEN 10660
10570 IF Q>8 THEN 10450
10580 IF C(7)-X6(INT(Q)) < 0 THEN 10640
10590 LET C(7)=C(7)-X6(INT(Q))
10600 PRINT " IT IS YOURS"
10610 LET X3=X3+1
10620 LET X4(X3)=INT(Q)
10630 GOTO 10450
10640 PRINT "COSTS TOO MUCH"
10650 GOTO 10450
10660 PRINT "YOU NOW HAVE"
10670 FOR M=1 TO X3
10680 IF X4(M)=0 THEN 700
10690 PRINT "+"; X4(M) : REM NOT SURE WHAT CHARACTER THE + IS SUPPOSTED TO BE
10700 NEXT M
10710 GOTO 1590
10720 REM
10730 REM CHEATING
10740 FOR M=0 TO 25
10750 FOR N=0 TO 25
10760 PRINT D(M,N);
10770 PRINT N
10780 PRINT
10790 PRINT M
10800 GOTO 1590
10810 REM
10820 GOTO 380
10830 PRINT "HOW MANY 200 GP. EACH ";
10840 INPUT Q
10850 IF C(7)-200*Q<0 THEN 10900
10860 LET C(0)=C(0)+INT(Q)
10870 LET C(7)=C(7)-INT(Q*200)
10880 PRINT "OK DONE"
10885 PRINT "HP= ";C(0)
10886 FOR M=1 TO 7
10887 PRINT C$(M);" = ";C(M)
10888 NEXT M
10890 GOTO 7000
10900 PRINT "NO"
10910 GOTO 10830
11000 PRINT "DNG";
11010 INPUT D2
11020 PRINT "X,Y,C";
11030 INPUT X9,Y9,C9
11035 IF C9<0 THEN 11060
11040 LET D(X9,Y9) = C9
11050 GOTO 11020
11060 PRINT "SAVE"
11061 INPUT Q
11062 IF Q<>1 THEN 7000
11063 FOR M=0 TO 25
11070 FOR N=0 TO 25
11080 WRITE +D2,D(M,N) : REM SAVING TO STORAGE???
11090 NEXT N
11100 NEXT M
11110 GOTO 7000
11120 END

  • Like 1
Link to comment
Share on other sites

Page 2 (that's all the typing for me today.)

200 LET H=INT(RND(0)*24+2)
210 FILE #1="DNG1"
220 FILE #2="DNG2",#3="DNG3",#4="DNG4",#5="DNG5",#6="DNG6"
230 RESTORE #4
240 FILE #7="GMSTR"
245 RESTORE #7
250 RESTORE #1
260 RESTORE #2
261 RESTORE #3
262 RESTORE #4
263 RESTORE #5
264 RESTORE #6
270 DATA "STR","DEX","CON","CHAR","WIS","INT","GOLD"
280 DATA "SWORD",10,"2-H-SWORD",15,"DAGGER",3,"MACE",5
290 DATA "SPEAR",2,"BOW",25,"ARROWS",2,"LEATHER MAIL",15
300 DATA "CHAIN MAIL",30,"TLTE MAIL",50,"ROPE",1,"SPIKES",1
310 DATA "FLASK OF OIL",2,"SILVER CROSS",25,"SPARE FOOD",5
320 PRINT "      DUNGEONS AND DRAGONS #1"
330 PRINT
340 PRINT "DO YOU NEED INSTRUCTIONS ";
350 INPUT Q$
360 IF Q$="YES" THEN 1730
370 IF Q$="Y" THEN 720
380 PRINT "OLD OR NEW GAME";
390 INPUT Q$
400 IF Q$="OLD" THEN 1770
410 PRINT "DUNGEON #";
420 INPUT D
421 PRINT "CONTINUES RESET 1=YES,2=NO ";
422 INPUT J6
430 REM ROLLING CHARICTERISTICS [sic]
440 PRINT "PLAYERS NME ";
450 INPUT N$
460 IF N$<>"SHAVS" THEN 1730
465 FOR M=1 TO 7
466 READ C$(M)
467 NEXT M
470 FOR M=1 TO 7
490 FOR N=1 TO 3
500 LET R=INT(RND(0)*6+1)
510 LET C(M)=C(M)+R
520 NEXT N
530 IF M<>7 THEN 550
540 LET C(M)=C(M)*15
550 REM
560 PRINT C$(M);"=";C(M)
570 NEXT M
580 PRINT
590 PRINT "CLASSIFICATION"
600 PRINT "WHICH DO YOU WANT TO BE"
610 PRINT "FIGHTER ,CLERIC ,OR WIZARD";
620 INPUT C$(0)
625 IF C$(0)<>"NONE" THEN 630
626 FOR M7=0 TO 7
627 LET C(M7)=0
628 NEXT M7
629 GO TO 470
630 IF C$(0)="FIGHTER" THEN 770
640 IF C$(0)="CLERIC" THEN 810
650 IF C$(0)="WIZARD" THEN 790
660 GO TO 620
670 PRINT "BUYING WEAPONS"
680 PRINT "FAST OR NORM"
690 INPUT Q3$
  • Like 1
Link to comment
Share on other sites

Here it is OCR'd... I'm not very happy with the results, so I'll keep messing with it.

 

https://www.dropbox.com/s/ai2kl1m0khpt5iv/DND1_Complete_OCR.pdf.zip

 

It's still a PDF, but you can select the text, copy & paste, and make any corrections in BASIC, using the original as a visual reference. A pain in the neck? Absolutely... like I said, I'll keep messing with it and try to get the accuracy down a little better.

Link to comment
Share on other sites

Here it is OCR'd... I'm not very happy with the results, so I'll keep messing with it.

 

https://www.dropbox.com/s/ai2kl1m0khpt5iv/DND1_Complete_OCR.pdf.zip

 

It's still a PDF, but you can select the text, copy & paste, and make any corrections in BASIC, using the original as a visual reference. A pain in the neck? Absolutely... like I said, I'll keep messing with it and try to get the accuracy down a little better.

 

Since you went to the trouble, I decided to do page 3. You're right, the OCR is pretty bad. :) Line 1090 looks like it might have a typo at the end (placement of semicolon). Anyone else feel like doing a page or two?

700 PRINT "NUMBER","ITEM","PRICE"
705 PRINT"-1-STOP"
710 FOR M=1 TO 15
720 READ I$(M),P(M)
725 IF Q3$="FAST" THEN 740
730 PRINT M,I$(M).P(M)
740 NEXT M
750 GOSUB 1150
760 GO TO 830
770 LET C(0)=INT(RND(0)*8+1)
780 GO TO 670
790 LET C(0)=INT(RND(0)*4+1)
800 GO TO 670
810 LET C(0)=INT(RND(0)*6+1)
820 GO TO 670
830 REM
850 LET X=X+1
860 INPUT Y
870 REM
880 IF Y<0 THEN 1000
885 IF Y>15 THEN 1000
890 IF C(7)-P(Y)<0 THEN 970
900 IF C$(0)="CLERIC" THEN 1290
910 IF C$(0)="WIZARD" THEN 1350
920 REM
930 LET C(7)=C(7)-P(Y)
940 PRINT "GP= ";C(7)
950 LET W(X)=Y
960 GO TO 830
970 PRINT "COSTS TOO MUCH"
980 PRINT "TRY AGAIN ";
990 GO TO 860
1000 PRINT "GP= ";C(7)
1010 REM
1020 PRINT "EQ LIST ";
1030 INPUT Q$
1040 IF Q$="NO" THEN 1090
1050 FOR M=1 TO X
1060 IF W(M)=0 THEN 1090
1070 PRINT W(M),I$(W(M))
1080 NEXT M
1090 PRINT "YOUR CHARACTERISTICS ARE;"
1100 PRINT C$(0)
1101 IF C(0)<>1 THEN 1110
1102 C(0)=2
1110 PRINT "HIT POINTS",C(0)
1120 PRINT
1130 PRINT
1140 GO TO 1400
1150 DATA "MAN",1,13,26,1,1,500
1160 DATA "GOBLIN",2,13,24,1,1,600
1170 DATA "TROLL",3,15,35,1,1,1000
1180 DATA "SKELETON",4,22,12,1,1,50
1190 DATA "BALROG",5,18,110,1,1,5000
Link to comment
Share on other sites

Yep... if you want to keep doing these, I'll just leave it be, because there's really no better way than to re-type it, like you're doing. That's just an awful lot of work and I thought I'd see if Acrobat Pro's OCR engine was capable of pulling it off (within reason).

Link to comment
Share on other sites

Yep... if you want to keep doing these, I'll just leave it be, because there's really no better way than to re-type it, like you're doing. That's just an awful lot of work and I thought I'd see if Acrobat Pro's OCR engine was capable of pulling it off (within reason).

I think each page needs to processed for maximum contrast between the type and the page. Then the OCR needs to be trained on the characters.

 

But, if several people work on it we could have it retyped in a short time.

Link to comment
Share on other sites

Yes, definitely. I am currently changing all of the pages to B&W (not grayscale or the yellowed paper of the original) to fix the contrast, but I'm still not sure that the OCR process will do too much better with it. I'll post the pages when I'm done, just in case anybody want to use them for one thing or another, but I think the freshly-typed pages are much nicer.

Link to comment
Share on other sites

Another question, doesn't it look like this also requires dungeon files to work?

 

I though the same thing. Looks like there should be 7 data files that are missing. We'll have to look at the code to see what it is expecting and then improvise some dungeon files unless RG sees that they are missing and releases them as well.

Link to comment
Share on other sites


Known issues

1. Missing 7 data files


Variable Table

C(X) seems to be the character data array
C(1) = hit points
C(7) = gold

X5(X) Cost of (cleric) spells 1..8
X6(X) Cost of (wizard) spells 1..8

---Page 1

10 LET J4=1
30 PRINT
100 BASE 0
110 LET X=0
120 LET J=0
130 LET K=0
140 X1=0
150 LET X3=0
160 LET J9=RND(CLK(J9))
170 DIM C(7),C$(7),W(100),D(50,50),P(100),I$(100),B(100,6),B$(100)
180 DIM E(100),F(100),X5(100),X6(100),X2(100),X4(100)
190 LET G=INT(RND(0)*24+2)

-- Page 2

200 LET H=INT(RND(0)*24+2)
210 FILE #1="DNG1"
220 FILE #2="DNG2",#3="DNG3",#4="DNG4",#5="DNG5",#6="DNG6"
230 RESTORE #4
240 FILE #7="GMSTR"
245 RESTORE #7
250 RESTORE #1
260 RESTORE #2
261 RESTORE #3
262 RESTORE #4
263 RESTORE #5
264 RESTORE #6
270 DATA "STR","DEX","CON","CHAR","WIS","INT","GOLD"
280 DATA "SWORD",10,"2-H-SWORD",15,"DAGGER",3,"MACE",5
290 DATA "SPEAR",2,"BOW",25,"ARROWS",2,"LEATHER MAIL",15
300 DATA "CHAIN MAIL",30,"TLTE MAIL",50,"ROPE",1,"SPIKES",1
310 DATA "FLASK OF OIL",2,"SILVER CROSS",25,"SPARE FOOD",5
320 PRINT " DUNGEONS AND DRAGONS #1"
330 PRINT
340 PRINT "DO YOU NEED INSTRUCTIONS ";
350 INPUT Q$
360 IF Q$="YES" THEN 1730
370 IF Q$="Y" THEN 720
380 PRINT "OLD OR NEW GAME";
390 INPUT Q$
400 IF Q$="OLD" THEN 1770
410 PRINT "DUNGEON #";
420 INPUT D
421 PRINT "CONTINUES RESET 1=YES,2=NO ";
422 INPUT J6
430 REM ROLLING CHARICTERISTICS [sic]
440 PRINT "PLAYERS NME ";
450 INPUT N$
460 IF N$<>"SHAVS" THEN 1730
465 FOR M=1 TO 7
466 READ C$(M)
467 NEXT M
470 FOR M=1 TO 7
490 FOR N=1 TO 3
500 LET R=INT(RND(0)*6+1)
510 LET C(M)=C(M)+R
520 NEXT N
530 IF M<>7 THEN 550
540 LET C(M)=C(M)*15
550 REM
560 PRINT C$(M);"=";C(M)
570 NEXT M
580 PRINT
590 PRINT "CLASSIFICATION"
600 PRINT "WHICH DO YOU WANT TO BE"
610 PRINT "FIGHTER ,CLERIC ,OR WIZARD";
620 INPUT C$(0)
625 IF C$(0)<>"NONE" THEN 630
626 FOR M7=0 TO 7
627 LET C(M7)=0
628 NEXT M7
629 GO TO 470
630 IF C$(0)="FIGHTER" THEN 770
640 IF C$(0)="CLERIC" THEN 810
650 IF C$(0)="WIZARD" THEN 790
660 GO TO 620
670 PRINT "BUYING WEAPONS"
680 PRINT "FAST OR NORM"
690 INPUT Q3$

--- Page 3

700 PRINT "NUMBER","ITEM","PRICE"
705 PRINT"-1-STOP"
710 FOR M=1 TO 15
720 READ I$(M),P(M)
725 IF Q3$="FAST" THEN 740
730 PRINT M,I$(M).P(M)
740 NEXT M
750 GOSUB 1150
760 GO TO 830
770 LET C(0)=INT(RND(0)*8+1)
780 GO TO 670
790 LET C(0)=INT(RND(0)*4+1)
800 GO TO 670
810 LET C(0)=INT(RND(0)*6+1)
820 GO TO 670
830 REM
850 LET X=X+1
860 INPUT Y
870 REM
880 IF Y<0 THEN 1000
885 IF Y>15 THEN 1000
890 IF C(7)-P(Y)<0 THEN 970
900 IF C$(0)="CLERIC" THEN 1290
910 IF C$(0)="WIZARD" THEN 1350
920 REM
930 LET C(7)=C(7)-P(Y)
940 PRINT "GP= ";C(7)
950 LET W(X)=Y
960 GO TO 830
970 PRINT "COSTS TOO MUCH"
980 PRINT "TRY AGAIN ";
990 GO TO 860
1000 PRINT "GP= ";C(7)
1010 REM
1020 PRINT "EQ LIST ";
1030 INPUT Q$
1040 IF Q$="NO" THEN 1090
1050 FOR M=1 TO X
1060 IF W(M)=0 THEN 1090
1070 PRINT W(M),I$(W(M))
1080 NEXT M
1090 PRINT "YOUR CHARACTERISTICS ARE;"
1100 PRINT C$(0)
1101 IF C(0)<>1 THEN 1110
1102 C(0)=2
1110 PRINT "HIT POINTS",C(0)
1120 PRINT
1130 PRINT
1140 GO TO 1400
1150 DATA "MAN",1,13,26,1,1,500
1160 DATA "GOBLIN",2,13,24,1,1,600
1170 DATA "TROLL",3,15,35,1,1,1000
1180 DATA "SKELETON",4,22,12,1,1,50
1190 DATA "BALROG",5,18,110,1,1,5000

-- Second to last page

10000 PRINT "YOU CANT BUY ANY"
10010 GOTO 1590
10020 PRINT "DO YOU KNOW THE CHOICES";
10030 INPUT Q$
10040 IF Q$="YES" THEN 10100
10050 PRINT "1-KILL-500 5-MAG. MISS. #1-100"
10060 PRINT "2-MAG. MISS #2-200 6-MAG. MISS. #3-300"
10070 PRINT "3-CURE LIGHT #1-200 7-CURE LIGHT #2-1000"
10080 PRINT "4-FIND ALL TRAPS-200 8-FIND ALL S.DOORS-200"
10090 PRINT "INPUT # WANTED NEG.NUM.TO STOP";
10100 PRINT Q
10110 LET X5(1)=500
10120 LET X5(2)=200
10130 LET X5(3)=200
10140 LET X5(4)=200
10150 LET X5(5)=100
10160 LET X5(6)=300
10170 LET X5(7)=1000
10180 LET X5(=200

10190 IF Q<1 THEN 10290
10200 IF Q>10 THEN 10100
10210 IF C(7)-X5(INT(Q))<0 THEN 10270
10220 LET C(7)=C(7)-X5(INT(Q))
10230 PRINT "IT IS YOURS"
10240 LET X1=X1+1
10250 LET X2(X1)=INT(Q)
10260 GOTO 10100
10270 PRINT "COSTS TOO MUCH"
10280 GOTO 10100
10290 PRINT "YOUR SPELLS ARE"
10300 FOR M=1 TO X1
10310 IF X2(M)=0 THEN 10330
10320 PRINT "#";X2(M)
10330 NEXT M
10340 PRINT "DONE"
10350 GOTO 1590
10360 PRINT "DO YOU KNOW THE SPELLS";
10370 INPUT Q$
10380 IF Q$="YES" THEN 10450
10390 PRINT "1-PUSH-75 6-M. M. #1-100"
10400 PRINT "2-KIHL-500 7-M. M. #2-200"
10410 PRINT "3-FIND TRAPS-200 8-M. M. #3-300"
10420 PRINT "4-TELEPORT-750 9-FIND S.DOORS-200"
10430 PRINT "5-CHANGE 1+0-600 10-CHANGE 0+1-600"
10440 PRINT "#OF ONE YOU WANT NEG.NUM. TO STOP";
10450 INPUT Q
10460 LET X6(1)=75
10470 LET X6(2)=500
10480 LET X6(3)=200
10490 LET X6(4)=750

--- Last Page

10500 LET X6(5)=600
10510 LET X6(6)=100
10520 LET X6(7)=200
10530 LET X6(=300
10540 LET X6(9)=200
10550 LET X6(10)=600
10560 IF Q<1 THEN 10660
10570 IF Q>8 THEN 10450
10580 IF C(7)-X6(INT(Q)) < 0 THEN 10640
10590 LET C(7)=C(7)-X6(INT(Q))
10600 PRINT " IT IS YOURS"
10610 LET X3=X3+1
10620 LET X4(X3)=INT(Q)
10630 GOTO 10450
10640 PRINT "COSTS TOO MUCH"
10650 GOTO 10450
10660 PRINT "YOU NOW HAVE"
10670 FOR M=1 TO X3
10680 IF X4(M)=0 THEN 700
10690 PRINT "#"; X4(M)
10700 NEXT M
10710 GOTO 1590
10720 REM
10730 REM CHEATING
10740 FOR M=0 TO 25
10750 FOR N=0 TO 25
10760 PRINT D(M,N);
10770 PRINT N
10780 PRINT
10790 PRINT M
10800 GOTO 1590
10810 REM
10820 GOTO 380
10830 PRINT "HOW MANY 200 GP. EACH ";
10840 INPUT Q
10850 IF C(7)-200*Q<0 THEN 10900
10860 LET C(0)=C(0)+INT(Q)
10870 LET C(7)=C(7)-INT(Q*200)
10880 PRINT "OK DONE"
10885 PRINT "HP= ";C(0)
10886 FOR M=1 TO 7
10887 PRINT C$(M);" = ";C(M)
10888 NEXT M
10890 GOTO 7000
10900 PRINT "NO"
10910 GOTO 10830
11000 PRINT "DNG";
11010 INPUT D2
11020 PRINT "X,Y,C";
11030 INPUT X9,Y9,C9
11035 IF C9<0 THEN 11060
11040 LET D(X9,Y9) = C9
11050 GOTO 11020
11060 PRINT "SAVE"
11061 INPUT Q
11062 IF Q<>1 THEN 7000
11063 FOR M=0 TO 25
11070 FOR N=0 TO 25
11080 WRITE #D2,D(M,N) : REM SAVING TO STORAGE???
11090 NEXT N
11100 NEXT M
11110 GOTO 7000
11120 END

Link to comment
Share on other sites

Might give it a go. Using Unity a lot at the moment ... but they want the game mapped to a texture. Not sure how to do that - yet. Plenty of time to figure it out. I hate contests that expect you to complete an entire game in 2 weeks. This one seems pretty simple.

 

So basically they're looking for someone to recreate the game for them so that it can appear somewhere in their new game.

 

 

Edit: I'm not having any problems reading the OCRed listing (there are a few typos in it). I am, however, having problems opening the PDP-11 Basic Manual. Acrobat doesn't want to open it up for me

Edited by Tickled_Pink
Link to comment
Share on other sites

Here's something that can convert the program logic from a BASIC listing to C source which can make it easier to redo for C# that Unity uses.. http://my-tech-site.blogspot.com/2012/01/convert-basic-to-c.html

 

Still have to make a function to print to a yellow texture but it's something to replace the printf statements.

Edited by MrMaddog
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...