Allegro.cc - Online Community

Allegro.cc Forums » Off-Topic Ordeals » Announcing: The RetroHack!

This thread is locked; no one can reply to it. rss feed Print
 1   2 
Announcing: The RetroHack!
Goodbytes
Member #448
June 2000
avatar

Greetings, fellow Allegators.

Let me start off by saying that I have just come home from a long trip and I am extremely tired! Therefore, I ask you to forgive the spelling, grammar and logic errors that are sure to be rampant in this announcement.

And now, I will cut to the chase.

For approximately two and a half weeks, entheh and I have been planning a competition, called the RetroHack. The basic concept is to simulate an old computer system circa 1985(codenamed "Retrix") and challenge people to make good games with it. Thus, entheh and I have been working on an API that simulates features of an old system, such as:

  • direct reads and writes to system memory via poke/peek functions

  • several varied graphics modes set by identification number

  • amusingly limited sound and graphics capabilities

The point is, the people who are developing games for this week-long contest can only use the Retrix library to do things, and nothing else(except for certain non-I/O portions of the Standard C and C++ libraries, maybe). Programming under a limited environment like so ought to be quite fun, as the experienced programmers here get to relive some nostalgic moments with a primitive system and the newcomers get to have a taste of what it was like back in the "old days" of game programming! :D

The API, which has been written in C and wraps around Allegro, will be supplied one day before the start of the competition, and at the end of the week, entries will be judged. The main focus of this competition is on originality - a return to the days when cloning and rehashing existing games was not yet practiced(wink wink). Extra points will be awarded for originality(while still maintaining good gameplay) and the creation of a completely new genre will definitely net quite a few brownie points with the judges. There will be three finalists in each category of: Most Original, Best Presentation, and Best Gameplay. (These categories may be changed and probably will be.)

Besides the mainstream rankings, there will be special prizes awarded for such things as Most Impressive Graphical Effect, Most Impressive Audio Effect, and other such things.

Anyhow, here are a few "specs" of the Retrix:

  • Several pixel and character mode displays, ranging from 160x240x4 to 640x240x1:o, as well as a vector graphics mode

  • Four!!! audio channels, allowing a combination of square waves, triangle waves, sawtooth waves, and even a special user wave mode

  • Support for hardware scrolling

  • A really nice default character set, which, although it is very nice to begin with, can be redefined

  • A nifty startup screen

I realize that ludumdare has just had a game programming competition, but I am going on a three-week vacation, in three weeks, and after that, school will be starting. So, I figure that the best dates to hold the competition will be from July 24th to July 31st. This is rather short notice, but so far, that's when the competition will be - from 12:00 AM GMT on the first Wednesday, to 12:00 AM GMT on the last Wednesday.

Now whatever comes of this competition, you are guaranteed to have fun! We already have two participants, entheh and I, so why not join the bandwagon?!

So, who would like to join? <friendly, encouraging smile>


--
~Goodbytes

Matthew Leverton
Supreme Loser
January 1999
avatar

I don't know how feasible this is... but perhaps you could limit the amount of allowable memory usage? Something like no variable can be larger than X amount of bytes. I dunno, just thinking outloud. If something like that were in place, you wouldn't have to worry about abusive malloc() and large sprites.

Quote:

# direct reads and writes to system memory via poke/peek functions

Or does this mean you have no variables - but must use a fixed system memory?

Is allegro totally out of the question [blit(), etc]?

Does the lib support sprites natively?

It would be nice if there were a doc available (soon) that detailed the exact specs. It would help potential contestants make up their mind...

Bruce Perry
Member #270
April 2000

You're allowed your own variables. It would be too much of a pain to have to do everything through the peek and poke functions. Whether malloc() will be allowed is another matter though; we might insist that everything be global or automatic (i.e. local to a function)...

In which case, don't put large arrays on the stack. If you want the array to be defined inside the function, make it static; then it will be stored in the same memory as global variables. Linux can cope with an arbitrarily large stack, but DOS can't, and I don't know about Windows.

You are not allowed to use ANYTHING from Allegro directly. No blit(). We might provide a set of functions for drawing sprites; any such sprites should be defined in arrays in the source code.

I'll post here when the docs are released. Would HTML be ok, or should I do TXT? I don't think we've got time to investigate the makedoc thingy Allegro uses...

--
Bruce "entheh" Perry [ Web site | DUMB | Set Up Us The Bomb !!! | Balls ]
Programming should be fun. That's why I hate C and C++.
The brxybrytl has you.

Goodbytes
Member #448
June 2000
avatar

Well, it just so happens that I have an API lying around here somewhere... where is it now... ah yes.

1/*
2RETRIX
3
4Retrix is a game programming library intended exclusively for the 2002
5Retrohack competition. The Retrohack is a contest in which entrants compete
6to make the most original game possible using the Retrix library. The
7library provides an API designed to mimic an early 1980's computer with lots
8of neat hacks. The library itself will be written in C and will use the
9Allegro Game Programming Library for input and output.
10
11
12This is an incomplete API, which will be fleshed out greatly during the next
13little while. It is intended only to give you an idea of the sort of things
14that the Retrix can do.
15*/
16 
17// |---|
18// |API|
19// |---|
20 
21 
22// MEMORY MAPPING
23// --------------
24typedef unsigned char rx_byte;
25 
26void rx_poke(int addr, rx_byte val);
27rx_byte rx_peek(int addr);
28void rx_poke16(int addr, int val);
29signed int rx_peek16s(int addr);
30unsigned int rx_peek16u(int addr);
31void rx_poke32(int addr, int val);
32signed int rx_peek32s(int addr);
33unsigned int rx_peek32u(int addr);
34 
35 
36// MODE SELECTION
37// --------------
38void rx_mode(rx_byte mode);
39 
40 
41// RANDOM FUNCTIONS
42// ----------------
43void rx_srand(long i1, long i2);
44unsigned long rx_rand(void);
45 
46 
47// PALETTE
48// -------
49void rx_pal_set(rx_byte entry, rx_byte c);
50rx_byte rx_pal_get(rx_byte entry);
51void rx_pal_cycle(void);
52 
53 
54// MODE 0 (CHARACTER MODE)
55// -----------------------
56void rx_locate(rx_byte row, rx_byte col);
57void rx_fgcol(rx_byte c);
58void rx_bgcol(rx_byte c);
59void rx_get_pos(rx_byte *row, rx_byte *col);
60int rx_get_fgcol(void);
61int rx_get_bgcol(void);
62void rx_target_page(rx_byte page);
63void rx_show_page(rx_byte page);
64 
65 
66// MODE 1, 2, 3 (PIXEL MODES)
67// --------------------------
68void rx_pset(int x, int y, rx_byte c);
69rx_byte rx_pget(int x, int y);
70void rx_line(int x1, int y1, int x2, int y2, rx_byte c);
71void rx_rect(int x1, int y1, int x2, int y2, rx_byte c);
72void rx_circ(int x, int y, int r, rx_byte c);
73void rx_oval(int x, int y, int rx, int ry, rx_byte c);
74 
75 
76// MODE 4 (VECTOR MODE)
77// --------------------
78void rx_beam_on(void);
79void rx_beam_off(void);
80void rx_beam_move(int dx, int dy);
81void rx_beam_zero(void);
82void rx_beam_pos(int *x, int *y);
83int rx_beam_state(void);
84void rx_beam_range(int l, int t, int w, int h);
85void rx_beam_execute(void);
86void rx_beam_clear(void);
87 
88 
89// TEXT OUTPUT
90// -----------
91void rx_putch(char ch);
92void rx_put_str(const char* str);
93void rx_put_int(int i);
94void rx_put_float(float f);
95 
96 
97// TEXT INPUT
98// ----------
99char rx_getch(void);
100char *rx_getstr(void);
101int rx_getint(void);
102float rx_getfloat(void);

This API is a bit of a work in progress, but this is the general idea of the library.

By the way, I thought that Ben's user name was entheh here, but it isn't. So, whenever I refer to 'entheh', just think 'Ben Davis.'


--
~Goodbytes

Bruce Perry
Member #270
April 2000

Apparently, everyone knows that entheh == Ben Davis, cough23cough... ::)

--
Bruce "entheh" Perry [ Web site | DUMB | Set Up Us The Bomb !!! | Balls ]
Programming should be fun. That's why I hate C and C++.
The brxybrytl has you.

Tuomas Korppi
Member #2,474
June 2002
avatar

Do you remember to include a feature to your library that makes the computer run extremely slowly, like the processor of commodore 64. IMHO speed is the thing that allows modern games be better and easier to write than the games of good old days.

How about a very limited number of hardware sprites, so that you have to make innovative video chip tricks to get decent graphics?

sicgamemaker
Member #1,365
June 2001
avatar

count me in :)

_______________________
[Insert signature here]

Goodbytes
Member #448
June 2000
avatar

Quote:

Do you remember to include a feature to your library that makes the computer run extremely slowly, like the processor of commodore 64. IMHO speed is the thing that allows modern games be better and easier to write than the games of good old days.

We have implemented a system that allows a maximum of 38400 pokes or peeks per second - this allows you to fill the entire "screen" in half a second, since the video memory occupies 19200 bytes.

How does that sound? Do you think more "delays" of this sort should be added?

Quote:

How about a very limited number of hardware sprites, so that you have to make innovative video chip tricks to get decent graphics?

The only thing resembling hardware sprites we have now are characters for use by text outputting in character and pixel modes. There are 256 of them, and they are all re-defineable, but some of them, of course, are letters, numbers, etc. So there is some restriction there.

Quote:

count me in :)

Well, I'm glad to hear that some people are interested in joining! Come on, it will be fun - who else wants to compete?


--
~Goodbytes

Irrelevant
Member #2,382
May 2002
avatar

This looks (no offence) like a trick, so during that week you'll be able to go to bed happily knowing that some poor souls are tearing their hair out trying to write something new from an assembly language/machine code rehash that you designed.

I like your style. ;)

PS: I won't participate because I'm still wrestling with C++/Allegro. Maybe next time.
What'll we be writing for then? ENIAC? ::)

<code>//----------------//</code>Here be l33tsp33x0rz.

Thomas Harte
Member #33
April 2000
avatar

Hmmm. Somewhat super-spec'd for a 1985 computer (particularly the sound chip, but also the vector output), and many older computers could update a lot more of their display than less than 10 scanlines per frame - generously assuming 50 frames per second rather than 60 - particularly z80's where you can set the stack pointer over the video display and get (limited) 16bit moves without going to an extended page.

But sure, if I'm free at the time, I'll join in. Any chance of throwing some simple TTL at the vector mode and giving us 8 colours?

Goodbytes
Member #448
June 2000
avatar

Irrelevant: No, this is not a trick, this is a competition. :P
And it's not in assembly/machine code. It's a C API. Pay attention!

Quote:

Somewhat super-spec'd for a 1985 computer (particularly the sound chip, but also the vector output)

So the Retrix was ahead of its time. ;)
The NES, which came out in 1985, had 4 sound channels - two square wave channels, a triangle wave channel, and a white noise channel. And I was under the impression that vector displays were out before raster ones.

Quote:

But sure, if I'm free at the time, I'll join in. Any chance of throwing some simple TTL at the vector mode and giving us 8 colours?

Glad to hear that you're joining! But, there will only be one colour for the vector mode: white. We're probably going to add some sort of line stippling capabilities, so maybe that could help a bit.

Anyhow, we're going to increase the amount of allowable pokes/peeks per second to 51200. But still, you won't be able to update the whole screen in one frame, so you'll have to find out how to work around it somehow - most likely by only updating the parts of the screen that have changed, or by working in character mode or something similar where you don't need to update as much of the screen. We are providing hardware scrolling and palette changes, so it won't be overly bad.


--
~Goodbytes

Thomas Harte
Member #33
April 2000
avatar

Quote:

The NES, which came out in 1985, had 4 sound channels

Technically the SN<whatever> which comes in the BBC Micro, Colecovision, MSX (I think - might be an AY) has four channels, although it is three square and one noise. But I was thinking of the special user wave mode. Although it occurs to me now that such things as the Music 5000 addon for the BBC Micro allowed waves to be uploaded and then modulated, so perhaps the Retrix was either really expensive or designed by a genius of cost minimisation?

Quote:

And I was under the impression that vector displays were out before raster ones.

Both were out before 1986, or obviously games such as Asteroids, Battlezone, Star Wars, etc, would not have existed, but I just mean that including both would, again, be very expensive - especially for the user who would have to buy two types of monitor. Unless the vector mode is just some sort of hardware addon for drawing lines without CPU assistance to the 640x240 display mode, which is communicated with through OS calls as though it were a vector display for the purposes of providing an environment people are used to?

Actually, if I take part (I have other scheduling considerations for the coming weeks, of which I am not in control), it is vector mode I want to use, so please ignore my childish argumentative manner!

Out of interest, what sort of performance can be expected in vector mode? I read somewhere that the vector screens on the old Atari arcade machines are addressable - in terms of moving the thing that excites phosphors - as 1024x768 displays, assuming that were true, what are the various costs for things in terms of pixels/second? If I'm busy thinking up radical new types of game, it would be nice to know what sort of complexity I am thinking about.

Goodbytes
Member #448
June 2000
avatar

Quote:

But I was thinking of the special user wave mode. Although it occurs to me now that such things as the Music 5000 addon for the BBC Micro allowed waves to be uploaded and then modulated, so perhaps the Retrix was either really expensive or designed by a genius of cost minimisation?

Don't worry, the user wave mode is limited and will sound very lo-fi :) And the person who designed the Retrix was a rich old man who didn't believe in profits.

And actually, the vector mode draws anti-aliased lines to a 640x480 screen. And the video memory is not used for individual pixels, but rather for a line queue with operations like RX_BEAM_ON, RX_BEAM_MOVE, and such. Once you have put everything into the queue, you execute it. Since it is a pretty big queue, and you can define where to start executing and where to stop, you can do neat things like compile a display list in a part of your queue that you only call when it is needed. And you don't have to compile it again.

As for performance, I really don't know. We are planning on limiting the number of lines that can be drawn in a fixed amount of time to try and get this thing to behave somewhat equally on different peoples' systems.


--
~Goodbytes

LEDominant
Member #2,218
April 2002
avatar

You could just pick an emulator (like Caprice Amstrad Emulator) and get everyone to make games for that. Then people will see almost exactly what it is like to program old-style.

Personally I prefer old-school programming, it involves so much more DETAILED thought. When you finish a game that shouldn't really be possible to make it is so much more satisfying.

Quite frankly, programming is getting way too easy. I wonder if people will hold 3rd Generation Language comps when 4GL and/or 5GL are finally common.???

--------------------------------------------------------
Life is a trip, watch your face when you hit the ground.

Niunio
Member #1,975
March 2002
avatar

¿Dónde hay que firmar?

Esteeeee... Where must I join? I want to create a new version of one of my games...:)

-----------------
Current projects: Allegro.pas | MinGRo

Gnatinator
Member #2,330
May 2002
avatar

I would participate if I could, this REALLY sounds like fun. BUT like Irrelevant I cannot because I'm still wrestling with C++/Allegro.:'(
I will hopefully be able to participate in the next one!

To the rest of the competitors:
Good Luck!;)

Bruce Perry
Member #270
April 2000

LEDominant: about choosing an existing emulator - it's been done, and there'd be less interest because people get attached to specific computers. Personally I'd choose the BBC Micro, but a poll a while ago on allegro.cc indicated that < 1% (IIRC) had a BBC as their first computer.

I agree with you about retro programing being more fun. These days, changing graphics mode causes the monitor to go dark for two seconds. Windows renders it impossible to do split-screen palette effects like the one in Lemmings; I've never even seen a PC do different modes in different parts of the screen, the way my BBC computer right next to me ;D can do them :-/

That said, there are always creative things you can do with today's computers, as Shawn proved with the graphics engine he did for Cupid. I still write 2D games most of the time, and I use palette tricks a lot. In fact, the vector screen in Retrix is implemented using palette tricks ;) Set Up Us The Bomb !!! used a neat palette trick to get explosions blended in the middle but with sharp edges, and without using any intermediate bitmaps; the method is described here.

Unfortunately, the more Microsoft abstract you from the hardware, the less you can do. That's why I still have Windows 98 ::)

Niunio: we don't have an official place for people to join yet. When we do, it'll be announced in this thread. Nice to see more people interested :D

--
Bruce "entheh" Perry [ Web site | DUMB | Set Up Us The Bomb !!! | Balls ]
Programming should be fun. That's why I hate C and C++.
The brxybrytl has you.

Irrelevant
Member #2,382
May 2002
avatar

Quote:

Irrelevant: No, this is not a trick, this is a competition.

I know. I was just kidding!

Quote:

And it's not in assembly/machine code. It's a C API. Pay attention!

peek & poke? Sounds like assembly (or vaugely related) to me.

Note: I said `rehash´. Rehashes don't have to be the same. They're usually slightly better.

Anyway, I WAS KIDDING!

~~~~~~~~~~

My first comp was a BBC B that my school was chucking out. GO REPTON! ;D

And, last year, I rescued 4 Masters they were binning. :o Can you believe it?! They were throwing out such a major peice of history!

BBC Basic is completely unlike C++. Well, mostly unlike it, anyway. IMO it's not really appropriate (sp?) for a C/C++ forum's RetroHack competition.

Quote:

split-screen palette effects like the one in Lemmings

Lemmings came on the BBC? Nice!
Where did lems use multiple palettes?

PS: Sorry for wandering off topic.

<code>//----------------//</code>Here be l33tsp33x0rz.

Thomas Harte
Member #33
April 2000
avatar

Quote:

peek & poke? Sounds like assembly (or vaugely related) to me.

Not true, if you like it is just an implementation of a system where certain areas aren't directly accesible by the CPU but only by port read/writes (if the CPU has ports) or particular registers. This is not an invented scenario - the TMS<something> graphics chip used in the MSX & Colecovision, and proprietarily upgraded by Sega for the Master System doesn't expose graphics memory to the CPU but requires port read/writes in exactly this manner.

Quote:

BBC Basic is completely unlike C++. Well, mostly unlike it, anyway. IMO it's not really appropriate (sp?) for a C/C++ forum's RetroHack competition.

But it is a lot more like C than most BASICs around at the time and afterwards (especially the awful C64 BASIC), supporting functions that take parameters and have return results.

Quote:

Lemmings came on the BBC? Nice!
Where did lems use multiple palettes?

I don't think it did. In fact I don't think it would even have been feasible on anything less than a Master due to memory restrictions. I think he was referring to the other versions, most of which use one palette for the level display and another for the status bar at the bottom.

N.B. have you played FireTrack? That's considered to be one of the smartest games for tricking the BBC display circuits, achieving a pixel smooth vertical scroll, and I think (I don't really know it that well) some parallax. If you don't have the correct disc drive on your computer to transfer it from the 'net, have you realised that (thanks largely to me!) tape images are proliferating and may be transferred with only a soundcard? See http://www.stairwaytohell.com, who have FireTrack amongst their collection.

Also, did you also see that http://www.masabi.com/ have formally licensed Repton 3 from Acornsoft to bring it to next generation mobile phones and pdas?

Now, the real reason I am posting to this thread :

What are the rules with respect to time? Do the rules state that I should not start my RetroHack entry at all until the competition begins, or are you only enforcing a time limit in as much as that is how long people have to become acquainted with the 'hardware'? Forget about the actual technicalities of deciding who has been cheating, if it were discovered that someone had started their entry early, or had just ported something they had already written to the hardware, would they be disqualified?

Goodbytes
Member #448
June 2000
avatar

The API and the place for joining will be up on a website sometime soon. In the mean time, less chatting, more joining! Come on, we want more than 5 people in this contest! :P

Thomas Harte: You can think about design and stuff, but you cannot start until the competition starts. I realze that this will be hard to enforce, but that's how it will go.


--
~Goodbytes

toril
Member #1,213
April 2001

It sound very cool to me !
I've never programmed on "retro" machines, so it will be interesting to see how it was !
and i'm a very nostalgic person and I like the oldschool-retro style !

I'm afraid that my programming skills aren't so high ;-(, but I can try !

Matt Smith
Member #783
November 2000

You can count me OUT. I'm old enough to remember all these machines, but not old enough to wallow in nostalgia.

Goodbytes
Member #448
June 2000
avatar

MattSmith: This conpetition is not about wallowing in nostalgia - maybe I shouldn't have said the bit about nostalgia. It's foremost a programming competition. In fact, I'm not old enough to wallow in nostalgia. I'm not even old enough to remember any of these machines - entheh is the expert on that. Maybe you don't want to join because you're tired of programming for old machines, but this is not about wallowing :)


--
~Goodbytes

Thomas Harte
Member #33
April 2000
avatar

Quote:

You can count me OUT. I'm old enough to remember all these machines, but not old enough to wallow in nostalgia.

I don't think all of us are wallowing in nostalgia. We are using modern tools to produce something with a large touch of the old fashioned. The limitations are superficially similar to an old machine in as much as they mimic video memory bandwidth and sound output capabilities, but not very similar because we are being allowed a CPU bandwidth several orders of magnitude above the real thing.

If you want a comparison, compare this to bands such as Ladytron or FischerSpooner who are creating very electronic music, superficially similar to Kraftwerk or (old style) Gary Numan, but are not scouring the country to find music studios that have not been refitted since 1980.

Grudge
Member #958
February 2001
avatar

hmmm, I have participated in the Ludum Dare compo, and to tell you the truth. It feels like I program more when I participate in one of these compos. I'm going to participate in this one !! Only one problem though, I've never had any of these old computers or old-skool stuff so I have no idea what it all involves. But I'm going to participate anyways... ;D

Can anybody maybe direct me to some old-skool sites where I can get an idea of what it all involves ?

--
Tom Van den Bon - Pixelate Editor
--
[ Pixelate ] - "...thats not a bug, it's a feature..."

 1   2 


Go to: