When demos go multi-platform
Written by Xeron, Marq and Magic
Many productions released on the demoscene are made for more than one platform. A smart move since you can reach a bigger audience this way. But what is needed to do this and what are the differences if any? Hugi got into a talk with Xeron of Iris and Marq of Fit, two coders whose latest productions were released on various systems. Read on about the 'how and why' when demos go multi-platform...
Magic:
Hi Xeron and Marq, welcome... Please give an introduction of yourselves to our readers.
What's your history regarding groups on the demoscene and what are your most known productions?
Xeron:
Well, I'm Peter Gordon, a 28-year-old programmer from the UK. I was brought up with the Amiga and couldn't let it go :-)
Well, the first group I joined was Spearhead, which had some quite talented members, back in the mid nineties.
The only thing Spearhead ever released, though, was a musicdisk containing my first few ahx tunes, coded by myself
quite badly in Blitz Basic. The group split up shortly after. I was briefly in "Amiga Trading Team", although
I don't know why, I was never into swapping or modem trading. I just used to make modules and silly programs and
upload them, dunno what happened to them. I made some protracker modules with def base under the group name "Def and Tickle"
(my handle back then was Mr. Tickle), that was fun, but I don't think the music was all that great. Towards the late 90's,
early 2000s I made friends with mod3m and joined Darkage. That was when I started to learn to properly code effects
in Assembler on the Amiga - it was a lot of fun but Darkage kind of imploded after mod3m got bored of the scene
so I spent a long while out of any groups. It was then that I changed my handle to "Xeron", because while Mr. Tickle
is the name of one of my favourite children's book characters, if you're not familiar with the character, it sounds kind
of gay :) I joined IRIS, after resisting for a long while because I felt I wasn't productive enough to be in a group and
that is where I remain. I suppose I'm best known for my silly demos coded with Dr. Doom (formerly Su5hi, or Cupid amoung others).
I'm well known for hivelytracker, which is a follow-on from the ahx soundsystem.
Marq:
In the demoscene circles I go by the name Marq/Fit since 1991 or so. I've worked on quite a lot of platforms ranging from
MS-DOS to Amiga and from Linux to Dreamcast. Apart from Fit I'm a member of Lieves!Tuore, which is an MSX group.
I guess the best known productions by me are the 4k intros made with NF/Bandwagon: "Yellow Rose of Texas" and "Make It 4k".
Magic:
Xeron, you are the coder behind the musicdisk Planet Hively, which is regarded to be the most ported demoscene release ever!
How did the Planet Hively project start? Was the idea to port it to as many platforms as possible initiated right from the beginning?
Xeron:
When we released the first version of hivelytracker, I had the idea to have a competition as a way of getting people
interested in making hively modules. We offered a C64-DTV as a prize, and people made modules in hively to compete.
It was always planned to make a musicdisk out of the entries to the competition, but I really wanted to release it
for Amiga 68k/AGA. The problem was that the hivelytracker replayer is written in pure C, and isn't very fast on 68k.
In fact, the musicdisk would have required a 68060 and I wouldn't have been happy with that. But StingRay (among others)
promised to code an optimised 68k hivelytracker replayer for us so I waited for that to happen. After a year, it was getting a
bit annoying; the tunes from the competition were not released, because I didn't want to release them outside of the musicdisk.
I decided to just code the musicdisk anyway, but I didn't want to limit it to OS4 because not many people would be able to see
it. I didn't want to code it for Windows because I hate coding for Windows so I decided to make it portable. I wrote the musicdisk
on OS4, but used SDL for the graphics and sound. Throughout development I tested it on Windows to make sure it was portable while
developing, I discussed with Spot/UpRough how cool it would be if the musicdisk ran on weird platforms like the GP2x, and he
agreed. So I decided to use software rendering to a framebuffer for the gfx to make it as portable as possible. Then once it was
done, I released it for AmigaOS4 and Windows but Spot had already contacted Marco van den Heuvel, the maintainer of various ports
of VICE, and asked him to port it to as many platforms as possible - and, well, he did :-) At various points along the way others had
offered to do ports but I think in the end most of them came from Marco. Marq/fit ported it to the Dreamcast and StingRay/Scarab
has a fixed PSP port which hasn't released yet. Oh, and Ransom did a PS3 and Linux port. I might have forgotten some :)
Magic:
Xeron, so if I understand it right, it just happened 'along the way' that Planet Hively became the most ported demoscene
release ever?
Xeron:
Yes, although our brief to Marco was that we wanted to "Out port fit". It was kind-of a joke, but we
definitely did want to see it released on as many platforms as possible.
Magic:
Marq, your productions Hex Pistols, Jenny Thinks, Chrysler, Yellow Rose of Texas, were they also made with the idea
to port them to multiple platforms from the start?
Marq:
Definitely all of them have been made multiplatform from the very beginning. I usually develop under Linux (and sometimes OS X)
and that gives a very good starting point, since you tend to use APIs and tools that are available more or less everywhere. Also
it's so that once you get into the right mindset you tend to write your code so that it's readily portable by nature. It's a way
of thinking more than an extra effort.
Magic:
Xeron, is a c-64 version of Planet Hively considered? And when will the PSP port be released?
Xeron:
No, a C-64 version of Planet Hively is not considered. There are plans for a few versions of Planet Hively which will require a special version written for them. For example, if StingRay ever delivered his 68k replayer, I would make an AGA version of the musicdisk that was written in Assembler and used the AGA chipset directly. Also, as I type this, my Wii is playing hivelytracker music (I got it working today), so I might
do a Wii version, not using SDL. The fixed PSP release is entirely up to StingRay. He has it working on his PSP, but says he has some tidying
up to do. (The Wii version was released shortly after we did this article -ed)
Magic:
This question is for the both of you. Next to Planet Hively and Fit releases, do you know any other demoscene releases which have been
ported to a lot of other platforms? Can you name a few?
Xeron:
Well, most demoscene releases are coded for a specific platform. Generally, if they use SDL and the sources are released they end
up getting ported to MacOS, Linux and AmigaOS4, at least. I think it is becoming more common. But mostly it seems to be Fit releases :D
Marq:
Well, there's "Saulin penis" by Jumalauta :) Seriously speaking, Bomb's "State of Mind", "HElliZER" by QMG and Artwork's "Megademo IV 2"
were the first mega-multiplatform demos and after that some others such as "Dose 2" by Mfx have been ported quite a lot. These days it's
not uncommon to release a Linux or OS X version of a demo in addition to the Windows one: groups like Rebels and Fresh!Mindworkz do it all
the time.
Magic:
I think Xeron already (partly) explained my next question, but what would be the basic 'ingredients' for a production to be
ported to as many other platforms in the easiest way? Please comment both of you.
Xeron:
The ingredients for a portable demo are simply that you don't do anything platform specific.
You have to use APIs such as SDL or GLUT that are available on multiple platforms.
You use the C-library to open files.
It's pretty straight forward.
But it means you can't optimise your demo for a specific architecture.
Or if you do, you also have to provide a generic portable unoptimised alternative.
Marq:
There are different layers to this. First of all the code should be endian clean and also aware of alignment - much less of a
problem with high level languages such as interpreters. In my opinion C is still the best choice for a language: good compilers
exist for every realistic platform and it's efficient. On top of that the code should be modular and preferably use common APIs
such as SDL, OpenGL, GLUT and POSIX. Java and Flash are portable by nature but not available on all possible targets and they might
be too slow and limited too. Here's a text I wrote about C code portability some years ago:
http://ftp.kameli.net/pub/fit/misc/portability.txt
Magic:
What are the most known differences between a port on different platforms?
Xeron:
Nothing much; Planet Hively was written with portability in mind, so the ports are basically the same.
The only differences are that some targets have fixed resolutions (like handhelds), and they are controlled differently
because there is no mouse (also mostly handhelds).
Marq:
It's easy to port upwards, meaning for a more powerful device. When you go the other way around you probably need to axe
features such as polygon count, resolution, sampling rate and filters. For example "One Day Miracle" runs in 8-bit colour
on the lesser platforms and some layers are dropped. "Yellow Rose of Texas" is software 3D on some platforms and the sound
is precalculated if the processor can't keep up. For really multiplatform stuff I start with the lowest common denominator
so usually there's no need to cut out features.
Magic:
Xeron, can you name all sceners who did a port of Planet Hively and tell me what port they did?
Xeron:
Me -> Windows, Amiga OS 4
Ransom/IRIS -> PS3 Linux
Marq/FIT -> GP32, IRIX, Dreamcast
Hmm... trying to remember who did the mac port, hang on.
Ok I can't remember who did the MacOS X build.
All the rest are by Blacky Stardust aka Marco van den Heuvel.
Magic:
Marq, what is your opinion about Planet Hively? Would you try to beat it with more ports of a production by you?
Marq:
I think they've made a huge effort porting it and also fixing the source to be better portable. Open source is the way to go
if you want to support that many platforms. I don't think I can top "Planet Hively" in the sheer numbers, simply because I don't
have access to so many different gadgets. And after all, this is not really any competition either - I've ported "Planet Hively"
to four platforms myself so far :)
Magic:
Why do you think porting demoscene releases becomes more common?
Xeron:
In the old days, demos couldn't be portable, since they were written for a specific architecture. These days, a lot of
demos are written to an API, be it Direct X, OpenGL, Win32, SDL. If you want to target the "cutting edge", then you pretty
much have to target Windows and Direct X, but it's possible to make a good demo for SDL/OpenGL, so some people are starting to do
that. A lot of it stems from the change in focus of the PC demoscene from "pushing hardware limits" to design. The hardware limits
of the PC cannot be defined since everyone has a different configuration and new cards come out every year. So if you are worried
more about design than cutting edge graphics, SDL & OpenGL isn't necessarily going to stop you making the demo you want.
Marq:
There's less hardware banging these days - practically everything is done through some API and if the API is cross-platform
already it's rather easy to do a port. The current popularity of the Apple laptops has lured people to that platform and
overall there is more interest in running your prods on exotic hardware such as mobiles.
Magic:
How do you see the future for multi-platform demoscene productions?
Xeron:
Well, demos traditionally were about 'pushing the limits' of a given
hardware. Portable demos are somewhat incompatible with that idea since they
don't target any particular platform. But they do present interesting
challenges and limitations, and I suppose you could see it as another
"platform" in its own right. Of course it all depends on your minimum
target; Planet Hively was always written with handheld devices in mind, for
example.
Marq:
Multi-platform productions have been around for about ten years now and little by little they seem to become more popular. However,
I don't think it will become a mainstream thing in the near future. Coders are just too lazy to go the extra mile and produce
compliant code and compile it to other targets. Another limiting factor is the access to the less commercially dominant platforms:
people just don't have all of them at home. Releasing the sources would be one solution to this problem but unfortunately that still
seems to be out of the question for most of the sceners.
Xeron, Marq and Magic