Allegro.cc - Online Community

Allegro.cc Forums » The Depot » Dodger revisited (need help)

This thread is locked; no one can reply to it. rss feed Print
 1   2   3 
Dodger revisited (need help)
kentl
Member #2,905
November 2002

I could look into if not using åäöÅÄÖ (that's all special characters we use in Sweden) is possible with some clever writing style. Would you like that or should I leave it as it is?

gnolam
Member #2,030
March 2002
avatar

Kent: "SETTINGS_CPU=Minska CPU belastning" should be "SETTINGS_CPU=Minska CPU-belastning". :)

--
Move to the Democratic People's Republic of Vivendi Universal (formerly known as Sweden) - officially democracy- and privacy-free since 2008-06-18!

Paul whoknows
Member #5,081
September 2004
avatar

And finally the very awaited(!?) Spanish version.
BTW, I don't like that big font at all, it doesn't allow words wider than 5 or 6 characters!
I'll see if I can make some ships later.

____

"The unlimited potential has been replaced by the concrete reality of what I programmed today." - Jordan Mechner.

wiseguy
Member #44
April 2000
avatar

I downloaded this and will check it out, and if I get time maybe I'll make some stuff for it...mainly I'm downloading as much linux stuff as I can to get everything completely setup since I just switched to linux for my main development platform

miran
Member #2,407
June 2002

Quote:

As I am a badass, I will launch it by gdb everytime !

EDIT: got it each time I quit. Here is the GDB log

Thanks, I'll have to compile in debug mode for that to be useful though...

Quote:

Grafics:when switching from full to windowed, problem : the windows size is not adjusted (the windowed new one is taking my full desktop)

That's weird. Could be a driver problem, I don't know... :-/

Quote:

All items in option menu: no one is refreshing automatically.

Maybe you don't have the latest version. I uploaded the game with the same version number a couple of times. One of the old ones had this problem...

Quote:

The exiting bug seem to only appear when hitting the cross. Nothing happens when selecting exit from the menu.

I'll look into it. I sometimes (rarely) get the freeze on exit bug. Maybe I'll just not clean up on exit or something... :P

Quote:

Very nice game, but it runs terribly slow on my even slower PC. Anyway I enjoyed playing DODGER.

Thanks. Yeah, it's slow as hell, especially now that I use true type fonts for almost everything. I need to optimize that.

Quote:

BUG? I ran it in the 16 bpp mode (via allegro.cfg), but the game sprites weren't rendered, only black boxes shown on screen. Game was playable this way, but I think, that you need to fix something with your color conversion code.

Yeah, I use alpha transparency which only works in 32bpp. Or is it possible to get it to work in 16bpp as well? I'll RTFM. ;)

Quote:

I attached a full POLISH translation. I've made a mixed version: with unicode characters and without them, as one of the fonts doesn't display them. I hope, that you will use it :)

Thanks! :D

Quote:

I could look into if not using åäöÅÄÖ (that's all special characters we use in Sweden) is possible with some clever writing style. Would you like that or should I leave it as it is?

Well, the strings that are printed with the small font definately shouldn't have accented characters. For the rest I think it's OK, but as I said, in this particular font most special characters are there, but not all. I think one of the a's is missing... :-/

Quote:

And finally the very awaited(!?) Spanish version.

Thanks! :D

Quote:

BTW, I don't like that big font at all, it doesn't allow words wider than 5 or 6 characters!

You mean the biggest font? That's only used for the title. The medium one can put quite a good number of chars in one line.

Quote:

I'll see if I can make some ships later.

That'd be great. :)

Quote:

I downloaded this and will check it out, and if I get time maybe I'll make some stuff for it...mainly I'm downloading as much linux stuff as I can to get everything completely setup since I just switched to linux for my main development platform

It'd be nice to know how much trouble you have compiling this. Because you need lots of semi non standard libs to compile (MASkinG, AllegroFont, DUMB) and a few more standard ones (Allegro, cURL, pthreads). Maybe I should just make a Linux binary?

Btw, yesterday I noticed a few more bugs that were introduced with using only true type fonts. I'll fix them today when I get off work. :)

--
sig used to be here

GullRaDriel
Member #3,861
September 2003
avatar

Quote:

Thanks, I'll have to compile in debug mode for that to be useful though...

If you manage to upload a debug binary, I will happily give you the trace. I can not compile it as I do not have & want that bunch of library on my system ;-)

Quote:

Maybe I'll just not clean up on exit or something...

I do not search for it in your source, but I manage the close button as this in my projects ( just an example ) :

EDIT: I searched and not founded it. If someone click on the cross when windowed, no clean exit.

1int DONE = 0;
2 
3void close_callback()
4 {
5 DONE = 1;
6 } /* close_callback(...) */
7 
8void at_exit_job();
9 
10int main(){
11 
12 allegro_init();
13
14 set_close_button_callback( close_callback );
15 
16 while( DONE == 0 ){
17 
18 /* main loop */
19 
20 };
21 
22 at_exit_job();
23}

EDIT: Whoops ! It seems that you already have corrected the exit bug (now when I hit the cross, it goes trought the menu instead of quitting in a ugly way). The menu are OK with the version I have now. I still have the resizing from fullscreen to windowed bug tought.

"Code is like shit - it only smells if it is not yours"
Allegro Wiki, full of examples and articles !!

wiseguy
Member #44
April 2000
avatar

yeh I realized how many other libraries I'm going to need to compile this and groaned...but it's good practice I guess. I'm still looking into setting up a cross-compiler for my other project and trying to update and clear out linux packages I don't need or want and stuff like that. I finally got my internet working decently for a dialup situation anyways. I'm wanting to use makefiles that can be used on windows and linux and macosx so that people can just download my sourcefiles from now on, but I've never really messed with doing my makefiles by hand before...

anyways, I will try to get masking and the others working too, and i already have ncurses and pthreads installed...

will let you know

kentl
Member #2,905
November 2002

Quote:

Kent: "SETTINGS_CPU=Minska CPU belastning" should be "SETTINGS_CPU=Minska CPU-belastning". :)

Yeah you are right. I might have missed something more.

Quote:

Well, the strings that are printed with the small font definately shouldn't have accented characters. For the rest I think it's OK, but as I said, in this particular font most special characters are there, but not all. I think one of the a's is missing... :-/

You could just replace that å or ä with an a then. Swedish people will understand anyway I guess. You could insert the - as well which I missed above. :)

miran
Member #2,407
June 2002

I just uploaded a new version: Dodger v1.17.

Changes:

  • fixed a problem with the intro screen (it wouldn't play at all in the previous version :-X)

  • optimized text rendering somewhat; The game is still slow but at least I get consistant framerates in the game. In-game I get around 125 FPS all the time (before it would drop to 50 FPS when there was a lot of text on screen) and in the menus around 150-200, depending on how much there is to draw.

  • added Czech, French, German, Italian, Polish, Spanish and Swedish translations; Thanks guys! :D

  • made the lists of languages and themes sort alphabetically for easier navigation

  • fixed logic framerate to 100 Hz for no apparent reason

Quote:

You could just replace that å or ä with an a then. Swedish people will understand anyway I guess. You could insert the - as well which I missed above.

Ah yes, I'll fix it in the next version. :)

Thanks again everyone. But there are still a few languages missing, like Dutch and Finnish... ;)

--
sig used to be here

OICW
Member #4,069
November 2003
avatar

Quote:

added Czech

Oops you make me worry. I hope you've packed there the non unicode version. Otherwise it will be all screewed up in the help etc.

Attached is final version.

Woohoo, the infection is spreading through the class ;D Mission Accomplished!

[My website][CppReference][Pixelate][Allegators worldwide][Who's online]
"Final Fantasy XIV, I feel that anything I could say will be repeating myself, so I'm just gonna express my feelings with a strangled noise from the back of my throat. Graaarghhhh..." - Yahtzee
"Uhm... this is a.cc. Did you honestly think this thread WOULDN'T be derailed and ruined?" - BAF
"You can discuss it, you can dislike it, you can disagree with it, but that's all what you can do with it"

miran
Member #2,407
June 2002

Quote:

Oops you make me worry. I hope you've packed there the non unicode version. Otherwise it will be all screewed up in the help etc.

Yeah, I edited your last version as necessary.

Quote:

Woohoo, the infection is spreading through the class Mission Accomplished!

;D;D;D

EDIT: Who is Tomas? He's getting close. :)

--
sig used to be here

OICW
Member #4,069
November 2003
avatar

Ok now the language file attached above is up-to-date. As friend pointed me.

Edit:
Tomas is a friend of mine, who's just playing...
Oh I just saw that language file included and that's exaclty what I just uploaded. Good job.

[My website][CppReference][Pixelate][Allegators worldwide][Who's online]
"Final Fantasy XIV, I feel that anything I could say will be repeating myself, so I'm just gonna express my feelings with a strangled noise from the back of my throat. Graaarghhhh..." - Yahtzee
"Uhm... this is a.cc. Did you honestly think this thread WOULDN'T be derailed and ruined?" - BAF
"You can discuss it, you can dislike it, you can disagree with it, but that's all what you can do with it"

Tomasz Grajewski
Member #4,284
February 2004

I've uploaded a fixed version of the polish translation. Now it's almost perfect ;) BTW, a practical question for the future: do we should use the English names for a language?

Another bug? I've played with the allegro.cfg file a little more, and I've discovered, that setting the config value of useVideoMemory to 1 makes DODGER crash everytime, when I switch beetwen fullscreen and windowed mode.

And one more thing: this game is addicting! :)

___________________________________________________________________________________________
mBlocks - a Tetris clone written in JavaScript | Merix Studio - website design & development | Zeitgeist

miran
Member #2,407
June 2002

Just uploaded new version: v1.18 which fixes a nasty bug (thanks to OICW) and includes some improvements to the language files (including the latest polish translation).

Quote:

I've uploaded a fixed version of the polish translation. Now it's almost perfect

Thanks. It was almost perfect before too. :) Thanks for noticing the © sign can be used. :)

Quote:

BTW, a practical question for the future: do we should use the English names for a language?

Personally I prefer native names, but I kept the filenames as people submitted them. I mean it's not like I even know how to say Swedish in Swedish. I know Sweden is Sverige or something like that though... :P

Quote:

Another bug? I've played with the allegro.cfg file a little more, and I've discovered, that setting the config value of useVideoMemory to 1 makes DODGER crash everytime, when I switch beetwen fullscreen and windowed mode.

Yeah, that's a generic MASkinG setting which isn't even fully implemented in MASkinG itself. I don't even remember if it does make the program use video memory or not. It certainly doesn't use video memory for everything. Anyway, it's an unfinished unsupported feature.

Quote:

And one more thing: this game is addicting!

Thanks, I know. I can't stop playing. Must beat top score.

Btw, speaking of top scores, I'm tempted to delete the best two from the database. They look a little suspicious to me... :-/

--
sig used to be here

GullRaDriel
Member #3,861
September 2003
avatar

Miran said:

Btw, speaking of top scores, I'm tempted to delete the best two from the database. They look a little suspicious to me... :-/

Yeah. I am really interested by knowing the speed of the bot & laser at second 50. At 17 second they are quite quick to move. I can not imagine that a human eye can see them at second 50.

As for a known bug: Do you assume everybody to have a qwerty keyboard , do you ? :-p

I think it is more a question of allegro initialisation than a question of code because you are already checking for KEY_Q. The main problem is that on my azerty keyboard Dodger still want me to hit A for Quit.

Give me your feedback. I need to have this key Quit correctly working ! C.a.n. .n.o.t. .s.t.o.p. .p.l.a.y.i.n.g. .!.!. :)

_

"Code is like shit - it only smells if it is not yours"
Allegro Wiki, full of examples and articles !!

miran
Member #2,407
June 2002

Quote:

Yeah. I am really interested by knowing the speed of the bot & laser at second 50. At 17 second they are quite quick to move. I can not imagine that a human eye can see them at second 50.

Actually they stop accelerating after about 20 seconds. So in theory if you can survive 30 seconds, you can survive forever. :)

Quote:

As for a known bug: Do you assume everybody to have a qwerty keyboard , do you ? :-p

I'm not sure I understand. Do the KEY_* constants not match the actual keys on the keyboard or am I using them the wrong way? I'm sorry, I've never even seen a keyboard other than QWERTZ/QWERTY so I don't know... :-/

EDIT: What about when you enter your name? Does that work?

--
sig used to be here

Epsi
Member #5,731
April 2005
avatar

Quote:

I'm not sure I understand. Do the KEY_* constants not match the actual keys on the keyboard or am I using them the wrong way? I'm sorry, I've never even seen a keyboard other than QWERTZ/QWERTY so I don't know...

yes that's an issue with KEY_*, I think it relates to the key physical position from an US keyboard, it's not related to the ASCII value.

I've never used other methods to read keyboard's entries so I don't know it Allegro is capable of handling different keyboards mapping.

___________________________________

piccolo: "soon all new 2d alegro games will be better. after i finsh my MMRPG. my game will serve as a code reference. so you can understand and grab code from."
piccolo: "just wait until my invetion comes out its going to take the wii to the next leave of game play. it will run sony and microsoft out of busness if i dont let them use it aswell."

miran
Member #2,407
June 2002

Can you please compile this program, run it, press a few keys and describe the output?

1#include <allegro.h>
2 
3int main() {
4 allegro_init();
5 set_color_depth(32);
6 set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0);
7 install_keyboard();
8 
9 while (!key[KEY_ESC]) {
10 while (keypressed()) {
11 int c = readkey();
12 clear_to_color(screen, 0);
13 textprintf_ex(screen, font, 0, 0, -1, -1, "you pressed: %s", scancode_to_name(c>>8));
14 
15 if (c>>8 == KEY_Q) {
16 textprintf_ex(screen, font, 0, 8, -1, -1, "KEY_Q detected!!!");
17 }
18 }
19 }
20 
21 return 0;
22}
23END_OF_MAIN();

--
sig used to be here

Epsi
Member #5,731
April 2005
avatar

My AZERTY keyboard is at home.

But anyway just change your keyboard layout to French and see what happens when you press "Q" (wich should be "A" with the new mapping)

___________________________________

piccolo: "soon all new 2d alegro games will be better. after i finsh my MMRPG. my game will serve as a code reference. so you can understand and grab code from."
piccolo: "just wait until my invetion comes out its going to take the wii to the next leave of game play. it will run sony and microsoft out of busness if i dont let them use it aswell."

miran
Member #2,407
June 2002

Quote:

But anyway just change your keyboard layout to French and see what happens when you press "Q" (wich should be "A" with the new mapping)

OK, I did that, I change the keyboard layout to FR in my OS and both the above test program and the game behave as expected. When I press 'q' on my keyboard, 'a' is printed and vice versa. And in the game, when I press my 'a' (which is 'q' on an actual french keyboard) at the "paused" message, I'm sent back to the main menu, as expected. Maybe I need to distribute keyboard.dat with game as well? If so, copy the attached file to the dame directory as dodger.exe and see if it makes a difference. If not, add this to allegro.cfg:

[system]
keyboard = FR

...and try again.

--
sig used to be here

GullRaDriel
Member #3,861
September 2003
avatar

It says :
You pressed A KEY_Q Detected !!!

Keyboard = FR does nothing

But when I type my name at the end of a game, keyboard 'A' is displayed 'A' and 'Q' is 'Q'

"Code is like shit - it only smells if it is not yours"
Allegro Wiki, full of examples and articles !!

miran
Member #2,407
June 2002

So basically what you're saying is that scancode_to_name(KEY_Q) returns 'a'? Is this normal, a bug in Allegro or a problem on your side? Does putting keyboard.dat in the same directory as the test exe make any difference?

By the way, I get

You pressed: 'q' KEY_Q detected!!!

when I press the left most key in the middle row of letter keys (right of the caps lock) when I use the French keyboard layout in my OS.

--
sig used to be here

Epsi
Member #5,731
April 2005
avatar

On an AZERTY keyboard KEY_Q is the "A" key, as KEY_W is "Z" (more keys also differs ofc).

So as you have no problem with the French keyboard mapping it really looks like KEY_* use the physical placement (as I've said before) of the key on the keyboard, instead of the ASCII value.

I consider that as an Allegro bug. (back in the DOS days, we had this problem with a lot of games, for example to activate the "DNCASHMAN" cheat of Duke Nukem 3D we had to type "DNCQSH,QN")

___________________________________

piccolo: "soon all new 2d alegro games will be better. after i finsh my MMRPG. my game will serve as a code reference. so you can understand and grab code from."
piccolo: "just wait until my invetion comes out its going to take the wii to the next leave of game play. it will run sony and microsoft out of busness if i dont let them use it aswell."

GullRaDriel
Member #3,861
September 2003
avatar

When I press Q it only says You pressed Q , so I second EPSI

"Code is like shit - it only smells if it is not yours"
Allegro Wiki, full of examples and articles !!

miran
Member #2,407
June 2002

Quote:

I consider that as an Allegro bug.

Allegro bug it is then. Not my problem anymore. ;D:-X

--
sig used to be here

 1   2   3 


Go to: