Jump to content
Opry99er

New Baseball game for the TI-99/4a

Recommended Posts

Perhaps I'm missing some, but am I correct that the only baseball game for the TI is the MBX baseball game?

 

It's a very good arcade game, but I am looking for more of a baseball simulation game... I'm working on one, and I'm curious what's out there. Thanks, and glad to be back.

 

 

Opry

Edited by Opry99er

Share this post


Link to post
Share on other sites

Ahh yes... I am quite rusty, guys... you'll have to forgive me. It's been almost 2 years since I've written any code and even longer since I've familiarized myself with anything very much TI-related. I'm off my game. =)

Share this post


Link to post
Share on other sites

So, a bit about what I plan to do with this game... It's going to be quite simple and not much in way of "code-depth". I'll probably spend some time on graphics to make it pretty later on, but my primary concern right now is the meat and potatoes.

 

It will be a baseball "simulation" game. It will not be an arcade game and will not involve much if any action. Essentially, it will be a plain and simple, cut and dried baseball sim. Now, what is a "baseball simulation?"

 

The engine will determine the outcome of each play by a roll of the proverbial "dice". It will have to consist of two dice, so to speak, one which determines the success or failure of an at-bat, and one which will determine how the play failed (ground out, strike out, etc.) or succeeded (single, triple, etc.). The rules are based on a game I play with my son and they are as follows:

 

 

 

**All baseball rules apply

 

Roll two 6 sided dice. One is the "matchup" die and the other is the "result" die.

 

*Matchup: 1-2 *batter reaches

*Matchup: 3-6 *batter is out

 

*Result (if batter reaches)

 

1: Walk

2: Single

3: Single

4: Double

5: Triple

6: Homerun

 

*Result (if out)

 

1: Strikeout

2: Groundout-all runners advance

3: Groundout-runners advance if forced

4: Groundout-DP if player on 1st

5: Pop-out, runners hold

6: Pop-out, Runners on 2B and/or 3B advance

 

Steal Base (if 2B or 3B are open, you can risk a steal if you choose)

1-2: Out

3-6: Safe

 

 

So as you can see, it is a very simple engine to write. I could expound on it a bit, but in essence, that is what I plan to do for the engine.

 

Each player will have a name and each at-bat will be recorded and scored just as in a regular baseball game. I intend to have a file on disk to write the statistics to, so a player of the game could potentially play an entire season and have player statistics recorded for the entire season. In this way, a player's batting average, ERA, on base percentage, etc. could be compiled and displayed on command.

Edited by Opry99er

Share this post


Link to post
Share on other sites

That being said, I do foresee expanding the dynamics some... For instance, pitching. A team could have a number of pitchers on the staff and once a certain pitch count is reached, the pitcher becomes less effective, perhaps allowing more hits, etc. It would be your responsibility as "GM" to call in the bullpen in this situation.

 

This could also be expanded into having particular statistical variables associated with different players. As an example, Jeremy Flumpkinmeister might fare better against left handed pitchers. Joe McNugget might have a higher batting average, so it may be better to have him hitting at the top of the lineup... Etc, etc.

 

The reason I like this project is that it can be as minimal or as embellished as it wants to be. Tracking variables and storing them to disk would be quite natural in this type of game.

Edited by Opry99er

Share this post


Link to post
Share on other sites

Thought on a RANDOM RND function....

 

To commence a play, the player will need to "PRESS SPACE BAR TO SIMULATE PLAY" or something of the like... the randomness of a roll will be crucial if the game is to have any "chance" element to it whatsoever. A standard call key function looks something like:

 

300 CALL KEY(0,K,S):: IF S=0 THEN 300

 

What if we implemented a FOR X=1 TO 10 element into it during the status check. Each check for status would have a different X value, and therefore when the status changes, that X value would be the "seed" for the RND number. In that way, the first batter wouldn't get a "single" his first time up every game, etc. Depending on the delay time between the start of the CALL KEY check and the player pressing ASCII 32 on the keyboard, the random seed would differ.

 

**P.S. I'm EXTREMELY rusty and I'm reading through my XB manual as I am planning this project. Forgive me for not adding a code box in here with a pre-designed function for my idea. I will need to practice and read and practice and read until I'm back up to snuff.

Share this post


Link to post
Share on other sites

Hi Owen! It's so good to see you back here! We've missed you a lot man.

It's cool that you have an idea for a new game.

Oh you have to check out the excellent XB compiler programmed by senior_falcon.

The speed of the compiled programs is incredible.

 

Myself haven't done any coding for the TI-99 in the last 2 years. Guess it's about time

I get back into the saddle myself :-)

 

Share this post


Link to post
Share on other sites

Hi Owen !! :D

welcome back !

excellent choice your resurrection in the days of Easter! :D :D

and from what I see you're back in great shape!

 

Great Friend !!

Share this post


Link to post
Share on other sites

Hi Owen,

I am a BIG baseball fan, I never thought about making a baseball game...

But now that I have read this.... The GM piece should have some effect on the outcome of a play.

That is, if a hitter has a 310 average VS a 270 average.. maybe the weight of the dice roll should be different.

Also, a pitcher's ERA and Left/Right handed etc.

 

Wow, I see the engine getting very complex very quickly!

 

Start with your engine! Then maybe expand the GM function. I wish MLB had a salary cap! Min and Max $$

Scouting/Managing and execution should dictate outcomes, not just payroll! I am a RED SOX fan, but hate

them trying to buy winning seasons. Actually, hasn't worked lately! Yankees are in the same sinking boat.

 

Looking forward to trying this!

Gene'

Share this post


Link to post
Share on other sites

Thanks Gene'!

 

Yea, the dice will have to be weighted in that regard. I plan on starting with the basic dice baseball simulation like my son and I play and then expanding from there. Once I get a working system in place then I can focus on getting it closer to a true baseball simulation.

 

One thing I am hoping to do is have 30 teams saved on disk--- hopefully with historical players and their historical statistics (compiled from their careers). That way, when a random schedule is generated at the start of the season, each game will call the next team from disk with their players and statistics for you to face.

 

Of course, that's my dream... May not happen in the end, but hey... a guy can dream. It might get too ridiculous, but in the meantime, building this simple no-weight sim with two simple teams is goal #1.

Share this post


Link to post
Share on other sites

@retroclouds: For a guy who's written arguably the finest piece of software for the TI in 30 years, you certainly OUGHT TO BE WRITING!!!! =) Missed you too, man. Glad to see the gang again.

 

@ti99usersclub: It has been a long strange trip, my friend. I'm glad to see you're still here and active. It definitely feels like home here. =)

Share this post


Link to post
Share on other sites

the mbx baseball game is one of the voice recongition games MB did for the TI back in the day.

I only seen it once back the ti-99/4a compyer faire in IL (mnay moons ago)

I wasn't really impressed with it my self because you can't really tell the who to catch the flys and such.

btw: spaeking of baseball games for ti, Ialso did one that might still be in ti-99/4a user groups libary in chicago

it was called all star baseball done in xb and has speech. in my game if you see a ball coming to one of out fields instead of

the computer choosing the outfielder you do by pressinga key. it was wan't the best but I like it.

Share this post


Link to post
Share on other sites

I am actually fortunate enough to have the MBX system and Championship Baseball. It's a good game, certainly neat with the voice commands and the very unique MBX joystick.

 

I would really like to have your game as well, Dan. Perhaps someone could get with Hal at the CTIUG and see if he's got a copy. There is also a possibility it exists on the ftp site, I may have a look there. Any additional information you might have to speed up/focus my search would be greatly appreciated. I would definitely like to get a look at what you did.

Share this post


Link to post
Share on other sites

So, here's an example of how "unrandom" the RND function truly is, by itself. I mean, it is what it is... The numbers are random, but they are sequenced the same every time. I'm working on changing the seed by using the loop I described above.

 


100 REM BASEBALL SIM
110 CALL CLEAR
120 DISPLAY AT(8,:"DICE BASEBALL";
130 DISPLAY AT(12,:"PRESS ANY KEY":"     TO CONTINUE";
140 CALL KEY(0,K,S):: IF S=0 THEN 140
150 SFDICE=INT(RND*6)+1
160 WHDICE=INT(RND*6)+1
170 CALL CLEAR :: PRINT SFDICE :: PRINT WHDICE
180 GOTO 140

 

In this little bit of code, press any key to see the dice results. Do it, then exit the program, then run it again. Results never vary. That's where the user interface randomization will come into play. I'll have it operational by this evening and I'll post it.

 

 

***Edit*** the code formatting keeps screwing up on me. The intro words aren't centered. I'm just using LIST "CLIP" in Classic 99, but I think somehow it's getting whacky.

Edited by Opry99er

Share this post


Link to post
Share on other sites

Add "50 RANDOMIZE", and you will see different results every time! :) RANDOMIZE sets the random number seed using the GPL random number, which is scrambled such that it's different every boot.

 

Share this post


Link to post
Share on other sites

I thought RANDOMIZE only worked with a seed? I was planning on using it, but with a random seed set by the user without their knowledge.

 

Added it, seems to work perfectly. Thanks... Man, I'm so freakin' rusty, man. Like I'm learning all over again!

Share this post


Link to post
Share on other sites

Okay guys, here's the basic baseball "dice roll" simulation. You press any key, it will display the numbers rolled and then it will show the result of the play based on the roll. Then it will cycle back and ask you to simulate the next play.

 

It's not much, but it's a start. ***The code is not optimized at all, it's just laid out for easy reading and interpretation. Sorry for formatting errors in advance.

 

 

100 RANDOMIZE
110 REM BASEBALL SIM
120 CALL CLEAR
130 DISPLAY AT(8,:"DICE BASEBALL";
140 DISPLAY AT(12,:"PRESS ANY KEY":"	 TO SIMULATE";
150 CALL KEY(0,K,S):: IF S=0 THEN 150
160 SFDICE=INT(RND*6)+1
170 WHDICE=INT(RND*6)+1
180 CALL CLEAR :: PRINT SFDICE :: PRINT WHDICE
181 FOR I=1 TO 400 :: NEXT I
185 IF SFDICE<3 THEN GOSUB 1000 ELSE GOSUB 2000
190 FOR I=1 TO 900 :: NEXT I :: CALL CLEAR :: GOTO 140
1000 CALL CLEAR
1010 ON WHDICE GOSUB 1100,1200,1300,1400,1500,1600 :: RETURN
1100 PRINT "WALK" :: RETURN
1200 PRINT "SINGLE" :: RETURN
1300 PRINT "SINGLE" :: RETURN
1400 PRINT "DOUBLE" :: RETURN
1500 PRINT "TRIPLE" :: RETURN
1600 PRINT "HOME RUN" :: RETURN
2000 CALL CLEAR
2010 ON WHDICE GOSUB 2100,2200,2300,2400,2500,2600 :: RETURN
2100 PRINT "STRIKEOUT" :: RETURN
2200 PRINT "GROUNDOUT, RUNNERS ADVANCE" :: RETURN
2300 PRINT "GROUNDOUT, RUNNERS ADVANCE":"IF FORCED" :: RETURN
2400 PRINT "GROUNDOUT, DOUBLE PLAY":"IF RUNNER ON 1ST AND":"LESS THAN 2 OUTS...":"ALL OTHERS ADVANCE" :: RETURN
2500 PRINT "SHALLOW FLYOUT":"RUNNERS HOLD" :: RETURN
2600 PRINT "DEEP FLYOUT, RUNNERS ON":"SECOND OR THIRD ADVANCE" :: RETURN
5000 FOR I=1 TO 300 :: NEXT I :: RETURN

 

 

Edited by Opry99er

Share this post


Link to post
Share on other sites

Next segment I will be focusing on is the base-running and lineup engine.

 

Basically I have to account for the lineup order, who's at the plate, who (if anyone) is on base, where they are on the base path, etc... This will prove slightly more complex than the dice roll simulation. I'll be working on it tonight. Once that segment is done, I will start working on creating the "weighted" dice variations. Eventually I want to incorporate some of the more important statistics into each batter's variable set and eliminate the "random chance" element for the most part. But getting the lineup in order and figuring out base running is first priority.

Share this post


Link to post
Share on other sites

Good to see you back, buddy! I've been puttering around with some type-in programs lately, trying to get back into programming myself. It's amazing how rusty I got. Hoping to figure out what the heck I was doing with all my half-finished programs and get them done this spring. Glad you're back at it!

Share this post


Link to post
Share on other sites

Okay, lineup order is set for now. It cycles through the lineup, batter 1-9, displays the player's name, and allows you to simulate a play for that player. Of course it's all superficial at this point, but it's one more step. Do enjoy pasting this into Classic99 if you'd like.

 

 


100 BAP=0
110 RANDOMIZE
120 REM BASEBALL SIM
130 P$="W. JOHNSON"
140 C$="J. BENCH"
150 B$="L. GEHRIG"
160 BB$="R. HORNSBY"
170 BBB$="E. MATHEWS"
180 SS$="H. WAGNER"
190 LF$="T. WILLIAMS"
200 CF$="J. DIMAGGIO"
210 RF$="B. RUTH"
220 CALL CLEAR
230 DISPLAY AT(8,:"DICE BASEBALL";
240 DISPLAY AT(12,:"PRESS ANY KEY":" TO SIMULATE";
250 GOSUB 510
260 DISPLAY AT(20,1):"NOW BATTING:":BAP$;
270 CALL KEY(0,K,S):: IF S=0 THEN 270
280 SFDICE=INT(RND*6)+1
290 WHDICE=INT(RND*6)+1
300 CALL CLEAR :: PRINT SFDICE :: PRINT WHDICE
310 FOR I=1 TO 400 :: NEXT I
320 IF SFDICE<3 THEN GOSUB 340 ELSE GOSUB 420
330 FOR I=1 TO 900 :: NEXT I :: CALL CLEAR :: GOTO 240
340 CALL CLEAR
350 ON WHDICE GOSUB 360,370,380,390,400,410 :: RETURN
360 PRINT "WALK" :: RETURN
370 PRINT "SINGLE" :: RETURN
380 PRINT "SINGLE" :: RETURN
390 PRINT "DOUBLE" :: RETURN
400 PRINT "TRIPLE" :: RETURN
410 PRINT "HOME RUN" :: RETURN
420 CALL CLEAR
430 ON WHDICE GOSUB 440,450,460,470,480,490 :: RETURN
440 PRINT "STRIKEOUT" :: RETURN
450 PRINT "GROUNDOUT, RUNNERS ADVANCE" :: RETURN
460 PRINT "GROUNDOUT, RUNNERS ADVANCE":"IF FORCED" :: RETURN
470 PRINT "GROUNDOUT, DOUBLE PLAY":"IF RUNNER ON 1ST AND":"LESS THAN 2 OUTS...":"ALL OTHERS ADVANCE" :: RETURN
480 PRINT "SHALLOW FLYOUT":"RUNNERS HOLD" :: RETURN
490 PRINT "DEEP FLYOUT, RUNNERS ON":"SECOND OR THIRD ADVANCE" :: RETURN
500 FOR I=1 TO 300 :: NEXT I :: RETURN
510 BAP=BAP+1 :: IF BAP>9 THEN BAP=1
520 IF BAP=1 THEN BAP$=B$ ELSE IF BAP=2 THEN BAP$=BB$ ELSE IF BAP=3 THEN BAP$=BBB$ ELSE IF BAP=4 THEN BAP$=SS$
530 IF BAP=5 THEN BAP$=LF$ ELSE IF BAP=6 THEN BAP$=CF$ ELSE IF BAP=7 THEN BAP$=RF$ ELSE IF BAP=8 THEN BAP$=C$
540 IF BAP=9 THEN BAP$=P$
550 RETURN

 

 

Edited by Opry99er

Share this post


Link to post
Share on other sites

Thanks alot Keith... Glad to see you active as well! I look forward to seeing more games from you in the future. =)

Share this post


Link to post
Share on other sites

Superficial "Outs" and "Innings" variables and displays inputted. Now if you get 3 outs, the inning rolls over.

 

It's really just a starter for the more complex problem of handling base runners and the results from the dice rolls. I should be able to have a working base-running engine done in a day or two... but for now, all you can do is use one team, simulate plays, watch the results, and watch the outs and innings roll over. Since a proper base-runner system is not in place, no scoring happens and you can play as many innings as you want to... Don't know why anyone would though. =) You'll never win anything as long as the code sits as it is. Copy and paste if you'd like and take a look at how the engine is shaping up.

 

**Again, code is NOT optimized because it is designed to be read like a book--- no comments have been added at this point.

 

 

 

100 BAP=0 :: INN=1 :: OUT=0
110 RANDOMIZE
120 REM BASEBALL SIM
130 P$="W. JOHNSON"
140 C$="J. BENCH"
150 B$="L. GEHRIG"
160 BB$="R. HORNSBY"
170 BBB$="E. MATHEWS"
180 SS$="H. WAGNER"
190 LF$="T. WILLIAMS"
200 CF$="J. DIMAGGIO"
210 RF$="B. RUTH"
220 CALL CLEAR
230 DISPLAY AT(8,:"DICE BASEBALL";
240 DISPLAY AT(12,:"PRESS ANY KEY":"        TO SIMULATE";
250 GOSUB 520
260 IF OUT>2 THEN OUT=0 :: INN=INN+1
270 DISPLAY AT(4,4):"OUTS: ";OUT :: DISPLAY AT(4,18):"INNING: ";INN
280 DISPLAY AT(20,1):"NOW BATTING:":BAP$;
290 CALL KEY(0,K,S):: IF S=0 THEN 290
300 SFDICE=INT(RND*6)+1
310 WHDICE=INT(RND*6)+1
320 CALL CLEAR :: PRINT SFDICE :: PRINT WHDICE
330 FOR I=1 TO 400 :: NEXT I
340 IF SFDICE<3 THEN GOSUB 360 ELSE GOSUB 440
350 FOR I=1 TO 900 :: NEXT I :: CALL CLEAR :: GOTO 240
360 CALL CLEAR
370 ON WHDICE GOSUB 380,390,400,410,420,430 :: RETURN
380 PRINT "WALK" :: RETURN
390 PRINT "SINGLE" :: RETURN
400 PRINT "SINGLE" :: RETURN
410 PRINT "DOUBLE" :: RETURN
420 PRINT "TRIPLE" :: RETURN
430 PRINT "HOME RUN" :: RETURN
440 CALL CLEAR
450 ON WHDICE GOSUB 460,470,480,490,500,510 :: RETURN
460 PRINT "STRIKEOUT" :: OUT=OUT+1 :: RETURN
470 PRINT "GROUNDOUT, RUNNERS ADVANCE" :: OUT=OUT+1 :: RETURN
480 PRINT "GROUNDOUT, RUNNERS ADVANCE":"IF FORCED" :: OUT=OUT+1 :: RETURN
490 PRINT "GROUNDOUT, DOUBLE PLAY":"IF RUNNER ON 1ST AND":"LESS THAN 2 OUTS...":"ALL OTHERS ADVANCE" :: OUT=OUT+1 :: RETURN
500 PRINT "SHALLOW FLYOUT":"RUNNERS HOLD" :: OUT=OUT+1 :: RETURN
510 PRINT "DEEP FLYOUT, RUNNERS ON":"SECOND OR THIRD ADVANCE" :: OUT=OUT+1 :: RETURN
520 BAP=BAP+1 :: IF BAP>9 THEN BAP=1
530 IF BAP=1 THEN BAP$=B$ ELSE IF BAP=2 THEN BAP$=BB$ ELSE IF BAP=3 THEN BAP$=BBB$ ELSE IF BAP=4 THEN BAP$=SS$
540 IF BAP=5 THEN BAP$=LF$ ELSE IF BAP=6 THEN BAP$=CF$ ELSE IF BAP=7 THEN BAP$=RF$ ELSE IF BAP=8 THEN BAP$=C$
550 IF BAP=9 THEN BAP$=P$
560 RETURN

 

 

Share this post


Link to post
Share on other sites

hehe. Yes, Randomize can take a seed too, in which case you will always get the sequence associated with that particular seed, but without a seed it uses an unpredictable one! :)

 

Share this post


Link to post
Share on other sites

Welcome back, Owen, you’ve been missed.

 

Randomize, or equivalent, with and without seed is essential with many games and demos. Seeds and logic can, in a sense, compress or super-compress levels, backgrounds, explosions, and much more, even sound effects and music. It’s kind of a walk backwards though, but often with interesting and surprising results.

 

:)

Share this post


Link to post
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.

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...