Release L'Abbaye des Morts


Ok i have fixed the button controls and now the game is playable (tested on my caanoo)...i have published the port on the betatesting area at gp32x.de

http://www.gp32x.de/board/index.php?/topic/63691-labbaye-des-morts-wiz-and-caanoo/

If you have a Caanoo or Wiz please test it and report any problem...Thanks

I have built also a gp2x version but is too slow to be playable....i want to find a way to optimize it (if i can).

Big Thanks to nevat and doragasu for the good work on this game.
 
Last edited by a moderator:
Good work ! Thank to you that spends your time porting to GPH consoles. I d0n't have any GPH console, so I can't test the program. A video of the game in this hardware would be cool :D

I'm a newbie in programming so I'm sure that the code can be optimized, a lot. Perhaps Doragasu have some ideas on what change in the code.
 
Last edited by a moderator:
This was a lot of fun, actually! It is an interesting feeling, to get the nostalgic feeling of an old favourite, yet still it isn't :)  
 
I have uploaded the Caanoo version here at archive..http://dl.openhandhelds.org/cgi-bin/caanoo.cgi?0,0,0,0,27,870

Also i have made a video of Caanoo and GP2X F200 in action..look at gp32x forum to see it and the other video of BAFelton about Pandora.

http://www.gp32x.de/board/index.php?/topic/63696-caanoo-labbaye-des-morts/
Farox, I make some changes in source code (pantallas.c file, intro2 function), trying to solve the slow speed of the game in GPH console, can you try if the second intro (Jean pursued by the enemies) works better with this change ? 

http://abbaye-for-linux.googlecode.com/files/pantallas.c
 
Last edited by a moderator:
Just recompiled but not found any noticeable improvement...but i want to take your attention on 2 things i'm experimenting.

Load of TTF font only on startup of the game and try to use mp3 files instead of ogg music files.

I have changed some code (but i'm not a programmer) and with mp3 music the game work but didn't hear nothing on output.

With TTF font i remember i've read from gp32x.de forum ( i think from "hmn" user ) this doc:

from http://www.gp32x.de/board/index.php?/topic/55495-gaming-wiz-slow-with-sdl-ttf-h/?hl=%2Bttf+%2Bbenchmark#entry896721


Not loading the font every time should give a BIG speedup. I actually wrote a little benchmark for this:

Loading font every time -> 6 FPS
Loading font just once --> 195 FPS

------------------------------------------------------------------------------
#include <SDL.h>
#include <SDL_ttf.h>

#include <assert.h>

const char* fontFilename = "DejaVuSans.ttf";
const int fontSize = 20;

void DrawTextOld( SDL_Surface* screen, char *text, int x, int y) {

TTF_Font *font;
//font=TTF_OpenFont("gfx/font.ttf",12);
font = TTF_OpenFont( fontFilename, fontSize );
SDL_Color color = { 255, 255, 255 };
SDL_Rect coordinates;
coordinates.x = (int)x;
coordinates.y = (int)y;
SDL_Surface *message = NULL;
message=TTF_RenderText_Solid(font,text,color);

SDL_BlitSurface(message,0,screen,&coordinates);

TTF_CloseFont(font);
SDL_FreeSurface(message);
}

void DrawTextNew( SDL_Surface* screen, TTF_Font* font, char *text, int x, int y) {

//TTF_Font *font;
//font=TTF_OpenFont("gfx/font.ttf",12);
SDL_Color color = { 255, 255, 255 };
SDL_Rect coordinates;
coordinates.x = (int)x;
coordinates.y = (int)y;
SDL_Surface *message = NULL;
message=TTF_RenderText_Solid(font,text,color);

SDL_BlitSurface(message,0,screen,&coordinates);

//TTF_CloseFont(font);
SDL_FreeSurface(message);
}

void DrawText( SDL_Surface* screen, TTF_Font* font, char *text, int x, int y, int old ) {

if( old )
DrawTextOld( screen, text, x, y );
else
DrawTextNew( screen, font, text, x, y );
}

int main( int argc, char** argv )
{
assert( !SDL_Init( SDL_INIT_VIDEO | SDL_INIT_JOYSTICK ) );
assert( SDL_JoystickOpen( 0 ) );
SDL_Surface* screen = SDL_SetVideoMode( 320, 240, 0, SDL_SWSURFACE );
assert( screen );
assert( !TTF_Init() );

TTF_Font* font = TTF_OpenFont( fontFilename, fontSize );
assert( font );

int old = 1;
Uint32 ticks0 = SDL_GetTicks();
Uint32 ticks = 0;
Uint32 frames = 0;
Uint32 fps = 0;

for( ;; ) {

int run = 1;
SDL_Event e;
while( SDL_PollEvent( &e ) ) {

if( e.type == SDL_QUIT ) {

run = 0;
}
else if( e.type == SDL_JOYBUTTONDOWN ) {

if( e.jbutton.button == 8 ) {

run = 0;
}
else if( e.jbutton.button == 9 ) {

old = old ? 0 : 1;
}
}
}
if( !run )
break;

SDL_FillRect( screen, 0, 0 );

const int x = 16;
int y = 16;

DrawText( screen, font, "Press menu to quit", x, y, old );
y += 30;
DrawText( screen, font, "Press select to change routine", x, y, old );
y += 30;
DrawText( screen, font, old ? "Old routine" : "New routine", x, y, old );
y += 30;

char buffer[ 100 ];
snprintf( buffer, sizeof( buffer ), "FPS: %d", fps );
DrawText( screen, font, buffer, x, y, old );

SDL_Flip( screen );

frames++;

Uint32 ticks1 = SDL_GetTicks();
ticks += ticks1 - ticks0;
ticks0 = ticks1;
if( ticks >= 1000 ) {

fps = ( 1000 * frames ) / ticks;
ticks = 0;
frames = 0;
}
}

TTF_Quit();
SDL_Quit();

return 0;
}

I have added this but i have segfault...but maybe i have done something wrong.

Also i have commented out a line in main.c as suggested by an user on gp32x.de forum :

Code:
/* Contadores */
		if (ciclo[0] < 29)
			ciclo[0] ++;
		else
			ciclo[0] = 0;
		if (ciclo[1] < 90)
		  ciclo[1] ++;
		else
		  ciclo[1] = 0;
		if (ciclo[2] < 8)
		  ciclo[2] ++;
		else
		  ciclo[2] = 0;

		 //disabled by farox...seems ok 
		//SDL_FillRect(pantalla, NULL, SDL_MapRGB(ventana->format, 0, 0, 0));

		animitems (fase, habitacion, ciclo);
		dibujarfase (ventana, fase, tiles, habitacion, ciclo, *cambiot, fondomd);
		if (habitacion != 4)
			barradeestado (ventana, tiles, habitacion, jean.estado[0], jean.estado[1]);
		if (jean.flags[6] < 8)
			dibujarjean (ventana, tiles, &jean, ciclo);
		/* Gestion de enemigos */
		if (enemigos.tipo[0] > 0) {
			if (habitacion != 4)
				moverenemigos (&enemigos, fase, ciclo, proyec, jean);
			if ((habitacion == 5) || (habitacion == 6))
				cruzados (&enemigos, ventana, tiles, ciclo, habitacion);
			if (habitacion == 10)
				dragon (&enemigos, ventana, tiles, ciclo, proyec);
			if (habitacion == 11)
				bolafuego (&enemigos, ventana, tiles, ciclo, jean, fase);
			if (habitacion == 14)
				plantas (&enemigos, ventana, tiles, ciclo, proyec);
			if (habitacion == 9)
			 	dibujarcuerda (enemigos, ventana, tiles);
			if (habitacion == 18)
				muerte (&enemigos, ventana, tiles, ciclo, proyec, fase);
			if ((habitacion == 24) && (enemigos.tipo[0] == 18))
				satan (&enemigos, ventana, tiles, ciclo, proyec);
			if ((habitacion == 24) && (jean.flags[6] == 5))
				cruzados (&enemigos, ventana, tiles, ciclo, habitacion);
			dibujarenemigos (&enemigos, ventana, tiles);
		}
		/* Gestion de disparos */
		if ((proyec[0] > 0) && ((habitacion == 17) || (habitacion == 20) || (habitacion == 21) || (habitacion == 22)))
		  dibujardisparo (proyec, tiles, ventana, &enemigos);
 
Last edited by a moderator:
Ok, I will try to load font only one time. I'll tell you the results asap.

In the sound side, in line 179 of main.c change the frequency from 44100 to 22050 this sould reduce CPU usage (the OGGs are in 44100, with this change you can hear rare sounds. If this works, we can reduce the frequency of the music to 22050).
 
Last edited by a moderator:
Ok reducing the freq we gain some more fps ( not much but all helps) but some music is distorted.

I have to do the resample at 22050 with audacity...

Another thing an user of Caanoo asked me if is possible to implement a save game to not restart from level 1 every time...
 
Ok reducing the freq we gain some more fps ( not much but all helps) but some music is distorted.

I have to do the resample at 22050 with audacity...

Another thing an user of Caanoo asked me if is possible to implement a save game to not restart from level 1 every time...
Well, now font is loaded only in start of the game,  little changes are needed:

In main.c

line 85 add "TTF_Font *fuente" at the end of the line, like this:

void barradeestado (SDL_Surface *ventana, SDL_Surface *tiles, int habitacion, int vidas, int cruces, TTF_Font *fuente);

After line 291 add

fuente = TTF_OpenFont(RUTA_FON_VENICE_CLASSIC, 17);

In line 394 add "fuente" at the end of the line, like this

barradeestado (ventana, tiles, habitacion, jean.estado[0], jean.estado[1], fuente);

After line 585 add

TTF_CloseFont(fuente);

In barradeestado.c comment lines 21, 23 & 111.

That's all.

Is possible to add save feature to the game. IMMO this feature is against the spirit of the game when LocoMalito make this program in 2010 (create a Spectrum-like game with the same look, music, difficult). What's the opinion of the people (including you, Farox) ?
 
Last edited by a moderator:
I think adding a save feature does break the spirit of the game, its not even a long game anyway I have seen speed runs on YouTube ^_^
 
I think adding a save feature does break the spirit of the game, its not even a long game anyway I have seen speed runs on YouTube ^_^
I think that a save feature would be excellent, but should be done in the spirit of the 8bits - it should save a 3 minute WAV file which contains an audio representation of the game state in speccy-compatible format.

Reloading of that state would involve playing the WAV back into the game :)

D.
 
OK just tested and is ok we gain more speed with this mods (ogg reduced to 22050 and font loaded at start).

Now i will test on gp2x.

For the save feature i'm with you and milkshake to not implement it .

Let me polish my code and i will pubblish on the archive.
 
ah forgot..i have converted also the sound files to 22050 but some fx (i think one or two) sound like distorted...
 
ah forgot..i have converted also the sound files to 22050 but some fx (i think one or two) sound like distorted...
Ok, tell me what sounds are. I have the original WAVs at 22050, so I can convert to OGG 22050 without problems.

(Original sounds are 22050, so now I'm thinking why converted the sounds to 44100 when made the port... FAIL to me :D )
 
Last edited by a moderator:
I have taken some days of relax...but now i wanna finish this port..at least for Caanoo (i have some problem to correctly implement diagonal movement on GP2X F200)

Now i have found a bug ( a little..bug) that bug is that is possible to jump when you are crouched (agachado..) so i have changed the code with:


if (evento.type == SDL_KEYDOWN) {
#ifdef _OPENPANDORA
if (evento.key.keysym.sym == SDLK_PAGEDOWN) {
#else
if (evento.key.keysym.sym == SDLK_UP) {
#endif
if ((jean->pulsa[0] == 0) && (jean->salto == 0)){
if (jean->agachado == 0) //fix the bug of jump allowed when agachado
jean->salto = 1;
else
jean->salto = 0;
}
}
it's on main.c , the function is tecladoj ....i don't give line numbers as my lines are much more (thanks to added support for GPH devices)

For the sound i think i have returned to 44100 Khz of sample rate because this (jump.ogg) fx is sounding really bad on 22050 ( i have tryed with every possible version with my and your files).
 
Back
Top