RISC OS Open
A fast and easily customised operating system for ARM devices
ROOL
Home | News | Downloads | Bugs | Bounties | Forum | Documents | Photos | Contact us
Account
Forums → Announcements →

!Stargate new game for RISC OS

Subscribe to !Stargate new game for RISC OS 43 posts, 13 voices

Posts per page:

Pages: 1 2

 
Dec 18, 2020 10:01pm
Avatar Terry Swanborough (61) 87 posts

Just in time for Christmas !

Download Stargate for RISC OS take your frustration out on invading Aliens from another dimension they are coming through stargate portals its your job to eradicate as many as possible.

The game needs AMplayer for the music I have included a zip file containing the audio modules if needed.

Stargate is a new game I have been writing in BASIC just to see how
it would perform mainly on newer style RISC OS machines PI and above.

The program makes great (not so great) use of global variables mainly to keep the speed up.

I did some timing on PROC statements and there is an overhead to using them , also passing variables can take time, so this is not a demonstration of how to write structured programs :-)

The program is crunched but I have included the source so anyone can have a play. You can define your own levels look for PROCSet_Level Ive been playing it for a while so cannot tell how difficult it is?.

Hitting the centre of the gates is meant to be hard as this increases your shield energy.

I timed a single screen on the Titanium and it took somewhere between 2mS and 9ms depending on screen contents so the worst case is :-
1/9= 111Fps (111 Hz) so the Titanium has plenty of grunt left.

a 50Hz screen time is :-
1/50= 0.02 seconds or 20mS so I think a PI should be able to handle this.

The program will sample the screen refresh rate 5 seconds into the intro screen this gives it time to stablise, it will then use this value to try an adjust the game speed for different screen refresh speeds?.

Let me know what you think?

Also what machines it runs on?

It can be quite hypnotic to watch the intro screen with just the music playing :-)

You can download Stargate from :-

www.mbelect.co.uk/RISCOS/progs/Stargate.zip

 
Dec 19, 2020 3:40am
Avatar Willard Goosey (5119) 228 posts

Wow that’s fun! and crazed!!

 
Dec 19, 2020 9:33am
Avatar Doug Webb (190) 765 posts

Plays well on my ARMX6.

Thanks for the free game and the explanation about it.

Good to see RDSP being used as well.

 
Dec 19, 2020 5:21pm
Avatar Terry Swanborough (61) 87 posts

Thanks for the replies

It will be interesting to see how well it works on different machines.

 
Dec 19, 2020 6:12pm
Avatar Paolo Fabio Zaino (28) 523 posts

Nice job Terry!

Downloaded and will fire it up on all my RISC OS 5 boards! :)

 
Dec 19, 2020 6:44pm
Avatar Andreas Skyman (8677) 116 posts

Good job! The game freezes slightly on my Pi 3 when the music track changes, but other than that runs smooth.

 
Dec 19, 2020 6:52pm
Avatar John Rickman (71) 255 posts

ARMX6 no problems surprisingly “in your face” with a large screen and amplifier for the music.

 
Dec 19, 2020 7:23pm
Avatar Terry Swanborough (61) 87 posts

@Andreas I noticed when I tried it on a Pi that the music caused a slight freeze.

I copied the game to RAM disc and had no problems.

@John the music can be quite addictive.

 
Dec 19, 2020 7:36pm
Avatar Doug Webb (190) 765 posts

Hi Terry

ARMBook fails to load with message:

`Screen mode not available at line number 19540`

Most likely due to the ARMBook having only two screen modes availabe as in 1920 × 1080 or 1366 × 768.

Hope that helps with testing.

 
Dec 19, 2020 7:56pm
Avatar Terry Swanborough (61) 87 posts

@Doug Thats to be expected at the moment the games calls
for 640,480 in 256 colours I might allow for different screen modes at a later date, as this is my first attempt at writing a game Im surprised I finished it to a playable level so one step at a time.

Everything helps with testing :-)

 
Dec 19, 2020 8:30pm
Avatar Terry Swanborough (61) 87 posts

@Doug

If your feeling brave look inside the !StarGate Directory and load the crunched file into an editor.

Line No. 19540 change Q4%=640:R4%=480
To Q4%=1366:R4%=768

I just tried 1360 & 768 as thats the monitor def I have here and it works to some extent

 
Dec 19, 2020 9:08pm
Avatar DavidS (1854) 1863 posts

Works well on Raspberry Pi 1B+.

From above statements on mode setting, I am guessing it is not even worth trying on Archimedes A3020 level.

 
Dec 19, 2020 9:18pm
Avatar Terry Swanborough (61) 87 posts

I did try it on the Iyonix and it plays but the games
sprites are moving in greater steps to increase the speed of the game, I think the Iyonix only got about 25ish Fps so it was a bit slow.

Your right its not worth trying A3020 levels.

 
Dec 20, 2020 12:00am
Avatar DavidS (1854) 1863 posts

I did try it on the Iyonix and it plays but the games
sprites are moving in greater steps to increase the speed of the game, I think the Iyonix only got about 25ish Fps so it was a bit slow.

Surprising. Though the reason I said the no A3020 level systems, is that they only use the numbered Screen modes.

I would have expected Iyonix to be a bit closer to RPi 1B in performance.

 
Dec 20, 2020 12:07am
Avatar DavidS (1854) 1863 posts

Finally decided to look inside the app-dir (wondering why it is most of 25MB in size). I think I see your performance issue, it is the same as the size issue.

MP3s are not good for performance, never have been.

 
Dec 20, 2020 12:31am
Avatar Terry Swanborough (61) 87 posts

The original files were in wav format and they were
about 5 times the size, mp3 was a good compromise between size and quality.

I was using !PlayIt to play back the wav files but it did not work as well in conjuction with the RDSP sound effects.

So unless you have a better idea MP3 seems the way to go?.

 
Dec 20, 2020 1:22am
Avatar DavidS (1854) 1863 posts

The original files were in wav format and they were
about 5 times the size, mp3 was a good compromise between size and quality.

For game music there is a reason that tracker mod is used almost universally. Not that I mind in this case (other thna the lost disk space). Though normally you want a long period of music in very little space, and you want it to play with a minimum of cycles taken from the game, so either a mod, or other Tracker type, or something custom that is space effecient and cycle effecient (I have even seen used the standard voice gens with binary format music to save space and CPU cycles).

Though overall I like the game.

 
Dec 20, 2020 1:38am
Avatar Terry Swanborough (61) 87 posts

Well the source code is in the directory, so if your feeling creative you can always add your own music or playing system to the game , your quite welcome.

 
Dec 20, 2020 4:41am
Avatar DavidS (1854) 1863 posts

I do enjoy the game, and who knows I may indeed play with the game as well as playing the game :) .

Thank you very much for sharing this creation.

 
Dec 20, 2020 9:21am
Avatar David Williams (2619) 92 posts

Congrats on the release. It’s nice to see a new RISC OS game since they’re so few and far between nowadays. I scored 7410 on my 2nd go, somewhat below the high score of 10000. By that point I was starting to worry about the possibility of repetitive strain injury setting in! :-)

Here’s an idea for your consideration: Every so often, have the game produce a collectable ‘auto fire’ token which lasts a certain amount of time. It would afford the player a bit of a rest (especially when the action gets really frantic), reduces the RSI risk, and is kinder to the fire key’s keyswitch. On the other hand, I appreciate that auto fire can take some (or a lot?) of the fun out of games of this type.

I played it on a Raspberry Pi 2 running RISC OS Direct. It performed well. No glitches as far as I could tell.

 
Dec 20, 2020 10:08am
Avatar Terry Swanborough (61) 87 posts

@David

Thanks for the comments, it was looking at some of your demos that lead me to believe that it was possible to write a game that was playable in BASIC some of your graphic demos are impressive.

I’ll think about adding some extras to the game but I’m supposed to be designing printed circuit boards during lock down but writing this has been a fun distraction. I forgot how fluid working in BASIC can be so quick to correct errors. I realise that BASIC has a bit of negativity associated with it but it is really easy to pickup where you left of and continue.

I do program in C but sometimes it can be so frustrating not the language but it can takes ages just the get the build environment up and running and don’t get me started on the error reporting :-) miss matched pointer to a pointer that might need this or that, just missing a } can sometimes have you searching around.

I have thought about writing a game that works within the desktop I realise that all the graphic would have to be changed for the wimp using colourtrans and you can plot a sprite to the window area but how do you handle vsync does the wimp only update windows after vsync? You can’t hang around waiting for it to happen? Perhaps you could use graphicsV vector? It’s not something I’ve looked at closely any ideas?

Anyway thanks for the comments and if the game was easy it would be boring right :-)

 
Dec 20, 2020 10:40am
Avatar Steve Fryatt (216) 1426 posts

just missing a } can sometimes have you searching around

This old chestnut. At least it warns you; BASIC won’t actually notice the missing ENDCASE from something like the following procedure until it needs to call PROCurl_bounce(), and there are many other similar examples which can be very hard to spot unless all of the necessary stars align. This one only showed up if an obscure button was clicked in the GUI, and there was no claimant for the first attempt to launch a URL – allowing it to escape into the wild.

DEF PROCprocess_bounce(message%)
CASE b%!16 OF
	WHEN &4E383, &4AF80	: PROCurl_bounce(message%)
	OTHERWISE		: PROCother_message_bounce(message%)
ENDPROC

Having the compiler syntactically check everything and refuse to play until you’ve got it correct is comforting: you know that there can only be semantic problems remaining.

 
Dec 20, 2020 10:52am
Avatar Terry Swanborough (61) 87 posts

Calm down I did’nt want to start a language war I’m sure all languages have there pros and cons :-) this is just a game after all :-)

 
Dec 20, 2020 12:12pm
Avatar Steve Drain (222) 1304 posts

BASIC won’t actually notice the missing ENDCASE

You do not mention that it will continue to search for an ENDCASE to the end of the program before reporting "Missing ENDCASE". If one is found before that you could end up looking for an error in a completely different routine.

 
Dec 20, 2020 12:14pm
Avatar DavidS (1854) 1863 posts

Having the compiler syntactically check everything and refuse to play until you’ve got it correct is comforting: you know that there can only be semantic problems remaining.

!ABC (may have to avoid newer additions to language until done testing, though works).

Next page

Pages: 1 2

Reply

To post replies, please first log in.

Forums → Announcements →

Search forums

Social

Follow us on and

ROOL Store

Buy RISC OS Open merchandise here, including SD cards for Raspberry Pi and more.

Donate! Why?

Help ROOL make things happen – please consider donating!

RISC OS IPR

RISC OS is an Open Source operating system owned by RISC OS Developments Ltd and licensed primarily under the Apache 2.0 license.

Description

Announce and discuss new hardware and software releases.

Voices

  • Terry Swanborough (61)
  • Willard Goosey (5119)
  • Doug Webb (190)
  • Paolo Fabio Zaino (28)
  • Andreas Skyman (8677)
  • John Rickman (71)
  • DavidS (1854)
  • David Williams (2619)
  • Steve Fryatt (216)
  • Steve Drain (222)

Options

  • Forums
  • Login
Site design © RISC OS Open Limited 2018 except where indicated
The RISC OS Open Beast theme is based on Beast's default layout

Valid XHTML 1.0  |  Valid CSS

Powered by Beast © 2006 Josh Goebel and Rick Olson
This site runs on Rails

Hosted by Arachsys