Author Topic: Meteoroid3D  (Read 15000 times)

Ziz (OP)

  • Posts: 285
    • http://ziz.gp2x.de
Meteoroid3D
« on: February 06, 2015, 12:41:18 pm »
Hi guys,

the last weeks I didn't have much time for programming, especially not for Hase. But I started a little project, I did want to do a long time:

Meteoroid3D
The first real 3D game for your GCW!

Throught your Nintendo DS to the corner, now comes the hard stuff.
All kids in the train, bus or at your work will be jealous of you playing this awesome game wearing fashionable 3D glasses (Luna Lovegood approved!).

First of all a video (Pandora version, but anyway):

<a href="https://www.youtube.com/watch?v=FMcDOMUFwgA" target="_blank">https://www.youtube.com/watch?v=FMcDOMUFwgA</a>

As you can see, this is a high end stereoscopy graphics asteroids like shooter.

Feature list:
  • Stereoscopic graphic with settings for red-green, red-cyan, red-blue or yellow-blue glasses. Of course you can play without 3d glasses, too, but then you will not enjoy the incredible DEPTH of the game! (Furthermore it is really easier to hit the meteoroids with 3D glasses...)
  • 3 different kinds of meteoroids. There are not only different in size, they are also different in points you get and in the number of sub meteoroids they will split!
  • Endless world - if you reach the end, another identic world will appear!
  • Awesome public domain music from Kevin MacLeod
  • Incredible realistic laser animation and sounds!
  • High end particle effects!
  • Total unconfusing 3D map!
  • Of course C4A support from the very beginning
  • And even the source code of the game itself, because this is fucking hardcore free software! https://github.com/theZiz/meteoroid3d
Download it here:
http://ziz.gp2x.de/downloads/meteoroid3d/meteoroid3d.opk
Or with the OPKManager!

Enjoy!
Ziz

PS: I couldn't test it on a GCW yet, so please tell me, whether it works or not!
« Last Edit: February 06, 2015, 12:43:24 pm by Ziz »
I am a leaf on the wind - watch how I soar. Wash

Gab1975

  • Posts: 1165
Re: Meteoroid3D
« Reply #1 on: February 06, 2015, 01:01:00 pm »
The game doesn't start... when I try to launch it, after a few moments, it comes back to the Gmenu2X...

Ziz (OP)

  • Posts: 285
    • http://ziz.gp2x.de
Re: Meteoroid3D
« Reply #2 on: February 06, 2015, 01:16:35 pm »
The game doesn't start... when I try to launch it, after a few moments, it comes back to the Gmenu2X...
Now it should work. -_-
I am a leaf on the wind - watch how I soar. Wash

Gab1975

  • Posts: 1165
Re: Meteoroid3D
« Reply #3 on: February 06, 2015, 01:25:14 pm »
Now it should work. -_-

No, it doesn't start as before... :(

Ziz (OP)

  • Posts: 285
    • http://ziz.gp2x.de
Re: Meteoroid3D
« Reply #4 on: February 06, 2015, 01:52:50 pm »
I am a leaf on the wind - watch how I soar. Wash

Xaijiqq

  • Posts: 447
Re: Meteoroid3D
« Reply #5 on: February 06, 2015, 02:43:53 pm »

Ziz (OP)

  • Posts: 285
    • http://ziz.gp2x.de
Re: Meteoroid3D
« Reply #6 on: February 06, 2015, 03:08:11 pm »
I am a leaf on the wind - watch how I soar. Wash

xXFrostXx

  • * Former Staff
  • Posts: 234
Re: Meteoroid3D
« Reply #7 on: February 06, 2015, 05:05:51 pm »
At first I thought the thread said "Metroid 3D".
I haven't seen a need for red/blue 3D glasses in a long time. This is a very interesting idea!
Dingoonity is the place to be!

codingcampbell

  • Posts: 25
Re: Meteoroid3D
« Reply #8 on: February 06, 2015, 06:03:36 pm »
Sorry I don't have time to do this live right now (I'm at work), but here is a quick gdb session:

Quote
opendingux:/media/GCW_SD/tmp/meteorid/meteoroid3d # LD_LIBRARY_PATH=. gdb ./meteoroid3d
GNU gdb (GDB) 7.5.1
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "mipsel-gcw0-linux-uclibc".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /media/GCW_SD/tmp/meteorid/meteoroid3d/meteoroid3d...done.
(gdb) start
Temporary breakpoint 1 at 0x403614
Starting program: /media/GCW_SD/tmp/meteorid/meteoroid3d/meteoroid3d
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".

Temporary breakpoint 1, 0x00403614 in main ()
(gdb) c
Continuing.
Found 1 Joysticks
  Opened Joystick 0 (linkdev device (Analog 2-axis 8-button 2-hat))
Support for ogg: Yes
Support for mp3: No (Mixer not built with MP3 support)
Support for flac: No (Mixer not built with MP3 support)
Support for mod: Yes
Try to open Sound: Success
  8 channels are avaible as default

Program received signal SIGSEGV, Segmentation fault.
0x770c57c4 in SDL_FillRect () from /usr/lib/libSDL-1.2.so.0

Good luck and thanks for all your efforts!

zear

  • * Moderator
  • Posts: 2381
Re: Meteoroid3D
« Reply #9 on: February 06, 2015, 06:50:35 pm »
Here's a more accurate log:
Code: [Select]
Program received signal SIGSEGV, Segmentation fault.
0x778dc7c4 in SDL_FillRect () from /usr/lib/libSDL-1.2.so.0
(gdb) bt
#0  0x778dc7c4 in SDL_FillRect () from /usr/lib/libSDL-1.2.so.0
#1  0x77678064 in spFontChangeLetter () from ./libsparrow3d.so
#2  0x7767823c in spFontInternalAddOneCharacter.part.2 () from ./libsparrow3d.so
#3  0x77679370 in spFontAdd () from ./libsparrow3d.so
#4  0x004047e0 in reload_font ()
#5  0x00406028 in set_color ()
#6  0x00406564 in init_stereo ()
#7  0x004036cc in main ()
Program received signal SIGSEGV, Segmentation fault.
0x778dc7c4 in SDL_FillRect () from /usr/lib/libSDL-1.2.so.0
(gdb) bt
#0  0x778dc7c4 in SDL_FillRect () from /usr/lib/libSDL-1.2.so.0
#1  0x77678064 in spFontChangeLetter () from ./libsparrow3d.so
#2  0x7767823c in spFontInternalAddOneCharacter.part.2 () from ./libsparrow3d.so
#3  0x77679370 in spFontAdd () from ./libsparrow3d.so
#4  0x004047e0 in reload_font ()
#5  0x00406028 in set_color ()
#6  0x00406564 in init_stereo ()
#7  0x004036cc in main ()

Ziz (OP)

  • Posts: 285
    • http://ziz.gp2x.de
Re: Meteoroid3D
« Reply #10 on: February 06, 2015, 10:39:56 pm »
Okay, thanks a lot for now! I will have a deeper look tomorrow. :\
I am a leaf on the wind - watch how I soar. Wash

David Knight

  • Posts: 577
Re: Meteoroid3D
« Reply #11 on: February 06, 2015, 11:03:40 pm »
The above seems to track the problem to sparrow3d, sparrowFont.c line 151:

Code: [Select]
PREFIX void spFontChangeLetter( spFontPointer font, spLetterPointer letter, Uint32 character, Uint16 color )
{
letter->color = color;
Uint16 buffer[2];
buffer[0] = character;
buffer[1] = 0;
SDL_Color sdlcolor = {( color >> 11 ) << 3, ( ( color << 5 ) >> 10 ) << 2, ( ( color & 31 ) << 3 )};
SDL_Surface* surface;
if (spFontBackgroundColor == SP_FONT_NO_BORDER)
surface = TTF_RenderUNICODE_Solid( font->font, buffer, sdlcolor );
else
{
SDL_Color background = {( spFontBackgroundColor >> 11 ) << 3, ( ( spFontBackgroundColor << 5 ) >> 10 ) << 2, ( ( spFontBackgroundColor & 31 ) << 3 )};
surface = TTF_RenderUNICODE_Shaded( font->font, buffer, sdlcolor ,background );
}
if (!surface)
surface = spCreateSurface(0,font->maxheight);
int width = surface->w + SP_FONT_EXTRASPACE * 2;
if ( width & 1 )
width++;
letter->surface = spCreateSurface(width, surface->h + SP_FONT_EXTRASPACE * 2);
SDL_FillRect( letter->surface, NULL, SP_ALPHA_COLOR );

SDL_Rect DestR;
DestR.x = SP_FONT_EXTRASPACE;
DestR.y = SP_FONT_EXTRASPACE;
DestR.w = surface->w;
DestR.h = surface->h;
SDL_BlitSurface( surface, NULL, letter->surface, &DestR );
SDL_FreeSurface( surface );

//Setting every spFontBackgroundColor to the alpha color
SDL_LockSurface( letter->surface );
Uint16* pixel = ( Uint16* )( letter->surface->pixels );
int scanline = letter->surface->pitch/letter->surface->format->BytesPerPixel;
int x, y;
for ( x = 0; x < letter->surface->w; x++ )
for ( y = 0; y < letter->surface->h; y++ )
if ( pixel[x + y * scanline] == spFontBackgroundColor )
pixel[x + y * scanline] = SP_ALPHA_COLOR;
SDL_UnlockSurface( letter->surface );

TTF_SizeUNICODE( font->font, buffer, &( letter->width ), &( letter->height ) );
if ( font->maxheight < letter->height )
font->maxheight = letter->height;
}

Do you need to link sparrowDefines.h in order to obtain the value of SP_ALPHA_COLOR?
Ah, I see it is already linked in sparrowFont.h.

So is letter->surface NULL?
« Last Edit: February 06, 2015, 11:53:54 pm by David Knight »

Ziz (OP)

  • Posts: 285
    • http://ziz.gp2x.de
Re: Meteoroid3D
« Reply #12 on: February 06, 2015, 11:55:32 pm »
Thanks, but I already found the position.

Now I wonder, WHY it breaks. I made a test on the PC and letter->surface seem to be a valid pointer with a width and height > 0.

I made a new build with debug symbols.

Could somebody tell me, whether
  • letter is a valid pointer
  • letter->surface is a valid pointer
  • letter->surface->w is greater 0
  • letter->surface->h is greater 0
Thank you very much!
« Last Edit: February 07, 2015, 12:06:43 am by Ziz »
I am a leaf on the wind - watch how I soar. Wash

David Knight

  • Posts: 577
Re: Meteoroid3D
« Reply #13 on: February 07, 2015, 12:10:17 am »
This build works fine  ;D


So compile time optimise problem?
« Last Edit: February 07, 2015, 12:18:13 am by David Knight »

codingcampbell

  • Posts: 25
Re: Meteoroid3D
« Reply #14 on: February 07, 2015, 12:25:59 am »
Yep this build is working for me as well. Now just to find my 3D glasses!

Great work Ziz

Gab1975

  • Posts: 1165
Re: Meteoroid3D
« Reply #15 on: February 07, 2015, 05:47:21 am »
Now the game works fine... a very cool "Asteroids" 3D version, thanks! :)

PS: not a big deal, but the default sound volume is a bit too low.

Ziz (OP)

  • Posts: 285
    • http://ziz.gp2x.de
Re: Meteoroid3D
« Reply #16 on: February 07, 2015, 09:36:22 am »
No... This is just wrong! >.< I will upload another non-debug version the next days (but with another name) to continue debug it.
A bug isn't fixed, just because it doesn't appear anymore!
I am a leaf on the wind - watch how I soar. Wash

Ziz (OP)

  • Posts: 285
    • http://ziz.gp2x.de
Re: Meteoroid3D
« Reply #17 on: February 07, 2015, 09:37:01 am »
Now the game works fine... a very cool "Asteroids" 3D version, thanks! :)

PS: not a big deal, but the default sound volume is a bit too low.
Okay, wasn't sure, because the Pandora has a hardware volume wheel and it is hard to tell, what is "too loud" for other devices.
I am a leaf on the wind - watch how I soar. Wash

Ziz (OP)

  • Posts: 285
    • http://ziz.gp2x.de
Re: Meteoroid3D
« Reply #18 on: February 07, 2015, 04:30:49 pm »
Okay, I have a theory, why it crashes on the GCW without debug informations.

Could someone please test this version?

http://ziz.gp2x.de/downloads/meteoroid3d/meteoroid3d_test.opk

Thanks a lot!

Ziz
I am a leaf on the wind - watch how I soar. Wash

Gab1975

  • Posts: 1165
Re: Meteoroid3D
« Reply #19 on: February 07, 2015, 05:05:16 pm »
Okay, I have a theory, why it crashes on the GCW without debug informations.

Could someone please test this version?

http://ziz.gp2x.de/downloads/meteoroid3d/meteoroid3d_test.opk

Thanks a lot!

Ziz

This release works without problems (with the exception of the sound volume too low! :P )

 

Post a new topic