Jump to content
IGNORED

New Baseball game for the TI-99/4a


Opry99er

Recommended Posts

Wooooo hooooooo!!!!!!!

 

It's all done except prescan. Here's the XB file, zipped up, ready to rock!

 

Once the prescan thing is finished, it will be available for play on the Heat Wave BBS. I'm having some issues, as I have added several new arrays and variables in order to make this more of a "game" rather than a "simulation."

 

I have played 10 games now (since I completed the code and did a MASSIVE debugging session) and I have won 6 of 10 games... There really is some strategy involved now, as you have the option as the user to bunt to advance your base runners... I've found that if you can get the leadoff man on, bunting to move him into scoring position and then hitting for contact tends to be a good strategy. =)

 

In any case, here's the game... enjoy.

 

***BTW, the random nature of the pitcher/hitter matchups doesn't seem so random once you get involved in two or three games. One game I played, the opposing team was up 8-2 in the top of the 8th... The game was tied 8-8 at the end of regulation and I lost by 1 in the 10th, giving up a home run to Todd Helton, pitching aggressively. =) Always sucks to lose in extras, but I was thrilled to see the game working properly.

BBSBALL1.zip

Link to comment
Share on other sites

Keep in mind that the above-posted gamefile is the BBS version... text only and scrolling PRINT statements. The full-on XB version will be much more in depth and have music and graphics (once I have time to get it going)... The vast majority of the actual meat of the code (engines and such) will still be there in the XB version... The primary differences are the displays and user interface.

 

 

 

Played 3 games this morning... I lost 2...

 

Final scores were

 

1)

Home: 4

Away: 9

 

2)

Home: 12

Away: 7

 

3)

Home: 5

Away: 6

 

 

=)

Edited by Opry99er
Link to comment
Share on other sites

Little update I'm considering... should only take a few minutes...

 

An option to "select your team" from a list of players... Basically right now there are 18 players in the code, each with their names in string variable arrays, their hitting/pitching stats in standard variable arrays...

 

What if you could pick your lineup (position-based of course) from the available players.... For instance,

 

SELECT YOUR FIRST BASEMAN:

 

1) Todd Helton

2) Lou Gehrig

 

SELECT YOUR SECOND BASEMAN:

 

1) Rod Carew

2) Rogers Hornsby

.

.

.

.

 

This would give the user a little more to do at startup, and it would be listed as an OPTION... Of course they could select "DEFAULT LINEUPS" if they so chose...

 

Should be no more than 5-10 lines of code... what do you think?

Link to comment
Share on other sites

Once the prescan thing is finished, it will be available for play on the Heat Wave BBS. I'm having some issues, as I have added several new arrays and variables in order to make this more of a "game" rather than a "simulation."

 

One thing to note is that your individual CALL C() print statements can be combined and efficiencies gained there. The subprogram I gave you was meant to mimic the PRINT statement so you could test in XB. :) Also need to add error trapping and a few other BBS-specific requirements.

Link to comment
Share on other sites

Ahhh...

 

Well, I have to admit, I've been working on game enhancements more than conversion the last couple days... That's my perfectionist nature taking over. =) Mad Hatter mentioned something about wanting a more in depth batter/pitcher matchup interface and I kind of went a bit crazy. Also have been adjusting some stuff on the internals of the code, not visible, in order to get organized...

Link to comment
Share on other sites

Finished the prescan disable. The code looks funny, but it works... Here's the first part of the code, it will show you what has to be done to achieve this.

 

***As a note, the launch time went from 18 seconds to 2 seconds! =)

 


5 CALL LINK("FORTY") :: CALL LINK("FCLEAR") :: CALL LINK("HOTKEY","")
6 GOTO 25
10 DIM SCO(2), P$(2), C$(2), B$(2), BB$(2), BBB$(2), SS$(2), LF$(2), CF$(2), RF$(2), BO(2), HIT(2), WH(2)
20 DIM PBSC(2), PSC(2), CSC(2), BSC(2), BBSC(2), BBBSC(2), SSSC(2), LFSC(2), CFSC(2), RFSC(2), STK(2):: INSC(2,10)
21 BAP, INN, OUT, BFLG, BBFLG, BBBFLG, HPFLG, TAP, INF, RFLG, I, SFDICE, WHDICE, POM, W$, X$, Y$, Z$, AS$, HS$, K, ASC, BAP$, BAPSC
22 BCH, PCH, WHIP
24 CALL C :: CALL CL :: CALL KY :: CALL S
25 !@P-

 

 

So you can see, line 6 forces the program to completely skip every line up to the !@P- (which does the dirty work). I basically had to "define" each variable, array, and string variable by listing it in this area... Then, continue with regular program execution. It forces the program to execute without doing it's regular sloooow scanning process, and as long as you KNOW your code works and isn't broken AND you have all variables listed in the area before the !@P-, it'll rock and roll on launch time.

 

One other thing (which was discussed earlier) is that you must re-instate the feature by entering !@P+ RIGHT before your user-defined subroutines.

 


2900 !@P+
3000 SUB C(A$) :: B$="~"&A$ :: CALL LINK("PRINTX",B$) :: SUBEND
4000 SUB CL :: CALL LINK("BCLEAR") :: CALL C(CHR$(12)&CHR$(26)&CHR$(13)) :: SUBEND
5000 SUB KY :: CALL KEY(0,K,S) :: SUBEND
5010 SUB S(K)!RETURN K AS THE KEY VALUE
5011 CALL LINK("SC",A$) :: IF A$="" OR A$=CHR$(0)THEN 5011 ELSE IF A$=CHR$(1)THEN 3
5012 K=ASC(A$) :: SUBEND

 

Thanks to Tim for helping me out with this. Hope you guys can use this in your programs to increase speed. =) I'll be using it for every XB offering from this point forward!

  • Like 1
Link to comment
Share on other sites

I like the draft idea, but I think you'd need to present the stats on the players and obviously will affect the balance of the game... It would be good to have some fielding stats too. Of course, you add that and boom - much more work.

Link to comment
Share on other sites

I'd like to implement those things, but they will have to wait for v 1.1. It would be fairly simple to accomplish, but simple doesn't always mean "easy" or even quick. I would need to have balanced players,offensive heavy players, and defensive heavy players available so that the user could build a team from scratch and set their lineup pre-game... All that and more will be in the full XB version, but I am struggling as to what to put into the BBS version PRACTICALLY. I have plenty of program space left, but I'm not sure how ambitious I want to get with the BBS game.

Link to comment
Share on other sites

Now that I have disabled the pre-scan and the load time has decreased exponentially, I think it's pretty close to being ready to rock for the BBSes. There are still a few mods and optimizations that need to occur before it's up and running there, but it's getting quite close.

 

If any of you are interested in playing it in it's new native environment, (by "new" I mean "as soon as it gets uploaded") get your telnet client running (or get yourself a modem hooked up to your TI-99) and look up the Heat Wave BBS, run by Mad Hatter and Tim Tesch. It's very well run and operates very quickly. It is hosted on a Geneve and runs the S&T BBS software. As many of you know, the Hidden Reef has been the sole TI-99/4a BBS for many years. It is running 24 hours a day on a real TI-99 console and is dial-in only. HeatWave runs the same basic software (with many upgrades and improvements) but on a Geneve. Interestingly enough, if you have another classic computer hooked up to a modem, you can dial into it as well. There is alot of good activity there, many callers and telnetters, good games and a very nice user interface. I highly recommend it for anyone wanting to become a member of a bulletin board service.

 

=)

Link to comment
Share on other sites

  • 1 month later...

Started re-converting(?) the code back into straight XB code and adding graphics. Heatwave BBS is down right now so there's no way to get the game up and running in that environment just yet.

 

I've thought about using SPRITEs for animation. I wonder what a SPRITE update would look like if as it travelled, it decreased in size (if going away) and increased in size when coming toward the "camera" as it were.... I don't know if there are enough pixels in a 16x16 character def block to make it look "right"... Perhaps using a magnification switch would make it more believable, but the character switching and magnification switching would have to dance together just right so it wouldn't look lame...

 

Maybe sometimes99er could weigh in here. =)

Link to comment
Share on other sites

Started re-converting(?) the code back into straight XB code and adding graphics. Heatwave BBS is down right now so there's no way to get the game up and running in that environment just yet.

After Mad Hatter replaces the failed hard drive, I will be able to download and update the game configuration, which in turn will allow us to activate your game online. I updated the onlin code for your Baseball program this afternoon in preparation for HeatWave's return. It helps to be home again for a few days and with a holiday to boot...who could ask for more? :)
Link to comment
Share on other sites

Yea man... I get one day off and then it's back to the salt mines again. :)

 

I've been working on some additional code for that baseball game too. Won't affect the routines you have so kindly put in place for BBS compatibility, but it will create a more complete and accurate engine for hitter/batter matchups. I will add the code without resequencing so as not to interfere with your enhancement lines and send it to you tomorrow. Probably a good hing we haven't gotten it up yet, as a revision would have been in order already. :)

 

Once I send you the code, you can add your revision lines and resequence if you so choose. Might be good to have even line numbers for the future.

 

Thanks again for all your help in getting this game BBS ready. :)

Edited by Opry99er
Link to comment
Share on other sites

Yea man... I get one day off and then it's back to the salt mines again. :)

 

I've been working on some additional code for that baseball game too. Won't affect the routines you have so kindly put in place for BBS compatibility, but it will create a more complete and accurate engine for hitter/batter matchups. I will add the code without resequencing so as not to interfere with your enhancement lines and send it to you tomorrow. Probably a good hing we haven't gotten it up yet, as a revision would have been in order already. :)

 

Once I send you the code, you can add your revision lines and resequence if you so choose. Might be good to have even line numbers for the future.

 

Thanks again for all your help in getting this game BBS ready. :)

Well, if we had a template for the games that would make it easier. For your next game, maybe you can test a template I have on file... we just need to get a few things squared away for Mad Hatter first.
Link to comment
Share on other sites

Would love that. I had actually planned to make the BBSball game a template for my future games. I was going to save all the subs in NotePad with high line numbers and call them as necessary. I assume that's similar to what you have for me. It would make conversion fairly easy. I can strip the graphics out of Lemonade Stand and do a simple search and replace for the subroutines in NotePad+. Please forward it to me, good sir. I can get started with it immediately.

Link to comment
Share on other sites

Hey Tim... The stuff I was trying to implement is going to take longer than I thought to finish. I was ambitious and opened the hood on this game and was planning to implement a bunch of new features, but I'm not sure I can have it all done by the time the BBS goes back up... I can probably have SOME of it done, but not all of it. I'm really going through the code with a fine toothed comb right now in an attempt to focus my efforts in one or two spots... If I can do that, I may have something worthwhile to add by tomorrow, but as of now, I think I may want to just "go with what we've got"....

 

I played the game a few times tonight (lost 2, won 1) and it seems to be functioning adequately... Part of the reason I wanted to change some things is that I KNOW how the engine works and a few elements bothered me... But to the end user, it's not going to make that much of a difference, most of what I wanted to change. I am trying to implement a "draft" concept right now (as an option) for the user to have an option to build the team or have a pre-set team made for them... Also wanted to give the user the option to set their lineups, but I'm not sure if that's going to be all that useful... Unless you REALLY know baseball and how to set a lineup from the 1-5 hitters, it'll be frivalous. I don't know...

 

I'll try to get a couple features done by tomorrow, but in rethinking this revision, it might not be prudent at this time...

Link to comment
Share on other sites

Okay... I gotta get to bed.....

 

Here's the latest incarnation of the code (this does not include InsaneMultitasker's final BBS support lines) It's fully commented and completely worthless in XB, so trying to paste will get you nowhere. =)

 

 

The point of posting this here and now is so anyone interested in seeing a format for BBS games (and prescan disable), they can look here for how it CAN be constructed... The code is a little funky, in that I should have created more user-defined subs as opposed to the GOSUBs, but I put REM statements before each subroutine so that it would be clear... I will be using user subs from now on in all XB projects going forward. =)

 

 

 

***REM BASEBALL GAME FOR S&T BBS SOFTWARE***


100 !SAVE DSK1.BB
110 !Some BBS housekeeping for  !activation later
120 !call load(-24576,xx)::RUN"device.launcher"
130 CALL LINK("FORTY") :: CALL LINK("FCLEAR") :: CALL LINK("HOTKEY","")

***REM THIS IS THE SETUP FOR PRESCAN... ALL VARIABLES ARE DEFINED HERE
140 GOTO 200
150 DIM SCO(2),P$(2),C$(2),B$(2),BB$(2),BBB$(2),SS$(2),LF$(2),CF$(2),RF$(2),BO(2),HIT(2),WH(2)
160 DIM PBSC(2),PSC(2),CSC(2),BSC(2),BBSC(2),BBBSC(2),SSSC(2),LFSC(2),CFSC(2),RFSC(2),STK(2) :: INSC(2,10)
170 BAP,INN,OUT,BFLG,BBFLG,BBBFLG,HPFLG,TAP,INF,RFLG,I,SFDICE,WHDICE,POM,W$,X$,Y$,Z$,AS$,HS$,K,ASC,BAP$,BAPSC
180 BCH,PCH,WHIP,S
190 CALL C :: CALL CL :: CALL KY :: CALL S
200 !@P-

***REM ALL VARIABLES AND ARRAYS ARE LOADED WITH VALUES HERE
210 FOR I=1 TO 10 :: INSC(1,I)=0 :: INSC(2,I)=0 :: NEXT I
220 BAP=0 :: INN=1 :: OUT=3 :: BFLG=0 :: BBFLG=0 :: BBBFLG=0 :: HPFLG=0 :: SCO(1)=0 :: SCO(2)=0 :: TAP=1 :: INF=0 :: RFLG=0
230 BO(1)=0 :: BO(2)=0 :: HIT(1)=0 :: HIT(2)=0 :: STK(1)=0 :: STK(2)=0


240 RANDOMIZE
250 REM  BASEBALL SIM


***REM HERE I LOAD STRING VARIABLES INTO THE STRING VARIABLE ARRAYS WHICH WILL CONTAIN PLAYER NAMES

260 REM  HOME TEAM
270 P$(1)="W. JOHNSON" :: PBSC(1)=450 :: PSC(1)=989
280 C$(1)="J. BENCH" :: CSC(1)=961
290 B$(1)="L. GEHRIG" :: BSC(1)=980
300 BB$(1)="R. HORNSBY" :: BBSC(1)=981
310 BBB$(1)="E. MATHEWS" :: BBBSC(1)=872
320 SS$(1)="H. WAGNER" :: SSSC(1)=857
330 LF$(1)="T. WILLIAMS" :: LFSC(1)=969
340 CF$(1)="J. DIMAGGIO" :: CFSC(1)=971
350 RF$(1)="B. RUTH" :: RFSC(1)=999


360 REM  AWAY TEAM

370 P$(2)="NOLAN RYAN" :: PBSC(2)=300 :: PSC(2)=989
380 C$(2)="Y. BERRA" :: CSC(2)=830
390 B$(2)="T. HELTON" :: BSC(2)=962
400 BB$(2)="R. CAREW" :: BBSC(2)=822
410 BBB$(2)="A. RODRIGUEZ" :: BBBSC(2)=944
420 SS$(2)="C. RIPKEN JR." :: SSSC(2)=788
430 LF$(2)="B. WILLIAMS" :: LFSC(2)=858
440 CF$(2)="P. ROSE" :: CFSC(2)=784
450 RF$(2)="M. CUDDYER" :: RFSC(2)=846




460 CALL CL :: GOSUB 2240  !This sends control of the program to the "intro screen"


470 CALL S(K)  !This is the equivalent of CALL KEY(0,K,S):: IF S=0 THEN 470


480 REM  BEGIN MAIN GAME LOOP
490 IF OUT>2 THEN GOSUB 1640
500 IF INN>8 THEN IF INF>1 THEN GOSUB 1930  ! bottom of 9th inning or later, gosub 1600


510 GOSUB 1490 !Rem 1490 determines who is up to bat, on the mound, etc....


520 REM  SCREEN DISPLAY
530 IF INF=1 THEN CALL C("                      TOP")ELSE CALL C("                      BOT")
540 CALL C(" OUTS: "&STR$(OUT)&"       INNING: "&STR$(INN))
550 CALL C("")
560 CALL C(" HOME: "&STR$(SCO(1)))
570 CALL C(" AWAY: "&STR$(SCO(2)))
580 FOR I=1 TO 3 :: CALL C("") :: NEXT I
590 TAP=TAP XOR 3
600 CALL C("NOW PITCHING:") :: CALL C(P$(TAP)) :: CALL C("")
610 TAP=TAP XOR 3
620 CALL C("NOW BATTING:") :: CALL C(BAP$)
630 CALL C("                 "&STR$(BBFLG))
640 CALL C("                "&STR$(BBBFLG)&" "&STR$(BFLG))
650 CALL C("                 "&STR$(BAP)) :: CALL C("")



660 REM  Inner game loop
670 GOSUB 2180  !This sends program control to the batter/pitcher matchup SUB
680 CALL CL
690 IF SFDICE=1 THEN GOSUB 720 ELSE GOSUB 1130   !If "reach base," gosub 360, if "out" gosub 440
700 FOR I=1 TO 400 :: NEXT I :: CALL CL :: GOTO 490


710 REM  "BATTER REACHES BASE" SUB
720 CALL CL
730 ON WHDICE GOSUB 740,740,810,870,930,870,870,870,1000,1060 :: RETURN


740 CALL C("WALK")
750 IF BBBFLG>0 AND BBFLG>0 AND BFLG>0 THEN INSC(TAP,INN)=INSC(TAP,INN)+1   !add to the inning score for later display
760 IF BBBFLG>0 AND BBFLG>0 AND BFLG>0 THEN HPFLG=BBBFLG :: SCO(TAP)=SCO(TAP)+1 :: BBBFLG=BBFLG :: BBFLG=BFLG :: BFLG=BAP
770 IF BBFLG>0 AND BFLG>0 THEN BBBFLG=BBFLG :: BBFLG=BFLG :: BFLG=BAP
780 IF BFLG>0 THEN BBFLG=BFLG :: BFLG=BAP
790 BFLG=BAP
800 RETURN


810 CALL C("SINGLE") :: HIT(TAP)=HIT(TAP)+1 :: IF BBBFLG>0 THEN HPFLG=BBBFLG :: SCO(TAP)=SCO(TAP)+1
820 IF BBBFLG>0 THEN INSC(TAP,INN)=INSC(TAP,INN)+1 :: BBBFLG=0
830 IF BBFLG>0 THEN BBBFLG=BBFLG :: BBFLG=0
840 IF BFLG>0 THEN BBFLG=BFLG :: BFLG=0
850 BFLG=BAP
860 RETURN


870 CALL C("SINGLE") :: HIT(TAP)=HIT(TAP)+1 :: IF BBBFLG>0 THEN HPFLG=BBBFLG :: SCO(TAP)=SCO(TAP)+1
880 IF BBBFLG>0 THEN INSC(TAP,INN)=INSC(TAP,INN)+1 :: BBBFLG=0
890 IF BBFLG>0 THEN BBBFLG=BBFLG :: BBFLG=0
900 IF BFLG>0 THEN BBFLG=BFLG :: BFLG=0
910 BFLG=BAP
920 RETURN


930 CALL C("DOUBLE") :: HIT(TAP)=HIT(TAP)+1 :: IF BBBFLG>0 THEN HPFLG=BBBFLG :: SCO(TAP)=SCO(TAP)+1
940 IF BBBFLG>0 THEN INSC(TAP,INN)=INSC(TAP,INN)+1 :: BBBFLG=0
950 IF BBFLG>0 THEN HPFLG=BBFLG :: SCO(TAP)=SCO(TAP)+1
960 IF BBFLG>0 THEN INSC(TAP,INN)=INSC(TAP,INN)+1 :: BBFLG=0
970 IF BFLG>0 THEN BBBFLG=BFLG :: BFLG=0
980 BBFLG=BAP
990 RETURN


1000 CALL C("TRIPLE") :: HIT(TAP)=HIT(TAP)+1 :: IF BBBFLG>0 THEN HPFLG=BBBFLG :: SCO(TAP)=SCO(TAP)+1
1010 IF BBBFLG>0 THEN INSC(TAP,INN)=INSC(TAP,INN)+1 :: BBBFLG=0
1020 IF BBFLG>0 THEN HPFLG=BBFLG :: SCO(TAP)=SCO(TAP)+1 :: BBFLG=0 :: INSC(TAP,INN)=INSC(TAP,INN)+1
1030 IF BFLG>0 THEN HPFLG=BFLG :: SCO(TAP)=SCO(TAP)+1 :: BFLG=0 :: INSC(TAP,INN)=INSC(TAP,INN)+1
1040 BBBFLG=BAP
1050 RETURN


1060 CALL C("HOME RUN") :: HIT(TAP)=HIT(TAP)+1 :: IF BBBFLG>0 THEN HPFLG=BBBFLG :: SCO(TAP)=SCO(TAP)+1
1070 IF BBBFLG>0 THEN INSC(TAP,INN)=INSC(TAP,INN)+1 :: BBBFLG=0
1080 IF BBFLG>0 THEN HPFLG=BBFLG :: SCO(TAP)=SCO(TAP)+1 :: BBFLG=0 :: INSC(TAP,INN)=INSC(TAP,INN)+1
1090 IF BFLG>0 THEN HPFLG=BFLG :: SCO(TAP)=SCO(TAP)+1 :: BFLG=0 :: INSC(TAP,INN)=INSC(TAP,INN)+1
1100 HPFLG=BAP :: SCO(TAP)=SCO(TAP)+1 :: INSC(TAP,INN)=INSC(TAP,INN)+1
1110 RETURN




1120 REM  THIS IS THE "YOU'RE OUT, AND HERE'S HOW" SUB
1130 CALL CL
1140 ON WHDICE GOSUB 1310,1160,1160,1230,1380,1420,1420,1150,1150,1150 :: RETURN


1150 CALL C("STRIKEOUT") :: OUT=OUT+1 :: STK(TAP)=STK(TAP)+1 :: RETURN


1160 CALL C("GROUNDOUT")
1170 OUT=OUT+1 :: IF OUT>2 THEN RETURN
1180 GOSUB 1880 :: IF RFLG>0 THEN CALL C("ALL RUNNERS ADVANCE")
1190 IF BBBFLG>0 THEN HPFLG=BBBFLG :: SCO(TAP)=SCO(TAP)+1 :: BBBFLG=0 :: INSC(TAP,INN)=INSC(TAP,INN)+1
1200 IF BBFLG>0 THEN BBBFLG=BBFLG :: BBFLG=0
1210 IF BFLG>0 THEN BBFLG=BFLG :: BFLG=0
1220 RETURN


1230 CALL C("GROUNDOUT")
1240 OUT=OUT+1 :: IF OUT>2 THEN RETURN
1250 GOSUB 1880 :: IF RFLG>0 THEN CALL C("RUNNERS ADVANCE IF FORCED")
1260 IF BBBFLG>0 AND BBFLG>0 AND BFLG>0 THEN HPFLG=BBBFLG :: SCO(TAP)=SCO(TAP)+1 :: BBBFLG=BBFLG :: BBFLG=BFLG
1270 IF BBBFLG>0 AND BBFLG>0 AND BFLG>0 THEN INSC(TAP,INN)=INSC(TAP,INN)+1 :: BFLG=0 :: RETURN
1280 IF BBFLG>0 AND BFLG>0 THEN BBBFLG=BBFLG :: BBFLG=BFLG :: BFLG=0 :: RETURN
1290 IF BFLG>0 THEN BBFLG=BFLG :: BFLG=0
1300 RETURN


1310 CALL C("GROUNDOUT")
1320 OUT=OUT+1 :: IF OUT>2 THEN RETURN
1330 IF BFLG>0 THEN OUT=OUT+1 :: BFLG=0 :: CALL C("DOUBLE PLAY!") :: IF OUT>2 THEN RETURN
1340 IF BBBFLG>0 THEN HPFLG=BBBFLG :: SCO(TAP)=SCO(TAP)+1 :: BBBFLG=0 :: INSC(TAP,INN)=INSC(TAP,INN)+1
1350 IF BBFLG>0 THEN BBBFLG=BBFLG :: BBFLG=0
1360 GOSUB 1880 :: IF RFLG>0 THEN CALL C("RUNNERS ADVANCE")
1370 RETURN


1380 CALL C("SHALLOW FLYOUT")
1390 OUT=OUT+1 :: IF OUT>2 THEN RETURN
1400 GOSUB 1880 :: IF RFLG>0 THEN CALL C("RUNNERS HOLD")
1410 RETURN


1420 CALL C("DEEP FLYOUT")
1430 OUT=OUT+1 :: IF OUT>2 THEN RETURN
1440 GOSUB 1880 :: IF RFLG>0 THEN CALL C("RUNNERS ON SECOND OR THIRD  ADVANCE")
1450 IF BBBFLG>0 THEN HPFLG=BBBFLG :: SCO(TAP)=SCO(TAP)+1 :: BBBFLG=0 :: INSC(TAP,INN)=INSC(TAP,INN)+1
1460 IF BBFLG>0 THEN BBBFLG=BBFLG :: BBFLG=0
1470 RETURN



1480 REM  THIS IS THE "GO THROUGH BATTING ORDER AND DISPLAY BATTER'S NAME" SUB
1490 BAP=BAP+1
1500 IF BAP>9 THEN BAP=1
1510 IF BAP=1 THEN BAP$=B$(TAP) :: BAPSC=BSC(TAP)
1520 IF BAP=2 THEN BAP$=BB$(TAP) :: BAPSC=BBSC(TAP)
1530 IF BAP=3 THEN BAP$=BBB$(TAP) :: BAPSC=BBBSC(TAP)
1540 IF BAP=4 THEN BAP$=SS$(TAP) :: BAPSC=SSSC(TAP)
1550 IF BAP=5 THEN BAP$=LF$(TAP) :: BAPSC=LFSC(TAP)
1560 IF BAP=6 THEN BAP$=CF$(TAP) :: BAPSC=CFSC(TAP)
1570 IF BAP=7 THEN BAP$=RF$(TAP) :: BAPSC=RFSC(TAP)
1580 IF BAP=8 THEN BAP$=C$(TAP) :: BAPSC=CSC(TAP)
1590 IF BAP=9 THEN BAP$=P$(TAP) :: BAPSC=PBSC(TAP)
1600 TAP=TAP XOR 3
1610 POM=PSC(TAP)
1620 TAP=TAP XOR 3
1630 RETURN

***REM END OF "HALF INNING"
1640 INF=INF+1
1650 CALL CL :: IF INN>8 THEN GOSUB 1930  !if 9th (or later inning) gosub 1600
1660 IF INF>2 THEN INF=1 :: INN=INN+1


1670 REM  Displaying box score between innings
1680 W$="HOME *"&STR$(INSC(1,1))&"*"&STR$(INSC(1,2))&"*"&STR$(INSC(1,3))&"*"&STR$(INSC(1,4))
1690 X$="*"&STR$(INSC(1,5))&"*"&STR$(INSC(1,6))&"*"&STR$(INSC(1,7))&"*"&STR$(INSC(1,)&"*"&STR$(INSC(1,9))&"* *"
1700 Y$="AWAY *"&STR$(INSC(2,1))&"*"&STR$(INSC(2,2))&"*"&STR$(INSC(2,3))&"*"&STR$(INSC(2,4))
1710 Z$="*"&STR$(INSC(2,5))&"*"&STR$(INSC(2,6))&"*"&STR$(INSC(2,7))&"*"&STR$(INSC(2,)&"*"&STR$(INSC(2,9))&"* *"
1720 CALL C("         BOX SCORE") :: FOR I=1 TO 3 :: CALL C("") :: NEXT I
1730 CALL C("      1 2 3 4 5 6 7 8 9 X")
1740 CALL C("     *********************")
1750 AS$=Y$&Z$ :: CALL C(AS$)
1760 CALL C("     *********************")
1770 HS$=W$&X$ :: CALL C(HS$)
1780 CALL C("     *********************")
1790 CALL C("") :: CALL C("") :: CALL C("") :: CALL C("    PRESS 'Q' TO QUIT") :: CALL C("        OTHERWISE")
1800 CALL C("PRESS ANY KEY TO CONTINUE")
1810 CALL S(K) :: IF K=88 THEN 120
1820 BO(TAP)=BAP :: TAP=TAP XOR 3
1830 BAP=BO(TAP)
1840 OUT=0 :: BFLG=0 :: BBFLG=0 :: BBBFLG=0
1850 CALL CL
1860 RETURN


1870 REM  THIS IS THE "CHECK IF THERE ARE ANY BASE RUNNERS" SUB
1880 IF BFLG>0 THEN RFLG=1 :: RETURN
1890 IF BBFLG>0 THEN RFLG=1 :: RETURN
1900 IF BBBFLG>0 THEN RFLG=1 :: RETURN
1910 RFLG=0 :: RETURN


1920 REM  THIS IS THE "CHECK FOR A TIE AT THE END OF THE GAME" SUB
1930 IF SCO(1)=SCO(2)THEN RETURN
1940 IF INF=1 THEN RETURN
1950 IF INF>2 THEN GOTO 1980
1960 IF SCO(1)<SCO(2)THEN RETURN    ! If bottom of inning and away team up, continue game


1970 REM  1705** if home team is ahead in bottom of 9th (or later inning) then end game
1980 CALL CL
1990 CALL C("          **GAME OVER**")
2000 CALL C("") :: CALL C("") :: CALL C("")
2010 CALL C("            BOX SCORE") :: CALL C("")
2020 CALL C("    ************************")
2030 CALL C("    * RUNS * HITS * STK-OUT*")
2040 CALL C("    ************************")
2050 CALL C("AWAY*  "&STR$(SCO(2))&"   *  "&STR$(HIT(2))&"  *    "&STR$(STK(2)))
2060 CALL C("    ************************")
2070 CALL C("HOME*  "&STR$(SCO(1))&"   *  "&STR$(HIT(1))&"  *    "&STR$(STK(1)))
2080 CALL C("    ************************")
2090 CALL C("") :: CALL C("") :: CALL C("")
2100 CALL C("Play Again?  Y/N")
2110 CALL S(K)!CALL KEY(0,K,S):: IF K=0 THEN 1786
2120 IF K=78 THEN 2150
2130 IF K=89 THEN 2160
2140 GOTO 2110
2150 END




2160 CALL CL :: RANDOMIZE :: GOTO 150   !Play again... return to top




2170 REM  BATTER/PITCHER MATCHUP SUB
2180 BCH=INT(RND*BAPSC)+1 :: PCH=INT(RND*POM)+1   !Batter vs. hitter matchup based on score
2190 IF BCH>PCH THEN SFDICE=1 ELSE SFDICE=2     !If the batter wins, SFDICE is 1, otherwise, 2
2200 WHDICE=INT(RND*10)+1
2210 IF TAP=1 THEN GOSUB 2670 ELSE GOSUB 2560
2220 RETURN





2230 REM  THIS IS THE INTRO SCREEN
2240 CALL C("Welcome to BBS Baseball!")
2250 CALL C("In this game, you control")
2260 CALL C("a team of all star players")
2270 CALL C("on their quest for the")
2280 CALL C("pennant!!!  Your job is to")
2290 CALL C("coach them up, giving them")
2300 CALL C("signs on how to approach")
2310 CALL C("the plays.  Each player has")
2320 CALL C("unique attributes and skills")
2330 CALL C("for you to learn and utilize...")
2340 CALL C("The team you face is also an")
2350 CALL C("all-star crew, so be wary of")
2360 CALL C("their abilities as well... ")
2370 CALL C("") :: CALL C("")
2380 CALL C("Good luck, skipper...")
2390 CALL C("") :: CALL C("") :: CALL C("Press any key to start!")
2400 RETURN




2410 REM  THIS IS THE "DISPLAY MATCHUP" SUB
2420 CALL CL
2430 CALL C("BATTER OPS:   ")
2440 CALL C(BAP$&":  ."&STR$(BAPSC))
2450 WHIP=1000-POM
2460 CALL C("") :: CALL C("")
2470 CALL C("PITCHER WHIP: ")
2480 TAP=TAP XOR 3
2490 CALL C(P$(TAP)&":  1.0"&STR$(WHIP))
2500 TAP=TAP XOR 3
2510 CALL C("") :: CALL C("")
2520 CALL C("Press Any Key to Continue")
2530 CALL S(K)  !CALL KEY(0,K,S):: IF S=0 THEN 2530
2540 CALL CL :: GOTO 530



2550 REM  THIS IS THE SUB DETERMINING "WHAT KIND OF PITCHING" THE USER WANTS**
2560 CALL C("1) AGGRESSIVE PITCHING?") :: CALL C("2) CAUTIOUS PITCHING?") :: CALL C("") :: CALL C("PRESS *?* TO CHECK MATCHUP")
2570 CALL S(K)!CALL KEY(0,K,S):: IF S=0 THEN 2310
2580 IF K=63 THEN GOTO 2420
2590 K=K-48
2600 IF K<1 THEN 2570
2610 IF K>2 THEN 2570
2620 ON K GOTO 2630,2640
2630 WHDICE=WHDICE+1 :: IF WHDICE>10 THEN WHDICE=10 :: GOTO 2650   !aggressive play, increase big result
2640 WHDICE=WHDICE-1 :: IF WHDICE<1 THEN WHDICE=1   !cautious play, decrease big result
2650 RETURN



2660 REM  THIS IS THE SUB DETERMINING "WHAT AM I GOING TO DO AT THE PLATE"
2670 CALL C("1) BUNT  2) CONTACT") :: CALL C("3) SWING FOR THE FENCES") :: CALL C("") :: CALL C("PRESS *?* TO CHECK MATCHUP")
2680 CALL S(K)   !CALL KEY(0,K,S):: IF S=0 THEN 2680
2690 IF K=63 THEN GOTO 2420
2700 K=K-48
2710 IF K<1 THEN 2680
2720 IF K>3 THEN 2680
2730 ON K GOTO 2740,2760,2770
2740 IF SFDICE=1 THEN SFDICE=2 :: WHDICE=2 :: RETURN
2750 IF SFDICE=2 THEN WHDICE=3
2760 RETURN
2770 WHDICE=WHDICE+1 :: IF WHDICE>10 THEN WHDICE=10
2780 RETURN



***REM End of program... Now, reinstate the PRESCAN crap and enter subroutines below


2790 !@P+
2800 SUB C(A$) :: B$="~"&A$ :: CALL LINK("PRINTX",B$) :: SUBEND
2810 SUB CL :: CALL LINK("BCLEAR") :: CALL C(CHR$(12)&CHR$(26)&CHR$(13)) :: SUBEND
2820 SUB KY :: CALL KEY(0,K,S) :: SUBEND
2830 SUB S(K)   !RETURN K AS THE KEY VALUE
2840 CALL LINK("SC",A$) :: IF A$="" OR A$=CHR$(0)THEN 2840 ELSE IF A$=CHR$(1)THEN 120
2850 K=ASC(A$) :: SUBEND

 

 

Link to comment
Share on other sites

I think I'll have to check this one out, too. There was a Mint update the other day, and poof! all of the Windows emulators (Classic99 and Win99) stopped running under Wine compatibility layer - so long story short, I only got Calimari Carl into a TIFILES format yesterday using XB paste in C99 on Windows 7 (and I haven't sent it over to the TI yet). I tried to use TI99Dir to convert the text file to a program file, but I couldn't get that to work :(.

Link to comment
Share on other sites

I can send you the program file zipped up if you'd like.

 

BTW, if you'D like to work on the XB baseball game with me, that would be pretty cool, too. :) The game engine is complete, we just need to figure out how we want to display it and create the graphic user interface.

 

It would make me happy to see Carl going again though, I gotta tell ya. :) One thing at a time I guess. Happy 4th, man.

Edited by Opry99er
  • Like 1
Link to comment
Share on other sites

  • 6 years later...

So my latest project is a statistical baseball game which I'm programming in RXB. I'm trying to figure out what to include/exclude, yet still make it a worthwhile venture. This is my labor of love project, as I've always wished the TI had a statistics based sports game, especially since TI loved to tout the accuracy of their calculators. Anyway, I'm glad I found this thread. I've downloaded what I believe is your final version (v6) of the non-BBS version of the game for some tips on how to include as many features as possible.

 

I must admit that I am using Avalon Hill's Statis Pro Baseball 2nd edition rules (from 1982), since stat cards from many seasons are widely available for free, and also for nearly all seasons for a price. To get me started, I found a copy of the Apple ][ version of the game which was written in Applesoft BASIC, requiring a 48K machine. I found some real spaghetti code, stuff that wasn't implemented but apparently planned, and even some lines of code that were never used. I found it most useful for coming up with manageable stat "cards" for players on each team, keeping the roster for each one at 25 - that's 15 batters/fielders and 10 pitchers. I too came to find that enforcing baseball's rules is a bit more intricate when programming than actually playing the game. I also realize that I'm going to have to trust players to be honest in certain situations, as I can't seem to find a way to enforce certain rules without it eating up too much program space. It would be REALLY cool if there was a way to use SAMS memory for XB/RXB program storage, or a way to chain programs together so that they don't lose the values in the variables when doing so. I find the TI boast in the XB manual to have that exact major caveat:

 

Quote

RUN has also been modified to allow you to specify which program to run. As a result, one program can load and run another program from a diskette. You can, therefore, write programs of almost unlimited size by breaking them into pieces and letting each segment run the next."

...provided you have no need to keep values in variables, and my guess would be that's not very often.

 

I'd have loved to have tried converting Strat-O-Matic Baseball since I own a late 80s boxed tabletop version of it, but it's next to impossible to find entire seasons of stats for the game without paying through the nose for them. I also own numerous versions of Out Of The Park Baseball for the PC which is probably the most awesome MLB sim there is. I won't kid myself that I'll be able to get anywhere near OOTP, but I would like a halfway decent program to run on the TI, thus my project.

 

Sooo... I currently have a working program which hasn't implemented the numerous types of outs yet, and I've only made up two teams for it, but it's definitely a lot farther along than I thought I might get. That said, it doesn't have even all of the basic SPB rules implemented either. Once I've added more features, I'll share it here, although that may be awhile.

 

So I was wondering, was any more development ever done on the XB game that this thread refers to? Would be cool to see how far along you got.

  • Like 1
Link to comment
Share on other sites

Looks like Opry99er has been missing for the past month and a half. In the meantime, I figured I'll share a teaser of what I have so far. It's working and plays a full game, but there are still plenty of features I'd like to implement to make it more realistic, which is why I'm looking into how to incorporate use of the SAMS card to store table and stat data. I've been doing all my test runs using the 2008 World Series teams. Once I've added more features, I'll expand on the 2008 season stats, as it's time consuming to convert them from the Statis Pro cards to the format I'm using in the game.

 

image.thumb.png.56b3d4bd657f5f8cae7b3e96e1a27c8a.pngimage.thumb.png.18a6956c2d0c651e7b4c48832a52f0e8.pngimage.thumb.png.35f4f3ffa725f5f10d4d3de2358b5892.pngimage.thumb.png.f1c46817fa9fea892d6278b0cc6490fc.png

Edited by majestyx
  • Like 2
Link to comment
Share on other sites

24 minutes ago, majestyx said:

Looks like Opry99er has been missing for the past month and a half. In the meantime, I figured I'll share a teaser of what I have so far. It's working and plays a full game, but there are still plenty of features I'd like to implement to make it more realistic, which is why I'm looking into how to incorporate use of the SAMS card to store table and stat data. I've been doing all my test runs using the 2008 World Series teams. Once I've added more features, I'll expand on the 2008 season stats, as it's time consuming to convert them from the Statis Pro cards to the format I'm using in the game.

Can you kindly explain something to me since this is an area that represents a significant gap in my TI-99/4a knowledge... When you say the SAMS card, are you just indicating you're using that for development, or will a SAMS be required to play? What little I know of the card is that it's not in the hands on my TI'ers (as opposed to the standard 32K expansion, which I assume most ACTIVE users have some form of at this point), but it seems to be a piece of hardware that's always brought up for whatever reason.

Link to comment
Share on other sites

48 minutes ago, Bill Loguidice said:

Can you kindly explain something to me since this is an area that represents a significant gap in my TI-99/4a knowledge... When you say the SAMS card, are you just indicating you're using that for development, or will a SAMS be required to play? What little I know of the card is that it's not in the hands [of many] TI'ers (as opposed to the standard 32K expansion, which I assume most ACTIVE users have some form of at this point), but it seems to be a piece of hardware that's always brought up for whatever reason.

Sure, no problem, Bill!

 

It's not seen often in the wild, although a member here (Ksarul - discussion thread here) I do believe has some new ones - as in he actually had a run of them made not long ago - available for sale. I know a good deal of the users here on AA do have one in their real hardware. The SAMS (and previously AMS) was a memory expansion board that could be plugged into the Peripheral Expansion Box (PEB). It was initially available as a 128K or 256K RAM board and was made by Asgard (Asgard Memory System, or AMS for short). It was then picked up by the SouthWest TI99ers (the S in the SAMS) and expanded to have up to 1 MB available. It has been further updated to, theoretically, expand up to 4 MB. Ksarul's version is a 4 MB board, but there is some issue that 4 MBs is not available for use, so he only has it available as a 1 MB card. Sorry, I don't own a PEB so I don't have the full details on the real hardware. I am programming in the Classic99 emulator which, among other emulators, can also emulate a SAMS expansion, so I'm trying to take advantage of it.

 

And yes, I believe there are more people who own the expansion than there are actual programs that make use of it. Thus it has a lot of potential which never was tapped into. The biggest issue is that only 32K is actually easily usable in any Extended BASIC available, and even Assembly appears to have some limitations with it - again, not a machine language programmer so I am not that familiar with what it can do. Since I've no way of implementing the SAMS yet, as I'm using RXB 2015 (an enhanced and updated Extended BASIC by Rich Gilbertson who has made a huge game called IN THE DARK which takes full advantage of the 1 MB SAMS), the baseball game I'm making in its current form only requires 32K expansion and a disk drive/disk drive equivalent (I use a nanoPEB on my physical machine) from which to load player stats. Of course these are the "real hardware" requirements, as emulation takes care of all of this quite easily.

 

Hope that helps~!

  • Like 2
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...