Polymer Picker (formal release)

developing/porting a new game or gaming framework? post in here!
User avatar
sa_scott
Posts: 420
Joined: Wed Feb 09, 2011 11:34 pm
Location: Witley, Surrey, UK
Contact:

Re: New game in development - Polymer Picker

Post by sa_scott »

I've attached v0.04, as I've managed to scrape together some further time on this.

Firstly, some screen grabs of what's changed:
night.png
dawn.png
day.png
This is the first version which adds the boat graphic. Hover under the boat to replenish your air supply. The shark can still get you however, so it's not completely safe.
The fish sprites have been redefined to use two of the MODE 2 flashing colours. This allows for some palette switching, so I can have more interesting looking fish, while retaining the same sprite.
You now have a 'score', in the form of currency. The idea being that earning cash is a more likely plot point for such a game.
I did at one point, have a high score table, lifted from one of Gordon Key's type in listings, as it was quite modular in nature. However, I hit memory issues quite early on, so had to drop that. I've also converted further MOVEs and PLOTs into VDU codes, to compress the code further as much as possible.
I'm not too happy with the shark behaviour, so I may have to have several on screen, moving in various directions, so you have to use good timing to avoid them. The homing behaviour relies on a single point, and working out whether the shark is touching you, is something I haven't worked out yet.

One thing with the fish dying - I did add single colour red/dead sprites to swap over with, but (whether it was the addition of high score or not), I ran out of room. This made me wonder - is there any way the sprite routine can be modifed to plot a 'dead' sprite with a single colour, somewhat like a 'mask' effect? This is probably a more efficient way of doing things, rather than add 2 more sprites. I'm open to ideas, but my assembler knowledge remains less than zero :(

I've not updated the Github repos with this version as yet, as - once again - I'm pushed for time. But any feedback is welcome, I think I need it, just to keep going!
Attachments
polymer-picker-assembly-v0-04.zip
Polymer Picker assembly version v0.04
(7.61 KiB) Downloaded 50 times
--
Stephen Scott, Digital Media Muckerupper
Games: Androidz Redux, Headcase Hotel, Polymer Picker
www.sassquad.net
User avatar
ChrisB
Posts: 548
Joined: Wed Oct 05, 2011 10:37 pm
Location: Surrey
Contact:

Re: New game in development - Polymer Picker

Post by ChrisB »

Well done - that's coming along nicely.

A BASIC Crunch routine will save you about 800 bytes - and probably make the game slightly faster - but it becomes a process to have a main copy that is crunched before delivery.

I think the air supply should gradually refill rather than just topping up - making you wait/waste time. Also the penalty for going faster should be higher as I didn't find myself running out of air and just held down return most of the time.
Castle Defender, Untitled Dungeon Game, Night Ninja, Wordle, Waffle, Acorn Island, Beebchase, Ghostbusters
User avatar
sa_scott
Posts: 420
Joined: Wed Feb 09, 2011 11:34 pm
Location: Witley, Surrey, UK
Contact:

Re: New game in development - Polymer Picker

Post by sa_scott »

ChrisB wrote: Fri Jun 24, 2022 6:19 pm Well done - that's coming along nicely.

A BASIC Crunch routine will save you about 800 bytes - and probably make the game slightly faster - but it becomes a process to have a main copy that is crunched before delivery.

I think the air supply should gradually refill rather than just topping up - making you wait/waste time. Also the penalty for going faster should be higher as I didn't find myself running out of air and just held down return most of the time.
Many thanks Chris.

I was actually having a look at the air supply going down faster if the shark gets you, but I agree, the air supply doesn't go down fast enough. Admittedly, the game is too easy at the moment.

I've attached v0.05 to this reply (I've also updated the Github to include this version). In this edition, the one time refill only applies when your air is below 50%. This was partly to stop the air supply from being replenished immediately upon starting the game, due to the start position! There's some further cleanup of the instructions, and I've blanked the screen out while it draws everything, other than a Get Ready message. When the game ends, you are prompted to press Space to play. The earlier version crashed with an error when it was game over, which I've corrected. I've also cleaned up the sea flora rendering, the random nature looked a bit lousy at times.

I've removed a few extra THENs as well, to shave some bytes. The code is becoming ever more dense, it's gonna be a nightmare to decipher on Github. Adding the cruncher as part of the build would be great, but I should focus on improving the gameplay:

- the shark paints poorly when you move slowly to the right while it's on top of you, and alternates between left and right directions, causing lots of display artifacting. The collision detection for the shark is really poor.
- the shark should deplete your oxygen a lot more than currently.
- one idea I've had as a level. Dispensing of fishing nets - collect the 4 corners of the net's 'anchors', with some creature trapped behind it. The way I thought of doing this was rendering the net using 4 flashing colours, switched to black. As each 'anchor' is collected, that corner is switched to blue, removing it. The creature itself, I was thinking of *LOADing a graphic to a specific area of screen memory, the creature would then display a heart when it is free. Something like that.
- I still want to add either a pufferfish, or some other hazards to the game to make collecting more difficult. The idea of strong currents is a tempting one. Need to balance this with memory limits however.
- Earning a cash bonus, based on whether you collect all the items; how much oxygen is left at the end etc. I like the way the Professor McBrolly game adds the remaining time to your score, using a ticker sound. There's also how Moon Patrol adds to your score, based on how much oxygen is left. Could you also get a bonus for picking up a polymer filled fish, as that reduces pollution? :idea:
- if you are near the left of the screen, and swim fast, you may suddenly jump to another point on the screen, because your X position has managed to go beyond the left edge. I don't think this happens on the right hand side however.
- Sounds and music are still needed.
v0-05.png
I can't promise I'll be able to do more versions - I'm frankly amazed I managed 2 in the space of a few days. It's clear that the longer I spend away from it, the longer it takes me to figure out my own code 8-[
Attachments
polymer-picker-assembly-v0-05.zip
Polymer Picker Assembly version 0.05
(7.78 KiB) Downloaded 48 times
--
Stephen Scott, Digital Media Muckerupper
Games: Androidz Redux, Headcase Hotel, Polymer Picker
www.sassquad.net
User avatar
sa_scott
Posts: 420
Joined: Wed Feb 09, 2011 11:34 pm
Location: Witley, Surrey, UK
Contact:

Re: New game in development - Polymer Picker

Post by sa_scott »

Hi all, another update:

Since the disc image is available on Github, the game can be played online. This makes playing the latest development version a bit easier than unzipping disc images.

[text deleted]
--
Stephen Scott, Digital Media Muckerupper
Games: Androidz Redux, Headcase Hotel, Polymer Picker
www.sassquad.net
User avatar
sa_scott
Posts: 420
Joined: Wed Feb 09, 2011 11:34 pm
Location: Witley, Surrey, UK
Contact:

Re: New game in development - Polymer Picker

Post by sa_scott »

I've attached v0.06 (also available from Github). You can play online via emulation here

I've managed to spend more time than usual these last few days. This was kickstarted by a casual playtest last week, whereupon I discovered that 2 items of rubbish were displayed in exactly the same location. Due to the EOR plot method, this resulted in 2 'missing' items of rubbish, and having no idea where to find them :oops:

My last message had a plea for assistance regarding item randomisation, which I've since deleted. I needed some lateral thinking, which has resulted in the x position of each item being part of a loop. This ensures that the rubbish is spread across the screen, eliminating the possibility of 2 items appearing in such a fashion.

I've now added a dead fish sprite, and in doing so, have changed the colour of the rubbish to white, so as to be able to differentiate the collectibles from the red dead fishes.

One fairly important change concerns the airbar. As was mentioned by another thread contributor, it was rather too easy to collect the items by just swimming faster. The airbar therefore reduces more drastically than before. I've done it in a way which still allows the faster breathing to occur; earlier attempts at this had the breathing sound playing almost on top of itself, which sounded awful.

With the somewhat improved collision detection between diver and shark, the revised air reduction makes the game somewhat more challenging. Depending on where the collectibles are distributed, a visit to your boat to replenish your air is more likely now.

I've now added extra keys for turning the sound on and off, and for pausing and unpausing the game. Some more code crunching has been performed, which was unintentional. I had feared the extra sprites were touching at the edge of the codespace, until I realised that the sprite space assembly language needed amending to include the extra space needed for the dead fish sprites. As a result, the main code relocates to PAGE &E00 now. On the plus side, I have all the spare space possible to add extra features ... if indeed, such space allows :shock:

I think the shark is less likely to artifact now when it's on top of you - earlier versions had it displaying left and right in quick succession, causing a lot of display tearing. I'm hopeful this particular bug is gone now.

All in all, I'm a lot happier with the game fundamentals now. I'm now in a position to start thinking about what else to add to improve the gameplay. As always, any feedback is most welcome.
Attachments
polymer-picker-assembly-v0-06.zip
Polymer Picker v0.06
(6.34 KiB) Downloaded 49 times
--
Stephen Scott, Digital Media Muckerupper
Games: Androidz Redux, Headcase Hotel, Polymer Picker
www.sassquad.net
User avatar
sa_scott
Posts: 420
Joined: Wed Feb 09, 2011 11:34 pm
Location: Witley, Surrey, UK
Contact:

Re: New game in development - Polymer Picker

Post by sa_scott »

v0.08 is attached below. The Github repo has also been updated.

Again, it's been too long since the last update, and it may be a few weeks yet before I can come back to this. However...
  • I've added a loading screen, thanks to Photoshop, and the power of Dithertron. The eagle eyed may have noticed me add this to a recent thread. I loved doing this, as I had a few hours to kill, which is the perfect amount of time to perform some dodgy photo compositing (since the 8-bit dithering is very handy at hiding the bodgework!)
  • I've tried refining some of the code concerning checks. However, I can't remember how to get the colour checking working. Specifically, the pink coral needs to hurt you. At the moment, the sea grass and coral hurts you. I need to find the correct 2 pixel combination for the magenta colour (I can't recall who helped me on this in an earlier version, I'll amend this message when I get the chance).
  • if at all possible, I would like the fish to hurt you as well. I'm not sure which routine is best placed to do this, whether I should perform a bounding box check, or whether checking the fish's 2 colours is good enough.
  • I have toyed with having both the fish and the shark on screen. If both fish and shark can hurt you, the game gets hideously hard. I may have to add a gradual progression in difficulty, using various flags in level data statements to switch on and off various elements to ramp up the difficulty. Perhaps have less rubbish to collect, to begin with, or less fish, just to ease players in gradually. Perhaps also have the shark move in a more restrained manner, moving along a horizontal plane to begin with. Later levels could have more than one shark, moving back and forth.
This is a bit of a brain dump, this version. Time has become an even bigger enemy than when I first started this project, I may have to cut short my ambition, just to get this out in some form or other!

If anyone can assist with the colour checks, as always, I would be most grateful. I'm holidaying in Cornwall next week, I may get some inspiration from seeing the sea (although if I see any sewage, it will more than sharks you have to avoid in the game!). In any case, I'll lurk on the forums and await any feedback you may have.

Thanks again for trying out the game :D
Attachments
polymer-picker-assembly-v0-08.zip
Polymer Picker assembly version v0.08
(22.05 KiB) Downloaded 44 times
--
Stephen Scott, Digital Media Muckerupper
Games: Androidz Redux, Headcase Hotel, Polymer Picker
www.sassquad.net
User avatar
sa_scott
Posts: 420
Joined: Wed Feb 09, 2011 11:34 pm
Location: Witley, Surrey, UK
Contact:

Re: New game in development - Polymer Picker

Post by sa_scott »

v0.09 attached below. Github not updated as yet,

Sorry, but just the 1 update:
  • For the time being, the fish can actually hurt you. I'm using the same routine used for the shark detection, but with the fish, it checks each fish in turn to see if it's within your hit box. If you play it, you'll notice that you fo eventually bleed, but the BASIC is doing more heavy lifting than it should. I've also noticed that all of the sea greenery at the bottom of the screen hurts you as well, instead of just the pink coral, which is incorrect. The color point detection is clearly wrong.
I've only been able to look at this during the last week, I spent much of the time pondering over my code, as I'm easily forgetting how I've put the game together :cry: My day job has picked up massively in the last month, after a long time of what I would consider to have been a fallow period.

The fish hurting is only something I want to introduce to later levels, along with varied sea currents, and some diver momentum. Given the speed at which the fish position detection is going, it's clear I'm veering into territory better dealt with by assembler. If only I knew what I was doing!

Anyway, have a go with it, and see if I've bitten off more than I can chew, unlike the shark :D
Attachments
polymer-picker-assembly-v0-09.zip
Polymer Picker assembly version 0.09
(22.08 KiB) Downloaded 43 times
--
Stephen Scott, Digital Media Muckerupper
Games: Androidz Redux, Headcase Hotel, Polymer Picker
www.sassquad.net
User avatar
sa_scott
Posts: 420
Joined: Wed Feb 09, 2011 11:34 pm
Location: Witley, Surrey, UK
Contact:

Re: New game in development - Polymer Picker

Post by sa_scott »

v0.10 attached to this message, the download link is below.

I've also updated the Github repo with this version (https://github.com/sassquad/polymer-picker-6502)

Here are some details of the updates, but I'm having to paste this in haste, as it's late :(
  • Improved/tweaked collision detection - I won't stick my neck out and say it's perfect, but it's moved on from what it was. Having played it again, it probably needs another pair of eyes to check it's working as intended.
  • Some overhaul of the game code, to reduce memory wastage. There's still more to do, but less than before.
  • An oxygen tank appears under boat, when your air reaches 50%. It was necessary to add some kind of visual cue to suggest you can get more air, otherwise the boat sits there without any purpose.
  • Bonus cash is given for each surviving fish when you've collected the rubbish.
  • The oxygen level doesn't go down quite as quickly as before. However, you can still get caught out if you swim too fast too often.
  • A heart graphic appears over each living fish as a 'thank you'
  • That said, the fish begin to hurt you a little after level 4. These fish are cold hearted!
  • After level 8, both the hurtful fish and the shark appear onscreen together. This will be maddening


I just checked the build, and the OH BOY! message that displays before each level was intended for later harder levels. I've also left in a REM on the error routine, so pressing Escape will break out of the game.

As I tweeted earlier today, the #BBC100 hashtag started being used in earnest today on Twitter and other social media, with the start of the BBC's centenary event. I am therefore aiming to get the game released in the coming weeks, to ride the crest of a wave that won't come again in our lifetime.

If anyone hasn't tried out the game, please do! I realise this thread is nearly a year old, and progress at times has been a miserable affair. I'm hopeful that I've ironed out most of the bugs, but appreciate that the game mechanics are not quite there, and the lack of decent sound remains a bugbear.

I'll have to sign off for now, but fingers crossed, I can give more frequent updates in the coming weeks.
Attachments
polymer-picker-assembly-v0-10.zip
Polymer Picker Assembly/Basic version v0.10
(21.55 KiB) Downloaded 37 times
--
Stephen Scott, Digital Media Muckerupper
Games: Androidz Redux, Headcase Hotel, Polymer Picker
www.sassquad.net
User avatar
ChrisB
Posts: 548
Joined: Wed Oct 05, 2011 10:37 pm
Location: Surrey
Contact:

Re: New game in development - Polymer Picker

Post by ChrisB »

You seem to have left some debug code in there.... (Line 112).
However - this is coming together well. To my mind being hurt doesn't seem to matter very much. I wrapped the levels without much effort. Also the message at the point of wrap wasn't displayed as I had return held down ;)
Castle Defender, Untitled Dungeon Game, Night Ninja, Wordle, Waffle, Acorn Island, Beebchase, Ghostbusters
User avatar
sa_scott
Posts: 420
Joined: Wed Feb 09, 2011 11:34 pm
Location: Witley, Surrey, UK
Contact:

Re: New game in development - Polymer Picker

Post by sa_scott »

ChrisB wrote: Wed Oct 19, 2022 8:04 am You seem to have left some debug code in there.... (Line 112).
However - this is coming together well. To my mind being hurt doesn't seem to matter very much. I wrapped the levels without much effort. Also the message at the point of wrap wasn't displayed as I had return held down ;)
Thanks for the vote of confidence :D

VS Code is reporting line numbers differently for me. Line 112 is stating this:

Code: Select all

VDU4,17,7,31,6,0:PRINT"$"STRING$(6-LENSTR$S%,"0");S%;:VDU5:ENDPROC
That would be the score printing. I may therefore need an idea of what you're seeing.

As for finishing the game, that means I am crap at playing it. Some of the rubbish goes rather deep, and I have my habit of pressing Return all the time. I'm an impatient swimmer clearly.

I wasn't sure about your last point, about the point of wrap message. Was this at the point the hearts appear, then the message 'NICE!' appears at the top? Did none of that happen when Return was pressed? ](*,)
--
Stephen Scott, Digital Media Muckerupper
Games: Androidz Redux, Headcase Hotel, Polymer Picker
www.sassquad.net
User avatar
ChrisB
Posts: 548
Joined: Wed Oct 05, 2011 10:37 pm
Location: Surrey
Contact:

Re: New game in development - Polymer Picker

Post by ChrisB »

Hmm. Looks like I may hae corrupted BASIC's workspace with my game...

This is what I saw - but not after a fresh "reset"... :oops:
ppicker.png
Castle Defender, Untitled Dungeon Game, Night Ninja, Wordle, Waffle, Acorn Island, Beebchase, Ghostbusters
User avatar
sa_scott
Posts: 420
Joined: Wed Feb 09, 2011 11:34 pm
Location: Witley, Surrey, UK
Contact:

Re: New game in development - Polymer Picker

Post by sa_scott »

ChrisB wrote: Wed Oct 19, 2022 5:46 pm Hmm. Looks like I may hae corrupted BASIC's workspace with my game...

This is what I saw - but not after a fresh "reset"... :oops:
ppicker.png
oohnasty.jpg
Looks like you've accidentally patched in to the state of the UK's finances there... so many zeros :wink:
--
Stephen Scott, Digital Media Muckerupper
Games: Androidz Redux, Headcase Hotel, Polymer Picker
www.sassquad.net
User avatar
sa_scott
Posts: 420
Joined: Wed Feb 09, 2011 11:34 pm
Location: Witley, Surrey, UK
Contact:

Re: New game in development - Polymer Picker

Post by sa_scott »

v0.11 attached to this message, the download link is below.

I've also updated the Github repo with this version (https://github.com/sassquad/polymer-picker-6502)

Here are some details of the updates, but I'm having to paste this in haste, as it's late :(
  • Re-inserted error reporting function
  • Tidied up VS task
  • Added more onscreen instructions.
  • Shortened procedure names
  • Fixed onscreen messages when starting levels.


Basically, a bit more of a clean up of v0.10.

I do want to add the ability to add redefined keys. I've noticed that the following games on the BBC Micro games archive have this ability:
These two examples have the redefine routine written in their BASIC loader code. However, the actual key controls - and how they are intercepted - are hidden in machine code. So I don't know how I would be able to harness this with my game. Would it be a case of using INKEY(?&70) where the address points to the INKEY value captured earlier?

Additionally, I would not want keys such as S/Q, Pause and unpause to be amended, so these would need to be excluded.

Some pointers on this would be awesome.

I'm still averse to sorting out sound and music - these remain extremely frustrating to do. I've not bookmarked responses to this, but can anyone point me to a way of either creating these sounds online, or finding a way of converting tunes to 8 bit beeb versions?

Can anyone also double check that the collision routines are working as intended? I'm not sure if it is good enough, or is too slow in the case of when the fish start to be hurtful from level 5 onwards.

A lot of questions, but in the meantime, onward :D
Attachments
polymer-picker-assembly-v0-11.zip
Polymer Picker Assembler/Basic edition v0.11
(21.75 KiB) Downloaded 34 times
--
Stephen Scott, Digital Media Muckerupper
Games: Androidz Redux, Headcase Hotel, Polymer Picker
www.sassquad.net
User avatar
ChrisB
Posts: 548
Joined: Wed Oct 05, 2011 10:37 pm
Location: Surrey
Contact:

Re: New game in development - Polymer Picker

Post by ChrisB »

Ladybug uses direct hardware access to determine if the keys it is interested in are being pressed. When I did Night Ninja I looked at that code for "inspiration"... :) When I came to redefine the keys I used OSBYTE &AC to scan the keyboard along with a couple of INKEYs for SHIFT and CTRL and just excluded keys that were either in the key list - or were "reserved".

Code: Select all

K%=-1
IF INKEY(-1) THEN K%=0
IF INKEY(-2) THEN K%=1
A%=121:X%=0:Y%=0
IF K%=-1 THEN K%=(USR(&FFF4)DIV256)AND255
You will need to convert these internal key numbers to inkey values (EOR &FF) then substitute the calues you check against with these.
Castle Defender, Untitled Dungeon Game, Night Ninja, Wordle, Waffle, Acorn Island, Beebchase, Ghostbusters
User avatar
sa_scott
Posts: 420
Joined: Wed Feb 09, 2011 11:34 pm
Location: Witley, Surrey, UK
Contact:

Re: New game in development - Polymer Picker

Post by sa_scott »

ChrisB wrote: Thu Oct 20, 2022 5:57 pm Ladybug uses direct hardware access to determine if the keys it is interested in are being pressed. When I did Night Ninja I looked at that code for "inspiration"... :) When I came to redefine the keys I used OSBYTE &AC to scan the keyboard along with a couple of INKEYs for SHIFT and CTRL and just excluded keys that were either in the key list - or were "reserved".

Code: Select all

K%=-1
IF INKEY(-1) THEN K%=0
IF INKEY(-2) THEN K%=1
A%=121:X%=0:Y%=0
IF K%=-1 THEN K%=(USR(&FFF4)DIV256)AND255
You will need to convert these internal key numbers to inkey values (EOR &FF) then substitute the calues you check against with these.
Thanks for the 'input' Chris. I've read this several times, and it's still
jurassic-park-flew-overmy-head.gif
jurassic-park-flew-overmy-head.gif (2.52 MiB) Viewed 3497 times
That said, I had forgotten that Night Ninja had redefinable keys (The BBC Archive should include a filter for games with redefinable keys, IMHO!)

I had noticed that the BBC BASIC code for yours and the other games mentioned have similar routines in determining the keys. But it was more about how to re-interpret those keys. That's the part I'm stuck on:

Taking my code, would I need to do something like the following?

Code: Select all

IFINKEY(?&70)ANDDX%<67:DX%=DX%+DF%:DZ%=1
IFINKEY(?&70?2)ANDDX%>1:DX%=DX%-DF%:DZ%=0
...
I guess I can (ahem) lift the key detection code from Night Ninja and crib accordingly?

Beginning to wonder if the Stardot Github should have a series of gists, of suggested approaches, or 'best practices' in adding such functionality to game projects? Sprite routines, key detection etc? Perhaps have live examples connecting to bbcmic.ro?

Anyway, my mind is wandering off again!
--
Stephen Scott, Digital Media Muckerupper
Games: Androidz Redux, Headcase Hotel, Polymer Picker
www.sassquad.net
User avatar
TobyLobster
Posts: 618
Joined: Sat Aug 31, 2019 7:58 am
Contact:

Re: New game in development - Polymer Picker

Post by TobyLobster »

When you write "?&70" you get a number 0-255. But to test for a specific key using INKEY you need a negative number. e.g.

PRINT INKEY(-98)

So you may need to do something like PRINT INKEY(?&70 - 256) or maybe PRINT INKEY(?&70 EOR 255) depending on what value has been stored when defining the keys.

Toby
User avatar
sa_scott
Posts: 420
Joined: Wed Feb 09, 2011 11:34 pm
Location: Witley, Surrey, UK
Contact:

Re: New game in development - Polymer Picker

Post by sa_scott »

TobyLobster wrote: Fri Oct 21, 2022 12:03 pm When you write "?&70" you get a number 0-255. But to test for a specific key using INKEY you need a negative number. e.g.

PRINT INKEY(-98)

So you may need to do something like PRINT INKEY(?&70 - 256) or maybe PRINT INKEY(?&70 EOR 255) depending on what value has been stored when defining the keys.

Toby
Many thanks for that TonyLobster. I'm going to have a go at adding this for v0.12. I'll see how I get on. [-o<
--
Stephen Scott, Digital Media Muckerupper
Games: Androidz Redux, Headcase Hotel, Polymer Picker
www.sassquad.net
User avatar
sa_scott
Posts: 420
Joined: Wed Feb 09, 2011 11:34 pm
Location: Witley, Surrey, UK
Contact:

Re: New game in development - Polymer Picker

Post by sa_scott »

sa_scott wrote: Fri Oct 21, 2022 8:16 pm
TobyLobster wrote: Fri Oct 21, 2022 12:03 pm When you write "?&70" you get a number 0-255. But to test for a specific key using INKEY you need a negative number. e.g.

PRINT INKEY(-98)

So you may need to do something like PRINT INKEY(?&70 - 256) or maybe PRINT INKEY(?&70 EOR 255) depending on what value has been stored when defining the keys.

Toby
Many thanks for that TonyLobster. I'm going to have a go at adding this for v0.12. I'll see how I get on. [-o<
I've put together a cobbling of user defined key code from Night Ninja at bbcmic.ro

This incorporates the functionality of establishing the keys, and then jumps to the procedure for user defining keys. There is then an attempt at a loop where the desired key action (left, right, up, down, swim faster) is printed out, showing the desired key.

However, if I go on the logic of earlier messages, I am not getting the expected output :cry:

If you input the Z,X,', / and Return keys, and select Y at being ok with these keys, it prints out the value of the first key EORed to &FF. However, the output of Z, is not the expected -98, but is instead 158 (97 EORed to &FF).

I don't know what I'm doing wrong, but I've tried for some time, and not got anywhere.

Any help appreciated!
--
Stephen Scott, Digital Media Muckerupper
Games: Androidz Redux, Headcase Hotel, Polymer Picker
www.sassquad.net
User avatar
sa_scott
Posts: 420
Joined: Wed Feb 09, 2011 11:34 pm
Location: Witley, Surrey, UK
Contact:

Re: New game in development - Polymer Picker

Post by sa_scott »

TobyLobster wrote: Sun Oct 23, 2022 12:42 am 158 - 256 = -98
<bangs head on desk>

With that in mind, having come across your resource:

https://tobylobster.github.io/mos/mos/S-s17.html#SP34

and this thread (viewtopic.php?f=4&t=22271) I am all at sea in assembler diving. It seems to me, that keyboard scanning can only be done with assembler. That said, I find it hard to believe that it's that difficult to have user definable keys in a Basic/assembler hybrid.

I shouldn't have to back away from adding this feature, but I'm utterly lost on doing this, and I can't dedicate the time needed to figure it out properly. I'm scanning the BBC games archive for any other game that has cracked this in the hope it can provide the missing gaps in knowledge required to fix it.

In the meantime, I'll leave the bbcmic.ro page up, in the hope that someone can unpick this.
--
Stephen Scott, Digital Media Muckerupper
Games: Androidz Redux, Headcase Hotel, Polymer Picker
www.sassquad.net
User avatar
TobyLobster
Posts: 618
Joined: Sat Aug 31, 2019 7:58 am
Contact:

Re: New game in development - Polymer Picker

Post by TobyLobster »

https://bbcmic.ro/#%7B%22v%22%3A1%2C%22 ... C%22%22%7D

EDIT: This is the only bit I changed:

Code: Select all

DEFPROCkeys
PRINTTAB(0,0)
IFINKEY(-(?&80 + 1)):PRINT "left"
IFINKEY(-(?&81 + 1)):PRINT "right"
IFINKEY(-(?&82 + 1)):PRINT "up"
IFINKEY(-(?&83 + 1)):PRINT "down"
IFINKEY(-(?&84 + 1)):PRINT "swim faster"
ENDPROC
User avatar
sa_scott
Posts: 420
Joined: Wed Feb 09, 2011 11:34 pm
Location: Witley, Surrey, UK
Contact:

Re: New game in development - Polymer Picker

Post by sa_scott »

TobyLobster wrote: Sun Oct 23, 2022 4:48 pm https://bbcmic.ro/#%7B%22v%22%3A1%2C%22 ... C%22%22%7D

EDIT: This is the only bit I changed:

Code: Select all

DEFPROCkeys
PRINTTAB(0,0)
IFINKEY(-(?&80 + 1)):PRINT "left"
IFINKEY(-(?&81 + 1)):PRINT "right"
IFINKEY(-(?&82 + 1)):PRINT "up"
IFINKEY(-(?&83 + 1)):PRINT "down"
IFINKEY(-(?&84 + 1)):PRINT "swim faster"
ENDPROC
Thanks again TonyLobster. I'm mystified as to why this works. It's not what I expected at all. I should probably use other sources to pick apart what's happening elsewhere in that test code, just so it's clear in my mind.

But again, thank you so much!
--
Stephen Scott, Digital Media Muckerupper
Games: Androidz Redux, Headcase Hotel, Polymer Picker
www.sassquad.net
User avatar
sa_scott
Posts: 420
Joined: Wed Feb 09, 2011 11:34 pm
Location: Witley, Surrey, UK
Contact:

Re: New game in development - Polymer Picker

Post by sa_scott »

v0.12 attached below. Github repo updated.

EDIT: I've just realised that this entire thread is one year old. I don't know where the time has gone, but it will be finished 'soon'!

Thanks to chrisb and TonyLobster for your invaluable input, this version now incorporates the ability to define your own keys, which is pretty much an essential these days. When you have read the instructions, you'll be presented with the option of defining your own keys, before the game loads.

It's pretty much the same routine taken from chrisb's Night Ninja, with the crucial difference being that the game code is in Basic, which was where I was having all the trouble in figuring out how to translate the key values into the game code.

I also corrected the unfortunate bug of your score resetting every time you reached the next level, thanks to my putting the score variable in the wrong place. I was somewhat amazed to find that S% was never initialised in previous versions - it was entirely a happy accident of BBC Basic that all variables from A% to Z% default to zero. However, I set it in the wrong procedure, which I've now addressed.

Here's a rundown of what I would like to be able to add in the near future:
  • Sound and music - this is going to be the hardest, I may end up having to be 'inspired' by other code, in order to do this.
  • A High score table - I suspect this may be a memory hog, but will try.
  • The shark collision detection remains iffy, I'd like to fine tune it, but the shark sprite being a different width to the diver is a bit of a pain.
  • I may - on later levels - have more than one shark, but they move back and forth in different directions. The current later levels are too difficult with nasty fish and sharks (or I'm just poor at my own game)
  • If memory permits, another foe of some kind. Pufferfish come to mind, but to be honest, I think there's enough going on as it is.
Onward and upward!
Attachments
polymer-picker-assembly-v0-12.zip
Polymer Picker assembly version 0.12
(23.3 KiB) Downloaded 31 times
--
Stephen Scott, Digital Media Muckerupper
Games: Androidz Redux, Headcase Hotel, Polymer Picker
www.sassquad.net
User avatar
sa_scott
Posts: 420
Joined: Wed Feb 09, 2011 11:34 pm
Location: Witley, Surrey, UK
Contact:

Re: New game in development - Polymer Picker

Post by sa_scott »

I've been done a bit of a blind alley, with regards to startup music.

Having scoured the web for suitable midi files, I used the Python script here to convert a midi file to bbc style music.

The code below is the resulting output. The Midi track is called 'Ocean'

Code: Select all

FOR C%=16 TO 19
SOUND C%,0,0,0
NEXT
N%=0
DIM c%(8)
FOR D%=0 TO 8
c%(D%)=252
NEXT
RESTORE
REPEAT
C%=0
REPEAT
READ D%:PRINT D%
c%(C%)=(D% AND 63)*4
I%=(D% DIV 64)+1
C%=C%+I%
UNTIL I%=4
READ D%:PRINT D%
REPEAT UNTIL ADVAL(-6)>3
FOR I%=0 TO 6 STEP 3
S%=0:T%=0
IF c%(I%)=252:V%=0:ELSE IF c%(I%+1)=252:V%=1:ELSE S%=1:Q%=c%(I%+1)-c%(I%):IF c%(I%+2)=252:V%=2:ELSE R%=c%(I%+2)-c%(I%+1):T%=1:V%=3
IF V%:V%=V%*24+55:N%=N%+1:IF N%=17:N%=1
IF V%:ENVELOPE N%,3,0,Q%,R%,1,S%,T%,V%,0,0,-V%,V%,V%:V%=N%
SOUND 513+(I% DIV 3),V%,c%(I%),D%
NEXT
UNTIL D%=0
END
DATA129,196,2,136,200,2,129,208,4,136,212,2,141,220,4,148,224,2,153,232,2,148,224,2,141,220,4,136,212,2,129,208,4,136,200,2,129,195,2,134,201,2,129,207,4,134,213,2,141,219,4,146,225,2,153,231,2,146,225,2,141,219,4,134,213,2,129,207,4
DATA134,201,2,129,198,2,137,205,2,129,210,4,137,217,2,141,222,4,149,229,2,153,234,2,149,229,2,141,222,4,137,217,2,129,210,4,137,205,2,129,196,2,136,200,2,129,208,4,136,212,2,141,220,4,148,224,2,153,232,2,148,224,2,141,220,4,136,212,2
DATA129,208,4,136,200,2,129,195,2,134,201,2,129,207,4,134,213,2,141,219,4,146,225,2,153,231,2,146,225,2,141,219,2,191,255,1,141,219,1,191,255,1,134,213,1,191,255,1,129,207,4,134,201,2,129,196,2,134,201,2,128,208,2,193,2,137,213,2,140,220,2
DATA205,2,146,225,2,152,232,2,146,225,2,141,220,2,204,2,134,213,2,129,208,2,192,2,134,201,2,129,193,2,136,196,2,129,205,4,136,208,2,141,217,2,136,144,217,2,129,205,2,136,208,2,141,151,255,2,136,144,215,2,129,205,2,136,208,2,141,149,255,2
DATA136,144,213,2,129,205,2,136,207,2,140,148,255,2,136,143,212,2,129,204,2,136,206,2,139,148,255,2,136,142,212,2,129,203,2,134,205,2,138,146,255,2,134,141,210,2,129,202,2,134,204,2,137,146,255,2,134,140,210,2,129,201,2,129,196,2
DATA136,136,255,2,129,208,4,136,212,2,141,220,4,148,224,2,153,232,2,148,224,2,141,220,4,136,212,2,129,208,4,136,200,2,129,195,2,134,201,2,129,207,4,134,213,2,141,219,4,146,225,2,153,231,2,146,225,2,141,219,4,134,213,2,129,207,4,134,201,2
DATA129,198,2,137,205,2,129,210,4,137,217,2,141,222,4,149,229,2,153,234,2,149,229,2,141,222,4,137,217,2,129,210,4,137,205,2,129,197,2,136,205,2,129,209,4,136,217,2,141,221,4,148,229,2,153,233,2,148,229,2,141,221,4,136,217,2,129,209,4
DATA136,205,2,134,201,2,130,206,2,134,213,4,134,218,2,142,225,2,210,2,154,230,2,158,237,2,154,230,2,146,225,4,142,218,2,134,213,4,130,206,2,136,200,2,131,204,2,134,212,2,200,2,143,216,2,146,224,2,212,2,152,228,2,158,236,2,152,228,2
DATA148,224,2,210,2,143,216,2,136,212,2,195,2,136,204,2,129,197,2,191,255,1,136,200,1,191,255,1,129,209,4,136,212,2,141,221,4,148,224,2,153,233,4,160,236,2,165,245,2,160,236,2,153,233,4,148,224,2,141,221,4,136,212,2,129,209,4,136,136,209,2
DATA129,197,2,136,200,2,128,131,255,2,136,200,2,129,207,2,136,200,2,131,198,2,136,200,2,129,212,2,136,200,2,129,197,2,136,200,2,129,209,4,136,145,212,2,141,157,255,4,148,224,2,153,233,4,160,236,2,165,245,2,160,236,2,153,233,4,148,224,2
DATA141,221,4,136,212,2,129,209,4,136,136,209,2,129,197,2,136,200,2,128,131,255,2,136,200,2,129,207,2,136,136,207,2,138,193,2,136,200,2,129,141,255,2,136,136,205,2,129,131,255,2,136,200,2,128,207,4,136,143,212,2,140,155,255,2,205,2
DATA148,224,2,152,231,2,217,2,160,236,2,164,243,2,160,236,2,153,231,2,216,2,148,224,2,141,219,2,204,2,136,212,2,129,207,2,192,2,136,136,207,2,129,195,2,136,200,2,138,129,255,2,134,198,2,129,205,2,134,134,205,2,138,193,2,134,198,2
DATA129,138,255,2,134,134,202,2,129,129,255,2,137,198,2,129,205,4,137,210,2,141,217,4,149,222,2,153,229,2,149,222,2,141,217,4,137,210,2,129,205,4,137,198,2,129,193,2,136,197,2,129,205,4,136,209,2,141,217,4,148,221,2,153,229,2,148,221,2
DATA141,217,4,136,209,2,129,205,4,136,197,2,137,193,2,132,196,2,137,205,4,132,208,2,137,217,4,144,220,2,149,229,2,220,2,161,232,2,161,241,2,156,232,2,149,229,4,144,220,2,137,217,4,132,208,2,137,205,4,132,132,205,2,141,191,255,1
DATA137,129,205,1,141,191,255,1,132,132,205,1,141,191,255,1,136,203,2,132,196,2,137,201,2,132,196,2,139,194,2,132,196,2,137,208,2,132,196,2,137,193,2,132,196,2,137,205,4,132,141,208,2,137,153,255,4,144,220,2,149,229,4,156,232,2,161,241,2
DATA156,232,2,149,229,4,144,220,2,137,217,4,132,208,2,137,205,4,132,132,205,2,137,193,2,132,196,2,136,139,255,2,132,196,2,137,201,2,132,196,2,134,201,2,132,196,2,137,201,2,132,196,2,137,203,2,132,196,2,136,203,2,201,2,132,139,208,2
DATA136,151,255,2,201,2,144,220,2,148,227,2,213,2,156,232,2,160,239,2,156,232,2,149,227,2,212,2,144,220,2,137,215,2,200,2,132,208,2,137,203,2,200,2,132,132,203,2,137,203,2,132,196,2,134,137,255,2,130,194,2,137,201,2,130,130,201,2,134,201,2
DATA130,194,2,137,134,255,2,130,130,198,2,137,137,255,2,133,194,2,137,201,4,133,206,2,137,213,4,145,218,2,149,225,2,145,218,2,137,213,4,133,206,2,137,201,4,133,194,2,137,201,2,132,193,2,137,201,4,132,205,2,137,213,2,132,205,2,137,201,2
DATA137,199,2,131,193,2,137,199,4,131,205,2,137,211,2,131,205,2,137,135,205,2,136,136,255,2,131,192,2,136,200,4,131,204,2,136,212,4,143,216,2,148,224,2,143,216,2,136,212,4,131,204,2,136,200,4,131,192,2,136,201,2,132,193,2,136,201,4
DATA132,205,2,136,213,4,144,217,2,148,225,2,144,217,2,136,213,4,132,205,2,136,201,4,132,193,2,200,2,131,198,2,137,205,4,131,210,2,137,217,4,143,222,2,149,229,2,143,222,2,137,217,4,191,255,1,131,210,1,191,255,1,137,205,4,131,198,2,136,192,2
DATA131,198,2,136,204,4,131,210,2,136,216,4,143,222,2,148,228,2,143,222,2,136,216,4,131,210,2,136,204,4,131,198,2,136,192,2,131,198,2,136,204,4,131,210,2,136,216,4,143,222,2,148,228,2,143,222,2,136,216,4,131,210,2,136,204,4,131,198,2
DATA137,193,2,134,198,2,137,205,4,134,210,2,137,217,4,146,222,2,149,229,2,146,222,2,137,217,4,134,210,2,137,205,4,134,198,2,138,196,2,135,199,2,138,208,4,135,211,2,138,220,4,147,223,2,150,232,2,147,223,2,138,220,4,135,211,2,138,208,4
DATA135,199,2,139,195,2,136,200,2,139,207,4,136,212,2,139,219,4,148,224,2,151,231,2,148,224,2,139,219,4,136,212,2,139,207,4,136,200,2,128,195,2,134,201,2,128,207,4,134,213,2,140,219,4,146,225,2,152,231,2,146,225,2,140,219,4,134,213,2
DATA128,207,4,134,201,2,129,196,2,134,201,2,129,208,4,134,213,2,141,220,4,146,225,2,153,232,2,146,225,2,141,220,4,134,213,2,129,208,4,134,201,2,132,200,2,137,205,2,132,212,4,137,217,2,144,224,4,149,229,2,156,236,2,149,229,2,144,224,4
DATA137,217,2,132,212,4,137,205,2,131,198,2,137,205,2,131,210,4,137,217,2,143,222,4,149,229,2,155,234,2,149,228,2,143,222,4,137,216,2,131,210,4,137,204,2,136,201,2,191,255,1,131,204,1,191,255,1,134,213,1,191,255,1,136,213,2,143,216,2
DATA146,225,2,212,2,155,228,2,158,237,2,155,228,2,148,225,2,210,2,143,216,2,136,213,2,198,2,131,204,2,136,200,2,131,204,2,134,212,2,200,2,143,216,2,146,224,2,212,2,155,228,2,158,236,2,155,228,2,148,224,2,210,2,143,216,2,136,212,2,198,2
DATA131,204,2,136,200,2,131,192,2,136,200,4,131,204,2,136,212,2,131,204,2,136,200,2,201,2,129,193,2,137,200,4,129,205,2,137,212,2,129,205,2,137,200,2,202,2,130,194,2,138,200,4,130,206,2,138,212,2,130,206,2,138,200,2,203,2,130,194,2
DATA139,200,2,130,194,2,128,200,2,131,195,2,128,200,2,131,195,2,129,196,2,136,200,2,129,208,4,136,212,2,141,220,4,148,224,2,153,232,2,148,224,2,141,220,4,136,212,2,129,208,4,136,200,2,129,195,2,134,201,2,129,207,4,134,213,2,141,219,4
DATA146,225,2,153,231,2,146,225,2,141,219,4,134,213,2,129,207,4,134,201,2,129,198,2,137,205,2,129,210,4,137,217,2,141,222,4,149,229,2,153,234,2,149,229,2,141,222,4,137,217,2,129,210,4,137,205,2,129,196,2,136,200,2,129,208,4,136,212,2
DATA141,220,4,148,224,2,153,232,2,148,224,2,141,220,4,136,212,2,129,208,4,136,200,2,129,195,2,134,201,2,129,207,4,134,213,2,141,219,4,146,225,2,153,231,2,146,225,2,141,219,4,134,213,2,129,207,4,134,201,2,129,196,2,134,201,2,128,208,2,193,2
DATA137,213,2,140,220,2,205,2,191,255,1,146,225,1,191,255,1,152,232,2,146,225,2,141,220,2,204,2,134,213,2,129,208,2,192,2,134,201,2,129,193,2,136,196,2,129,205,4,136,208,2,141,217,2,136,144,217,2,129,205,2,136,208,2,141,151,255,2
DATA136,144,215,2,129,205,2,136,208,2,141,149,255,2,136,144,213,2,129,205,2,136,207,2,140,148,255,2,136,143,212,2,129,204,2,136,206,2,139,148,255,2,136,142,212,2,129,203,2,134,205,2,138,146,255,2,134,141,210,2,129,202,2,134,204,2
DATA137,146,255,2,134,140,210,2,129,201,2,129,196,2,136,136,255,2,129,208,4,136,212,2,141,220,4,148,224,2,153,232,2,148,224,2,141,220,4,136,212,2,129,208,4,136,200,2,129,195,2,134,201,2,129,207,4,134,213,2,141,219,4,146,225,2,153,231,2
DATA146,225,2,141,219,4,134,213,2,129,207,4,134,201,2,129,197,2,136,203,2,129,209,4,136,215,2,141,221,4,148,227,2,153,233,2,148,227,2,141,221,4,136,215,2,129,209,4,136,204,2,2,72,134,204,2,9,127,137,255,2,130,210,4,137,213,2,142,222,4
DATA149,225,2,154,234,2,149,225,2,142,222,4,137,213,2,130,210,4,137,201,2,130,198,2,137,201,2,130,210,4,137,213,2,142,222,4,149,225,2,154,234,2,149,225,2,142,222,4,137,213,2,130,210,4,137,201,2,130,197,2,136,203,2,130,209,4,136,215,2
DATA142,221,4,148,227,2,154,233,2,148,227,2,142,221,4,136,215,2,130,209,4,136,203,2,130,198,2,137,204,2,130,210,4,137,216,2,142,222,4,149,228,2,154,234,2,149,228,2,142,222,4,191,255,1,137,216,1,191,255,1,130,210,1,191,255,1,130,210,2
DATA137,204,2,131,137,200,2,136,140,255,2,131,212,4,136,216,2,143,224,2,136,216,2,131,212,2,131,201,2,134,204,2,131,213,4,134,216,2,143,225,2,134,216,2,131,213,2,132,200,2,129,205,2,132,212,4,141,217,2,144,224,4,153,229,2,156,236,2
DATA153,229,2,144,224,4,141,217,2,132,212,4,129,205,2,197,2,129,212,2,133,217,4,141,224,2,145,229,4,153,236,2,157,241,2,153,236,2,145,229,4,141,224,2,133,217,4,129,212,2,134,203,2,129,205,2,134,215,4,141,217,2,146,227,2,141,217,2,134,215,2
DATA134,201,2,129,205,2,134,213,4,141,217,2,146,225,2,141,217,2,134,213,2,134,198,2,129,201,2,134,210,4,141,213,2,146,222,2,141,213,2,134,210,2,134,195,2,129,201,2,134,207,4,141,213,2,146,219,2,141,213,2,134,207,2,136,200,2,132,205,2
DATA136,212,4,144,217,2,148,224,4,156,229,2,160,236,2,156,229,2,148,224,4,144,217,2,136,212,4,132,205,2,136,201,2,132,205,2,136,213,4,144,217,2,148,225,4,156,229,2,160,237,2,156,229,2,148,225,4,144,217,2,136,213,4,132,205,2,136,201,2
DATA131,204,2,134,213,2,200,2,143,216,2,146,225,2,212,2,155,228,2,158,237,2,155,228,2,148,225,2,210,2,143,216,2,136,213,2,198,2,131,204,2,136,200,2,131,204,2,134,212,2,200,2,143,216,2,146,224,2,212,2,155,228,2,158,236,2,155,228,2,148,224,2
DATA210,2,143,216,2,136,212,2,195,2,136,204,2,129,197,2,136,200,2,191,255,1,129,209,1,191,255,1,129,209,2,136,212,2,141,221,4,148,224,2,153,233,4,160,236,2,165,245,2,160,236,2,153,233,4,148,224,2,141,221,4,136,212,2,129,209,4,136,136,209,2
DATA129,197,2,136,200,2,128,131,255,2,136,200,2,129,207,2,136,200,2,131,198,2,136,200,2,129,212,2,136,136,212,2,129,133,255,2,136,200,2,129,209,4,136,212,2,141,221,4,148,224,2,153,233,4,160,236,2,165,245,2,160,236,2,153,233,4,148,224,2
DATA141,221,4,136,212,2,129,209,4,136,136,209,2,129,197,2,136,200,2,128,131,255,2,136,200,2,129,207,2,136,136,207,2,138,193,2,136,200,2,129,141,255,2,136,136,205,2,129,131,255,2,136,200,2,128,207,2,193,2,136,143,212,2,140,155,255,2,205,2
DATA148,224,2,152,231,2,217,2,160,236,2,164,243,2,160,236,2,153,231,2,216,2,148,224,2,141,219,2,204,2,136,212,2,129,207,2,192,2,136,136,207,2,129,195,2,136,200,2,138,129,255,2,134,198,2,129,205,2,134,134,205,2,138,193,2,134,198,2
DATA129,138,255,2,134,134,202,2,129,129,255,2,137,198,2,129,205,4,137,210,2,141,217,4,149,222,2,153,229,4,161,234,2,165,241,2,161,234,2,153,229,4,149,222,2,141,217,4,137,210,2,129,205,4,137,134,205,2,129,193,2,137,198,2,129,129,255,2
DATA137,198,2,129,205,2,137,134,205,2,129,193,2,137,198,2,129,143,255,2,137,134,207,2,129,129,255,2,137,198,2,129,205,4,137,210,2,141,217,4,149,222,2,153,229,4,161,234,2,165,241,2,161,234,2,153,229,4,149,222,2,141,217,4,137,210,2,129,205,4
DATA137,134,205,2,129,193,2,141,191,255,1,137,134,205,1,141,191,255,1,129,193,1,191,255,1,137,198,2,129,205,2,137,134,205,2,129,193,2,137,198,2,129,143,255,2,137,134,207,2,129,133,255,2,136,200,2,129,209,2,136,200,2,136,197,2,136,200,2
DATA129,209,2,136,200,2,129,197,2,136,200,2,129,209,2,136,200,2,136,197,2,136,200,2,129,209,2,136,200,2,129,197,2,136,200,2,129,209,2,136,200,2,136,197,2,136,200,2,129,209,2,136,200,2,129,197,2,136,200,2,129,209,2,136,200,2,136,197,2
DATA136,200,2,129,209,2,136,200,2,129,129,197,8,191,191,255,8,1,8,13,17,84,25,221,16,63,63,63,63,127,63,255,62,255,0
As the Python script author forewarned, the tuning is a bit wobbly. I've tried to load this file in at the point the game title screen is showing. However, the file is too big, as it invades Mode 1 screen memory, even with PAGE set to &1100. I did try to edit down the data, but the format is too obtuse for me, kept getting 'out of data' errors, clearly chopping at the wrong place. The tune is fairly repetitive - if I knew where to splice the code, there would be the basis of a short ditty playing on the title screen.

Such is not to be.

I'll focus on the other sounds to add in the game.

Since Picker isn't a BBC Master game, I won't have the luxuries of space, so I'll leave this code here for you to 'listen' to.
--
Stephen Scott, Digital Media Muckerupper
Games: Androidz Redux, Headcase Hotel, Polymer Picker
www.sassquad.net
User avatar
sa_scott
Posts: 420
Joined: Wed Feb 09, 2011 11:34 pm
Location: Witley, Surrey, UK
Contact:

Re: New game in development - Polymer Picker

Post by sa_scott »

I've attached a broken v0.13 to this message.

The assembly code was formerly assigned to &900. With my extra sound envelopes, I can't really use this space anymore, so I've moved it to &A00. I've tried moving the data for sprite positions (fish and bags) from B00 to 9C0 and upwards (this is apparently the speech buffer).

However, the game is now no longer running, it's now hanging.

Clearly, something is amiss. I've theoretically got everything pointing to the right addresses, but clearly the relocation to E00 is breaking, or running into other stuff I've set up.

I've pushed this version to Github as a branch, so you can hopefully see the code differences to get an better idea of what I've done.

Can anyone have a look at this? I am prepared to stick to using 4 envelopes if I'm unable to do any further code shifting, if it comes down to it.

Thanks in advance!
Attachments
polymer-picker-assembly-v0-13.zip
Polymer Picker (broken) assembly v0.13
(24.97 KiB) Downloaded 29 times
--
Stephen Scott, Digital Media Muckerupper
Games: Androidz Redux, Headcase Hotel, Polymer Picker
www.sassquad.net
User avatar
sa_scott
Posts: 420
Joined: Wed Feb 09, 2011 11:34 pm
Location: Witley, Surrey, UK
Contact:

Re: New game in development - Polymer Picker

Post by sa_scott »

I scrapped v0.13, and have jumped to v0.14, which is present on Github.

I've performed some further cleanup of the code, and have added a high score table. However, I have gotten the dreaded 'No room' error. I'm guessing the high score table is too much of a stretch.

I was hoping to use basictool, but as it's late, I'm on Windows, and I don't know how to do a Windows build, I'll continue on my other machine, the Mac, in the morning.

I decided to stick to using 4 envelopes, it wasn't worth the hassle just for the sake of a few extra sounds, and all that code shifting ultimately did my head in.

For v0.14, I've taken some of the code that was outputting level variations based on the modulo of the level number, and have moved it all to data statements, to introduce some brevity to the code. Earlier in the evening, this was all working great.

I am desperate to add in the high score table, so am hopeful that I can squeeze this in, with the aid of the basictool packing utility.

Think I'm nearly there :D
--
Stephen Scott, Digital Media Muckerupper
Games: Androidz Redux, Headcase Hotel, Polymer Picker
www.sassquad.net
User avatar
ChrisB
Posts: 548
Joined: Wed Oct 05, 2011 10:37 pm
Location: Surrey
Contact:

Re: New game in development - Polymer Picker

Post by ChrisB »

I have used the "toolkit+" ROM to pack BASIC programs. Yes - you need to do this in emulator - but a simple *CRUNCH reduces your program size by nearly 900 bytes. Just remember that it's a one way process and keep your original program separate.
Castle Defender, Untitled Dungeon Game, Night Ninja, Wordle, Waffle, Acorn Island, Beebchase, Ghostbusters
User avatar
sa_scott
Posts: 420
Joined: Wed Feb 09, 2011 11:34 pm
Location: Witley, Surrey, UK
Contact:

Re: New game in development - Polymer Picker

Post by sa_scott »

ChrisB wrote: Wed Nov 02, 2022 6:51 am I have used the "toolkit+" ROM to pack BASIC programs. Yes - you need to do this in emulator - but a simple *CRUNCH reduces your program size by nearly 900 bytes. Just remember that it's a one way process and keep your original program separate.
Thanks Chris, I'd forgotten about toolkit+ - I mentioned the Mac as I had done a build of basictool there. Here's hoping!
--
Stephen Scott, Digital Media Muckerupper
Games: Androidz Redux, Headcase Hotel, Polymer Picker
www.sassquad.net
User avatar
sa_scott
Posts: 420
Joined: Wed Feb 09, 2011 11:34 pm
Location: Witley, Surrey, UK
Contact:

v0.14 attached (potential pre-release version)

Post by sa_scott »

v0.14 attached (view on Github)

Play online (via jsbeeb)

This is - I hope - close to a final release :D

Here's a rundown of what is here:
  • I've had to use basictool to compress the main game code, as the lack of memory, became a major concern. The code is therefore pretty hard to decipher on Github.
  • I've added a high score table, making use of code from one of Gordon Key's games. I may have mentioned it in an earlier post, but his high score routine is very neat and compact, and solid in terms of sanitizing input.
  • I've had to remove the onscreen cues for sound and pause status - I was that lacking in memory, that even after compaction, I had to cut out this feature.
  • A bit of refinement regarding the shark collision - it looked like only his top fin had to touch you, to get hurt, so I've adjusted this.
  • Some in game tunes for inbetween levels. I cribbed this from Mike Goldberg's Five Alive game, but modded the original tune for the remaining two jingles.
I'm now extremely limited, to put in mildly, as to what more I can do here.

I would be very keen for the game to be tested as much as possible, as I'm still worried that the 'No room' error will crop up at inopportune moments. I've played it as much as I can, but haven't reached the later levels, to see if it can still hold up without crashing.

There is no sound when you finish the shark level, unlike the bonus tones at the end of fish levels, for bonus purposes. So, it's a bit quiet. I'm not sure what to do with this anomaly, as I can't add any more envelopes.

I've had to compromise a lot in the end. Features I had wanted to introduce have had to be put aside, as the lack of memory caught me out. I have to hand it to game authors of past and present on how they managed to do it - it's HARD!

I'll amend the thread title to encourage others here to give it a play, and have put a version online for others outside of Stardot to try out, and hopefully not crash it!
All feedback is welcome :D
Attachments
polymer-picker-assembly-v0-14.zip
Polymer Picker Assembly version 0.14
(23.27 KiB) Downloaded 32 times
--
Stephen Scott, Digital Media Muckerupper
Games: Androidz Redux, Headcase Hotel, Polymer Picker
www.sassquad.net
User avatar
sa_scott
Posts: 420
Joined: Wed Feb 09, 2011 11:34 pm
Location: Witley, Surrey, UK
Contact:

Re: Polymer Picker (possible pre-release version)

Post by sa_scott »

I'm going to assume I haven't broken anything - it's all been eerily quiet in my mentions :lol:

I fancy a bit of meddling with the code, but without the space to do it, I may have to push the tune and level data into memory locations, as per Androidz Redux, in the hope I can free up some more space to add the following:
  • Adding an animation sequence of bubbles, using 2 of the flashing colours to draw a stream of them rising up from the sea bed.
  • Addition of a level complete jingle (the shark level has no bonus sequence, so it's too quiet)
  • Static (or moving upwards?) jellyfish, to raise the stakes a bit more?
  • I'm wondering whether on later levels, the shark should move left or right instead of homing in on you, the levels with the poisonous fish.
The first two are the most likely additions, the last two I'm pretty certain there's not enough memory to pull those off.

I have been trying to study some examples of 6502 games, mainly from magazine listings. Gordon Key's games are quite a good starting point, in particular Dino and Hunkie Egg (McBrolly, Dune Hunter and Blockbreaker has the assembly language obfuscated), along with some other games in the archive, to get a sense of similarities in technique. However, I'm keen to get the game out sooner, so will try and focus now :D

Has anyone managed to break the game so far?
--
Stephen Scott, Digital Media Muckerupper
Games: Androidz Redux, Headcase Hotel, Polymer Picker
www.sassquad.net
Post Reply

Return to “new projects in development: games”