Graphics Extension ROM based Game - experimenting

discussion of beeb/electron applications, languages, utils and educational s/w
Post Reply
User avatar
flibble
Posts: 640
Joined: Tue Sep 22, 2009 10:29 am
Contact:

Graphics Extension ROM based Game - experimenting

Post by flibble » Mon Jul 17, 2017 7:31 pm

gxr-game.png
I started playing with this little test program at Markfield earlier in the year, I finally reached a 'milestone' of sorts, I ran out of memory on the BBC B :lol:

Good
- Tile based plotting
- Animation of character in 4 steps between adjacent tiles.
- Two sprite layers, background and characters plotted on top
- Written fully in BASIC
- keyboard input on z,x,*,/
- Just about fast enough performance
- Gfx look good, (even better in the Gameboy game I borrowed them from, ahem)

Bad
- flickery (plotting BG then character in each frame)
- no mask based plotting, when the white backgrounded character walks over a darker tile it looks a bit silly.

Ugly
- with only 12 sprites (8 character, 2 facing each direction, 4 background sprites), I have already run out of memory on the Beeb B

Running

- A machine with the graphics extension ROM fitted, or a Master with the 'Spriter' romimage from the welcome disc loaded into Sideways ram
- type *SSPACE 4
- hit break
- CH."GAME"

Future
I'm not sure it's worth me running any further with this. If I did I'd be tempted to say 'BBC Master only', as you always have the GXR to hand on the welcome disk and I could use shadow ram to free up 20k for more sprites and some actual gameplay.
Attachments
spritestests.zip
(3.37 KiB) Downloaded 26 times

User avatar
Lardo Boffin
Posts: 1094
Joined: Thu Aug 06, 2015 6:47 am
Contact:

Re: Graphics Extension ROM based Game - experimenting

Post by Lardo Boffin » Mon Jul 17, 2017 9:29 pm

Have you considered running this over the Tube? The main program would live on the co-proc while the sprite data lives on the Beeb itself. That should help provide more space for sprites and interesting stuff!
BBC model B 32k issue 4, 16k sideways RAM, Watford 12 ROM board, Retroclinic Datacentre + HDD, Viglen twin 40/80 5.25" discs, acorn cassette, Acorn 6502 coproc
BBC model B 32k issue 7, turboMMC, Opus Challenger 3 512k, Pi 3 coproc
BBC Master

User avatar
Lardo Boffin
Posts: 1094
Joined: Thu Aug 06, 2015 6:47 am
Contact:

Re: Graphics Extension ROM based Game - experimenting

Post by Lardo Boffin » Mon Jul 17, 2017 9:59 pm

Also the Beeb can get on with just running sprite code for the ROM while the co proc handled the BASIC. Might help reduce flicker.
BBC model B 32k issue 4, 16k sideways RAM, Watford 12 ROM board, Retroclinic Datacentre + HDD, Viglen twin 40/80 5.25" discs, acorn cassette, Acorn 6502 coproc
BBC model B 32k issue 7, turboMMC, Opus Challenger 3 512k, Pi 3 coproc
BBC Master

User avatar
flibble
Posts: 640
Joined: Tue Sep 22, 2009 10:29 am
Contact:

Re: Graphics Extension ROM based Game - experimenting

Post by flibble » Tue Jul 18, 2017 2:19 pm

Interesting idea about the 2nd processor, running a few tests in beebem the second proc *does* give the most available memory, even more than shadow ram.

master 128 LOMEM HIMEM
MODE 1 3586 12288
MODE 129 3586 32768

bbc b
MODE 1 7170 12288
bbc b 6502 second proc
MODE 1 2050 32768

But I think I'll try the master next as I think more people have one ... including me :)

User avatar
Elminster
Posts: 2417
Joined: Wed Jun 20, 2012 8:09 am
Location: Essex, UK
Contact:

Re: Graphics Extension ROM based Game - experimenting

Post by Elminster » Tue Jul 18, 2017 2:52 pm

Master with shadow and HiBASIC (ad copro) will give you 44k usable if you need more.But the thing about Basic is it is to blow that as well, then you will just have to start crunching.

User avatar
Lardo Boffin
Posts: 1094
Joined: Thu Aug 06, 2015 6:47 am
Contact:

Re: Graphics Extension ROM based Game - experimenting

Post by Lardo Boffin » Tue Jul 18, 2017 3:39 pm

flibble wrote: But I think I'll try the master next as I think more people have one ... including me :)
I guess I will have to join the master race at some point then! Although with raspberry Pi co-procs available for very little outlay hopefully most people have one by now.
BBC model B 32k issue 4, 16k sideways RAM, Watford 12 ROM board, Retroclinic Datacentre + HDD, Viglen twin 40/80 5.25" discs, acorn cassette, Acorn 6502 coproc
BBC model B 32k issue 7, turboMMC, Opus Challenger 3 512k, Pi 3 coproc
BBC Master

User avatar
flibble
Posts: 640
Joined: Tue Sep 22, 2009 10:29 am
Contact:

Re: Graphics Extension ROM based Game - experimenting

Post by flibble » Tue Jul 18, 2017 4:22 pm

Elminster wrote:then you will just have to start crunching.
With the initial 'B' version I had already started having to shorten variable names :)

I'm currently editing the program on the PC and pasting into to Beebem for testing, I think I could add an extra step in my build process that at least stripped out the comments.

User avatar
Elminster
Posts: 2417
Joined: Wed Jun 20, 2012 8:09 am
Location: Essex, UK
Contact:

Re: Graphics Extension ROM based Game - experimenting

Post by Elminster » Tue Jul 18, 2017 5:02 pm

I write on Mac in bbedit, crunch it using the mdfs *crunch, makes it unreadable though which is a bit of a debugging pain. You can also hack the files up to crunch and then *lik as well if not enough memory to crunch them.

Was on my todo list to do some sort of Mac runableble basic cruncher and do it there rather than on Beeb, but never got around to it.

User avatar
flibble
Posts: 640
Joined: Tue Sep 22, 2009 10:29 am
Contact:

Re: Graphics Extension ROM based Game - experimenting

Post by flibble » Sat Dec 30, 2017 12:36 am

Well, 6 months on and an update.

I did experiment a bit more with this, but the big thing that got me to keep trying was cmorley helping me setup a working C compiler. As such I rewrote the program in C (with a coresponding decrease in size and increase in performance) and setup to use shadow RAM, giving me an extra 20KB to play with.

Things I've added recently.
  • I created a 'spritesheet' on windows, used 'BBC Micro Image Converter' to create a 'screen', loaded this into screen memory and then wrote a short basic program that created GFX extension ROM sprites from the screen data. This is a lot easier than using the GFX ROMs SEDIT program.
  • Added a 'Solid' flag to the map data to prevent players walking through buildings etc
  • Added a 'door' flag to the map data which enables you to teleport between 'rooms'
  • Added a 'special procedure' flag to the map data, which can be used to trigger events in the main code when a player touches or enters a location.
  • Made the palette dynamic between different rooms.
  • Added 'dialog' that can print up speeches between characters etc, triggered on 'special procedures'.
Big things that I still need to look at
  • A combat system ... some game play would be good
  • A map editor, programmatically typing in data, or just raw typing binary data into files isn't going to cut it.
I'm still not sure if I can fit all this in memory, but I have about 10KB more to play with I think. After that more drastic measures to reduce mem usage

Current sizes
  • binary, 7.7KB
  • Sprites, 4.5KB
  • Workspace/variables, who knows? :)
rpg1.png
rpg2.png

User avatar
tricky
Posts: 2559
Joined: Tue Jun 21, 2011 8:25 am
Contact:

Re: Graphics Extension ROM based Game - experimenting

Post by tricky » Sat Dec 30, 2017 10:08 am

That's great, could this be the first Retro software C release, or even the first beeb C game?

cmorley
Posts: 522
Joined: Sat Jul 30, 2016 7:11 pm
Location: Oxford
Contact:

Re: Graphics Extension ROM based Game - experimenting

Post by cmorley » Sat Dec 30, 2017 10:20 am

+1 like. Good work.

Sideways RAM is trivial to use from C too (I did all my memory module test code in gcc). Assuming most people would have 2 banks, there is 32K more for tables, graphics etc. I think the linker file I gave you has an example of how to output overlaid memory segments... if not I can send you something.
Chris

edit: -Os optimise for size seems to help a bit... did you try that?

Post Reply