Jump to content
IGNORED

Cave Trap and Cave Bandit (New 4k and 32k DPC+ Games, with Source Code)


Recommended Posts

I always liked and still play acousticguitar's old game called "MissIt" occasionally.  It had been on my to-do list of game ideas for years to make a similar game that includes a jumping mechanic.  

 

I started off using RT's fake gravity demos and came up with two new games with those demos as my inspiration to get started (thanks RT!).  The first one "Cave Trap" is a standard kernel 4k game that has you jumping over obstacles.  To make it a little more interesting, I added a jump counter that counts how many times you completed a full height jump, an invincibility option that makes you invincible for about 3 seconds (you can use it four times per game), and a timer to keep track of how long you've survived in the game.  Push down on the joystick to activate invincibility.

 

The status bar includes the jump counter at the top left, an "invincibility uses remaining" counter at the top right, and the timer just below them.  AtariVox/SaveKey support is not included, there isn't enough ROM space.

 

Cave_Trap_v0.1.bas.bin  (Original)

Cave_Trap_v0.3.bas.bin  (Fixes scanline stability issues and a few other minor things)

 

image.thumb.png.b780e0407e9c44045875611a5763b294.png

 

The second game is called "Cave Bandit".  I expanded on the same idea from the first game but used the DPC+ kernel instead.  In this game, you also must jump around to avoid the bats, but the real goal is to collect the treasures that appear around the screen.  It has three difficulty levels (Selectable from a menu):

 

Novice:  The speed starts very slow (and gets progressively faster), and the bats always follow a linear pattern.

Standard:  The speed starts a little faster (and gets faster), and the bats will break off from the initial pattern to fly around more randomly.

Expert:  The speed starts at the fastest speed, and the bats also break their pattern as you get further into the game.

 

The platform positions don't change in the game (they now do in v0.16), and the treasure will appear in a different place on the screen after you pick one up.

 

There is no AtariVox or SaveKey support in this game either.  There's ROM space remaining to add a bit more to this if I think of anything or if anyone has suggestions, but I already seem to be close to the limit on how many CPU cycles I have remaining in the main loop.  Adding additional levels with different platform positions and treasure locations may be possible, but like I said I'm hitting some limits already.

 

Cave_Bandit_v0.10.bas.bin (Initial release)

Cave_Bandit_v0.11.bas.bin (Some bugfixes, you drop through a platform when ducking, sliding reduced, you can now jump off of the top platform)

Cave_Bandit_v0.13.bas.bin (Control Change - Push down to duck on a platform, Push down and press fire to drop down from a platform)

Cave_Bandit_v0.16.bas.bin (New alternating platform screens and invincibility powerup added)

 

image.thumb.png.199efac39ad24e6cfda05164dbd691fb.png

 

  • Like 7
  • Thanks 1
Link to comment
Share on other sites

Here's the source code for Cave Trap.  The zip file includes the batari basic source code as well as the three inline assembly files you'll need to compile it.  For this game, you'll also need to modify your std_kernel.asm file (in the bB includes subdirectory) in order to compile the file as-is. 

 

In the std_kernel.asm file, add the "jsr minikernela" and "jsr minikernelb" lines above and below the existing "jsr minikernel" line like below:


ifconst minikernel
     jsr minikernela
     jsr minikernel
     jsr minikernelb
endif
 
minkernela sets color on top status bar line and minikernelb sets the color behind timer.  To change them, modify "scbacka" and "scbackb" in the code.

 

Cave_Trap_v0.1_Source.zip

  • Like 4
Link to comment
Share on other sites

Here's the source code for Cave Bandit.  It took a while for me to get this cleaned up enough to want to share it. :)

 

The zip file includes all of the assembly files needed to compile it, including the AtariAge Logo and the Maximus Games logo that I've used for other games I've shared here in the past.  

 

Cave_Bandit_v0.10_Source.zip

 

The following Assembly files are required for compiling Cave Bandit:
Atari_Age_Logo.asm 
Have_You_Played_Atari_Today.asm
Maximus_Games_Logo.asm - Please do not re-use this file as-is for your own projects! :)
Cave_Bandit_Title_Revision_5.asm
Cave_Bandit_Expert.asm
Cave_Bandit_Standard.asm
Cave_Bandit_Novice.asm

 

The Splash screens and menu screens were built with the Atari Background Builder (note that I did modify the resulting assembly after using the tool):
https://alienbill.com/2600/atari-background-builder/


The AtariAge Logo is from code shared in this forum thread:


A lot of code was used from the Fake Gravity Platform Test source:


Bat Movement code taken from "MissIt", the game that originally inspired me to start these two projects:


 

  • Like 2
  • Thanks 2
Link to comment
Share on other sites

You did a great job with Cave Bandit, that game is awesome!

 

My highest score was 110 points.

 

One suggestion I have is to give the player the ability to drop through platforms.

 

I was thinking the player could press fire while ducking to fall through a platform and make a quick escape.

Link to comment
Share on other sites

38 minutes ago, Siddikinz said:

You did a great job with Cave Bandit, that game is awesome!

 

My highest score was 110 points.

 

One suggestion I have is to give the player the ability to drop through platforms.

 

I was thinking the player could press fire while ducking to fall through a platform and make a quick escape.

Thanks!  Because I re-used so much code from Random Terrain's demo, the game came together really quickly.  I spent less than a week on it.  The ability to drop down through platforms is something I could experiment with, I like that idea.

4 minutes ago, Philsan said:

Very nice games Steve!

 

In Cave Trap I found that if you go to the right the player stops before the wall but walk animation continues. 

Thanks!  I didn't catch that animation issue.  I'll have to go back and take a look.

  • Thanks 1
Link to comment
Share on other sites

Very fun games Steve, I'll be playing both of them on ZPH tonight! A couple of things I noticed while playing them:

  • Cave Bandit: Takes two presses when changing direction for difficulty in the 'Choose Level' screen
  • Cave Bandit: If you change difficulty on the 'Choose Level' screen you need to press the button twice to start the game [EDIT: Additional Issue]
  • Cave Bandit: One frame of three vertical lines appear briefly between a game over situation and going back to the 'Choose Level' screen. (See below)
  • Cave Trap: The title screen is 263 lines which could cause a slight screen roll or video drop out on some TVs when switching to the standard 262 during the game.
  • Cave Trap: The last digit of the time is mangled in Developer mode and may display that way on some consoles. (See below)

- James

 

 

image.thumb.png.132060acb1d38c6ee9f34f2a65153e1c.png

 

image.thumb.png.a370aff60355b243e557523305a5863f.png

Link to comment
Share on other sites

2 minutes ago, ZeroPage Homebrew said:

Very fun games Steve, I'll be playing both of them on ZPH tonight! A couple of things I noticed while playing them:

  • Cave Bandit: Takes two presses when changing direction for difficulty in the 'Choose Level' screen
  • Cave Bandit: One frame of three vertical lines appear briefly between a game over situation and going back to the 'Choose Level' screen. (See below)
  • Cave Trap: The title screen is 263 lines which could cause a slight screen roll or video drop out when switching to the standard 262 during the game on some TVs.
  • Cave Trap: The last digit of the time is mangled in Developer mode and may display that way on some consoles. (See below)

- James

 

Thanks for pointing out those issues James.  I won't have any time to look at these again today (and I'm also out this evening so I won't be able to be online for your show tonight either), but I should be able to address those in the near future.

  • Like 2
Link to comment
Share on other sites

ZeroPage Homebrew is playing Cave Bandit & Cave Trap on today's ZPH stream LIVE on Twitch! Hope you can join us!

 

Games:

 

 

  • Like 1
Link to comment
Share on other sites

Thanks for playing last night James!  I was unable to watch live, but I watched the video this morning.  I love how determined you were to get to 99 jumps! :)  I'll revisit the games in the coming weeks with some fixes and changes based on what was mentioned during the show. 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Here's an updated version of the Cave Trap game (the first post on this thread was also updated).  I fixed the scanline stability issues on the title screen, when jumping from the title screen to the main game, when restarting the game after death, and the running animation when at the right side of the screen.  I haven't been able to replicate the issue mentioned with the last digit of the timer.  The scanline issues were mostly related to using the pfhline statement inside of a loop.  Moving it solved a lot of problems.  I will share updated source code again in the near future.

 

Cave_Trap_v0.3.bas.bin

  • Like 3
  • Thanks 1
Link to comment
Share on other sites

1 hour ago, Atarius Maximus said:

I haven't been able to replicate the issue mentioned with the last digit of the timer.

 

To be able to see the issue, run the game in Stella with all the developer settings turned on.

 

The specific option that is triggering the issue is the 'Delayed VDEL... swap for Players'. If you make sure the 'Players' setting is on, you will be able to see the graphical issue. You can read more details about that emulated glitch on the Stella website here: https://stella-emu.github.io/docs/index.html

 

"Emulates a VDELP0/P1/BL swap delayed by one color clock. This e.g cause glitches in the He-Man title screen"

 

image.thumb.png.74b7394c3a37dc2651717dd04aa230be.png

 

I developed my Pac-Line game with all the developer settings turned on so I'm able to catch any issues as I was programming. It sometimes makes for some very tight kernels but it will eliminate a lot of issues on various systems that might show these types of graphical bugs. The developer settings are also invaluable in catching programming issues, especially the ones on the 'Emulation' page.

 

- James

Link to comment
Share on other sites

Aha.  Thanks for the extra details on that, James.  I'm not sure off the top of my head how to fix the problem but at least I can replicate it now.

 

I updated Cave Bandit today as well.  I fixed the 3 white bars that showed up on top when going back to the difficulty selection screen, the two button presses or joystick movements required for navigating the difficulty menu, I reduced the sliding effect by about 50%, you can jump off the top middle platform now, and now when you duck on a platform you'll drop straight down through the platform (Edit: after playing, I may change this to require pressing fire while ducking to drop through a platform, that's open to feedback).  I'm not done with the game yet, I'm still playing around with some other possible enhancements.

Cave_Bandit_v0.11.bas.bin

  • Like 4
Link to comment
Share on other sites

36 minutes ago, Atarius Maximus said:

Aha.  Thanks for the extra details on that, James.  I'm not sure off the top of my head how to fix the problem but at least I can replicate it now.

 

I updated Cave Bandit today as well.  I fixed the 3 white bars that showed up on top when going back to the difficulty selection screen, the two button presses or joystick movements required for navigating the difficulty menu, I reduced the sliding effect by about 50%, you can jump off the top middle platform now, and now when you duck on a platform you'll drop straight down through the platform.  I'm not done with the game yet, I'm still playing around with some other possible enhancements.

Cave_Bandit_v0.11.bas.bin 32 kB · 1 download

Nice work, I'm glad you implemented my suggestion!

 

Another enhancement I would like to see is a multiplayer mode for Cave Bandit.

 

Even if it's a simple mode where players take turns, it would be super fun to play this game with friends!

Link to comment
Share on other sites

Thank you!  It hit me after I finished the update earlier that you'd suggested using the fire button while ducking to drop down, my change actually makes you immediately drop just by pressing down on a platform.  I'm going to add a fire button press as a requirement and just play both ways and see which just "feels" better, not sure on that yet.  I appreciate the suggestion.

 

It might be possible to add an alternating two player mode.  While it's technically possible, adding an additional player on the screen at the same time for simultaneous play in my existing code would definitely use way too much CPU.  I'll add an alternating 2P play mode to my list of things to try out and see if it will work.

  • Like 1
Link to comment
Share on other sites

This version gives you the choice of pushing down to duck on a platform or pushing down and pressing fire to drop down from a platform.   I think this works out better as it gives you the choice of either, and it feels pretty natural when playing the game.

Cave_Bandit_v0.13.bas.bin

 

Edit:  I'm still testing other ideas.  I have alternating platform screens working if I sacrifice one of the bats, that's needed in order to free up enough CPU cycles.  I'm also working on adding some kind of invincibility powerup option.

  • Like 5
Link to comment
Share on other sites

22 hours ago, ZeroPage Homebrew said:

The specific option that is triggering the issue is the 'Delayed VDEL... swap for Players'. If you make sure the 'Players' setting is on, you will be able to see the graphical issue. You can read more details about that emulated glitch on the Stella website here: https://stella-emu.github.io/docs/index.html

 

For what it's worth, I think this is an issue you will see with the bB score in general with that dev option turned on. The timing in the bB score is very tight, since it includes the score digits as well as the possibility of pfscore bars. Here's a screenshot showing Space Game demonstrating the score glitch with that TIA bug option enabled. I suspect it can be seen in a lot of bB games, perhaps depending partially on the design of the score font.

 

Screenshotfrom2024-07-2614-05-52.thumb.png.1e0d2a1aa3f413ec815e8e7e80018263.png

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

8 minutes ago, Karl G said:

For what it's worth, I think this is an issue you will see with the bB score in general with that dev option turned on. The timing in the bB score is very tight, since it includes the score digits as well as the possibility of pfscore bars. Here's a screenshot showing Space Game demonstrating the score glitch with that TIA bug option enabled. I suspect it can be seen in a lot of bB games, perhaps depending partially on the design of the score font.

 

Screenshotfrom2024-07-2614-05-52.thumb.png.1e0d2a1aa3f413ec815e8e7e80018263.png

 

Thanks for the info Karl! I'll try to remember to not point that out going forward if it's baked into the bB score kernel. 🙂

 

- James

  • Like 2
Link to comment
Share on other sites

Thanks for the additional information, Karl!  I'm glad to know it wasn't simply a mistake on my part for this specific game.

 

I updated Cave Bandit again with a few new features.  There are now two alternating platform screens.  The screen will change after two conditions are met:  You've collected 8 treasures since the last screen change, and you have jumped/fallen to the bottom of the screen (to avoid falling from a platform that suddenly disappears on a screen change).  I've also added an invincibility powerup that will drop from the top of the screen (using missile1).  It will appear once every screen change and grants invincibility for around 4 seconds.  Your player character will turn grey to indicate that invincibility has been activated.  After admittedly not very much playtesting it appears to all work as expected and I didn't notice that it jumped over 262 scanlines while playing.

 

The fifth bat will need to be permanently removed from the game.  It makes the game a little bit easier, but it was pretty tough in its original form to begin with and it freed up enough CPU cycles/ROM space for the new additions.  The main loop runs in bank 2 and you can see how tight this is now:

 

      15 bytes of ROM space left in bank 1
      0 bytes of ROM space left in bank 2
      1755 bytes of ROM space left in bank 3
      3213 bytes of ROM space left in bank 4
      84 bytes of ROM space left in bank 5
      128 bytes of ROM space left in bank 6
      2769 bytes of ROM space left in graphics bank

 

Cave_Bandit_v0.16.bas.bin

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