Allegro.cc - Online Community

Allegro.cc Forums » The Depot » [Final Release] Toggles and other games

This thread is locked; no one can reply to it. rss feed Print
 1   2 
[Final Release] Toggles and other games
Onewing
Member #6,152
August 2005
avatar

I won't talk as long as I did last time. I've been working on several titles and I finally think they are ready for the public. One game is made using allegro, the other two were made in one month using the Game Maker. I'm posting these games on several websites that I visit and hope for about 500 people to at least look at the post and 50 people to play the game.

The highscore tables have been cleared for Toggles. This is the first site I'm posting to, so get your highscores while you have the advantage!

==============================TOGGLES================================
http://comp.uark.edu/~spsilve/games/toggles/tog_ss.JPG
http://comp.uark.edu/~spsilve/toggles/tog4.JPG
Windows binary and source code: Toggles
Linux source code (still some bugs, but patches are being work on as we speak. However, you can still compile and play the game with this version, given you have the right libraries. Just see the readme included): Toggles Linux Version 1.0.13

Don't forget to review it in the depot. I am curious as to what you guys think. :)

===============================Mymaze================================
I briefly talked about this game before on the forums.
http://comp.uark.edu/~spsilve/games/mymaze/title.jpg
http://comp.uark.edu/~spsilve/games/mymaze/maze_ss.JPG
http://comp.uark.edu/~spsilve/games/maze1.JPG
What's New:

  • 50 complete mazes, plus 3 secretly hidden mazes

  • Non-linearity, you don't have to go through the first 10 levels to get to the next.

  • Save game and load game functionality. You can still save/load states with F5/F6 at any time in the game.

  • A silly, wrap-around story.

  • Item collection.

  • Music from battletoads. :)

Windows binary: Mymaze

==============================1945-Clone==================================
Yes, it's already been done a million times. Still, here's my rendition.
http://comp.uark.edu/~spsilve/games/1945/1945s1.JPG
http://comp.uark.edu/~spsilve/games/1945/1945s2.JPG
http://comp.uark.edu/~spsilve/games/1945/1945s3.JPG
Windows binary: 1945

------------
Solo-Games.org | My Tech Blog: The Digital Helm

miran
Member #2,407
June 2002

Downloading Toggles now, but it's really slow, like 10kB/s...

--
sig used to be here

Kikaru
Member #7,616
August 2006
avatar

Downloading Toggels! Yay! :D

miran
Member #2,407
June 2002

After much pain and suffering it compiled (the pain and suffering was caused by alogg). When I run it, I get two intro screens, then this:

http://www.allegro.cc/files/attachment/590341

EDIT: Ooh, I noticed the zip contains a prebuilt Linux binary. It doesn't work of course:

ERROR:  Failed to initialize allegro library.  Terminating program.
REPORT:  Unable to find a usable VT

EDIT2: I noticed one more thing. The obj directory is full of .o files. You MUST NOT include them in the final release!

--
sig used to be here

Onewing
Member #6,152
August 2005
avatar

Quote:

Ooh, I noticed the zip contains a prebuilt Linux binary.

Crap, I did a "make clean" on the source code on the "[Linux] Last bit of help..." thread but not on the package linked above. Sorry, going to fix it right away!

------------
Solo-Games.org | My Tech Blog: The Digital Helm

Kikaru
Member #7,616
August 2006
avatar

Wow... Toggles is really cool now. :o

Onewing
Member #6,152
August 2005
avatar

Quote:

Toggles is really cool now.

Heh, guess it's gone through a few face lifts, eh? :)

@miran: Okay, I updated the final release to not have the prebuilt binary and removed the .o files from the obj/static directory. I also added vortec.bmp to the data images. Because you probably don't want to reload all the data, I made this quick zip file that includes the source and include files and the vortec.bmp file (put this in data/images). Hope this helps: Quick fix.

------------
Solo-Games.org | My Tech Blog: The Digital Helm

miran
Member #2,407
June 2002

It still doesn't work.

The problem is in convert_to_backslash() which doesn't do what it's supposed to do and corrupts the input string by writing over the trailing \0. But why do you even need to write such silly functions? Why is Allegro's own fix_filename_slashes() not good enough for you? Or any of the other file and string manipulation functions in Allegro? Such as for example

and several others. Did you even know that these functions exist? Did you even RTFM?

--
sig used to be here

Onewing
Member #6,152
August 2005
avatar

Quote:

Did you even know that these functions exist?

No. I forgot that anything I think of has already been done.

Quote:

Did you even RTFM?

I often think of allegro as a graphics library only, so I forget has some very useful things for common problems like this as well. But, if it's any consolation, I had the allegro manual open pretty much through the entire development of the game.

Anyway, took out my convert_to_backslash quick hack and put the easy to use fix_filename_slashes(char*) in instead. From what I can tell, it just updates the string sent to it, so I hope I used it right (another blind test). I've updated the Quick Fix link above and the linux source on the OP. For reference, here's the Quick Fix link again.

------------
Solo-Games.org | My Tech Blog: The Digital Helm

miran
Member #2,407
June 2002

The new version crashes without warning:

Shutting down Allegro due to signal #11
Segmentation fault

My guess is that you're using the function the wrong way. I think that the manual should be updated on that because I don't understand it either. The description of the function says that it returns a copy of the modified string, but the example completely discards this copy, thus creating a memory leak. This shouldn't cause a crash though...

EDIT:
This code works:

1BITMAP *load_bitmap_check(char *cpath, RGB *pal)
2{
3 BITMAP *bTest;
4 
5 char *temp = new char[1024];
6 ustrcpy(temp, cpath);
7 fix_filename_slashes(temp);
8 bTest = load_bitmap(temp, pal);
9 if(!bTest)
10 {
11 set_gfx_mode(GFX_TEXT, 0, 0, 0, 0);
12 
13 allegro_message("ERROR: Could not find/open '%s'", temp);
14 delete [] temp;
15 exit(0);
16 }
17 delete [] temp;
18 return bTest;
19}

Now the game works, although it seems a bit slow. I've only looked at the menus so far. I like the water effect on the cesspool. I assume that's a cesspool, I didn't read the story yet... :-X

EDIT2: The menus work great! Although it would be nice if it was possible to speed up the animation to make it more snappy. There's just one serious bug: the mouse cursor doesn't work. When you move the mouse, the desktop/hardware cursor flashes a bit, but when the mouse is still, no cursor is drawn. Also it'd be nice if the menus could be operated with the keyboard.

EDIT3: Woohoo, I'm in the credits! ;D

EDIT4: Btw, about that fix slashes thing, I'm not sure it's even necessary. I think think load_bitmap() and friends work just as well no matter which path separator you use...

--
sig used to be here

Onewing
Member #6,152
August 2005
avatar

Quote:

although it seems a bit slow.

You can speed up the game via the config file, however that won't help the framerate much. There's a section in the config that lets you control how the water reacts and flows. Messing with some of these options might help the speed. I'm not the best programmer, so getting the water to work effectively with rest of the game was a chore in itself. That's why I included the graphics option under the option menu for different graphics modes.

Quote:

When you move the mouse, the desktop/hardware cursor flashes a bit, but when the mouse is still, no cursor is drawn.

There's a config option you can change to draw the hardware mouse instead of the mouse icon that I draw. That might work better.

Quote:

Also it'd be nice if the menus could be operated with the keyboard.

One quick trick you can do with the menus is press the right mouse button to make the menu items instantly fall into spot. Helps when you're navigating through the help menu. :)

Quote:

Woohoo, I'm in the credits!

Did you click you're name? ;D

------------
Solo-Games.org | My Tech Blog: The Digital Helm

Inphernic
Member #1,111
March 2001

Toggles:

The water effect seems to be a nice touch but monstrously inefficient. The graphics are quite bad, and the music blows as well. I played up to level 9 and quit. Overall: 4/10

Evert
Member #794
November 2000
avatar

Quote:

There's a config option you can change to draw the hardware mouse instead of the mouse icon that I draw. That might work better.

You should try to use the hardware mouse and if that doesn't work, fall back to drawing your own.

Onewing
Member #6,152
August 2005
avatar

Quote:

The water effect seems to be a nice touch but monstrously inefficient.

Thanks! By inefficient, do you mean it doesn't work right or takes too much away from the game (either gameplay or game speed).

Quote:

The graphics are quite bad, and the music blows as well.

Fair enough. Any advice on how it could be improved?

Quote:

I played up to level 9 and quit.

Thanks for playing that far. I figure, since you quit, gameplay was not fun?

Quote:

Overall: 4/10

Ah, so close to 5. Well, looks as if I've got much more to improve, eh? ;)

Quote:

You should try to use the hardware mouse and if that doesn't work, fall back to drawing your own.

I default to my own mouse because I feel it fits better with the environment of the game. At least I have the option for users to choose. :)

[EDIT]
BTW, I just pwned all your scores. Even managed to get the fourth combo, which I've never been able to do before!

------------
Solo-Games.org | My Tech Blog: The Digital Helm

Inphernic
Member #1,111
March 2001

Quote:

By inefficient, do you mean it doesn't work right or takes too much away from the game (either gameplay or game speed).

By inefficient I mean that I get 18 fps on the main menu. I've seen more impressive software effects run at amazing speeds back in the 15th century.

Quote:

Fair enough. Any advice on how it could be improved?

Graphics=
+ no specific style/consistency, just a glorios mishmash of everything
+ too much going on
+ jagged edge galore
+ colour abuse
+ gradient abuse
+ the font is awful
= no

Here's a 15 minute sketch (ok 401367280476 hrs in Paint srs):

http://www.duckiehorde.net/quickmockup.jpg

That's probably not how I would make it look like, it's just a quick'n'silly mockup. The point of its is just to show that clean/less is (usually) better.

Can't comment on the music: can't remember them, the game's already gone and I don't feel like re-downloading just for that. I might (later) if I have nothing to do.

Quote:

Thanks for playing that far. I figure, since you quit, gameplay was not fun?

Well, it wasn't dreadful nor enjoyable.. not just very interesting.

Quote:

Ah, so close to 5. Well, looks as if I've got much more to improve, eh?

To clarify the Arbitra-O-Meter scaling, 5 is average and 10 is absolutely perfect. On second thought, 4 might still be too high, but let's say it comes from effort. ;)

Kikaru
Member #7,616
August 2006
avatar

I actually think that sketch looks pretty nice...

Evert
Member #794
November 2000
avatar

Quote:

I default to my own mouse because I feel it fits better with the environment of the game.

What does that have to do with letting the OS draw it instead of doing it yourself?

Onewing
Member #6,152
August 2005
avatar

Quote:

I actually think that sketch looks pretty nice...

I do too, it's very elegant. The bottom time bar is my favorite part (with the shiny gradient). I was trying to go for as many bells and whistles as I could, kind of like a carnival game. But as Inphernic said, "clean/less is (usually) better."

Since I'm not going to spend much more time on this game (got other projects to work on), the only thing I can offer is that there are some things you can do to change it to your own theme. For example, I did the following in about 5 minutes (literally):

http://comp.uark.edu/~spsilve/games/toggles/tog_ss2.JPG

All you have to do is go to the data/images folder and change the "back.pcx" to whatever image of your liking, any size too. Next, in the config.ini, there's a "still_background" option. Set this to 1 so the background doesn't move. Lastly, you can change the rgb settings for the different gradients (you can also make it a solid color, because, like Inphernic said, I've got some gradient abuse.). You can't completely strip the graphics, but you do have a little room for your own personal likings. I'd like to see some body do a girly, pink version...hehe.

Anyway, thanks Inphernic for the advice. I'll try to implement some of those ideas more accurately for my next game. As for the speed of the water, I would just have to improve the algorithm, which of course, is obviously my fault.

Quote:

What does that have to do with letting the OS draw it instead of doing it yourself?

I'm assuming you mean using the set_mouse_cursor_bitmap() function and let the OS always handle the mouse drawing, right? Sorry, I didn't realize this was an option.

[edit] the above image is a JPEG, so its quality isn't perfect!

------------
Solo-Games.org | My Tech Blog: The Digital Helm

Evert
Member #794
November 2000
avatar

Quote:

I'm assuming you mean using the set_mouse_cursor_bitmap() function and let the OS always handle the mouse drawing, right?

Yes, of course.

Quote:

Sorry, I didn't realize this was an option.

Then what did you mean by hardware cursor? Allegro's manual makes a clear distinction between what it calls a hardware cursor (a custom cursor drawn by the operating system) and what it calls an operating system cursor (the default OS cursors).

Onewing
Member #6,152
August 2005
avatar

Quote:

Then what did you mean by hardware cursor?

If the mouse_icon is set to 1 in the config.ini file, it will call show_mouse(buffer). Otherwise, it will call draw_bitmap(buffer, bMouse, mouse_x, mouse_y) prior to drawing the buffer to the screen.

Quote:

Allegro's manual makes a clear distinction

Yes, I agree the manual makes plenty of clear distinctions, but you have to read that portion of the manual. I'll admit that I haven't read all of the manual, so I'm bound to slip up from time to time, even when the manual clearly explains what to do. ::)

------------
Solo-Games.org | My Tech Blog: The Digital Helm

Evert
Member #794
November 2000
avatar

Quote:

it will call show_mouse(buffer). Otherwise, it will call draw_bitmap(buffer, bMouse, mouse_x, mouse_y) prior to drawing the buffer to the screen.

Ok, but in neither case will you get a hardware cursor.
Aside, using show_mouse() on a memory bitmap defeats the purpose of having Allegro update the mouse sprite in the background (it won't be visible until you blit the buffer anyway), so if you're not using show_mouse() on a visible surface, you might as well draw it yourself.

Quote:

I agree the manual makes plenty of clear distinctions, but you have to read that portion of the manual.

Since you used the phrase 'hardware mouse', I assumed you had read that portion of the manual. It's fair enough that you don't read all of it (although it's highly recommended to at least look at the table of contents and the remarks at the start of each section).

Onewing
Member #6,152
August 2005
avatar

Quote:

using show_mouse() on a memory bitmap

I have a bad memory, I did use show_mouse(screen). If you downloaded the game, you can see it written in the code. But thanks for the advice anyway, makes it a little more clear.

Quote:

Since you used the phrase 'hardware mouse', I assumed you had read that portion of the manual.

My bad. Seriously. :)

BTW, I have a question for the users out there. Several people have mentioned slow downloads and I'm curious if it's having a hard time updating the high score registry as well. Has any body put in a high score and gotten an ERROR or the high score didn't show up on the table?

------------
Solo-Games.org | My Tech Blog: The Digital Helm

Kikaru
Member #7,616
August 2006
avatar

The on-line highscores work fine for me. I am numbers 2 and 3. Oh, and I got 5 combos in one stage! :D

Onewing
Member #6,152
August 2005
avatar

Quote:

Oh, and I got 5 combos in one stage!

No, no, no, silly. There's no 5th combo. To get combos, you have to get a certain amount of consecutive toggles in under 3 seconds. By consecutive toggles, I mean getting toggles to go down without bringing one up. The 4th combo, you have to get over 60 consecutive toggles in under 3 seconds and it's worth 1000 times whatever level you're in. So, getting the 4th combo in level 10 would be worth 10,000 points! There's a nice little music sound that happens when you get it too. :)

------------
Solo-Games.org | My Tech Blog: The Digital Helm

Kikaru
Member #7,616
August 2006
avatar

Oohhhhh... I never knew that happened...

 1   2 


Go to: