Jump to content

Photo

Pitfall!x256 (was: Pitfall!x16)

Pitfall! Hack

56 replies to this topic

#1 Thomas Jentzsch OFFLINE  

Thomas Jentzsch

    Thrust, Jammed, SWOOPS!, Boulder Dash, THREE·S, Star Castle

  • 22,599 posts
  • Always left from right here!
  • Location:Düsseldorf, Germany, Europe, Earth

Posted Sat Jun 24, 2017 1:07 PM

Hi,

I had a few hours of spare time and, based on my old disassembly from 2001, created a little hack of Pitfall!. This hack allows you to select one of 16 all new maze variations. Especially for those who have still fun in mapping screens and underground passages. Enjoy!

 

NTSC and PAL-60 (with some small color adjustments) versions included.

 

Update: The x256 version has 256 mazes and additional variety of the existing game elements. See this post for details.


Edited by Thomas Jentzsch, Wed Jul 5, 2017 4:30 AM.


#2 toiletunes OFFLINE  

toiletunes

    River Patroller

  • 3,084 posts
  • Hater Brigader
  • Location:Salem, Mo 65560 USA

Posted Sat Jun 24, 2017 1:57 PM

Thank you! Pitfall, as good as it was, needed some variety for replay value. A+



#3 MrBeefy OFFLINE  

MrBeefy

    Dragonstomper

  • 540 posts
  • Location:Missouri USA

Posted Sat Jun 24, 2017 2:11 PM

Hi,

I had a few hours of spare time and, based on my old disassembly from 2001, created a little hack of Pitfall!. This hack allows you to select one of 16 all new maze variations. Especially for those who have still fun in mapping screens and underground passages. Enjoy!

 

NTSC and PAL-60 (with some small color adjustments) versions included.

 


Back in the day my mother had her own map memorized to complete the game. I have never been that good. lol I will try this though :D

#4 Special Teams OFFLINE  

Special Teams

    Dragonstomper

  • 778 posts
  • Location:Seattle

Posted Sat Jun 24, 2017 2:13 PM

Thanks!



#5 hizzy OFFLINE  

hizzy

    Dragonstomper

  • 689 posts
  • Location:Montreal, QC

Posted Sat Jun 24, 2017 3:19 PM

Amazing! Thank you, Thomas!



#6 ultima OFFLINE  

ultima

    Chopper Commander

  • 122 posts
  • Location:West Los Angeles, CA USA

Posted Sat Jun 24, 2017 5:42 PM

Cool!! I love pitfall! Can't wait to try this thanks

#7 Thomas Jentzsch OFFLINE  

Thomas Jentzsch

    Thrust, Jammed, SWOOPS!, Boulder Dash, THREE·S, Star Castle

  • Topic Starter
  • 22,599 posts
  • Always left from right here!
  • Location:Düsseldorf, Germany, Europe, Earth

Posted Wed Jun 28, 2017 3:37 AM

Why stop at 16? Yesterday I had the idea how to have 256 variations. So here is: Pitfall!x256

 

The game now contains the 16 variations (1..16) of Pitfall!x16 plus 240 all new ones. And each variation has its own, unique map. This should keep fans busy quite long. :) 

 

With SELECT you can manually select a variation. If you press SELECT + RESET simultaneously the game with select a random variation for you. If you hold the switch(es), the selection is now accelerated.

 

Note: The PAL-50 version is speed adjusted. So it will play at the same speed as the NTSC or PAL-60 version.

 

EDIT: Faulty ROMs deleted. New ROMs will be in the first post.


Edited by Thomas Jentzsch, Thu Jun 29, 2017 10:43 AM.


#8 JDTAY ONLINE  

JDTAY

    Chopper Commander

  • 184 posts
  • Location:North Carolina, USA

Posted Wed Jun 28, 2017 4:02 AM

Now ya might be gettin' into overkill territory...

#9 Thomas Jentzsch OFFLINE  

Thomas Jentzsch

    Thrust, Jammed, SWOOPS!, Boulder Dash, THREE·S, Star Castle

  • Topic Starter
  • 22,599 posts
  • Always left from right here!
  • Location:Düsseldorf, Germany, Europe, Earth

Posted Wed Jun 28, 2017 4:43 AM

Some people continue to claim that there is no variation in Pitfall!.

 

Maybe this silences them. :)



#10 save2600 OFFLINE  

save2600

    Quadrunner

  • 13,917 posts
  • Location:Wisconsin

Posted Wed Jun 28, 2017 12:15 PM

Holy cow is that awesome. All new reason to play Pitfall! again. Thanks Thomas!

#11 CapitanClassic OFFLINE  

CapitanClassic

    Dragonstomper

  • 507 posts

Posted Wed Jun 28, 2017 1:36 PM

From my memory, the rooms aren't stored in some sort of data table, instead a PRNG is seeded and then an algorithm generates the next number when going right or previous number going left.

(Assuming you didn't have to modify the algorithm) If the PRNG used a 8bit 256 cycle, then wouldn't Pitfall!x256 just give you a different staring location. If it used a 16bit 65535 cycle PRNG, is Pitfall!x256 still solvable in 20 minutes? The original is barely finishable within the limit, and that is with skipping probably 2/3-1/2 of the game using the underground.

#12 Thomas Jentzsch OFFLINE  

Thomas Jentzsch

    Thrust, Jammed, SWOOPS!, Boulder Dash, THREE·S, Star Castle

  • Topic Starter
  • 22,599 posts
  • Always left from right here!
  • Location:Düsseldorf, Germany, Europe, Earth

Posted Wed Jun 28, 2017 2:51 PM

From my memory, the rooms aren't stored in some sort of data table, instead a PRNG is seeded and then an algorithm generates the next number when going right or previous number going left.

Correct.

 

(Assuming you didn't have to modify the algorithm) If the PRNG used a 8bit 256 cycle, then wouldn't Pitfall!x256 just give you a different staring location. If it used a 16bit 65535 cycle PRNG, is Pitfall!x256 still solvable in 20 minutes? The original is barely finishable within the limit, and that is with skipping probably 2/3-1/2 of the game using the underground.

Pitfall! uses a 8 bit cycle PRNG which allows for 255 screens before repeating.

I changed the a bit convoluted PRNG code into a simpler, standard LFSR. This one uses an XOR-value, which I change depending on the game variation. Each XOR-value creates a completely different sequence of random values. However there exist only 16 XOR-values which generate a 255 values (0 isn't allowed) maximum length sequence (I cannot switch to 16 bit, because then the number of treasures within 255 screens is not determined). This resulted into the 16 variations of Pitfall!x16.

 

To get to 256 variations, I simply repeat the LFSR multiple (1, 3, 5, ..15) times for each screen. This causes different value sequences, which also repeat after 256255 values. 

 

And while I was answering your questions (thanks a lot!), I realized that I have made a big mistake here :roll:. I always had 256 screens in mind, so I chose those odd values for repeating the LFSR. But there are only 255 screens, and this breaks the code. :x

 

Fortunately this seems easy to fix. 1, 2, 4, 7, 8, 11, 13 and 14 iterations should do the job. But before I post the new ROMs, I better double check.



#13 CapitanClassic OFFLINE  

CapitanClassic

    Dragonstomper

  • 507 posts

Posted Wed Jun 28, 2017 7:36 PM

Correct.
 
Pitfall! uses a 8 bit cycle PRNG which allows for 255 screens before repeating.

I changed the a bit convoluted PRNG code into a simpler, standard LFSR. This one uses an XOR-value, which I change depending on the game variation. Each XOR-value creates a completely different sequence of random values. However there exist only 16 XOR-values which generate a 255 values (0 isn't allowed) maximum length sequence (I cannot switch to 16 bit, because then the number of treasures within 255 screens is not determined). This resulted into the 16 variations of Pitfall!x16.
 
To get to 256 variations, I simply repeat the LFSR multiple (1, 3, 5, ..15) times for each screen. This causes different value sequences, which also repeat after 256255 values. .

Makes sense, as in bits shifting and XORing 0000 0000 just gets you 0000 0000 back again.

I wonder if this has been discussed before, but could a similar method be used to generate a random rogue-like game, with one algorithm (and register) handling the Y location, and algorithm handling the X location (and current D X location register)

You could then use 4 bits to handle the available edits from a room (with doors that close behind you in situations where you can go North, but the room N does not have an exit south)

0000 & 1111 representing all exits NSEW
0001 W
0010 E
0100 N
1000 S
...
1110 NSE
1101 NSW
1011 SWE
0111 NWE

Using a different seed to get 255 different dungeon layouts. (Actually 65535, because the UP/Down seed is different than the LEFT/RIGHT seed)
The worst situation might be starting location with one exit, and that room you have an exit to only having an exit back to the starting location.

Perhaps so algorithm to force the starting location to have all exits open, 0000 or 1111.

That leaves a total of 12 other bits to control information like enemies, treasures, weapons etc.

#14 Thomas Jentzsch OFFLINE  

Thomas Jentzsch

    Thrust, Jammed, SWOOPS!, Boulder Dash, THREE·S, Star Castle

  • Topic Starter
  • 22,599 posts
  • Always left from right here!
  • Location:Düsseldorf, Germany, Europe, Earth

Posted Thu Jun 29, 2017 10:30 AM

For sure, you can create whole worlds randomly. This is no rocket science. And one LFSR per direction is a possible solution. But the problems arise when you want to make your world alive and interacting. Then things get quite complicated soon.

 

E.g. there is a certain treasure, which exists only once. The position must be constant per game and not depend in which order you visit the rooms. Now, if you want create this on-the-fly, how can you do that? You could create it at the game start, but that has to be stored somewhere. And the 2600 is very short of RAM.

 

Lookup "The Stacks" (which is still in development) is you want to see an example of a large, randomly generated world for the Atari 2600.
 



#15 Thomas Jentzsch OFFLINE  

Thomas Jentzsch

    Thrust, Jammed, SWOOPS!, Boulder Dash, THREE·S, Star Castle

  • Topic Starter
  • 22,599 posts
  • Always left from right here!
  • Location:Düsseldorf, Germany, Europe, Earth

Posted Thu Jun 29, 2017 10:58 AM

I have the deleted the faulty ROMs. The fixed ROMs can be found in the first post.

 

These ROMs contain further changes, which add more variety to the game itself. These should make the game itself (even) more entertaining and provide more varying timings.

 

Note: Some changes are there from the beginning and some start when you have collected a certain number of treasures. The latter will also make the game more challenging. To reflect that, I have increased the scores.



#16 Cafeman OFFLINE  

Cafeman

    Quadrunner

  • 6,338 posts
  • Hungry
  • Location:Pennsylvania, 3 rights after the Mulberry tree

Posted Thu Jun 29, 2017 11:10 AM

Omg! I can't wait to try this!

#17 CapitanClassic OFFLINE  

CapitanClassic

    Dragonstomper

  • 507 posts

Posted Thu Jun 29, 2017 7:16 PM

For sure, you can create whole worlds randomly. This is no rocket science. And one LFSR per direction is a possible solution. But the problems arise when you want to make your world alive and interacting. Then things get quite complicated soon.
 
E.g. there is a certain treasure, which exists only once. The position must be constant per game and not depend in which order you visit the rooms. Now, if you want create this on-the-fly, how can you do that? You could create it at the game start, but that has to be stored somewhere. And the 2600 is very short of RAM.
 
Lookup "The Stacks" (which is still in development) is you want to see an example of a large, randomly generated world for the Atari 2600.
 

i see what you mean. According to , Retrogame Archeology: Exploring Old Computer Games, Pitfall! Uses 4 bytes to track all 32 treasures, and its ingenious design to use the PCG (procedural content generation) of maximal length, ensures that all 32 treasures can be found within the 255 screens.

If someone wants a pseudo random world where you can actually interact with it by picking up objects such that they are removed from the world when you return to the screen, you start eating up RAM fast.

#18 StanJr OFFLINE  

StanJr

    Web-slinger

  • 14,930 posts
  • fun or bust
  • Location:Louisville KY

Posted Thu Jun 29, 2017 8:10 PM

what treasure only appears once??



#19 CapitanClassic OFFLINE  

CapitanClassic

    Dragonstomper

  • 507 posts

Posted Thu Jun 29, 2017 10:48 PM

I suppose I wasn't clear. Each treasure only appears once in Pitfall!

From glancing over the book above, the PCG generates an 8bit value that represents everything you see on the screen, log count, where the holes are, the tree pattern, rope or not, etc. This includes the specific treasures that need to disappear once you collect them. (I.e. If you leave the screen and return to it, the treasures don't respawn)

All treasures appear on a black disappearing pond which is 101x xxxx the remaining 5 bits indicate one of the 4 type of treasure (2-bits, that refer to a specific byte of RAM that contains and the last 3 bits the number of the specific treasure of 8 possible ones.

So to track the 32 treasures, you need 32bits or 4 bytes.

#20 Thomas Jentzsch OFFLINE  

Thomas Jentzsch

    Thrust, Jammed, SWOOPS!, Boulder Dash, THREE·S, Star Castle

  • Topic Starter
  • 22,599 posts
  • Always left from right here!
  • Location:Düsseldorf, Germany, Europe, Earth

Posted Fri Jun 30, 2017 4:54 AM

That book you are referring too, does it show source code? I wonder if they used my disassembly or if a different source exists.



#21 Thomas Jentzsch OFFLINE  

Thomas Jentzsch

    Thrust, Jammed, SWOOPS!, Boulder Dash, THREE·S, Star Castle

  • Topic Starter
  • 22,599 posts
  • Always left from right here!
  • Location:Düsseldorf, Germany, Europe, Earth

Posted Fri Jun 30, 2017 5:47 AM

I have updated the x256 ROMs at the first post to fix some minor issues.



#22 CapitanClassic OFFLINE  

CapitanClassic

    Dragonstomper

  • 507 posts

Posted Fri Jun 30, 2017 7:36 PM

I am not certain. Was using google book preview https://books.google...Pitfall&f=false

According to the references, it goes to an Edge online a magazine that doesn't exist.

#23 Thomas Jentzsch OFFLINE  

Thomas Jentzsch

    Thrust, Jammed, SWOOPS!, Boulder Dash, THREE·S, Star Castle

  • Topic Starter
  • 22,599 posts
  • Always left from right here!
  • Location:Düsseldorf, Germany, Europe, Earth

Posted Sun Jul 2, 2017 1:03 PM

Added one more variety element and fixed two gameplay issues. ROMs v1.14 in the first post.

 

BTW: When you play the game, please give me some feedback.


Edited by Thomas Jentzsch, Sun Jul 2, 2017 1:04 PM.


#24 Trebor OFFLINE  

Trebor

    River Patroller

  • 4,167 posts

Posted Sun Jul 2, 2017 2:03 PM

Added one more variety element and fixed two gameplay issues. ROMs v1.14 in the first post.

 

BTW: When you play the game, please give me some feedback.

 

Thomas...The 'pits' open and close too fast now.  There's no way to cross it in time.  

Tried the initial (Start up) "1" variety with the Diamond ring on screen with tar/black pit under Stella 5.0.0-pre9 and MAME 0.187.  

Same results under both emulators for the NTSC ROM v1.14.



#25 Thomas Jentzsch OFFLINE  

Thomas Jentzsch

    Thrust, Jammed, SWOOPS!, Boulder Dash, THREE·S, Star Castle

  • Topic Starter
  • 22,599 posts
  • Always left from right here!
  • Location:Düsseldorf, Germany, Europe, Earth

Posted Sun Jul 2, 2017 2:28 PM

You can cross them if you jump into the pit when it has opened and then jump again before it opens again.

 

BTW: It's not all pits. :)







Also tagged with one or more of these keywords: Pitfall!, Hack

0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users