Image Map Image Map
Results 1 to 8 of 8

Thread: H-Tron: a little DOS game for the Hercules graphics card

  1. #1
    Join Date
    Dec 2016
    Location
    Vienna, Austria
    Posts
    16

    Default H-Tron: a little DOS game for the Hercules graphics card

    Hi all,

    I have recently written a little DOS game for the Hercules graphics card. It is the classical overhead view "Tron" game (motorcycles that leave "wall trails" behind them):

    HTron.jpg

    The game concept is simple: if you crash into a wall, your opponent scores one point. Who first reaches five points wins. The players' score is displayed in the top left and right corner (each line stands for one point).

    You can choose between either one- or two-player-mode. Especially the one-player mode should be fun to play - it took me quite many attempts to beat the computer opponent for the first time.

    I have included the source code, which - as you can see - is not too complicated. The game is written in Turbo C 2.01, which has the advantage over 1.0 that there is a delay() function for accurate timing. Therefore the game should run with the same speed on all systems from an original 4.77 MHz XT to DOSBox (it is *slightly* slower on 4.77 MHz, but still ok to play). Contact me if you need a Turbo C 1.0 version (for whatever reason).

    Tell me what you think about the game, I hope you like it.

    Merry Christmas to those who celebrate it!
    Attached Files Attached Files
    Last edited by RobertK; December 24th, 2016 at 09:51 AM. Reason: New version (VileR's issues 1 and 2)

  2. #2

    Default

    "Device driver file not found (HERC.BGI)"

    Easy enough to download but I think it's OK to bundle it with the game. I remember old DOS games being bundled with *.BGI files.

    And the game is cute - I'm playing it now on a real 10MHz Hercules machine. Just needs the voice pack...

  3. #3
    Join Date
    Dec 2016
    Location
    Vienna, Austria
    Posts
    16

    Default

    Oops, I completely forgot the HERC.BGI driver. I have updated the zip file in the posting above, now it contains this file as well.
    I was thinking about adding some beeper sound, but this would be maybe a little montonous (just engine sound and crash sound).

  4. #4

    Default

    Nice work! The computer player gives me a hard time, but not unfairly so- quite balanced overall.

    Hope you don't mind a couple of comments:

    1) After perhaps ten games or so, when I try to start another, it says "not enough memory to load driver" and drops me back to the prompt. A memory leak issue perhaps (is the BGI driver reloaded on each new game without its memory being deallocated first?)

    2) It would be a nice touch to clear the keyboard buffer when a new round begins. Should prevent human players from starting with an unplanned turn due to a leftover keystroke.

    Regardless, keep it up.. new games for oldskool PCs are always appreciated.

  5. #5
    Join Date
    Dec 2016
    Location
    Vienna, Austria
    Posts
    16

    Default

    Quote Originally Posted by VileR View Post
    1) After perhaps ten games or so, when I try to start another, it says "not enough memory to load driver" and drops me back to the prompt. A memory leak issue perhaps (is the BGI driver reloaded on each new game without its memory being deallocated first?)
    I'm glad to read that you played it that often!
    Fixed. The reason was: after restorecrtmode() a closegraph() call is required to clean up memory.
    I am a newcomer to the graphics.h library, therefore such occasional inconveniences can happen...

    Quote Originally Posted by VileR View Post
    2) It would be a nice touch to clear the keyboard buffer when a new round begins. Should prevent human players from starting with an unplanned turn due to a leftover keystroke.
    That's a good point. Having read your comment I tried a fflush(stdin) call before the start of the game, but it would require a longer pause after a crash to completely prevent an unwanted game start. And when a game is so addicitive like this one , the player wants to restart it as quickly as possible.
    I have now changed the code so that you start the game by pressing the space bar, this should hopefully also be convenient (although I liked about the previous version that in one-player-mode you could rest your left hand until the end of the game).

    Thanks for your comments, your feedback is highly appreciated!

    P.S. My replies arrive a little later than my updates to my first posting because the admins always have to activate my posts since I am new to this forum.

  6. #6
    Join Date
    Sep 2011
    Location
    Michigan, USA
    Posts
    158

    Default

    This is a fun game! Works great on an IBM 5150 PC with a 286 CPU Accelerator Card and Hercules Video to an IBM 5151 monitor. I will admit that I did have to re-read your post about the objective of the game (Don't hit the walls) so you might consider including that information in the welcome screen. Also, you might consider making the scoring tick marks a little larger or wider... so they can be more easily seen from a distance. Nice job!!

  7. #7
    Join Date
    Dec 2016
    Location
    Vienna, Austria
    Posts
    16

    Default

    @mmruzek: thanks for you comments, I have implemented both items.

    The score is now displayed as text, which IMHO looks much better. The reason for the graphical display was that I was previously using Turbo C 1.0 with a custom graphics library that had no way to display text in graphics mode (note that graphics.h wasn't introduced until Turbo C 2.0).

    I cannot edit my first posting anymore, so here is the new package attached.
    Attached Files Attached Files

  8. #8
    Join Date
    Dec 2016
    Location
    Vienna, Austria
    Posts
    16

    Default

    I have made two more changes:

    1. Now the game always stays in graphics mode, because I fear that frequent switching between text mode and graphics mode could reduce the life expectancy of an old monitor.

    2. Zero-player-mode added, that means now you can watch two computer players battling each other. I added this because it was easy to implement. Maybe I will later use this to make the game start in "attract mode".
    Attached Files Attached Files

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •