Allegro.cc - Online Community

Allegro.cc Forums » The Depot » Darkwave, Alpha Release

This thread is locked; no one can reply to it. rss feed Print
Darkwave, Alpha Release
IonBlade
Member #3,521
May 2003
avatar

[EDIT]: Source included in my next post.

Well, I'm putting up my first game for release (technically it's my second, if you want to call a console window connect 4 game from several years ago a release;D).

It's called Darkwave, and I think I'll let the readme description do the rest:

Darkwave is a puzzle game in which you must destroy the colored blocks by putting like-colored breaker pieces next to them. The more you break, the more points you get. Causing chain reactions will earn you a combo multiplier bonus. How big of a combo can you get?

The version shown here is the very first "public-ready" version. I am actually redesigning the game from the ground up, as this was my first attempt at a releasable puzzle game. Infact, this is the first game I've gotten far enough to be able to show publicly.

So far it has only been tested on WinXP, and you shouldn't mess around too much with the default config.cfg or you could get some unpredictable behavior. The controls are included in the readme. I've submitted this project to the Depot and it is still queued, so here is the link to the game via my forthcoming personal website:

http://www.impulsezero.com/dwAlpha.zip(5.6MB), and we'd all love some screenshots, wouldn't we?

http://www.impulsezero.com/dw1.JPG
http://www.impulsezero.com/dw2.JPG
http://www.impulsezero.com/dw3.JPG

Let me know what you think. (check out my score on the third screenshot.. i'll never be able to do that again :o)

KNOWN BUGS:

A bug exists that sometimes allows you to move a piece
inside an existing one, thus overwriting it. This happens
if you're rotating real fast in an enclosed space.

Some of the music doesn't loop properly. Either it won't loop at all, or it will play again oddly at low speed. The program randomly selects a song from the data/music/mod/ folder upon loading, so throw any .it, .s3m, .xm, or .mod in there and it should load just fine.

(you can also put any screen-sized .bmp in the data/backgrounds folder. the default screen size is 800x600)

CREDITS:

This isn't a full release so I'll just list the basics:

Game and GFX by me, Alex Adolphsen

Backgrounds are from my old HD, they were downloaded from
some desktop render site a long time ago...

Music from www.modarchive.com
Sound effects from Half-Life 2

Allegro 4.1 is used, and the DLL is included.
Also included is msvcr71.dll, incase it is needed.

This game uses the FMOD Ex audio library,
http://www.fmod.org

Also used: JPGAlleg, FBlend0.5beta, and AllegroFont.

I don't plan on releasing the source for this, because it became a hard to follow mess that made it difficult to implement new features easily, plus I'd be embarassed:) I'm in the process of re-writing the entire game with a respectable code base for future releases, using Allegro 4.2 and a newer version of FMOD Ex.

------

"I've got to choose my words carefully so that I'm not misunderstood, but I think there are fewer developers around today who think about making a good game. As a creator, I find that sad..." - Hideo Kojima

CGamesPlay
Member #2,559
July 2002
avatar

Looks nice :) But if you won't release the source I won't play the game. This is mainly because you don't include a Linux binary. Several other people will have the same reaction.

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Michael Faerber
Member #4,800
July 2004
avatar

Quote:

Looks nice :) But if you won't release the source I won't play the game. This is mainly because you don't include a Linux binary. Several other people will have the same reaction.

I second that.

--
"The basic of informatics is Microsoft Office." - An informatics teacher in our school
"Do you know Linux?" "Linux? Isn't that something for visually impaired people?"

IonBlade
Member #3,521
May 2003
avatar

Well.. here's the source, just click the attachment. You'll need Fblend0.5, FMOD 3.74 http://www.fmod.org (it's my remake version that uses FMOD Ex, doh), and AllegroFont. Don't consider this the base for future versions, the code is very rough.

[EDIT]: The link to Alfont is broken, so I've uploaded it here: http://www.impulsezero.com/downloads/alfont.zip
[EDIT2]: You can add joystick support by adding poll_joystick() somewhere in the game loop, and by changing

//init board controls
board[0].SetInputType(INP_KEYBOARD);
board[0].SetLeftKey(KEY_LEFT);
board[0].SetRightKey(KEY_RIGHT);
board[0].SetDownKey(KEY_DOWN);
board[0].SetDropKey(KEY_UP);
board[0].SetRotateRightKey(KEY_SPACE);

to

board[0].SetInputType(INP_JOYSTICK); 
board[0].SetLeftKey(JOY_LEFT);
board[0].SetRightKey(JOY_RIGHT);
board[0].SetDownKey(JOY_DOWN);
board[0].SetDropKey(JOY_UP);
board[0].SetRotateRightKey(JOY_BUTTON1);

------

"I've got to choose my words carefully so that I'm not misunderstood, but I think there are fewer developers around today who think about making a good game. As a creator, I find that sad..." - Hideo Kojima

Jonny Cook
Member #4,055
November 2003

Whoa, that's a really professional looking game! Nice work. Maybe someday I'll feel motivated enough to make a cool game like that...

The face of a child can say it all, especially the mouth part of the face.

IonBlade
Member #3,521
May 2003
avatar

Quote:

Whoa, that's a really professional looking game! Nice work. Maybe someday I'll feel motivated enough to make a cool game like that...

Did you play it, or just look at the screenshots?

------

"I've got to choose my words carefully so that I'm not misunderstood, but I think there are fewer developers around today who think about making a good game. As a creator, I find that sad..." - Hideo Kojima

zer0
Member #6,501
October 2005
avatar

Gave it a try using windows. The concept is ok and the graphics look good. I found a bug where if you drop a piece that has two breaking-blocks, and you break two sections of color, it won't give you a combo score. The controls were actually kind of frustrating. Wasn't bad, gave me about 15 minutes of gameplay.

CGamesPlay
Member #2,559
July 2002
avatar

I looked over your code, and you really shouldn't be embarassed. That's some of the nicer code I've seen. I think the only thing you might be embarassed about is the number of global variables, because there are a lot.... But that's nothing bad, because you abstract everything well enough that nothing interferes with anything else.

//rotation speed. negative for left rotation, zero for no rotation, positive for right rotationThat's backwards, btw :P

[edit]
Here's an interesting gem from random.h:

static unsigned long mt[N]; /* the array for the state vector  */
static int mti=N+1; /* mti==N+1 means mt[N] is not initialized */

Did you mean for that to be in random.cpp instead?

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Jonny Cook
Member #4,055
November 2003

Quote:

Did you play it, or just look at the screenshots?

Of course I played it.

The face of a child can say it all, especially the mouth part of the face.

Michael Faerber
Member #4,800
July 2004
avatar

Sorry, but I Linux users will not be able to play your game, because you use FBlend, which is a Windows-only library.

If you want OS-independent blending functions, you could use OpenLayer in future versions.

OpenLayer download
OpenLayer Documentation

--
"The basic of informatics is Microsoft Office." - An informatics teacher in our school
"Do you know Linux?" "Linux? Isn't that something for visually impaired people?"

Jonny Cook
Member #4,055
November 2003

Quote:

If you want OS-independent blending functions, you could use OpenLayer in future versions.

Or just use the functions provided by Allegro. Sure they might not be the fastest, but I would imagine they would be good enough for a game such as yours.

The face of a child can say it all, especially the mouth part of the face.

IonBlade
Member #3,521
May 2003
avatar

Quote:

Here's an interesting gem from random.h:

static unsigned long mt[N]; /* the array for the state vector */
static int mti=N+1; /* mti==N+1 means mt[N] is not initialized */

Did you mean for that to be in random.cpp instead?

I downloaded the Mersenne Twister, and turned in from a .c file into a .h and .cpp file real quick. I didn't really know how to handle it, but it ended up working :) That was awhile ago though, things will be better.

Quote:

Ofcourse I played it.

Sorry, I just saw "looks nice" and thought maybe you literally just looked at it :)

As for FBlend, I've already ditched it for my newer version. One less lib to worry about.

Also, the reason I say this code is ugly is because, well, my newer code is more cleaned up and organized. There are some globals, but they're all objects, for instance a Text object that deals with custom text printing routines, a Sound object for FMOD related sound tasks, etc... I suppose I could turn them all into members of an "Engine" object, then I'd only need 1 global... we'll see.

[edit]: here's a comparison of the old main.cpp and the new main.cpp:

OLD:

1#include <allegro.h>
2 
3#include "main.h"
4 
5/*globals*/
6 
7volatile int g_time; //main timer variable to be checked by all time-based functions
8void counter_tic(void)
9{
10 g_time++;
11}
12END_OF_FUNCTION(counter_tic);
13LOCK_VARIABLE(g_time);
14LOCK_FUNCTION(counter_tic);
15 
16 
17mouse_t gMouse; //global mouse functions
18keyboard_t gKey; //global keyboard functions
19cJoystick_t gJoy[2]; //global joystick info
20 
21int g_Quit = 0; //set this to 1 to exit the program entirely
22 
23 
24//audio cvars
25int s_Sound = 1; //all sound on/off
26 
27//video cvars
28int vid_quality = 32; //color depth
29int screen_width = 1024; //screen width
30int screen_height = 768; //screen height
31int fullscreen = 1; //full screen or windowed
32 
33/* fonts */
34cFontData_t _default_font;
35cFontData_t _gothic_font;
36/*end globals*/
37 
38//music player
39cMusicPlayer_t musicplayer;
40 
41/* MAIN GAME STATE VARIABLE */
42int gGameState = GS_GAME;
43 
44/* PROGRAM ENTRY */
45int main() {
46 
47 gVersion = 0.5;
48 debugmode = 0;
49
50 game_mode = GAME_TIMEATTACK;
51
52 current_screenshot = 0;
53
54 init();
55 textprintf_ex(screen,font,0,0,makecol(255,255,255),0,"Loading");
56 // FSOUND_SAMPLE *s = FSOUND_Sample_Load(FSOUND_FREE,"data/music/mkd-puzzled.mp3",FSOUND_LOOP_NORMAL,0,0);
57 //FSOUND_PlaySound(0,s);
58
59 //init mouse
60 gMouse.Init();
61 //init keyboard
62 gKey.Init();
63 //init joysticks
64 gJoy[0].align = 0;
65 gJoy[1].align = 1;
66 
67 //init fonts
68 _default_font.Load("data/fonts/trebuc.ttf");
69 _gothic_font.Load("data/fonts/BNKGOTHM.ttf");
70
71 MainLoop();
72 
73 //FSOUND_Sample_Free(s);
74 //shutdown music
75 musicplayer.FreeAll();
76
77 deinit();
78 return 0;
79}
80END_OF_MAIN();
81/*END OF PROGRAM*/
82 
83 
84/* MAIN LOOP */
85 
86void MainLoop()
87{
88
89 cMainMenu_t *menu = new cMainMenu_t();
90 menu->Init();
91
92 cGame_t *game = new cGame_t();
93 //game->Init();
94 
95 while (!g_Quit)
96 {
97 //poll devices
98 poll_joystick();
99
100 switch (gGameState){
101
102
103 case (GS_MAINMENU):
104 menu->Loop();
105 break;
106
107 case (GS_GAME):
108 game->Loop();
109 break;
110 
111 }
112 
113 rest(1);
114
115 }
116
117 if (game->started)
118 game->Shutdown();
119
120 menu->Destroy();
121
122 delete game;
123 delete menu;
124}
125 
126 
127/* END MAIN LOOP */

NEW:

1/*=================================================================
2
3 Main.cpp
4
5 Contains the main function
6
7==================================================================*/
8 
9#include "base_engine.h"
10 
11/* Begin Globals =================================================*/
12 
13bool g_ExitGame; //If this is true, the game will shut down.
14int g_GameState; //Current state of the game.
15int g_TicRate; //Tic rate.
16short int g_TTU; //"Time to update". If this is > 0, logic will happen.
17dwGameProc_t* Game; //the game itself
18dwGFX_t* Graphics; //the graphics object
19dwSound_t* Sound; //the sound object
20dwText_t* Text; //the text object
21dwPaint_t* Paint; //the paint object
22dwTexCache_t* Textures; //the texture cache object
23dwLog_t* Log; //Log.
24dwConfig_t* Config; //Configuration data.
25 
26dwInput_t* g_Input; //Global input object.
27dwMouse_t* g_Mouse; //Global mouse object.
28dwKeyboard_t* g_Keyboard; //Global keyboard object.
29dwJoystick_t* Joystick; //Joysticks
30 
31/* End Globals ===================================================*/
32 
33int main(int argc, char* argv[]) {
34 
35 DW_Init();
36 DW_Main();
37 DW_Shutdown();
38 
39 return 0;
40 
41}
42END_OF_MAIN()

:D

------

"I've got to choose my words carefully so that I'm not misunderstood, but I think there are fewer developers around today who think about making a good game. As a creator, I find that sad..." - Hideo Kojima

Neil Walker
Member #210
April 2000
avatar

Since when was FBlend a Windows only library?

And besides, if you don't want to use it all you have to do is
#define USE_ALLEGRO_BLENDER and it ignores all the code.

Neil.
MAME Cabinet Blog / AXL LIBRARY (a games framework) / AXL Documentation and Tutorial

wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie

count
Member #5,401
January 2005

Very well done!

Fun to play. Sometimes the speciel gems are very rare which makes it hard.

IonBlade
Member #3,521
May 2003
avatar

A bit of an update... I've come up with a fresh and interesting approach to the "falling blocks" gameplay. Not only will I be tightening up the standard blocks dropping+get combos gameplay, I'll be adding a second objective that will use the mouse to perform another totally different action (at the same time) that doesn't relate to the puzzle board, but relates to the game overall. It will definitely take the name "Darkwave" into account. It'll be interesting to see if I manage to pull this off. Hides in dark room coding, never to see the light of day

[EDIT]: Restarting the game from an empty white page with nothing but a blinking cursor has another advantage: I'm going to make the code optionally 100% Allegro functions; other libs will be used for the high quality special effects and file support, but you can switch to a different mode if you want to compile the game without using any other libs. And yes, I'll be releasing the source "out of the box" next time I update my Depot page.

[EDIT2]: Yarrr, I like sharing my game ideas, can't stop typing ;D. My philosophy with this game is going to be "constant motion". I want the game to almost feel like it's "breathing", nothing is totally static or boring. And when I say breathing, I mean that literally. Also, near invisible loading times and mostly simple menu screens will help the "constant motion" idea.

------

"I've got to choose my words carefully so that I'm not misunderstood, but I think there are fewer developers around today who think about making a good game. As a creator, I find that sad..." - Hideo Kojima

Go to: