anthonybartram
Posts: 19
Joined: Wed Apr 29, 2015 11:03 pm

New 2.5D Game Released for RISC OS Written on the RPi

Fri May 01, 2015 10:30 pm

Hi everyone,

I've spent the last 10 months writing a new game which I've now released through the !Store on RISC OS.

Full source code is included for tinkering and making new games. Its in BBC BASIC V, which I found surprisingly powerful with its ability to call operating system SWI's directly.

Its a 2.5D/3D space game in the style of Gyruss/Tempest featuring ~45 minutes of original music (using MP3 Streaming).
http://www.amcog-games.co.uk

The game runs at 60hz in 800x600. I also looked into making the game compatible with other RISC OS systems and managed to run it on pandaboard, beagleboard, Iyonix, ARM X6, Virtual Acorn as well as the Pi.

Having not used RISC OS before, I found the Raspberry Pi a nice cheap way to experiment with it. I released games in the 90's for the Amiga as shareware using AMOS and the experience was similar but a bit more low level. So I intend to share a BASIC library that makes it easier to write games.

Kind Regards,

Tony

strawberrytau
Posts: 67
Joined: Wed May 30, 2012 7:56 am

Re: New 2.5D Game Released for RISC OS Written on the RPi

Fri May 01, 2015 11:16 pm

This sounds great! I can't wait to try it, but you didn't tell us what the game is called. ;-)

anthonybartram
Posts: 19
Joined: Wed Apr 29, 2015 11:03 pm

Re: New 2.5D Game Released for RISC OS Written on the RPi

Sat May 02, 2015 7:26 am

Oops. Sorry.

The game is called "Overlord".

Tony

ti84
Posts: 70
Joined: Wed Feb 06, 2013 9:09 pm

Re: New 2.5D Game Released for RISC OS Written on the RPi

Sat May 02, 2015 11:20 pm

Anthony

Your project looks cool...I had never heard of BBC basic v...I am very curious about its performs for graphic...does it have better performance than python...could you write a nes emulator with it?

anthonybartram
Posts: 19
Joined: Wed Apr 29, 2015 11:03 pm

Re: New 2.5D Game Released for RISC OS Written on the RPi

Mon May 04, 2015 10:10 pm

Hi ti84,

I've not seen benchmarks that I feel confident in which compare Python versus BBC BASIC V. However, a friend of mine helps to run a Coder Dojo and had a go at writing a computer game with the kids but gave up because Python did not offer high enough performance.

I understand that on RISC OS, the BBC basic module is only kilobytes in size and it also lets you hit the operating system SWI calls directly a well as mixing in/calling, in-line assembler easily. My game consists of 3500 lines of code, but the tokenised bytecode is only around 96k. Also RISC OS is a fairly small operating system, which is cooperative - so my game runs using the CPU and the only other thing running is the MP3 streaming. Therefore it can probably run from the CPU cache giving good performance and blitting sprites to the screen is relatively quick.

If I were to write an emulator in Python, BASIC or some other interpreted language, then I would be tempted to compile a C/C++ implementation of the 6502 CPU and call into it to execute instructions. Most of the chip emulation is already available and also under a suitable license for re-use. In in order to spin up a project of this type, reusing existing chip emulation would be useful in order to cope with any undocumented instructions or critical timing issues e.g. Looking at the NES specs, it looks like split screen effects relied on memory access timing on the PPU memory.

Best Regards,

Tony

ti84
Posts: 70
Joined: Wed Feb 06, 2013 9:09 pm

Re: New 2.5D Game Released for RISC OS Written on the RPi

Wed May 06, 2015 12:59 am

Tony

Thank you for the info...I have been looking for a good way to do powerful graphics on the raspberry pi...powerful graphics seem very difficult on the pi..you have to be a Jedi knight programmer...And I think that explains the lack of original game development on the pi. Python has simple graphics but lacks power...the pi needs something simple like directx...I was hoping bbc basic would provide something similar to directx and as powerful in the 2d world

anthonybartram
Posts: 19
Joined: Wed Apr 29, 2015 11:03 pm

Re: New 2.5D Game Released for RISC OS Written on the RPi

Thu May 07, 2015 7:26 pm

Hi,

On RISCOS (n.b.. this is not Linux), you can call the 2D graphics operating system directly via SWI (i.e. SYS) calls. This is fairly simple to do and the called functions run ARM code to do the graphics functions rather than use the GPU, but they're quick enough.

For example I use 'SYS"OS_SpriteOp", 56 ' (i.e. Plot sprite transformed) for rotated sprites and SYS SpriteOp 52 for scaled sprites.

I posted the procedures for rotate and scale on RISC OS open. Reproduced below:
DEF PROCSpriteRotate(name$, X, Y, theta)
REM Todo: Use SinTable
rot!0=&10000*COStheta : rot!4=&10000*-SINtheta
rot!8=&10000*SINtheta : rot!12=&10000*COStheta
rot!16=X<<8 : rot!20=Y<<8
SYS"OS_SpriteOp",256+56, SPRITE%, name$, 0, 0, 8, rot,0
ENDPROC
DEF PROCSpriteScale(name$, AX, AY, AS)
IF AS > 0 THEN
PX = 800+(SinTable(AX*100) * AY)
PY = SinTable((AX+1.5)*100) * AY) + 600
scale!0=10
scale!4=10
scale!8=AS
scale!12=AS
SYS “OS_SpriteOp”,256+52, SPRITE%, name$, PX, PY, 8, scale, 0
ENDIF
ENDPROC

n.b. My game models a Tempest cylinder, hence the sintable reference in the scale procedure.

That said I've only been using RISC OS for just under a year and I'm still learning what I can do with it.

Tony

User avatar
mrpi64
Posts: 931
Joined: Sat Feb 16, 2013 5:13 pm

Re: New 2.5D Game Released for RISC OS Written on the RPi

Fri May 08, 2015 4:50 pm

Added to the list ;)
I'm happy to help.
https://www.raspberrypi.org/forums/viewtopic.php?f=78&t=51794 - List of games that work on the Pi.

anthonybartram
Posts: 19
Joined: Wed Apr 29, 2015 11:03 pm

Re: New 2.5D Game Released for RISC OS Written on the RPi

Tue Jun 23, 2015 12:33 pm

Hi all,

Overlord was written on RISC OS Pi and as such will also run on hardware other than the Raspberry Pi. I've uploaded a video of the game running on an emulator:

https://www.youtube.com/watch?v=NRjs32-ARS4

Tony

Return to “Gaming”