Gridrunner

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

Gridrunner

Post by fizgog »

Hi everyone,

I’ve been trying to learn 6502 for the past month, since digging out my BBC from the loft and decided to work on creating a game.

I've always liked GridRunner on my friends C64 and was surprised it’s never been converted to the beeb.

GridRunner.png

Started working on a real beeb, then switched to using BeebASM in Visual Code as it was much easier :)
I managed to find a disassembly of the game, so I decided to work on this, seems the original used character based graphics so I tried first doing it this way using the user defined characters on the beeb, then realised this was too slow so switched to using sprites for the graphics.

Decided on using the Vic20 game as a starting point as it’s supposed to be the best one, so I’m using Mode 2 although it has less columns than the Vic20.

I might also create a 40 column Mode 1 version later on, to give the user more choice.

Following still needs to be worked on: -

Instructions need adding
Joystick support - although I’ve not got a joystick to test with :(
Timings - Enemies, ship and bullet need tweaking
Sound - Anyone know of any good tutorials on
Collision detection - still has a few problems
Ship Explosion

I've attached a ssd file of what I've done so far.

Regards
Shaun
Attachments
gridrunner.ssd
(6.25 KiB) Downloaded 114 times
Last edited by fizgog on Tue Jan 30, 2024 7:15 pm, edited 1 time in total.
Pitfall, Gridrunner, Matrix: Gridrunner 2, LaserZone, AcornViewer, AcornPad
nicolagiacobbe
Posts: 215
Joined: Tue Jul 03, 2007 10:40 am
Location: italy
Contact:

Re: GridRunner WIP

Post by nicolagiacobbe »

Seems excellent. Everyone would assume the most has been done.....
Out of curiosity: how much memory remain to implement audio and instructions?

(BTW, it is really fast! are my reflexes so slow or it is really faster than the original?)
User avatar
fizgog
Posts: 618
Joined: Thu Jun 17, 2021 3:18 pm
Location: Nottinghamshire
Contact:

Re: GridRunner WIP

Post by fizgog »

Thanks,

I'll probably add instructions to basic loader file so it won't impact on the game,

In terms of memory, the game is currently compiling from 1900 - 2780, so should be plenty of space to play with for sounds and explosion animations etc.
There is also the possibility to relocate the sprites down to 0900-0BFF if I'm running out of space

Definitely faster than it should be, it needs tweaking

Also managed to download a Vic20 and C64 user manual last night, so I'll be going through these at the weekend to try and understand the sound system.
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: GridRunner WIP

Post by fizgog »

Thanks,

I'll probably add instructions to basic loader file so it won't impact on the game,

In terms of memory, the game is currently compiling from 1900 - 2780, so should be plenty of space to play with for sounds and explosion animations etc.
There is also the possibility to relocate the sprites down to 0900-0BFF if I'm running out of space

Definitely faster than it should be, it needs tweaking

Also managed to download a Vic20 and C64 user manual last night, so I'll be going through these at the weekend to try and understand the sound system.

Update

Whilst reading through the manuals for Vic20 and C64 on sound, I've added some instructions to the basic loader and also new Mode1 version (larger play area, but lacks the colours of Mode 2)

Screenshot 2021-06-19 at 19.01.40.png

To access this version press 1 on the instruction game control screen rather than 2 or the spacebar
Attachments
GridRunner.ssd
(11 KiB) Downloaded 101 times
Pitfall, Gridrunner, Matrix: Gridrunner 2, LaserZone, AcornViewer, AcornPad
nicolagiacobbe
Posts: 215
Joined: Tue Jul 03, 2007 10:40 am
Location: italy
Contact:

Re: GridRunner WIP

Post by nicolagiacobbe »

[attachment=0]Screenshot 2021-06-20 at 12-17-56 jsbeeb - Javascript BBC Micro emulator.png[/attachment]
Hello and thanks for the game.
I have tested both versions (MODE 2 and MODE 1) one after the other and, as a strictly personal opinion, I prefer the wider and more coloured MODE 2 version. I am just adding a suggestion: the game would be more immersive if it where fullscreen, do you have enought time to draw the chars as 8 x 12 blocks instead of the actual 8x8? This way you could fill the screen but I do understand that it would be much more complex. Another option (but at the moment I do not know if it is viable) would be to separate each screen row by two pixel tall blank lines (a la MODE 3), that would extend the screen vertically but for that we should ask tricky and the other geniuses of the forum. For example, I have tried putting 8 in register 9 of 6845 and the result is a nice extended screen with black lines between rows, once centered could be a possible alternative.
Attachments
Screenshot 2021-06-20 at 12-17-56 jsbeeb - Javascript BBC Micro emulator.png
Friga
Posts: 52
Joined: Tue Apr 06, 2021 2:49 pm
Location: Adelaide
Contact:

Re: GridRunner WIP

Post by Friga »

Hi- had quick game and it seemed quite playable - good work!

I dont think I have played the original (or not in the last 30 years), but it seemed familiar. I preferred the MODE 1, 4 colour - just seemed more appropriate resolution. May MODE 2 grid could be thinned out a little.

I could not move up and down (using beebem?) could be my non-standard US Ergodox keyboard, but not seen that issue on other BBC games. Or is that only on later levels?
User avatar
fizgog
Posts: 618
Joined: Thu Jun 17, 2021 3:18 pm
Location: Nottinghamshire
Contact:

Re: GridRunner WIP

Post by fizgog »

Progress Update

First thanks for the feedback

Still working on it in my spare time, but i've put Mode1 version on the back burner - didn't like the 4 colours and I only did it as proof of concept

Decided instead of copying the VIC20 game screen layout, I'd make it fit the BBC mode 2 a lot better, by extending the grid, not sure I'm proficient enough to do 12x8 as it goes over character boundary and I've only been coding 6502 for about a month.

Fixed a zapper collisions detections, still some more though to add
Fixed clearing of droid array - this stopped the ship from moving or firing when either starting again or the next level
Added high score screen
Added level select - use up / down to select starting level
Added extra sprite animations for droid leader, also coloured them green to distinguish between the head and the body
Full screen mode

Still more to go, but once I've completed it I'll release the source code to go with it

mainscreen.png
Highscore.png
battlestations.png
game..png
No ssd this time though as its currently crashing on the stack after a few mins
Pitfall, Gridrunner, Matrix: Gridrunner 2, LaserZone, AcornViewer, AcornPad
nicolagiacobbe
Posts: 215
Joined: Tue Jul 03, 2007 10:40 am
Location: italy
Contact:

Re: GridRunner WIP

Post by nicolagiacobbe »

Seems really nice. I am eager to test it.
When you are speaking about 12x8 I assume it is 8 pixel horizontal and 12 vertical, isn'it? I have never tacked the problem (and I'd like to) but a possible suggestion could be having two routines for each even and odd values of the vertical Y coordinate, this way the sprite data could be the same (i.e. an ininterrupted stream of 48 bytes). Not willing to state the obvious, just suggesting.
User avatar
Chuckie
Posts: 89
Joined: Thu Jun 20, 2019 1:21 pm
Contact:

Re: GridRunner WIP

Post by Chuckie »

What about attack of the mutant camels. Jeff Minter still codes just uses 'retro styles' on modern platform.
User avatar
fizgog
Posts: 618
Joined: Thu Jun 17, 2021 3:18 pm
Location: Nottinghamshire
Contact:

Re: GridRunner WIP

Post by fizgog »

Update

Managed to find some spare time to work on this some more.
  • I've fixed the crash bug
  • Started to implement sound - ship only at the moment
  • Added sound / pause panel to bottom right of the screen, use S for sound on / off and P for pause on / off
  • New leader droid graphics - green was to similar to the ship
  • Fixed some timing issues with enemies
I'm currently working on the ship exploding animation and adding further sounds

Screenshot 2021-07-08 at 18.18.22.png
Attachments
Gridrunner.ssd
(12.25 KiB) Downloaded 78 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: GridRunner WIP

Post by fizgog »

Quick update

Managed to add ship explosion routine on my dinner break :D
gridrunner.png
Attachments
Gridrunner.ssd
(12.25 KiB) Downloaded 79 times
Pitfall, Gridrunner, Matrix: Gridrunner 2, LaserZone, AcornViewer, AcornPad
User avatar
tricky
Posts: 7712
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: GridRunner WIP

Post by tricky »

I don't know the game, but this is looking great.
Perhaps you would like to give a quick preview and maybe a few words on a thursday dev night zoom?
User avatar
fizgog
Posts: 618
Joined: Thu Jun 17, 2021 3:18 pm
Location: Nottinghamshire
Contact:

Re: GridRunner WIP

Post by fizgog »

First things first, thanks for all the comments and encouragement.
Perhaps you would like to give a quick preview and maybe a few words on a thursday dev night zoom?
Sorry I'm not one for public speaking, not something I like doing, so I'll give it a miss if you don't mind, thanks for the offer though. :)

I'd also like to thank Rich Talbot-Watkins for both BeebASM and BeebSpriter which I'm using to create this
RTW in the high score for that :wink:

I've fixed and added the following things
  • Shooting to the top of the grid.
  • Bombs dropping down will now wipe out any pods below them, instead of being respawned
  • Added joystick support press J to toggle the icon on and off
Can someone please test this as I don't have a joystick to test with :oops:

I think the only thing left to do is the remaining sound effects. Can't for the life of me understand the VIC sound system so I've been using synth from the following location which I find excellent for playing with.

http://bbcmicro.co.uk/game.php?id=3569
Attachments
Gridrunner.ssd
(9 KiB) Downloaded 68 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:

Gridrunner

Post by fizgog »

I've added the remaining sound effects I think

Hopefully barring any bugs I'll consider this finished

Once I've tidied up the code, I'll post it somewhere, probably github

Then I'll need a new project to work on
Attachments
Gridrunner.ssd
(9.25 KiB) Downloaded 82 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:

Gridrunner

Post by fizgog »

Finally gone through the code and tidied it up a bit. Code is split over several files as I found it easier to handle and read.

Sprites can be viewed using the excellent BeebSpriter program from http://www.retrosoftware.co.uk/wiki/ind ... eebSpriter

Let me know if I've done anything stupid in my first attempt at coding in 6502

Link is as follows: -

https://github.com/fizgog/Gridrunner
Pitfall, Gridrunner, Matrix: Gridrunner 2, LaserZone, AcornViewer, AcornPad
gsm2022
Posts: 4
Joined: Sat Apr 30, 2022 9:03 am
Contact:

Re: GridRunner WIP

Post by gsm2022 »

Hi could you please share where you found the original disassembly of this?
User avatar
fizgog
Posts: 618
Joined: Thu Jun 17, 2021 3:18 pm
Location: Nottinghamshire
Contact:

Re: GridRunner WIP

Post by fizgog »

I recommend following OldSkoolCoder

https://oldskoolcoder.co.uk/

Disassembly is here for C64 but there are probably others on GitHub

https://github.com/OldSkoolCoder/GridRunner-Original

Also welcome to the forum
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: Gridrunner

Post by fizgog »

In between working double shifts, I’ve been tinkering away with an updated version of Gridrunner, seeing as I’ve gotten a little bit better at coding in 6502, since I first developed this.

New front end and in game has several new backdrops
IMG_0556.png
IMG_0557.png

Video of gameplay can be seen here

https://youtu.be/zJTYVG35r2g?si=bEa9-qzt-UnDQEBp

Still not forgotten about my other projects, but just not had enough quality time to give them my full attention.
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: Gridrunner

Post by fizgog »

Had a spare hour last night, so started to work on a high score entry like you get in Donkey Kong, so far it shows the screen and allows you to move the cursor (I'll be able to use some of this code in my other conversation Hellgate)

Screenshot 2024-02-01 at 19.23.13.png

Video showing it working

https://youtu.be/-1rVj7esaVs
Pitfall, Gridrunner, Matrix: Gridrunner 2, LaserZone, AcornViewer, AcornPad
nicolagiacobbe
Posts: 215
Joined: Tue Jul 03, 2007 10:40 am
Location: italy
Contact:

Re: Gridrunner

Post by nicolagiacobbe »

Really nice. How to you get the scrolling background effect? I do not suppose you are scrolling all of it by CPU, do you? I was wondering how difficult could be to keep track of the sprites while scrolling the screen that way using the 6845.
User avatar
lovebug
Posts: 1758
Joined: Sun Jan 31, 2021 5:07 pm
Location: Magrathea
Contact:

Re: Gridrunner

Post by lovebug »

looking great :+1: :+1: :+1: :+1: :+1:
Image Image Image Image
User avatar
fizgog
Posts: 618
Joined: Thu Jun 17, 2021 3:18 pm
Location: Nottinghamshire
Contact:

Re: Gridrunner

Post by fizgog »

nicolagiacobbe wrote: Fri Feb 02, 2024 4:31 pm Really nice. How to you get the scrolling background effect? I do not suppose you are scrolling all of it by CPU, do you? I was wondering how difficult could be to keep track of the sprites while scrolling the screen that way using the 6845.
Nothing fancy just using simple palette changing and just passing in the logical colour into X and the primary colour into Y, like so

Code: Select all

.ULAPaletteTable
EQUB $07,$17,$27,$37,$47,$57,$67,$77
EQUB $87,$97,$A7,$B7,$C7,$D7,$E7,$F7

.DefineColour
{
    TYA
    EOR ULAPaletteTable,X
    ; Bypass MOS and write directly to hardware
    STA ulaPalette
    RTS
}

lovebug wrote: Fri Feb 02, 2024 7:37 pm looking great :+1: :+1: :+1: :+1: :+1:
Thanks, it keeps me tinkering on this in 6502 until I get some dedicated time for my other projects

If anyone is interested in the Cursor movement for the high score, it's very easy to do, I just have a cursor index that goes from 0 to 29 as I have 30 positions, then divide by 10 for the number of columns and use Y to count the number of rows and the remainder goes into x, then have a X and Y lookup table, you should be able to use this on different sizes with just a few changes

Code: Select all


.CursorXArray   
EQUB $09,$0F,$15,$1B,$21,$27,$2D,$33,$39,$3F

.CursorYArray
EQUB $7D,$8D,$9D


.UpdateCursor
{
    JSR EraseCursor

    LDY #$FF
    LDA cursor_index
.loop
    TAX
    INY
    SEC : SBC #$0A 
    BPL loop
    LDA CursorXArray,X : STA cursor_xpos
    LDA CursorYArray,Y : STA cursor_ypos
    
    JMP PlotCursor
    ; Return
}

Pitfall, Gridrunner, Matrix: Gridrunner 2, LaserZone, AcornViewer, AcornPad
Post Reply

Return to “new projects in development: games”