Main Menu

Caanoo lags

Started by glitschen, September 17, 2011, 07:57:58 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

glitschen

Hi .just before talk about my problem I like to say that i am french and not very good in english so sorry for my faults ;D
Thus ,i test my bennugd program on caanoo and that work but i have many lags problem(not on pc).The first is when i use a machine gun which send 1 process all 2 1 frame.yet when they exit the screen they are destroy.The second is with snow particle.
they maybe have 150-200 particle (not process=> draw_fcricle)on the screen (That I started again in an example) so my question is : is that normal ? :D
And my last problem is with midi song when i try play_song(songroom2,-1) it's work also good in pc but not on caanoo .
Thanks for reading.


FreeYourMind


glitschen

#2
for snow

Program
const
flocon=400;

..............

process neige()
private
max=3;
vit[flocon];
coordx[flocon];
coordy[flocon];
compte;
xa;
vitx;
vity;
begin
for(compte=0;compte<flocon;compte++)
coordx[compte]=rand(-500,820);
coordy[compte]=rand(-150,1);
vit[compte]=rand(1,3);
end
loop
if (scroll.x0>0 and scroll.x0<3000-320 and bouge==1)vitx=copter_x;elseif(bouge==1) vitx=0;elseif(bouge==0)vitx=-scroll.speed/2;end
if (scroll.y0>0 and scroll.x0<500 and bouge==1)vity=copter_y;elseif(bouge==1) vity=0;elseif(bouge==0)vity=0;end
clear_screen();
for(compte=0;compte<flocon;compte++)
if (coordy[compte]>240 or coordx[compte]<-500 or coordx[compte]>820)
coordx[compte]=rand(-500,820);
coordy[compte]=rand(0,1);
vit[compte]=rand(1,3);
end
drawing_color (rgb(255,255,255));
draw_fcircle (coordx[compte]+xa,coordy[compte],0);
xa=rand(-1,1);
coordx[compte]=(coordx[compte]+xa-vitx);
coordy[compte]+=vit[compte]-vity;
end
frame;
end
end


copter_x and copter_y are copter speed on x and on y.bouge==1 when the copter can move.

for shoot:

if (key(_control) and nombremunition!=0)tirallie1(png_tir2,16,12,12,16);nombremunition-=1;end

for bullet shoot

process tirallie1(graph,vit,lenghtx,lenghty,flags)

begin
ctype=c_scroll;
file=fpg_terror;
angle=father.angle;
x=father.x+get_distx(angle,lenghtx);
y=father.y+get_disty(angle,lenghty);
if (father.id==id_copter)
if (father.flags==1)angle=-father.angle;x-=get_distx(angle,18);y+=get_disty(angle,20)+5;
else angle=father.angle+180000;x+=get_distx(angle,7);y+=get_disty(angle,20)+5;end
angle+=rand(-5000,5000);
end
loop
if (y>420)break;end
advance(vit);
if(out_region(id,0))break;end
if(process_id3=collision(type missilesilo))process_id3.viemechant-=1;signal(id,s_kill);end
if(process_id3=collision(type avion1))process_id3.viemechant-=1;signal(id,s_kill);end
if(process_id1=collision(type bateau1))process_id1.viemechant-=1;signal(id,s_kill);end
if(process_id1=collision(type bateau4))process_id1.viemechant-=1;signal(id,s_kill);end
if(process_id1=collision(type porteavion))process_id1.viemechant-=1;signal(id,s_kill);end
if(process_id1=collision(type camion1))process_id1.viemechant-=1;signal(id,s_kill);end
if(process_id1=collision_box(type terroriste1))process_id1.viemechant-=1;signal(id,s_kill);end
if(process_id1=collision(type maisonterror))process_id1.viemechant-=1;signal(id,s_kill);end
if(process_id1=collision(type coptermechant))process_id1.viemechant-=1;signal(id,s_kill);end

if (map_get_pixel(0,montagneforemask,x,y)==63488 and room==11)signal(id,s_kill);end
if (map_get_pixel(0,montagneforemask2,x,y)==63488 and room==13)signal(id,s_kill);end
if (map_get_pixel(0,ilemask,x,y)==63488 and (room==7 or room==9))signal(id,s_kill);end
if (map_get_pixel(fpg_decor,6,x,y)==63488 and room==1)signal(id,s_kill);end
frame;
end
end

FreeYourMind

Sorry, but you need to put the prg file with all the resources, to see why the sound don't play and test your program

glitschen

#4
ok thank i will try something
=>the file http://www.megaupload.com/?d=3LMCZLPV

SplinterGU

is normal... draw_circle draw again in each frame... maybe you must use a map+size for it...
Download Lastest BennuGD Release: http://www.bennugd.org/node/2

glitschen

#6
ok thank you however i don't understand why song don't play on caanoo,i have test also with play_wave and it doesn't work
EDIT: sorry play_wave work but not play_song

BlackCurtain

Quote from: glitschen on September 18, 2011, 07:00:15 PM
ok thank you however i don't understand why song don't play on caanoo,i have test also with play_wave and it doesn't work
EDIT: sorry play_wave work but not play_song
You will need to use ogg-files with the correct bitrate and Hz. Check the GPH developer guide for proper figures. I usually use 22050 Hz, 8-bit stereo and it works fine.

glitschen