Allegro.cc - Online Community

Allegro.cc Forums » Off-Topic Ordeals » [RetroHack] Start of competition

This thread is locked; no one can reply to it. rss feed Print
[RetroHack] Start of competition
Victor Williams Stafusa da Silva
Member #4,212
January 2004
avatar

Hopefully i could do something.

[The attack of the space bugs - Speedhack 2005] [Rambananas - Speedhack 2006] [Make clean - Speedhack 2009] [The source god - TINS 2010]

Simon Parzer
Member #3,330
March 2003
avatar

Does anyone know of a tracker/sequencer program that can create .psg files? I have to write one if I don't find one (It can be an ATARI/MSX/whatever program as long as I'm able to emulate it).

And no, stealing music isn't a solution for me.

Jeff Bernard
Member #6,698
December 2005
avatar

A little clarification on the rules: With the 512 kb space limit. Let's say my game is less than 512 kb out of the zip and runs. Now, my game has saving in it, and what if the created save file brings the filesize greater than 512 kb? Does the RetroHack Machine have a "memory card" system, or are we saving directly to the "battery"?

Simon Parzer: I've been looking for one too. Not much success (as I haven't found one), but if I do, I'll post it here.

--
I thought I was wrong once, but I was mistaken.

Thomas Harte
Member #33
April 2000
avatar

Quote:

Thomas, is the colour palette set? If so, what are the colours? Or can we use Allegro to change it?

Whatever you do, don't use Allegro! As it's a library "other than the RetroHack library and any libraries that you would reasonably expect to be supplied with a compiler", it's size would count towards the total size of your entry. And as the source code is currently 5.1 MB, you'd be disqualified for breaking the 512 kB rule...

Quote:

Does anyone know of a tracker/sequencer program that can create .psg files?

The Wikipedia paye for AY-3-8910 mentions "SoundTracker", but the wikilink seems to go to a different tracker with the same name.

Note that the AY in the RetroHack machine is clocked at exactly the same rate as a ZX Spectrum.

Probably one of us (me?) should look into providing a tracker or wider file format support as a service for everyone else — especially as there's no rule against using other people's code. Just remember that it count's towards your file size total.

Quote:

Does the RetroHack Machine have a "memory card" system, or are we saving directly to the "battery"?

Oh, I hadn't thought about that at all. The rule, as worded, concerns the file size before the program is built or run, so the save games would not be counted. Since I don't want to be changing rules mid-competition, I guess that's how it'll have to stay.

Quote:

Ok, the sound works fine now.

Great! I'll make that version 1.1 of the library assuming it passes all of my tests too.

I don't think my code liked being adapted from a threaded SDL implementation to an Allegro "please can I have a sound buffer to fill now, if I'm awake at all" type arrangement.

EDIT:

Quote:

Grrr... this palette is so limiting... I can't find any good reds to even recreate Mario.

Then recreate Luigi!

I admit the palette doesn't quite span the full gamut, and isn't very close to the traditional RGB TTL-logic of many 80s machines. But its similar (though more expansive) to that on platforms like the C64.

Richard Phipps
Member #1,632
November 2001
avatar

Come on guys, you had very limited colours and palettes on the 8-bit (and even the 16-bit machines). Use your imagination and work within the limitations! :P

HardTranceFan
Member #7,317
June 2006
avatar

Quote:

Does anyone know of a tracker/sequencer program that can create .psg files?

The only ones I found a few days ago are MSX trackers. Use the emulator to log the AY changes to a psg file for use with your RetroHack game. Thomas mentioned FUSE Spectrum (Linux). In windows fMSX creates a psg file (my attempts with it resulted in about 30 seconds of music being a few hundred kb in size) and apparently X128 can do it too, but I can't confirm as it doesn't want to run on my machine :-/.

Quote:

Probably one of us (me?) should look into providing a tracker or wider file format support

Either option would be great and make life a little easier on us, particularly as there's a deadline and a few restrictions to adjust to.

Quote:

Quote:

Ok, the sound works fine now.

Great! I'll make that version 1.1 of the library assuming it passes all of my tests too.

Heh, and version 1.1 makes for crappier sound for me. It's slower, the pauses between notes seems to be a little random (either that, or a note is played for a longer period than it should). If it'll help, I can get a wav dump of the tetris demo so you can hear what it's like.

--
"Shame your mind don't shine like your possessions do" - Faithless (I want more part 1)

Thomas Harte
Member #33
April 2000
avatar

Quote:

In windows fMSX creates a psg file (my attempts with it resulted in about 30 seconds of music being a few hundred kb in size) and apparently X128 can do it too, but I can't confirm as it doesn't want to run on my machine

No, X128 is an ancient DOS emulator that I think was extremely popular a little less than 10 years ago.

PSG files are gigantic because they're really, really stupid. At best they are a tagged list of the changes that were made to AY registers during each frame. At worst, as with the ones I got from FUSE, They're a list of the value in every single register, every single frame - and they're almost twice as large as they need to be for that because the format is based around "identifier of changed register, new value" pairs so FUSE is wastefully writing 16 bytes every frame that could easily be implicit.

The proper tracker formats seem to have notes, envelopes, loops, etc, as you'd expect. Which probably make both the tunes I've included about 2 kB in size rather than <whatever> hundred kB they are at the minute.

I'll get onto this as soon as I have a spare minute.

Quote:

Heh, and version 1.1 makes for crappier sound for me. It's slower, the pauses between notes seems to be a little random (either that, or a note is played for a longer period than it should). If it'll help, I can get a wav dump of the tetris demo so you can hear what it's like.

Just to confirm: you mean the version attached to this post and not any of the previous ones? If so then it may not help that it periodically dumps '.'s to stdout. But I doubt if that's a serious timing problem as it doesn't do it much. A WAV would be great.

Allegro is sufficiently frustrating that I'm tempted just to leave the buffer size hardcoded at 1024 (as in the current official libraries) and leave it as a compile time option as neither OS X or Windows seem to have an issue with that sort of buffer size and — as an extremely broad generalisation — Linux people are used to having to adjust things anyway.

HardTranceFan
Member #7,317
June 2006
avatar

Quote:

Just to confirm: you mean the version attached to this post and not any of the previous ones? If so then it may not help that it periodically dumps '.'s to stdout. But I doubt if that's a serious timing problem as it doesn't do it much. A WAV would be great.

Yes, that retrohack.c file.

Attached are 2 mp3 files:
OriginalTetrominoes.mp3 is the output from the original game you supplied as an example program.
WithNewRetroHeader.mp3 is the output compiled with the new retrohack.c file.

Any chance that you compile and post a new version of the tetrominoes.exe? Then I can check to see if it's my compiler, or maybe something I'm doing (though I've compiled with the original .c file and there were no problems).

--
"Shame your mind don't shine like your possessions do" - Faithless (I want more part 1)

Thomas Harte
Member #33
April 2000
avatar

Quote:

Attached are 2 mp3 files

Oh, you're right, that's horrid. I'll get right onto it. I expect I've forgotten to initialise something.

Vanneto
Member #8,643
May 2007

I get an undefined reference to rt_Init() linking error. :P What am I doing wrong?

Im using the function like this:

1// something.hpp
2#ifndef ...
3#define ...
4#include "retrohack.h"
5 
6class Something
7{
8 public:
9 static bool Init();
10};
11#endif
12 
13// something.cpp
14bool Something::Init()
15{
16 bool result = rt_Init();
17 if (result != true) return false;
18 return true;
19}

In capitalist America bank robs you.

Simon Parzer
Member #3,330
March 2003
avatar

Quote:

I get an undefined reference to rt_Init() linking error. :P What am I doing wrong?

Maybe you forgot to add retrohack.c to your project?

Vanneto
Member #8,643
May 2007

Nope, already thought about that. Its in the project alright...

In capitalist America bank robs you.

Thomas Harte
Member #33
April 2000
avatar

Quote:

I get an undefined reference to rt_Init() linking error. What am I doing wrong?

Oh! My mistake! Try this:

 extern "C" {
   #include "retrohack.h"
 }

It'll be fixed in version 1.1.

microcat
Member #9,025
September 2007

What about the allegro timers? Is it okay to use them in this competition?
I was thinking about making a game where you have to race against the clock, do I have to find alternate methods?

I think it's a bit unclear what parts of allegro we can use and what parts we can not. In tetrominoes.c, for example, I seem to recall a call to load_pcx, blit and others. I assume we can use all the allegro functions as long as we use the retrohack ones for graphic display and sound playing?

Vanneto
Member #8,643
May 2007

You should use the RetroHack machine timers...

In capitalist America bank robs you.

Jeff Bernard
Member #6,698
December 2005
avatar

I believe you can't use any Allegro routines. At least, I'm not going to.

What you say in tetrominoes was how Thomas Harte made his .fnt file from a bitmap font. If you looked at the source, you would notice that GrabFont() is never called.

--
I thought I was wrong once, but I was mistaken.

Elias
Member #358
May 2000

Is there something like in Speedhack where you can see screenshots with the current progress of contestants? I always liked watching those.. :)

--
"Either help out or stop whining" - Evert

Jeff Bernard
Member #6,698
December 2005
avatar

Nope. :(

I've set up a special blog for RetroHack on my website. It's pretty much up to everyone themselves.

--
I thought I was wrong once, but I was mistaken.

HardTranceFan
Member #7,317
June 2006
avatar

My current screen shot is a blank screen. Although I've checked out the example programs, searched for .psg files and trackers, hunted for appropriate graphics and scratched my head in desperation for a semi-decent game idea, I've not started any coding what-so-ever.

My initial intention is create a utility to convert my 256 colour bitmap sprites to images with the palette that is used by the RetroHack library, so that the colours are as close to the original sprite as possible.

I'm aiming to complete a simple game (due to time constraints & house renovations), but hopefully one that contains a smidgeon of fun.

[edit]
Thomas, any chance of modifying the library to play .ay files?
[/edit]

--
"Shame your mind don't shine like your possessions do" - Faithless (I want more part 1)

Jakub Wasilewski
Member #3,653
June 2003
avatar

My current screenshot is a green screen. However, the sound is what is interesting.

I've began putting together my own tracker, and lo and behold, it uses its own format for storing music. I deemed that using the .psg playing functions would be a bit of a cop-out (come on, no '80s computer shipped with a "please play my music" subroutines in their ROM ;)), so I went all the way. Of course, I will probably fail miserably (due to timing issues and the need to interleave AY/blitter calls), but it's still worth a try. As of now, the tracker routine loads and plays "samples", but is oblivious to the order they should be played :).

The other thing I already have is a python converter for graphics, again converting to my homegrown format (which allows even 256-colour bitmaps - if you have the time to blit them).

I have a clear idea for what my game will be, and the type of gameplay is heavily influenced by the way the blitter works. It will be rather simple, so hopefully I will be able to finish it in time, even in between classes and work.

One question, though - are teams allowed? Nothing really deep, I just want to convince one of my friends to write some music for the game. Most people will use ripped files anyways, so I think that should be okay :).

---------------------------
[ ChristmasHack! | My games ] :::: One CSS to style them all, One Javascript to script them, / One HTML to bring them all and in the browser bind them / In the Land of Fantasy where Standards mean something.

Thomas Harte
Member #33
April 2000
avatar

Quote:

I think it's a bit unclear what parts of allegro we can use and what parts we can not. In tetrominoes.c, for example, I seem to recall a call to load_pcx, blit and others. I assume we can use all the allegro functions as long as we use the retrohack ones for graphic display and sound playing?

Quote:

What you say in tetrominoes was how Thomas Harte made his .fnt file from a bitmap font. If you looked at the source, you would notice that GrabFont() is never called.

Oh, yeah, no Allegro functions are allowed! GrabFont was meant to be commented out, I guess I uncommented it for some reason and forgot to comment it again. The only reason it's not deleted is that I thought other people might like a quick and way to get some writing done in their games and probably wouldn't like that horrid variant of Tahoma that I picked and then found disgusting.

Quote:

Thomas, any chance of modifying the library to play .ay files?

If I can find a documentation then yeah — why not? Except that at this stage it won't go in the library but will instead be some extra code that people may chose to use if they want, the fundamental difference being that it'll count towards your 512 kB.

The only things I intend to do to the main library are fix the header so that you don't have to manually declare it extern "C" if you're a C++ user and try to get dynamic audiostream size selection working to alleviate the problems with high latency machines as described by Simon Parzer.

Quote:

come on, no '80s computer shipped with a "please play my music" subroutines in their ROM

The BBC Micro does...

Quote:

One question, though - are teams allowed?

Yep. I stand by the principle that it's too late to add or modify rules significantly now.

Paul Pridham
Member #250
April 2000
avatar

Does this have to be a game per se? Could one make an interpretive interface on top of the Retrohack library instead, like the old interactive BASICs and such used for making games back in the 8-bit days?

Jakub Wasilewski
Member #3,653
June 2003
avatar

Quote:

The BBC Micro does...

Wasn't aware of that, sorry. I've never seen a BBC Micro in real life, and I'm not even sure they were ever available here (Poland being part of the socialist block back then).

Anyway, I just want to get the most kick out of participating and trying new things - hence doing my own tracker is just something to boost my own satisfaction :).

---------------------------
[ ChristmasHack! | My games ] :::: One CSS to style them all, One Javascript to script them, / One HTML to bring them all and in the browser bind them / In the Land of Fantasy where Standards mean something.

Elias
Member #358
May 2000

Just starting here.. and I'm wondering about colors, each sprite can use one 16-color palette out of the following 48 palettes - did I interpret that right?
593583

--
"Either help out or stop whining" - Evert

Karies
Member #8,158
December 2006
avatar

Jakub! Also You could release your tracker for other person using... like me :P



Go to: