MicroHack
CGamesPlay

I want to run a super-quick competition. I'm talking about 1-hour long. The restriction is:

You may only have 1 source file as your entry.

That is, there are no other files allowed. You have to generate images and other media (you may load _FILE_), and give compilation instructions as a comment in the code. I put up a quick page to give a countdown here:

http://cgamesplay.com/minorhack/

Please participate if you are bored and have an hour to spare :)

[append]
Topic should be "MinorHack"

Onewing

Does it have to be allegro? And why post here?

CGamesPlay

Yes, Allegro, and post here because that is how we compare entries, of course :P

Onewing

No, no, I mean why post in Programming Questions?

I don't have allegro on me at the moment, but I could do a pure C program. :)

CGamesPlay

Pure C in console? Well, if you can do something interesting, go for it :)

Programming Questions because it felt most appropriate... It's not design, and it's more on-topic than most off-topic threads. So yes.

[append]
By the way, you know allegro.cc has precompiled binaries, right?

Onewing
Quote:

By the way, you know allegro.cc has precompiled binaries, right?

Yeah, thing is I'm at work. We have linux servers, so we got the whole gcc setup, so pure C is the only way for me atm. :)

Why I'd be participating whilst at work is a topic for another day...

CGamesPlay

Well if you want to draw up a quick text adventure over lunch or something, it'd be good in my book. Just don't use platform-specific thingies ;)

Yeah, I'm scrambling to get soem work done now so I can take a slightly-longer-than-normal lunch to do this in :)

BAF

I'm in!

CGamesPlay

Great, 2 entries and 1 maybe and 20 minutes left still :)

I will be making a tank game (if I haven't already said that), hopefully.

yozshura

I'm also in, though I don't think an hour is long enough for me but I will try.

Onewing

Question, is it MicroHack or MinorHack?

CGamesPlay

MinorHack, Micro-BlitzHack was the original name, but I changed it :)

Okay, 3 entries and 1 maybe :)

James Stanley

What, a whole game in an hour? Count me out...

CGamesPlay

Not a whole game, a crappy thing you throw together really fast :)

mh.win.zip - A fun game I coded between 11 p.m. December 31, 2005 and 2006. I just wanted to copyright something 2005.

Richard Phipps

You could do a pong / breakout game in an hour.

Snake is another good one.

CGamesPlay

GO!

Good luck, participants :)

BAF

Snake... good idea RP. :D

Onewing

Bring it!

CGamesPlay

You're in then? Good, it will be refreshing playing a text adventure :P

Or better, a C-style-IO text action game. Those are tricky :P

Onewing

I stand by what I said...bring it!

CGamesPlay

We're already 1 quarter over! I haven't even run my program for the first time yet :)

I'm looking at a tricky display method which doesn't use double buffering... because it's cool ;)

Richard Phipps

You l00t hackers you! :P

Epsi

I would do a 2 line MMORPG.

printf("Go out of your parent's house, take a good look at the big shiny ball called "the sun" and interact with other players/NPC");
printf("Other players can be identified in that they have greasy cheetos-fingers. All others living things are NPC.");

I only ask for a 30€ monthly fee :)

yozshura

I am gonna have to drop out, have other stuff to do. sorry

Richard Phipps

Hehe! Even a one hour compo is too much. :)

Todd Cope

My game is done. Do I post the source as an attachment?

CGamesPlay

Yeah, please do.

Here is my incomplete entry. Maybe I will have it finished soon:

1/// \file cgamesplay.cpp
2/// It's my MinorHack entry for 25 Jul 2006.
3/// Compile with Allegro!
4 
5#include <allegro.h>
6#include <math.h>
7#include <vector>
8 
9using namespace std;
10 
11#define SKY_COLOR makecol(196, 196, 255)
12#define GROUND_COLOR makecol(128, 196, 96)
13#define NUM_EQ 4
14#define NUM_PLAYERS 2
15#define TURN_RATE (AL_PI / 30 / 2)
16 
17double frand()
18{
19 return (double) rand() / RAND_MAX;
20}
21 
22class Tank
23{
24 public: // Public variables
25 double angle;
26 double x, y;
27 int color;
28 
29 public: // Public functions
30 Tank(): angle(0), x(0), y(0), color(0xff0000)
31 {
32 }
33 
34 void Spawn(bool facingRight);
35 void Fire();
36};
37 
38class Map
39{
40 public: // Public variables
41 int width, height;
42 int* heights;
43 Tank tanks[NUM_PLAYERS];
44 int turn;
45 
46 public: // Public functions
47 Map(): width(0), height(0), heights(NULL), turn(0)
48 {
49 }
50 
51 ~Map()
52 {
53 delete [] heights;
54 }
55 
56 void Create(int width, int height)
57 {
58 this->width = width;
59 this->height = height - text_height(font);
60 heights = new int [width];
61 
62 double freq[NUM_EQ] = {
63 (frand() / 2 + .25) * width,
64 (frand() / 2 + .25) * width,
65 (frand() / 2 + .25) * width,
66 (frand() / 2 + .25) * width,
67 };
68 double amp[NUM_EQ] = {
69 frand() * height * 3 / 4 / NUM_EQ,
70 frand() * height * 3 / 4 / NUM_EQ,
71 frand() * height * 3 / 4 / NUM_EQ,
72 frand() * height * 3 / 4 / NUM_EQ,
73 };
74
75 for(int i = 0; i < width; i++)
76 {
77 double val = 0;
78 for(int j = 0; j < NUM_EQ; j++)
79 val += (sin(i * AL_PI / freq[j])) * amp[j];
80 if(val < 1)
81 val = 1;
82 heights<i> = val;
83 }
84 
85 for(int i = 0; i < NUM_PLAYERS; i++)
86 tanks<i>.Spawn(i % 2);
87 
88 turn = 0;
89 }
90 
91 void Logic();
92 void Draw(BITMAP* to);
93} map;
94 
95void Tank::Spawn(bool facingRight)
96{
97 x = (frand() * 1 / 2 + .25) * map.width;
98 y = map.heights[(int) x];
99 if(facingRight)
100 angle = AL_PI;
101 else
102 angle = 0;
103}
104 
105void Tank::Fire()
106{
107 
108}
109 
110void Map::Logic()
111{
112 if(key[KEY_UP])
113 {
114 if(tanks[turn].angle > AL_PI / 2)
115 tanks[turn].angle -= TURN_RATE;
116 else
117 tanks[turn].angle += TURN_RATE;
118 }
119 if(key[KEY_DOWN])
120 {
121 if(tanks[turn].angle > AL_PI / 2)
122 tanks[turn].angle += TURN_RATE;
123 else
124 tanks[turn].angle -= TURN_RATE;
125 }
126 if(key[KEY_SPACE])
127 {
128 tanks[turn].Fire();
129 }
130}
131 
132void Map::Draw(BITMAP* to)
133{
134 struct seg
135 {
136 int y;
137 int x;
138 int w;
139 int c;
140 };
141 
142 vector<seg> segments;
143 
144 for(int y = 0; y < height; y++)
145 {
146 seg curseg;
147 curseg.y = y;
148 curseg.x = 0;
149 curseg.c = SKY_COLOR;
150 curseg.w = 0;
151 
152 for(int x = 0; x < width; x++)
153 {
154 if(curseg.c == SKY_COLOR)
155 {
156 if(height - heights[x] <= y)
157 {
158 curseg.w = x - curseg.x;
159 if(curseg.w)
160 segments.push_back(curseg);
161 curseg.x = x;
162 curseg.c = GROUND_COLOR;
163 }
164 }
165 if(curseg.c == GROUND_COLOR)
166 {
167 if(height - heights[x] > y)
168 {
169 curseg.w = x - curseg.x;
170 if(curseg.w)
171 segments.push_back(curseg);
172 curseg.x = x;
173 curseg.c = SKY_COLOR;
174 }
175 }
176 }
177 
178 curseg.w = width - curseg.x;
179 if(curseg.w)
180 segments.push_back(curseg);
181 }
182 
183 for(vector<seg>::iterator i = segments.begin(); i != segments.end(); i++)
184 {
185 hline(to, i->x, i->y, i->x + i->w, i->c);
186 }
187 
188 for(int i = 0; i < NUM_PLAYERS; i++)
189 {
190 double x2 = cos(tanks<i>.angle) * 16 + tanks<i>.x;
191 double y2 = sin(tanks<i>.angle) * 16 + tanks<i>.y;
192 line(to, (int) tanks<i>.x, map.height - (int) tanks<i>.y, (int) x2, map.height - (int) y2, tanks<i>.color);
193 }
194 
195 double angle = tanks[turn].angle;
196 if(angle > AL_PI / 2)
197 angle = AL_PI / 2 - angle;
198 textprintf_ex(to, font, 0, height, -1, 0, "Turn: %d Angle: %0.4f", turn + 1, angle);
199}
200 
201volatile int game_time = 0;
202static void timer()
203{
204 ++game_time;
205}
206 
207int main(int argc, char* argv[])
208{
209 allegro_init();
210 srand(time(NULL));
211 
212 set_color_depth(16);
213 set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0);
214 
215 install_keyboard();
216 install_timer();
217 
218 install_int_ex(timer, BPS_TO_TIMER(30));
219 
220 map.Create(SCREEN_W, SCREEN_H);
221 
222 while(!key[KEY_ESC])
223 {
224 while(!game_time)
225 rest(1);
226 
227 map.Logic();
228 
229 map.Draw(screen);
230 }
231 
232 return 0;
233}
234END_OF_MAIN()
235 
236// The end

Onewing

Hmmm...gotta figure out how to attach my file...

1//COMPILE LIKE THIS: gcc eatc.c -o eatc.exe
2 
3#include<stdio.h>
4#include<time.h>
5#include<string.h>
6 
7 
8 
9typedef struct area
10{
11 char cname[30];
12 char description[255];
13 struct area *adj1;
14 struct area *adj2;
15 struct area *adj3;
16} AREA;
17 
18typedef struct enemy
19{
20 char cname[30];
21 char description[255];
22 int iHP;
23 int iStr;
24 AREA *current;
25} ENEMY;
26 
27AREA *place[30];
28#define MAX_WORKERS 1
29ENEMY *workers[MAX_WORKERS];
30 
31void begin_game();
32int battle(ENEMY *monster);
33 
34int main()
35{
36 char cTemp[30];
37 int iTemp;
38 
39 place[0] = (AREA *) malloc(sizeof(AREA));
40 strcpy(place[0]->cname, "Your Desk");
41 strcpy(place[0]->description, "Your not-so big office desk.");
42 
43 
44 place[1] = (AREA *) malloc(sizeof(AREA));
45 strcpy(place[1]->cname, "Neighboring Cubicle");
46 strcpy(place[1]->description, "The walls of your fat co-worker of mold on them...");
47 
48 place[2] = (AREA *) malloc(sizeof(AREA));
49 strcpy(place[2]->cname, "Bathroom");
50 strcpy(place[2]->description, "There are two stalls...");
51 
52 place[30] = (AREA *) malloc(sizeof(AREA));
53 strcpy(place[30]->cname, "No Where!");
54 strcpy(place[30]->description, "You aren't really here!");
55 
56 place[0]->adj1 = place[1];
57 place[0]->adj2 = place[2];
58 place[0]->adj3 = place[30];
59 
60 place[1]->adj1 = place[0];
61 place[1]->adj2 = place[2];
62 place[1]->adj3 = place[30];
63 place[2]->adj1 = place[0];
64 place[2]->adj2 = place[1];
65 place[2]->adj3 = place[30];
66 
67 workers[0] = (ENEMY *) malloc(sizeof(ENEMY));
68 strcpy(workers[0]->cname, "Neighboring Programmer");
69 strcpy(workers[0]->cname, "It's Bob! You know, that fat guy you work with?");
70 workers[0]->iHP = 10;
71 workers[0]->iStr = 4;
72 workers[0]->current = place[1];
73 
74 
75 system("cls");
76 printf("*****************************\n");
77 printf("* *\n");
78 printf("* *\n");
79 printf("* minorHack Presents *\n");
80 printf("* *\n");
81 printf("* *\n");
82 printf("*****************************\n");
83 printf("Press any key to continue...");
84
85
86 scanf("%c", cTemp);
87 system("cls");
88 printf("*****************************\n");
89 printf("* *\n");
90 printf("* *\n");
91 printf("* Eat C and Die! *\n");
92 printf("* *\n");
93 printf("* *\n");
94 printf("*****************************\n");
95 
96 printf("1) Start Game\n");
97 printf("2) Quit\n");
98 scanf("%d", &iTemp);
99 if(iTemp == 1)
100 begin_game();
101
102 return 1;
103}
104 
105void begin_game()
106{
107 int i = 0, iTemp = 0;
108 AREA *current_place = place[0];
109 srand((unsigned int) time(NULL));
110 int iHp = 0, iStr = 0;
111 iHp = rand() % 5 + 10;
112 iStr = rand() % 5 - iHp + 20;
113
114 system("cls");
115 printf("*****************************\n");
116 printf("* Eat C and Die! *\n");
117 printf("*****************************\n");
118 printf("HP: %d\n", iHp);
119 printf("STR: %d\n", iStr);
120 while(iHp > 0)
121 {
122 printf("%s\n", current_place->cname);
123 printf("%s\n", current_place->description);
124 printf("1) %s\n", current_place->adj1->cname);
125 printf("2) %s\n", current_place->adj2->cname);
126 printf("3) %s\n", current_place->adj3->cname);
127 
128 for(i = 0; i < MAX_WORKERS; i++)
129 {
130 if(workers<i>->current = current_place)
131 iHp = battle(workers<i>);
132 }
133 
134 scanf("%d", &iTemp);
135 if(iTemp == 1)
136 current_place = current_place->adj1;
137 if(iTemp == 2 )
138 current_place = current_place->adj2;
139 if(iTemp == 3 )
140 current_place = current_place->adj3;
141 
142 }
143
144}
145 
146int battle(ENEMY *monster)
147{
148 return 0;
149}

Todd Cope

Okay, attached.

FMC

ahh.. too late to start :(

BAF
#SelectExpand
1#include <allegro.h> 2#include <stdlib.h> 3#include <time.h> 4#include <vector> 5#include <list> 6#include <iostream> 7 8volatile int GameTicker = 0; 9void Ticker() 10{ 11 ++GameTicker; 12} 13END_OF_FUNCTION(Ticker); 14 15 16std::vector<int> RandomData; 17 18void LoadExeData() 19{ 20 char ThisFile[512]; 21 get_executable_name(ThisFile, 512); 22 PACKFILE *Self = pack_fopen(ThisFile, "rb"); 23 24 int RandAmt = file_size(ThisFile) / 16; 25 26 for(int i = 0; i < RandAmt; ++i) 27 RandomData.push_back(pack_igetw(Self)); 28 29 pack_fclose(Self); 30} 31 32int GetRand() 33{ 34 if(RandomData.size() <= 0) 35 LoadExeData(); 36 37 int Rand = rand() % RandomData.size(); 38 int Ret = RandomData[Rand]; 39 RandomData.erase(RandomData.begin() + Rand); 40 return Ret; 41} 42 43struct SnakePixel 44{ 45 int x, y; 46 47 SnakePixel(int X, int Y) : x(X), y(Y) { } 48}; 49 50 51int main(int argc, char *argv[]) 52{ 53 srand(time(NULL)); 54 55 allegro_init(); 56 install_keyboard(); 57 install_timer(); 58 59 LOCK_VARIABLE(GameTicker); 60 LOCK_FUNCTION(Ticker); 61 install_int_ex(Ticker, BPS_TO_TIMER(60)); 62 63 set_color_depth(desktop_color_depth()); 64 if(set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0)) 65 if(set_gfx_mode(GFX_AUTODETECT, 640, 480, 0, 0)) 66 return -1; 67 68 LoadExeData(); 69 70 BITMAP *buffer = create_bitmap(SCREEN_W, SCREEN_H); 71 enum eSD 72 { 73 NORTH = 0, 74 WEST, 75 EAST, 76 SOUTH 77 } SnakeDirection; 78 79 80 // set up board 81 int BoardWidth = SCREEN_W / 5; 82 int BoardHeight = SCREEN_H / 5; 83 char **Board = new char*[BoardWidth]; 84 for(int i = 0; i < BoardWidth; ++i) 85 Board<i> = new char[BoardHeight]; 86 87 // board edge barriers 88 for(int x = 0; x < BoardWidth; ++x) 89 Board[x][0] = Board[x][BoardHeight - 1] = 1; 90 for(int y = 0; y < BoardHeight; ++y) 91 Board[0][y] = Board[BoardWidth - 1][y] = 1; 92 93 for(int x = 1; x < BoardWidth - 1; ++x) 94 for(int y = 1; y < BoardHeight - 1; ++y) 95 Board[x][y] = 0; 96 97 for(int i = 0; i < 15; ++i) 98 Board[(GetRand() % (BoardWidth - 2)) + 1][(GetRand() % (BoardHeight - 2)) + 1] = 2; 99 100 for(int i = 0; i < 30; ++i) 101 Board[(GetRand() % (BoardWidth - 2)) + 1][(GetRand() % (BoardHeight - 2)) + 1] = 1; 102 103 104 // set up snake 105 std::list<SnakePixel*> Snake; 106 //Snake.push_back(new SnakePixel((GetRand() % (BoardWidth - 6)) + 3, (GetRand() % (BoardWidth - 6)) + 3)); 107 Snake.push_back(new SnakePixel(BoardWidth / 2, BoardHeight / 2)); 108 SnakeDirection = (eSD)(GetRand() % 4); 109 switch(SnakeDirection) 110 { 111 case NORTH: 112 Snake.push_back(new SnakePixel(Snake.back()->x, Snake.back()->y + 1)); 113 Snake.push_back(new SnakePixel(Snake.back()->x, Snake.back()->y + 1)); 114 break; 115 116 case WEST: 117 Snake.push_back(new SnakePixel(Snake.back()->x + 1, Snake.back()->y)); 118 Snake.push_back(new SnakePixel(Snake.back()->x + 1, Snake.back()->y)); 119 break; 120 121 case EAST: 122 Snake.push_back(new SnakePixel(Snake.back()->x - 1, Snake.back()->y)); 123 Snake.push_back(new SnakePixel(Snake.back()->x - 1, Snake.back()->y)); 124 break; 125 126 case SOUTH: 127 Snake.push_back(new SnakePixel(Snake.back()->x, Snake.back()->y - 1)); 128 Snake.push_back(new SnakePixel(Snake.back()->x, Snake.back()->y - 1)); 129 break; 130 } 131 132 int DoSnake = 0; 133 int Score = 0; 134 while(!key[KEY_ESC]) 135 { 136 while(GameTicker > 0) 137 { 138 poll_keyboard(); 139 140 if(key[KEY_LEFT] && SnakeDirection != EAST) 141 SnakeDirection = WEST; 142 else if(key[KEY_RIGHT] && SnakeDirection != WEST) 143 SnakeDirection = EAST; 144 else if(key[KEY_UP] && SnakeDirection != SOUTH) 145 SnakeDirection = NORTH; 146 else if(key[KEY_DOWN] && SnakeDirection != NORTH) 147 SnakeDirection = SOUTH; 148 149 if((DoSnake % 8) == 0) 150 { 151 switch(SnakeDirection) 152 { 153 case NORTH: 154 Snake.push_front(new SnakePixel(Snake.front()->x, Snake.front()->y - 1)); 155 break; 156 157 case WEST: 158 Snake.push_front(new SnakePixel(Snake.front()->x - 1, Snake.front()->y)); 159 break; 160 161 case EAST: 162 Snake.push_front(new SnakePixel(Snake.front()->x + 1, Snake.front()->y)); 163 break; 164 165 case SOUTH: 166 Snake.push_front(new SnakePixel(Snake.front()->x, Snake.front()->y + 1)); 167 break; 168 } 169 Snake.pop_back(); 170 171 if(Board[Snake.front()->x][Snake.front()->y] == 1) // Hit Barrier 172 { 173 std::cout << "\nGame Over! Score: " << Score << "\n\n"; 174 return 0; 175 } 176 else if(Board[Snake.front()->x][Snake.front()->y] == 2) // FOOD! 177 { 178 ++Score; 179 Board[Snake.front()->x][Snake.front()->y] = 0; 180 Board[(GetRand() % (BoardWidth - 2)) + 1][(GetRand() % (BoardHeight - 2)) + 1] = 2; // new food 181 182 switch(SnakeDirection) // Make snake longer \o/ 183 { 184 case NORTH: 185 Snake.push_front(new SnakePixel(Snake.front()->x, Snake.front()->y - 1)); 186 break; 187 188 case WEST: 189 Snake.push_front(new SnakePixel(Snake.front()->x - 1, Snake.front()->y)); 190 break; 191 192 case EAST: 193 Snake.push_front(new SnakePixel(Snake.front()->x + 1, Snake.front()->y)); 194 break; 195 196 case SOUTH: 197 Snake.push_front(new SnakePixel(Snake.front()->x, Snake.front()->y + 1)); 198 break; 199 } 200 } 201 202 DoSnake = 0; 203 } 204 205 ++DoSnake; 206 --GameTicker; 207 } 208 209 while(GameTicker < 0) 210 { 211 rest(1); 212 } 213 214 clear_bitmap(buffer); 215 216 /*rectfill(buffer, 0, 0, SCREEN_W, 5, makecol(255, 255, 0)); // Top 217 rectfill(buffer, 0, 0, 5, SCREEN_H, makecol(255, 255, 0)); // Left 218 rectfill(buffer, 0, SCREEN_H - 5, SCREEN_W, SCREEN_H, makecol(255, 255, 0)); // Bottom 219 rectfill(buffer, SCREEN_W - 5, 0, SCREEN_W, SCREEN_H, makecol(255, 255, 0)); // Right*/ 220 221 for(int x = 0; x < BoardWidth; ++x) 222 { 223 for(int y = 0; y < BoardHeight; ++y) 224 { 225 if(Board[x][y] == 1) // Barrier 226 rectfill(buffer, x * 5, y * 5, ((x + 1) * 5) - 1, ((y + 1) * 5) - 1, makecol(255, 255, 0)); 227 if(Board[x][y] == 2) // Food 228 rectfill(buffer, x * 5, y * 5, ((x + 1) * 5) - 1, ((y + 1) * 5) - 1, makecol(255, 128, 64)); 229 } 230 } 231 232 for(std::list<SnakePixel*>::iterator i = Snake.begin(); i != Snake.end(); ++i) 233 { 234 rectfill(buffer, (*i)->x * 5, (*i)->y * 5, (((*i)->x + 1) * 5) - 1, (((*i)->y + 1) * 5) - 1, makecol(192, 192, 192)); 235 } 236 237 textprintf_right_ex(buffer, font, SCREEN_W, 0, makecol(255, 0, 0), makecol(255, 255, 0), " Score: %d ", Score); 238 239 240 blit(buffer, screen, 0, 0, 0, 0, SCREEN_W, SCREEN_H); 241 } 242 243 destroy_bitmap(buffer); 244 245 return 0; 246} 247END_OF_MAIN()

There is mine. Compile it how you would any normal allegro program. For more randomness, specify a different debugger level (e.g. -g3 for maximum randomness). I used `g++ minorhack_release.cpp -o minorhack_release -g3 -lalleg` myself.

You are the grey snake. Eat the pinkish colored food while avoiding the yellow stuff. Sometimes it doesn't recognize a turn (I didn't have time to fix that :P). There may be random bugs but for the most part it works. It reads itself (its own binary executable file) and randomly picks bits from it to use for random positioning of stuff.

I didn't have time to code detection of running into yourself, so you can hit yourself and keep going. :P

Todd Cope

Cool, snakes 8-)

Richard Phipps

Very clever Baf!

Now if you can do that, why not a full game next? :)

CGamesPlay

Onewing: Nice attempt. Once the battle part is done maybe it will work :P

BAF: Pretty cool. Definitely the best in my opinion :P

Todd: You are a close second, but I couldn't figure out how to kill the yellows or blues...

All in all, I think it goes BAF, Todd, then Onewing and me tied for third :) Hmm, but Onewing's might be slightly more involving than mine...

Simon Parzer

Uhh, can we do something like this again, on a weekend perhaps? Completely missed it. :(

Derezo

I also completely missed it. We should do another one some time! :D

I liked blitzhack, which was 6 hours.

CGamesPlay

I was actually going to suggest one of two things. Either another of the same thing as this, or a phase-based competition. Taking place over 1 day, the competition happens in phases:

First is a 3-hour coding competition to create a good game engine. You may use any number of source files, but no media, yet. (Time: T+3 hours)

Then is a 1-hour break in which we get together and determine which program is the best. The top two will be used for the next part of the competition. (Time: T+4 hours)

In the second phase, you may select either of the two previous winners (you may not select the one that you wrote), and enhance it. This part of the competition is 2 hours long, and a rule-o-matic will be used to determine what to enhance (i.e. you must make this enhancement, and at your option may add others). You may use external media for this part of the competition. (Time: T+6 hours)

Then is 2-hour break in which we get together and determine which program is the best (that is, which person produced the best enhancements). The top two will again be carried in to the next phase. During this break, you may create media files for use in the next phase. (Time: T+8 hours)

The final phase is another 2-hour phase where you can select either of the previous top two winners. In this phase you may select either of the winners, even if one of them is yours. A rule-o-matic will be used to generate a genre requirement, and the goal of the phase is to make the game fit into that genre. (Time: T+10 hours)

What do you guys think? I think this is a unique competition idea that should be fun, interactive, and also give you the opportunity to both work with someone else's code and create graphics on a tight deadline. The time line is rather long for a straight-run competition, but there are actually only 3 + 2 + 2 hours that you must be there.

If you guys are interested in the phase idea, I will set it up. I imagine we would run it sometime after SpeedHack, but that's at everyone's option. We can do the MinorHack again this weekend either way.

Onewing
Quote:

Nice attempt

Thanks! I thought it was considering I had absolutely nothing and I had to use gcc (which I prefer not to).

I'd be up for another one, but only if I get to use allegro. About the phase-based competition, sounds interesting...and confusing, but interesting. I'm always up for anything. I'm a Hack-Whore.

CGamesPlay

Well, I'm gonna go ahead and set the time for the next MinorHack to this saturday at the same time of day. If anyone would rather it be moved, let me know and we can work it out.

BAF

I dunno if I'll be participating this weekend, I may have commitments to fulfill.

Onewing
Quote:

next MinorHack to this saturday at the same time of day.

So I've got a week to make a game, eh? Guess I better get started. :P

Actually, I wouldn't do that, but what's stopping someone else from doing it?

FMC

I think it is nice as it is, one hour, one source file :)
But i think we should choose a theme, just to discourage stupid people from using something written before

Richard Phipps

I can pick a theme. Just let me know when.. :)

CGamesPlay
Quote:

Actually, I wouldn't do that, but what's stopping someone else from doing it?

I'm going to add a rule-o-matic that selects one stupid rule :)

For instance, "game must use a VM". Very loose but very off-the-wall rules. I don't want to limit genre or theme, because I like having different genres, and some games might not actually have a theme.

Onewing
Quote:

Very loose but very off-the-wall rules.

Good enough. Maybe, "all functions have to be recursive" or "you must use rotate_sprite in some manner" could be fitting rules. ;D

CGamesPlay

Those are both good. I have some very creative ideas. I think I will add theme restriction rules, but if one of them is selected there will be a backup rule for games in which there is no theme.

FMC
Quote:

all functions have to be recursive

I'd need an hour just to think how to implement it :P

Derezo

That would be extremely difficult to implement.

Unless you only have one function... ;)

CGamesPlay

I am taking down the MinorHack countdown for a while. It will be back before Saturday, don't worry :)

BAF
Quote:

Very clever Baf!

Now if you can do that, why not a full game next? :)

I have no motivation. An hour or two is good, once or twice a year I can handle 72 hours, but a full fledge game? :P

[edit]
Plus I always try to neaten and get things orderly, and never end up getting anything done. My stuff ends up being infinately extendable yet infinately not done. With 1 hour, I just pour code straight from my brain into the editor and go. :P No time for organizing, as you can tell by looking at my source. Its fugly.

kazzmir

I only tried CGamesPlay and sort of skipped most of the comments after he pasted his code but a) it didnt compile outright and b) firing is unimplemented.

Originally I got this error:

x.cpp:140: error: `Map::Draw(BITMAP*)::seg' uses local type `Map::Draw(BITMAP*)::seg'
x.cpp:140: error:   trying to instantiate `template<class _Alloc> class std::allocator'
x.cpp:140: error: template argument 2 is invalid

Because vector<seg> segments used a locally declared struct, I didnt even know that was legal and apparently neither does g++( 3.4.4 ). I moved the definition of the struct outside the Draw() method and it worked fine.

CGamesPlay

Yeah, firing was unimplemented. I should have just gone with the double buffer method and solved both those problems :P

jakerohs

West of House
You are standing in an open field west of a white house, with a boarded front door.
There is a small mailbox here.

>

James Stanley

You are standing in an open field west of a white house, with a boarded front door.
There is a small mailbox here.

>LOOK AT GROUND

You see a sledgehammer, lots of grass and some beetles

>GET SLEDGEHAMMER

You have picked up a Sledgehammer

>INVENTORY

1 Sledgehammer
1 Sandwich
3 Mysterious coins

>EAST

OK.

>LOOK

You are at a white house, with a boarded front door.
There is a small mailbox here. To the west is an open field.

>SMASH DOOR

What with? You need to use something.

>USE SLEDGEHAMMER

OK.

>SMASH DOOR

The door breaks down in front of you.

>LOOK

You are at a white house, with a broken front door.
There is a small mailbox here. To the west is an open field. Through the doorway you can see a flight of stairs. You can see an eerie purple light reflected on the stairs.

>_

Hee hee. Anyone like to continue? :)

Richard Phipps

Quote:

Plus I always try to neaten and get things orderly, and never end up getting anything done. My stuff ends up being infinately extendable yet infinately not done.

Just get stuff done and don't worry about the code. Even professional game developers don't have time to stop code getting hacky when it's crunch time. :)

CGamesPlay

Ack! I am not going to be able to participate this Saturday! I would like to run one on Sunday at 8 p.m. EDT (Mon Jul 31 01:00:00 UTC 2006). I can run both if you guys like, or only one. You decide :) (Or suggest something completely different)

Onewing

I can't really do Saturday either, because of yet-another-wedding. However, I'm in for Sunday. ;D

BAF

I don't know if I'm in or out. Probably out Fri,Sat,Sun. Probably Thurs.

CGamesPlay

Ugh. I've had some plans sprung on me, and won't be in town this weekend. I will still have the site up, but won't be in town to manage it.

[append]

Feast your eyes, allegroites, on the new, improved MinorHack site. It features a super-slick backend that you don't really care about. Most importantly, it has a count down, and will select a rule once the competition starts. I won't be in town for these, of course, but I expect some good entries, damnit! If I get back and nobody has anything I will be angry! And sad! Avoir!

Onewing

Are those times UTC?

CGamesPlay

No, they are EDT, sorry :) That's GMT -4 :)

Onewing

I thought of an idea that would be kind of neat for a programming competition. It would be cool if we could get somebody (or somebodies) to make a large set of artwork, gfx, sfx and music and this is the only media that participants use. This totally focuses on the programmer's ability to make efficient/fun gameplay, considering every game will have the same look/feel. It's just an idea that's up for the community to manage into a working model.

Also, at the International Programming Competition*, there was this fun mini-competition where you are given a manual of object code written in java. The goal was to take this set of object functionality and produce some code that would make the object to think and react. Then, you step back and everybody's code competes with everybody elses code and the winners are determined simply by which AI wins the game itself.

At the competition I was at, we have a car and we had to develop it's brain to race and collect points and win by having the most points. It was three hours long, and none of us were very familiar with java, so the first two hours, we tried to figure out how the manual worked. Then, for the last hour, we designed a "brain" that just went for the simplest route of gainning points. Assuming we lost, we watched the games play out in several tournament like matches. We were proud (and surprised) to win third place. The main thing about our program was that it avoided pile-ups from running into other cars, which happened every race. It was really funny.

Hmmm, I really went off topic there, didn't I? Well, anywho, the phase-idea that you presented would allow for similar results of that java competition if we make a decent engine in the early phases. Just thought I'd throw all this out there. :)

  • I was a Sophomore at the time. I got to go because I was on the reserve team (which was allowed to compete in the java challenge). One of my roommates ran into Sean Connery in our hotel. :o What an experience...

[edit] - some typos.

CGamesPlay

Bump!

So I guess nothing happened then :-/ How very sad :P

Well I will do more work on a PhaseHack site and maybe run one late August/early September.

Onewing

I ended up being too busy to do one anyway. However, with you gone, it didn't make much sense. You've got to have a sheperd to herd the sheep!

Thread #586670. Printed from Allegro.cc