Pitfall

developing/porting a new game or gaming framework? post in here!
User avatar
kieranhj
Posts: 1103
Joined: Sat Sep 19, 2015 11:11 pm
Location: Farnham, Surrey, UK
Contact:

Re: Pitfall

Post by kieranhj »

fizgog wrote: Thu Jun 30, 2022 9:28 am I've managed to download the book Racing the Beam and according to page 35 the TIA offers two number-size registers NUSIZ0 and NUSIZ1 to allow the placement of the same sprites on screen (it's how they did Space Invaders)

So I've got some reading to do tonight
If you want some even more light reading, then this is a HTML version of the defacto Stella Programmer's Guide from 1979!

EDIT: PS. This is looking great! Keep up the good work. =D>
Bitshifters Collective | Retro Code & Demos for BBC Micro & Acorn computers | https://bitshifters.github.io/
User avatar
fizgog
Posts: 618
Joined: Thu Jun 17, 2021 3:18 pm
Location: Nottinghamshire
Contact:

Re: Pitfall

Post by fizgog »

kieranhj wrote: Thu Jun 30, 2022 4:00 pm
fizgog wrote: Thu Jun 30, 2022 9:28 am I've managed to download the book Racing the Beam and according to page 35 the TIA offers two number-size registers NUSIZ0 and NUSIZ1 to allow the placement of the same sprites on screen (it's how they did Space Invaders)

So I've got some reading to do tonight
If you want some even more light reading, then this is a HTML version of the defacto Stella Programmer's Guide from 1979!

EDIT: PS. This is looking great! Keep up the good work. =D>
Thanks Kieran,

I'll look forward to reading this document :)
Pitfall, Gridrunner, Matrix: Gridrunner 2, LaserZone, AcornViewer, AcornPad
User avatar
fizgog
Posts: 618
Joined: Thu Jun 17, 2021 3:18 pm
Location: Nottinghamshire
Contact:

Re: Pitfall

Post by fizgog »

After delving into the Atari TIA I’ve found that the NUSIZ contains the following: -

Code: Select all

; ATARI 2600 NUSIZ
000 - 1 copy
001 - 2 copies - close
010 - 2 copies - med
011 - 3 copies - close
100 - 2 copies - wide
101 - double size player
110 - 3 copies medium
111 - quad sized player

We don't care about double and quad sized player sprites for Pitfall so we can ignore these

if the distance between sprites are 8 - close, 16 medium and 32 wide (will need double checking) we can then set up the following contants

Code: Select all

; 8, 16 and 32 distance
ONE_COPY.            = #$00  ; 00000001 - 1 copy                                    
TWO_COPIES.          = #$0A  ; 00001010 - 2 copies                                
THREE_COPIES.        = #$0B  ; 00001011 - 3 copies close                      
TWO_COPIES_MEDIUM    = #$12  ; 00010010 - 2 copies medium                 
THREE_COPIES_MEDIUM  = #$13  ; 00010011 - 3 copies medium                 
TWO_COPIES_WIDE      = #$22  ; 00100010 - 2 copies wide           

Then we can use the following to extract the info we need

AND #$03 - gets the number of copies to plot
AND #$38 - gets the distance between sprites in pixels

NB On the otherhand if the distance is 16, 32 and 64 then we can shift bits 6,5,4 left by one and then use AND #$70 instead to get the distance

We can then create a table to store the objects copies and distances with the following: -

Code: Select all

; Max 12 objects
.Object_NUSIZ_Table
EQUB ONE_COPY
EQUB TWO_COPIES
EQUB TWO_COPIES_WIDE
EQUB THREE_COPIES_MEDIUM
EQUB ONE_COPY
EQUB THREE_COPIES
EQUB ONE_COPY
EQUB ONE_COPY
EQUB ONE_COPY
EQUB ONE_COPY
EQUB ONE_COPY
EQUB ONE_COPY

and then something like the following: -

Code: Select all

.UpdateObject
    LDX objectType                   
    LDA Object_NUSIZ_Table,X
    STA result
           
    AND #$03    ; get number of copies
    TAX         ; store into X
    LDA result     
    AND #$38 : STA distance
           
.loop  
    JSR UpdateObjectSprite
           
    LDA object_xpos : CLC : ADC distance : STA object_xpos
    DEX
    BNE loop
           
.exit
    RTS

PS All of the above has not been tested as I don't have access to my development machine so may be rubbish :lol:
Pitfall, Gridrunner, Matrix: Gridrunner 2, LaserZone, AcornViewer, AcornPad
User avatar
fizgog
Posts: 618
Joined: Thu Jun 17, 2021 3:18 pm
Location: Nottinghamshire
Contact:

Re: Pitfall

Post by fizgog »

Code needed a couple of tweaks, but in general it seemed to work

This constant should of been 1 not 0 which was a typo

Code: Select all

ONE_COPY   = #$01  ; 00000001 - 1 copy   
and I used AND #$07 to get bits 123 and AND #$F8 to get bits 45678

I still need to look at how to handle the sprites going off the screen :(


https://youtu.be/zDUG57gkmkw

Screenshot 2022-07-01 at 21.37.46.png
Last edited by fizgog on Sat Jul 02, 2022 8:22 am, edited 1 time in total.
Pitfall, Gridrunner, Matrix: Gridrunner 2, LaserZone, AcornViewer, AcornPad
User avatar
fizgog
Posts: 618
Joined: Thu Jun 17, 2021 3:18 pm
Location: Nottinghamshire
Contact:

Re: Pitfall

Post by fizgog »

Managed to add the three animated crocodiles last night, no pond though

https://youtu.be/y_YYZMrmQwo

Screenshot 2022-07-02 at 08.18.13.png
Pitfall, Gridrunner, Matrix: Gridrunner 2, LaserZone, AcornViewer, AcornPad
User avatar
tricky
Posts: 7699
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Pitfall

Post by tricky »

David Crane (the author of Pitfall) presented his postmortem of Pitfall at GDC 2011 and it is available for free in their GDCVault section.
https://www.gdcvault.com/play/1014632/C ... em-PITFALL
This also includes quite a bit of background on the 2600.
User avatar
fizgog
Posts: 618
Joined: Thu Jun 17, 2021 3:18 pm
Location: Nottinghamshire
Contact:

Re: Pitfall

Post by fizgog »

tricky wrote: Sun Jul 03, 2022 11:58 am David Crane (the author of Pitfall) presented his postmortem of Pitfall at GDC 2011 and it is available for free in their GDCVault section.
https://www.gdcvault.com/play/1014632/C ... em-PITFALL
This also includes quite a bit of background on the 2600.
Thanks that was a good presentation by David Crane
Pitfall, Gridrunner, Matrix: Gridrunner 2, LaserZone, AcornViewer, AcornPad
User avatar
fizgog
Posts: 618
Joined: Thu Jun 17, 2021 3:18 pm
Location: Nottinghamshire
Contact:

Re: Pitfall

Post by fizgog »

It's been way too hot to code at night, but I did end up deciding to rewrite the sprite plotting code from scratch.

Implemented Mode 2 masking and erasing, as using the previous EOR method only gave me a few colours to play with, now I have the use of 16

Added code to allow player to go in between the holes

https://youtu.be/RsxHNKGO1AA

Screenshot 2022-07-18 at 10.54.47.png
Pitfall, Gridrunner, Matrix: Gridrunner 2, LaserZone, AcornViewer, AcornPad
User avatar
lurkio
Posts: 4351
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: Pitfall

Post by lurkio »

Love to see the progress on this game! Great work!

=D> =D> :)
Beebson
Posts: 149
Joined: Tue Jan 18, 2022 2:24 pm
Contact:

Re: Pitfall

Post by Beebson »

Partly hidden Harry looks nice! :)
User avatar
marcusjambler
Posts: 1147
Joined: Mon May 22, 2017 12:20 pm
Location: Bradford
Contact:

Re: Pitfall

Post by marcusjambler »

Looking very good Fizgog :D
User avatar
Rob_hawk
Posts: 477
Joined: Mon Jul 12, 2021 6:50 pm
Location: Valmeinier, France
Contact:

Re: Pitfall

Post by Rob_hawk »

Looks like the hard work Sprite rewrite has paid off - looks super =D>
User avatar
fizgog
Posts: 618
Joined: Thu Jun 17, 2021 3:18 pm
Location: Nottinghamshire
Contact:

Re: Pitfall

Post by fizgog »

Added sprite clipping to animated logs

https://youtu.be/nVQlViHTBc4

Screenshot 2022-07-19 at 18.31.49.png
Pitfall, Gridrunner, Matrix: Gridrunner 2, LaserZone, AcornViewer, AcornPad
User avatar
FourthStone
Posts: 1527
Joined: Thu Nov 17, 2016 2:29 am
Location: Brisbane, Australia
Contact:

Re: Pitfall

Post by FourthStone »

This is coming along great, please keep the posting updates to progress when possible =D>

I'd be interested to know if you're going to follow the same level design logic as the original using one byte to define the screen layout for the entire game along with some logic that decodes it and allows consistent travel to and from each level including the underground shortcuts.

It was described in the post-mortem video by the creator David Crane and I found a nice write up here:
https://evoniuk.github.io/posts/pitfall.html
User avatar
fizgog
Posts: 618
Joined: Thu Jun 17, 2021 3:18 pm
Location: Nottinghamshire
Contact:

Re: Pitfall

Post by fizgog »

FourthStone wrote: Tue Jul 19, 2022 10:46 pm This is coming along great, please keep the posting updates to progress when possible =D>

I'd be interested to know if you're going to follow the same level design logic as the original using one byte to define the screen layout for the entire game along with some logic that decodes it and allows consistent travel to and from each level including the underground shortcuts.

It was described in the post-mortem video by the creator David Crane and I found a nice write up here:
https://evoniuk.github.io/posts/pitfall.html
Thanks,

It was after reading that article that I decided to have a go

Yes I'm using the Random Generator from the Atari 2600 code to generate the screens and objects (not all sprite and objects data have been coded yet)
Underground shortcuts have been done.

Just fixed a masking issue when 3 logs are rolling - seems the mask backup data was going over a page boundary
Pitfall, Gridrunner, Matrix: Gridrunner 2, LaserZone, AcornViewer, AcornPad
User avatar
fizgog
Posts: 618
Joined: Thu Jun 17, 2021 3:18 pm
Location: Nottinghamshire
Contact:

Re: Pitfall

Post by fizgog »

Added the swamp for the crocodiles.
Converted crocs to use sprite masking

Screenshot 2022-07-20 at 23.13.13.png
Pitfall, Gridrunner, Matrix: Gridrunner 2, LaserZone, AcornViewer, AcornPad
User avatar
leenew
Posts: 4900
Joined: Wed Jul 04, 2012 4:27 pm
Location: Doncaster, Yorkshire
Contact:

Re: Pitfall

Post by leenew »

This is coming along really well =D>
I have never played the Atari original so could you tell me what features you still have to add?
Thanks,

Lee
User avatar
fizgog
Posts: 618
Joined: Thu Jun 17, 2021 3:18 pm
Location: Nottinghamshire
Contact:

Re: Pitfall

Post by fizgog »

leenew wrote: Wed Jul 20, 2022 11:55 pm This is coming along really well =D>
I have never played the Atari original so could you tell me what features you still have to add?
Thanks,

Lee
Still loads to do, following is not the full list

Collision detection
Animated vine
Tar pit
Animated quicksand
Treasures
Timer
Score
Lives
Sound
Pitfall, Gridrunner, Matrix: Gridrunner 2, LaserZone, AcornViewer, AcornPad
User avatar
lovebug
Posts: 1741
Joined: Sun Jan 31, 2021 5:07 pm
Location: Magrathea
Contact:

Re: Pitfall

Post by lovebug »

amazing work, looking great and progressing swiftly

very well done
Image Image Image Image
User avatar
fizgog
Posts: 618
Joined: Thu Jun 17, 2021 3:18 pm
Location: Nottinghamshire
Contact:

Re: Pitfall

Post by fizgog »

lovebug wrote: Sun Aug 07, 2022 8:04 pm amazing work, looking great and progressing swiftly

very well done
Thanks

Not sure about it progressing swiftly though, as I’ve not touched it in a couple of weeks as I’ve just not been able to find the time :(
Pitfall, Gridrunner, Matrix: Gridrunner 2, LaserZone, AcornViewer, AcornPad
User avatar
Rob_hawk
Posts: 477
Joined: Mon Jul 12, 2021 6:50 pm
Location: Valmeinier, France
Contact:

Re: Pitfall

Post by Rob_hawk »

fizgog wrote: Mon Aug 08, 2022 7:30 am Not sure about it progressing swiftly though, as I’ve not touched it in a couple of weeks as I’ve just not been able to find the time :(
It’ll be well worth the wait of that I’m sure :D
User avatar
oss003
Posts: 3849
Joined: Tue Jul 14, 2009 12:57 pm
Location: Netherlands
Contact:

Re: Pitfall

Post by oss003 »

Hi fizgog, I was following this great thread and wondering if you made some progress on Pitfall?
Is it already playable?

Greetings
Kees
User avatar
fizgog
Posts: 618
Joined: Thu Jun 17, 2021 3:18 pm
Location: Nottinghamshire
Contact:

Re: Pitfall

Post by fizgog »

oss003 wrote: Sat Oct 29, 2022 12:07 pm Hi fizgog, I was following this great thread and wondering if you made some progress on Pitfall?
Is it already playable?

Greetings
Kees
I wish I could say yes, but work and home life has taken over pretty much of my free time at the moment. I've been working very long hours to complete a project for work 300,000+ lines of code and in-between this trying to renovate the house to keep the wife happy.

Hopefully I'll be able to get back to some quality 6502 coding soon.

NB I've currently got 2 projects in development this and Laser Zone

Regards
Shaun
Pitfall, Gridrunner, Matrix: Gridrunner 2, LaserZone, AcornViewer, AcornPad
User avatar
Rob_hawk
Posts: 477
Joined: Mon Jul 12, 2021 6:50 pm
Location: Valmeinier, France
Contact:

Re: Pitfall

Post by Rob_hawk »

Good luck with the work project Shaun and hope the renovation goes well.

Like all great things Pitfall will be worth the wait :D

Rob
User avatar
fizgog
Posts: 618
Joined: Thu Jun 17, 2021 3:18 pm
Location: Nottinghamshire
Contact:

Re: Pitfall

Post by fizgog »

Finally finished major work project and have some time to myself :D

Started to add the swinging vine, video attached below

Screenshot 2022-11-28 at 22.17.56.png

https://youtu.be/jMw6VysZe14


Anyone know what's the best way of hiding the vine going through the trees?
Pitfall, Gridrunner, Matrix: Gridrunner 2, LaserZone, AcornViewer, AcornPad
User avatar
FourthStone
Posts: 1527
Joined: Thu Nov 17, 2016 2:29 am
Location: Brisbane, Australia
Contact:

Re: Pitfall

Post by FourthStone »

fizgog wrote: Mon Nov 28, 2022 10:20 pm Finally finished major work project and have some time to myself :D

Started to add the swinging vine, video attached below

Anyone know what's the best way of hiding the vine going through the trees?
Looks great! Would a simple height check work for masking the vine at the foliage level?
User avatar
fizgog
Posts: 618
Joined: Thu Jun 17, 2021 3:18 pm
Location: Nottinghamshire
Contact:

Re: Pitfall

Post by fizgog »

FourthStone wrote: Mon Nov 28, 2022 11:00 pm
fizgog wrote: Mon Nov 28, 2022 10:20 pm Finally finished major work project and have some time to myself :D

Started to add the swinging vine, video attached below

Anyone know what's the best way of hiding the vine going through the trees?
Looks great! Would a simple height check work for masking the vine at the foliage level?
Probably but I suppose I would need to code my own line drawing routine, currently for first test I’m just using the OS

See following thread for 6502 code
https://stardot.org.uk/forums/viewtopi ... 27#p376927
Pitfall, Gridrunner, Matrix: Gridrunner 2, LaserZone, AcornViewer, AcornPad
User avatar
TobyLobster
Posts: 618
Joined: Sat Aug 31, 2019 7:58 am
Contact:

Re: Pitfall

Post by TobyLobster »

Maybe something can be done by redefining the palette?

For example if logical colours 8 and 9 (flashing colours by default) are defined as black and green and these are used to draw the trees, then when the (say logical colour 7) rope is drawn on top then the trees become logical colours 8 EOR 7=15 and 9 EOR 7=14. So by also redefining colours 15 and 14 as black and green the change should become invisible.
User avatar
fizgog
Posts: 618
Joined: Thu Jun 17, 2021 3:18 pm
Location: Nottinghamshire
Contact:

Re: Pitfall

Post by fizgog »

TobyLobster wrote: Mon Nov 28, 2022 11:21 pm Maybe something can be done by redefining the palette?

For example if logical colours 8 and 9 (flashing colours by default) are defined as black and green and these are used to draw the trees, then when the (say logical colour 7) rope is drawn on top then the trees become logical colours 8 EOR 7=15 and 9 EOR 7=14. So by also redefining colours 15 and 14 as black and green the change should become invisible.
Thanks for that

I made a change late last night to handle the tree colour palette and also recoded the vine data to give it a longer swing from start of pond to end of pond to match the 2600 version, giving the below result

Screenshot 2022-11-29 at 10.33.50.png

https://www.youtube.com/watch?v=mCcdFq1yAMQ
Pitfall, Gridrunner, Matrix: Gridrunner 2, LaserZone, AcornViewer, AcornPad
Post Reply

Return to “new projects in development: games”