New Game Development
Greg (2474) 144 posts |
I’ve been reading this post now for a while and feel like I might be interested in having a crack at coding a simple game. Now, I’m no expert and the RISC OS sound system has always baffled me, from a coding perspective but using Relocatable modules was fine back in yesteryear but I am now having great difficulty in figuring out how I can play the same sound in rapid succession as in the fire button being repeatedly pressed or held down. I can play a sound using ‘PlayIt’ but i cant repeat play the same sound before the current sound has finished without stopping it first then playing it again. I’m sure there must be a way but am stumped |
Anthony Vaughan Bartram (2454) 458 posts |
Hi Greg, I am planning to release a free sound module later this year which includes a synthesiser capability as well as sample playback. I hope this will simplify sound and sample playback on RISC OS which (except for MP3 playback) is not as immediate and simple as it could be… Here is the code fom Overlord to play sounds over four channels where channels are assigned automaically: DEF PROCUnLoadSoundPlayer DEF PROCPlaySound(n%) Each sample in the tracker file is identified by a number n%. Hope this is useful. Tony. |
Greg (2474) 144 posts |
Thanks Tony, it looks very usefull. Theres only one thing though. It seems I have to get all my samples into a tracker song format of which I dont believe there is one for ROS 5? Is there anywhere I can obtain a full list of SWI’s and what they do for TimPlayer. There is no help using *HELP TimPlayer. Ive got the documentation of the digital cd website and what appears to be the TimPlayer documentation is quite messy to read so figure it needs a special reader. Good luck with your game. Greg |
André Timmermans (100) 655 posts |
The TimPlayer 1.23 documentation is a StrongHelp file so you need to start the !StrongHelp application first. The current version of that application can be found at http://www.stronged.iconbar.com/fjg/ Once the help file is open follow the link “Playing notes”. That page gives you all the basics for playing notes from that module. Point 4 describes how you can create a new pseudo soundtrack and map its samples to chunks of data located elsewere in memory. |
Anthony Vaughan Bartram (2454) 458 posts |
Thanks Greg. Regarding sound trackers, there is a port of MilkyTracker available for Risc OS 5 ‘http://www.riscos.info/packages/AudioDetails.html’. Tony |
Anthony Vaughan Bartram (2454) 458 posts |
Hi Andre, Thanks for developing TimPlayer, AudioMPEG & DigitalCD. I dropped you a line to let you know I was using them. Did you receive it ok? Best Regards, Tony |
Greg (2474) 144 posts |
@ Tony @ Andre :-) Greg |
André Timmermans (100) 655 posts |
@ Anthony |
David Williams (2619) 103 posts |
Tony, the triple buffering code you kindly posted has found first use with me in a little BASIC demo (filetype BASIC/&FFB): Crunched: http://www.proggies.uk/riscos/basic/stars2bhiX Rock-solid 60 fps; no flicker on the RPi 2. To be honest, there’s not usually any flicker with the ‘double buffering’ option either on the Pi, but sometimes the Pi 2 is subject to seemingly inexplicable slowdowns in which case some flicker may be evident with DB.
Interesting news! I used the Win32 version of MilkyTracker very recently to make the cover tune for Bugs. I didn’t have the time or patience to make use of any ProTracker effect commands, just wanted to hammer out the tune. Whilst it’s a fiddly program to use, it was at least usable. I got a tune out of it! There was a version of ProTracker for the Archimedes (probably 26-bit only) which showed great promise (I believe I may have used it once or twice myself to make a tune for the 4th Dimension), but sadly the author ceased development. David. |
David Feugey (2125) 2709 posts |
The same here with a Pandaboard and network apps. I suspect that the problem is the same on both platforms. |
Rick Murray (539) 13840 posts |
David – have you tried other builds of RISC OS to try to narrow down a date where the changes might have occurred? I noticed in CVS overview that MbufMan had something altered, though I’ve not looked at USB/network changes in detail… |
David Feugey (2125) 2709 posts |
I think it’s more a sync/frequency problem. It’ very fast, but when clock goes down, everything goes wrong for minutes on network (but not only). Network packets take several seconds to reach the application. It could be also something completely different, present in RISC OS since years :) I tried December ROM with little success and wait now for a September ROM. |
Steve Pampling (1551) 8170 posts |
As people may have gathered I have a bit of an archive of older builds. I will be off line in a few hours with virtually zero chance of a reply until Tuesday afternoon. |
David Feugey (2125) 2709 posts |
Not at all… |
Anthony Vaughan Bartram (2454) 458 posts |
Hi David, Like the stars. Also checked out a couple of (your BB4W games *Flak 1.2 and Bugs". Music is good. Which program did you use for Flak music? The stars program requires recent RO 5 due to the sprite fade. I ran it on my PI2 (my PI1 is on RC12). Think the mode setting code might have a bug: Got a split screen (horizontal in the middle), unless that was intended? Just adjusting and testing Overlord. 1 week to go to Wakefield. Making a few more things fire at you + more testing… Very low bug velocity (1 per week) so freezing code this weekend. Tony |
David Williams (2619) 103 posts |
Thanks. Flak – oh yeah, pretty ancient! I think that was one of the first games I made for BB4W (using Richard Russell’s SPRITELIB – proper sprite emulation, if a little slow because it relies on Windows GDI graphics functions). Flak II is all custom-written sprite plotters (my first foray into x86 assembler). Flak 1’s music is a MIDI tune I made with MadTracker (development of which ceased in 2006 — pity!). MadTracker is emphatically not a MIDI sequencer, and it caused me quite a few problems when trying to compose that tune. So, it’s not suited to making MIDI tunes, but I didn’t have anything else at hand. Incidentally, Flak II’s music (MP3 format) was made by Stuart Bruce/Atomiser Music, and incorporated some elements from the original tune. http://www.proggies.uk/audio/flaktune_midi.mid (best heard on an ancient Audigy 2 ZS soundcard; doesn’t sound right at all on my laptop!)
Thanks for pointing this out, I had totally forgotten about it. I’ll put a note on the webpage informing that RISC OS 5.21 is required. In addition, a 256-colour version will go up at some point (640×480×32bpp at ~60 fps is quite a big ask for many ARM-based systems, especially when SpriteOp’s doing the pixel pushing). I also intend to make the animation time-dependent so they (the stars) move along at roughly the same speed regardless of frame rate. Should do that for all demos and games, really. (This is partly why I was looking at David Ruck’s TimerMod the other day.)
Definitely not intended! It works fine with RPCEmu (RISC OS 5.21) and of course on the RPi 2 (RISC OS 5.21), so I don’t really know where I’m going wrong at the moment. I’m tempted to buy an RPi 1 (B/B+) just to see how well or badly my programs run on it. David. |
Dave Wisnia (449) 11 posts |
Music plays back brilliantly on ReMidi on this ArminiX. |
Anthony Vaughan Bartram (2454) 458 posts |
Hi All, Quick update. I’ve unified the code so that Overlord runs on Risc OS 4 and Risc OS 5 from a single program. The only different code selected based on operating system is the MP3 player type. Some dumps from Virtual Acorn on Risc OS 4: Warp Power up Misc game scenes Approaching Radiation Wall Here is one additional music track: Tony |
David Williams (2619) 103 posts |
Looking and sounding good, Tony. Arguably the first new, substantial game for RISC OS for quite a few years (not sure if Simon Foster’s Hopper remake should quite count here because most – if not practically all – of it was coded in the early 90s [although he did mention a Hopper II that may be forthcoming]). Wouldn’t it be nice if Overlord’s release inspires a flurry of RISC OS game creation? David. |
David Feugey (2125) 2709 posts |
As Bugs? :) |
David Williams (2619) 103 posts |
Yeah, that isn’t going to inspire much, admittedly. :) I should consider getting started on a new game myself, rather than hammering out yet more BASIC graphics demos. David. |
Steve Pampling (1551) 8170 posts |
Missed that. Trip to Nottingham complete, back now and the OMAP4 September 1st image is in your mailbox. If that works I suggest October 31st as the mid-point between the two tests |
Anthony Vaughan Bartram (2454) 458 posts |
Thank you to everyone that came and bought the game at Wakefield. Overlord is now available for download in the PlingStore and is priced at £9.99 I will be updating www.amcog-games.co.uk soon and sending out wider announcements later on this evening. The game source code is included in the download (!RunImage is not compiled or protected) and the license encourages production of new games i.e. Overlord can be used a reference implementation and the code may be used in derivative works Please note the following hints which I have reproduced from the Game cover:
In addition, I ran the game at the show on the Raspberry Pi 2 from a USB stick, because it appeared faster at streaming the MP3 than the micro SD card. It might have just been that particular micro SD card, but I wished to highlight it in case anyone else encounters the same issue. Further games (2 at present) and a music tracker (+ sound module) are in development. I will update the thread as I make progress. Please drop me a line or write a message here if anyone has any ideas, thoughts or problems. Tony |
David Williams (2619) 103 posts |
Tony, I’ve added a link to your website in the RISC OS section of my webpage (I’m presuming you don’t mind!). Will be buying your game tomorrow (it’ll involve my first attempt at connecting an RPi 2 to the ’net). :) David. |
Anthony Vaughan Bartram (2454) 458 posts |
Hi David, Please note the comment above about the USB stick. I increased the read buffer size on the MP3 player, however there was a definite small jump in the game every 5 seconds or so if I used my Micro SD card. Ran beautifully off the USB though. I’ll add these points to my website under a trouble shooting section, just in case. Tony |