Pitfall

developing/porting a new game or gaming framework? post in here!
User avatar
fizgog
Posts: 618
Joined: Thu Jun 17, 2021 3:18 pm
Location: Nottinghamshire
Contact:

Re: Pitfall

Post by fizgog »

TobyLobster wrote: Tue Jan 10, 2023 2:28 pm
fizgog wrote: Tue Jan 10, 2023 2:24 pm https://youtu.be/nJcy2ZQlWBU
'Video is private'
Whoops - should be fixed
Pitfall, Gridrunner, Matrix: Gridrunner 2, LaserZone, AcornViewer, AcornPad
User avatar
tricky
Posts: 7713
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Pitfall

Post by tricky »

There are several fast line drawing routines including one of mine, I think Kieran posted a nice test program where you could switch between them. Spoiler, mine was only fastest about 10% of the time.
User avatar
fizgog
Posts: 618
Joined: Thu Jun 17, 2021 3:18 pm
Location: Nottinghamshire
Contact:

Re: Pitfall

Post by fizgog »

tricky wrote: Tue Jan 10, 2023 6:22 pm There are several fast line drawing routines including one of mine, I think Kieran posted a nice test program where you could switch between them. Spoiler, mine was only fastest about 10% of the time.

Thanks, I couldn’t find the test program but a quick search brought up the following, so I’ve got a bit of reading to do…
kieranhj wrote: Tue Feb 28, 2017 10:18 am
tricky wrote:So, does anyone have a fast line drawing routine for the beeb before I go off to write another?
The proof of concept is in mode 0, but mode 4 is probably more practical.
Actually we do, although not technically ours. Simon.M spent some time making the crazy fast 3D stuff we discovered compatible with BeebAsm for easy re-use. https://github.com/simondotm/bbc-micro-3d/. I believe there is a fully unrolled MODE 4 line draw in there somewhere.
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 »

Nope, that seems to be using a back buffer to handle the line code hence using 10k modes 4 and 5
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 »

Further optimisations

Line drawing now only checks for down and left and down and right, also delta y is always greater than delta x

Plots line backwards from y2 to y1 and stops just above the leaves as there was no point plotting the pixels hidden by the trees

Still more code tweaks to go, such as remove get screen address on every plot pixel call as I'm sure I could inc or dec the screen address?

Screenshot 2023-01-11 at 08.26.43.png

Video test is here
https://youtu.be/Nik-AQ2XZDI
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 jumping on and off the custom line drawn vine

There is still a slight flicker and so more optimisation is needed

Also player doesn't always catch the rope, so the logic needs looking at again

Picture showing most of the objects and background removed

Screenshot 2023-01-12 at 16.28.13.png

Latest video
https://youtu.be/xB5Krr0ksk4
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 »

Alpha version 0.004

Last night added the following

Further optimisation on vine - still needs more though
Added jumping on and off of vine
Fixed vine collection detection

Added sinking into swamp
Added jumping onto crocodiles

NB doesn't test for sinking into quicksand yet

Screenshot 2023-01-13 at 12.01.44.png
Pitfall-0.004.ssd
(31.25 KiB) Downloaded 50 times
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 »

Nothing to see or play, but I've just added player sinking into quicksand

Also the game now relocates down to &0200 to give me more memory to play with, but it's currently crashing when you lose your 3 lives and the game starts again.

NB I don't think I'll go down to &0000 like other do though
Pitfall, Gridrunner, Matrix: Gridrunner 2, LaserZone, AcornViewer, AcornPad
User avatar
kieranhj
Posts: 1104
Joined: Sat Sep 19, 2015 11:11 pm
Location: Farnham, Surrey, UK
Contact:

Re: Pitfall

Post by kieranhj »

fizgog wrote: Sat Jan 14, 2023 10:12 pm Nothing to see or play, but I've just added player sinking into quicksand

Also the game now relocates down to &0200 to give me more memory to play with, but it's currently crashing when you lose your 3 lives and the game starts again.

NB I don't think I'll go down to &0000 like other do though
&0200 is the OS Vectors so unless you’ve completely disabled/bypassed the MOS you’re probably safer starting at &0400 upwards. (&0300 is VDU workspace.)

Edit: PS. Great progress! Looking forward to trying a build one of these days.
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 »

Thanks, I'll probably do another alpha release in the week

I've just fixed the game crash, after losing 3 lives and restarting the game
kieranhj wrote: Sat Jan 14, 2023 10:29 pm &0200 is the OS Vectors so unless you’ve completely disabled/bypassed the MOS you’re probably safer starting at &0400 upwards. (&0300 is VDU workspace.)
Yes I'm no longer using the MOS for the game, was only ever using it for the rope and altering the swamp colour, but I'm doing that myself now.

I'm skipping the first 4 bytes, then putting in my IRQ handler at &0204 / &0205, then the main code is at &0206 onwards.

NB I will need to do some research on generating sound effects without the MOS though.
Pitfall, Gridrunner, Matrix: Gridrunner 2, LaserZone, AcornViewer, AcornPad
User avatar
tricky
Posts: 7713
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Pitfall

Post by tricky »

I build the vectors into my image, which I decompress with interrupts disabled.

I can try to tidy my vgm converter if you wanted to see what it does to sounds recorded on the beeb. I think at least one of the emulators will export a .vgm of the sound.

I might do a video of using it as it is written for my weird brain ;)
Last edited by tricky on Tue Jan 24, 2023 6:57 pm, edited 1 time in total.
User avatar
fizgog
Posts: 618
Joined: Thu Jun 17, 2021 3:18 pm
Location: Nottinghamshire
Contact:

Re: Pitfall

Post by fizgog »

tricky wrote: Sun Jan 15, 2023 10:44 am I build the vectors into my image, which I decompress with interrupts disabled.

I can try to tidy my vgm converter if you wanted to see what it does to sounds betrayed on the beeb. I think at least one of the emulators will export a .vgm of the sound.

I might do a video of using it as it is written for my weird brain ;)
Yes please to everything :D

I did find the following site with a bit of the sound chip info on, but have not read it yet

https://www.chibiakumas.com/
Pitfall, Gridrunner, Matrix: Gridrunner 2, LaserZone, AcornViewer, AcornPad
User avatar
tricky
Posts: 7713
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Pitfall

Post by tricky »

This has the best info for the sn76489 and even has a bit on the differences in the different versions of the sn76489.

https://www.smspower.org/Development/SN76489

The only one that matters for most coders is that on the SMS, period 0 is DC which is great for playing samples, but on the beeb it is effectively &400, which is the lowest frequency.

For chip tune people, the white noise is "in tune" with the sound channel when it is being controlled by the sound frequency but on the beeb, it isn't!
User avatar
Cybershark
Posts: 741
Joined: Wed Jun 14, 2006 11:16 pm
Contact:

Re: Pitfall

Post by Cybershark »

Ooooh! This one's not smelling too far off being cooked now \:D/
User avatar
fizgog
Posts: 618
Joined: Thu Jun 17, 2021 3:18 pm
Location: Nottinghamshire
Contact:

Re: Pitfall

Post by fizgog »

Alpha version 0.005

Pitfall-0.005.ssd
(31.75 KiB) Downloaded 38 times

Tonights build includes the following

No longer using Acorn MOS
Program now relocates to &200
Added player sinking into quicksand
Added collection of treasures
Added treasure score increase
Fixed - bug where static objects where constantly being erased and redrawn
Fixed - game restart crash when losing all 3 lives
Fixed - stopped vine being added to all crocs screen rather than just certain ones
Removed VideoNuLA support as it seems to be broken when running it on a standard beeb (seems to set all colours to magenta and white)

Still to do in no particular order

Sound Effects
Fix VideoNuLA support
Lose score when being hit by a rolling log, and forcing Harry to kneel
Game over screen ?
Game completion screen ?
Finish loader
Add joystick support
Fix quicksand timings ?
Further optimisations to reduce flicker on the vine screens
+ anything else I've forgotten
Pitfall, Gridrunner, Matrix: Gridrunner 2, LaserZone, AcornViewer, AcornPad
User avatar
lovebug
Posts: 1759
Joined: Sun Jan 31, 2021 5:07 pm
Location: Magrathea
Contact:

Re: Pitfall

Post by lovebug »

coming along nicely =D> =D> =D> =D> =D>
Image Image Image Image
User avatar
ChrisB
Posts: 551
Joined: Wed Oct 05, 2011 10:37 pm
Location: Surrey
Contact:

Re: Pitfall

Post by ChrisB »

Yes indeed. Starting to play very well. =D>
fizgog wrote: Wed Jan 18, 2023 9:59 pm + anything else I've forgotten
Why is this list always longer than the todo list ;)
Castle Defender, Untitled Dungeon Game, Night Ninja, Wordle, Waffle, Acorn Island, Beebchase, Ghostbusters
User avatar
fizgog
Posts: 618
Joined: Thu Jun 17, 2021 3:18 pm
Location: Nottinghamshire
Contact:

Re: Pitfall

Post by fizgog »

lovebug wrote: Wed Jan 18, 2023 10:38 pm coming along nicely =D> =D> =D> =D> =D>
ChrisB wrote: Thu Jan 19, 2023 7:45 am Yes indeed. Starting to play very well. =D>
fizgog wrote: Wed Jan 18, 2023 9:59 pm + anything else I've forgotten
Why is this list always longer than the todo list ;)
Thanks, it's much appreciated.


I'm still plodding away, but not had much spare time to work on it. I did however manage to add being hit by rolling and static logs and losing points

Screenshot 2023-01-23 at 18.34.17.png

Also been trying to read about SN76489 sound chip but it's not sinking in yet, eventually it will I hope.
Pitfall, Gridrunner, Matrix: Gridrunner 2, LaserZone, AcornViewer, AcornPad
User avatar
ChrisB
Posts: 551
Joined: Wed Oct 05, 2011 10:37 pm
Location: Surrey
Contact:

Re: Pitfall

Post by ChrisB »

Regarding the sound (and apologies if this is teaching grandmothers...) I have taken quite a lot of "inspiration" from Lovebug's ladybug here : https://github.com/LoveBug2084/LadyBug/ ... adybug.asm

Basically you need to keep track of a 10 bit frequency and a volume and send them to the chip when they change. How you calculate them is up to you. FYI as far as I know these are the 10 bit frequency values for the bottom octave that the Beeb can produce - Divide by two for each octave up.

Code: Select all

B	%1111110011
C	%1110111011
C#	%1110000101
D	%1101010010
D#	%1100100011
E	%1011110101
F	%1011001011
F#	%1010100011
G	%1001111101
G#	%1001011001
A	%1000110111
A#	%1000010111
Castle Defender, Untitled Dungeon Game, Night Ninja, Wordle, Waffle, Acorn Island, Beebchase, Ghostbusters
User avatar
tricky
Posts: 7713
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Pitfall

Post by tricky »

Don't get too hung up on the latching, of you are sending both bytes, you'll be fine.
When you set the noise channel's frequency, it resets its counter, which means if you do it every frame, you get a 50hz clucky humb.
User avatar
lovebug
Posts: 1759
Joined: Sun Jan 31, 2021 5:07 pm
Location: Magrathea
Contact:

Re: Pitfall

Post by lovebug »

you could encode your music table as 5 bits for 32 notes (2.6 octaves) and 3 bits for duration, 2nd byte for 4 bits volume and some other control bits for loop, end etc

in ladybug soundtables.asm are just raw register data and duration which is kind of wasteful
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 »

Thanks all, there’s much to ponder on with the sound.

Nothing to see but I managed to find a bit of time to remove the leading zeros from the score apart from the last one if your score is 0

Next alpha release might be a while as I’d like to get the sound working
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 »

Alpha version 0.006

Pitfall-0.006.ssd
(33.5 KiB) Downloaded 46 times

This build includes the sounds effects for jumping, swinging, falling and dying

Next on the list is to look at reducing the flickering and a clean reset

NB Seems to be a bug collecting treasure as it makes you lose a life, so this also needs looking at
Pitfall, Gridrunner, Matrix: Gridrunner 2, LaserZone, AcornViewer, AcornPad
User avatar
Cybershark
Posts: 741
Joined: Wed Jun 14, 2006 11:16 pm
Contact:

Re: Pitfall

Post by Cybershark »

Amazing what a difference the SFX make to it! Or perhaps it's just that the advancements have now accumulated to such a point that this is now barely distinguishable from a completed product. The deadly treasure is certainly something of a drawback though :lol:
User avatar
fizgog
Posts: 618
Joined: Thu Jun 17, 2021 3:18 pm
Location: Nottinghamshire
Contact:

Re: Pitfall

Post by fizgog »

Cybershark wrote: Sun Feb 05, 2023 9:20 pm Amazing what a difference the SFX make to it! Or perhaps it's just that the advancements have now accumulated to such a point that this is now barely distinguishable from a completed product. The deadly treasure is certainly something of a drawback though :lol:
Thanks and yes the sound does seem to make a big difference, I can’t believe I started on this last June, although I did lose some time before xmas due to work and life.

Currently trying to track down the treasure bug at the moment.
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 »

Alpha version 0.007

Pitfall-0.007.ssd
(33.5 KiB) Downloaded 53 times

This build fixes the treasure collecting bug were it killed you for collecting the treasure and played the dying sound effect
treasure sound effect is now played and lets you carry on.

Need to look at code optimisation and flicker next, so might be a while.
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 »

Started looking at the flickering last night, so I switched to using a timer to trigger the vsync flag which now triggers at the bottom of the play area - row 28

Using the following formula which I hope is correct for row 28

Code: Select all

;Timer1Value = (39-35) * 8 * 64   ; total rows - vsync row * 8 * 64 (Fixed)
;            - 2*64               ; latch * 64 (Fixed)
;            + 28*8*64            ; row * 8 * 64 (Can be changed)

Timer1Value = (39-34) * 8 * 64 - (2 * 64) + (28 * 8 * 64)

NB Magenta is objects being erased, blue is objects being drawn

Screenshot 2023-02-07 at 08.36.18.png

This has reduced the flickering a bit, so next I need to look at optimising the code

*Edit this is a couple of shots without the base layer showing worse cases. (seems one of the drawing frames in the 2nd pic is getting hammered)

Screenshot 2023-02-07 at 09.01.18.png
Screenshot 2023-02-07 at 09.01.41.png
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 get a bit done in my dinner hour

Alpha version 0.008
Pitfall-0.008.ssd
(35.5 KiB) Downloaded 50 times

This build adds the following: -

Uses timer1 for handling vsync - reduces flickering a bit - still need to look at optimising the code.
Added collision sound effect when being hit by the logs
Added frontend instructions / manual (pressing escape jumps to the controls section)

Shift Break to load

Screenshot 2023-02-07 at 14.04.18.png
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 »

Alpha version 0.009

This build adds the following : -

Further optimisation on the swinging vine - Thanks go to ChrisB for some coding advice
Changed instructions heading title from green to yellow as there was too much green showing on the screen

Pitfall-0.009.ssd
(35.5 KiB) Downloaded 40 times

Let me know if you experience any bugs / glitches in this version

I need to look at optimising the sprite routines next
Pitfall, Gridrunner, Matrix: Gridrunner 2, LaserZone, AcornViewer, AcornPad
Post Reply

Return to “new projects in development: games”