+OLD CS1 Posted August 28, 2020 Author Share Posted August 28, 2020 @oddemann Thank you. I let the program run for several hours playing itself. It did not show any strange behaviors nor had it crashed at the times I checked on it. That is a good thing. But I did run into an interesting occurrence. The computer logic is, as I stated, rather simple. It appears that it can find itself in a dead-lock situation. In particular, this game was the perfect storm. In GRID 2, the computer player apparently found the two-part explorer, four-part bomber, and five-part mother ship very early in the game. That left the three-part fighter to find. The spacing of the random shots leads me to the early-discovery conclusion. Note at this point there is only one area large enough to contain the three-part fighter, and where the computer should make its shot. However, the computer did not take a shot for over three hours! I finally terminated the program and started it running, again. It seems that this situation would be rare enough not to impact a real game of human v. computer. I spent time reviewing the logic in the original game which not only appears similar to mine (since I largely based my logic on the original's observable behavior,) but also does not appear to contain logic to break out of such dead-lock. My concern is, as the shot-taking logic is transparent, I cannot be certain that an appropriate spot was not chosen and rejected. I have begun considering a way to prevent this from happening, which could also increase the speed at which the computer takes its shots. I will have to set up a simulation of this game to test the selection logic for failure. While I want to pursue this further, I am still not convinced this issue will have real-world impact on games. 1 Quote Link to comment Share on other sites More sharing options...
+OLD CS1 Posted August 30, 2020 Author Share Posted August 30, 2020 Dead-lock corrected. I forgot to clear the detection variable for the solution proposal fit check when switching from horizontal check to vertical check. The unexpected consequence is to make the logic a bit more effective... now that it checks all four directions. Only other change is that a computer v. computer game ship deployments are not hidden, but are covered quickly after the explorer is placed. LS-083020.zip 1 Quote Link to comment Share on other sites More sharing options...
Keneg Posted August 31, 2020 Share Posted August 31, 2020 Downloaded this today. Played one game against the computer and had the computer play itself twice. Very nice, if a bit slow. Probably the best you can do in console BASIC. I understand extended BASIC is somewhat faster. Quote Link to comment Share on other sites More sharing options...
+OLD CS1 Posted August 31, 2020 Author Share Posted August 31, 2020 @Keneg Thank you for the feedback. Yeah, I spent a good bit of time working on some of the routines, which I have used in other programs. I think where this one gets sluggish is in placing the cursor. I made the decision to show a white dot over a hit ship as you move the cursor. This involves a calculation of the character to place in that location, and I think it is complex enough to cause additional slowness on top of what we would expect from console BASIC. I thought about this over the weekend and decided I might have something I can do to help with the sluggishness, but I am not sure if breaking the formula apart will give any speed increase versus the program logic which will be required to replace it. Extended BASIC actually running this game as-it-is is appreciably faster, and I will have an Extended BASIC version released to complete the magazine type-in style. The TI BASIC program is something like 300 lines, which is larger than I would normally expect for a type-in but, in all fairness, the version on other computers are built from multi-statement lines so I think it still fits the spirit. The Extended BASIC version I hope would have felt right at home within the same pages. 1 Quote Link to comment Share on other sites More sharing options...
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.
Note: Your post will require moderator approval before it will be visible.