Raydium 3D Game Engine

Official forum for everything about Raydium, ManiaDrive, MeMak, ...
It is currently Fri Mar 29, 2024 2:33 am

All times are UTC




Post new topic Reply to topic  [ 33 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject:
PostPosted: Wed Jun 18, 2008 11:40 am 
Offline
User avatar

Joined: Thu Aug 24, 2006 4:06 pm
Posts: 73
Location: SLOVAKIA
FINISHED.

here is solution but SVN isn't now updated:

Code:
...

    raydium_particle_generator_load("dust.prt","dustA");
    raydium_particle_generator_load("dust.prt","dustB");
    raydium_particle_generator_load("dust.prt","dustC");
    raydium_particle_generator_load("dust.prt","dustD");

    raydium_ode_element_particle_offset_name_3f(CAR.wheel_A.name,"dustA",0,0,0);
    raydium_ode_element_particle_offset_name_3f(CAR.wheel_B.name,"dustB",0,0,0);
    raydium_ode_element_particle_offset_name_3f(CAR.wheel_C.name,"dustC",0,0,0);
    raydium_ode_element_particle_offset_name_3f(CAR.wheel_D.name,"dustD",0,0,0);

    CAR.wheel_A.particle_id = raydium_particle_generator_find("dustA");
    CAR.wheel_B.particle_id = raydium_particle_generator_find("dustB");
    CAR.wheel_C.particle_id = raydium_particle_generator_find("dustC");
    CAR.wheel_D.particle_id = raydium_particle_generator_find("dustD");

    CAR.wheel_A.element_id = raydium_ode_element_find(CAR.wheel_A.name);
    CAR.wheel_B.element_id = raydium_ode_element_find(CAR.wheel_B.name);
    CAR.wheel_C.element_id = raydium_ode_element_find(CAR.wheel_C.name);
    CAR.wheel_D.element_id = raydium_ode_element_find(CAR.wheel_D.name);

...


and callback looks:

Code:
char WheelCollision(int e1, int e2, dContact *c)
{
    int i1,i2;
    i1=raydium_ode_element_tag_get(e1);
    i2=raydium_ode_element_tag_get(e2);
    dReal *origin_A;
    dReal *origin_B;
    dReal *origin_C;
    dReal *origin_D;



    if (i1==TYPE_WHEEL)
    {
     if (CAR.wheel_A.element_id == raydium_ode_element[e1].id)
     {
         origin_A=raydium_ode_element_pos_get(raydium_ode_element[e1].id);
         raydium_particle_generator_move(CAR.wheel_A.particle_id,origin_A);
     }

     if (CAR.wheel_B.element_id == raydium_ode_element[e1].id)
     {
         origin_B=raydium_ode_element_pos_get(raydium_ode_element[e1].id);
         raydium_particle_generator_move(CAR.wheel_B.particle_id,origin_B);
     }

     if (CAR.wheel_C.element_id == raydium_ode_element[e1].id)
     {
         origin_C=raydium_ode_element_pos_get(raydium_ode_element[e1].id);
         raydium_particle_generator_move(CAR.wheel_C.particle_id,origin_C);
     }
     if (CAR.wheel_D.element_id == raydium_ode_element[e1].id)
     {
         origin_D=raydium_ode_element_pos_get(raydium_ode_element[e1].id);
         raydium_particle_generator_move(CAR.wheel_D.particle_id,origin_D);
     }
    }
}


and work really nice, now i have a lot of possibility for nice visual FX ... big thanks. When you find any mistake in logic then write me ... big thanks


EDIT.: Last question is how to STOP emitting from particle, because this is needed when car has speed=0.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 18, 2008 12:44 pm 
Offline

Joined: Sun Oct 09, 2005 10:46 pm
Posts: 759
Hello,

Some remarks ...


wheel element can be e2 as e1. Be carrefull your code won't work in that case.

I think that there is position information in dcontact (geom.pos) which give you exact position of contact.

Anyway it's good. Update Svn, i can test.

Have a nice day
Ouille


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 18, 2008 1:18 pm 
Offline
User avatar

Joined: Thu Aug 24, 2006 4:06 pm
Posts: 73
Location: SLOVAKIA
SVN updated.

And any help about ---> how to STOP emitting from particle, because this is needed when car has speed=0.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 18, 2008 5:06 pm 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
About dummy object:

As long as I know you can make a dummy object with certain ease.
By one side you can create an element as usual. Then you can disable the collisions with that element. For example:
Code:
raydium_ode_object_colliding(elementid,0);

or
Code:
raydium_ode_object_colliding_name("elementname",0);


I've not tested this yet, but according the reference it should work.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 18, 2008 7:57 pm 
Offline
User avatar

Joined: Thu Aug 24, 2006 4:06 pm
Posts: 73
Location: SLOVAKIA
Why is movement with lagging, like MP game on slow network !!!!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 19, 2008 7:19 am 
Offline

Joined: Sun Oct 09, 2005 10:46 pm
Posts: 759
Hello,

You can enable / disable particle generator with:
Code:
raydium_particle_generator_enable


About lag.
You need do decrease number of particule. Here i got 60fps when car is moving, but drop to 20 when i stop (i think that particle update become slow).

Particle position update in collide callback is called at 400Hz perhapse you can filter this to have only one update for a frame.

Have a nice day.
Ouille


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 19, 2008 8:53 am 
Offline
User avatar

Joined: Thu Aug 24, 2006 4:06 pm
Posts: 73
Location: SLOVAKIA
Thx for answer

BUT

1) particles count isn't a problem, this problem was before too (without particles) btw. this has impact to framerate and then is rendering pipeline freezed, but then continue normaly

2) my LAG problem return car position BACK on position a few sec. back - this is LAG with a car reposition


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 19, 2008 10:17 am 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
I have no lag... Just low framerate with particles


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 19, 2008 10:22 am 
Offline

Joined: Sun Oct 09, 2005 10:46 pm
Posts: 759
Hello,

Not such lag car don't go back here .

Have a nice day

Ouille


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 19, 2008 10:51 am 
Offline
User avatar

Joined: Thu Aug 24, 2006 4:06 pm
Posts: 73
Location: SLOVAKIA
Hmm.

Ok today we publish video with this problem, for better understanding.

Note: a few facts, CAR position is OK, only camera is a randomly stopped and then it jumped to calculated position with F2 - CAR camera view, this looks like problem with raydium_camera_smooth cmd, because all others VIEW TYPES are working good.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 19, 2008 11:53 am 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
the smoothed camera has know issues.
For example if your computer is done something in background (p2p, compressión, decompression, video...) the frame time could change a lot compared with the previous one. As the smooth positions are calculed with those frame times then yes, you could see like-lag effect in camera.

At first I would claim that windows is the problem... but you told me yesterday the problem was also with linux. So... i assume win* is not the problem.

Do you run others application in background while testing? Maybe chat with encryption (quite cpu intensive)?
Can you look at your system monitor to search for cpu peaks?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 19, 2008 12:01 pm 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
I just have found this topic that maybe could help:
viewtopic.php?t=668


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 19, 2008 12:44 pm 
Offline
User avatar

Joined: Thu Aug 24, 2006 4:06 pm
Posts: 73
Location: SLOVAKIA
thx. implemented and was tried - but same result :(


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 19, 2008 12:47 pm 
Offline
User avatar

Joined: Thu Aug 24, 2006 4:06 pm
Posts: 73
Location: SLOVAKIA
vicente wrote:
the smoothed camera has know issues.
For example if your computer is done something in background (p2p, compressión, decompression, video...) the frame time could change a lot compared with the previous one. As the smooth positions are calculed with those frame times then yes, you could see like-lag effect in camera.

At first I would claim that windows is the problem... but you told me yesterday the problem was also with linux. So... i assume win* is not the problem.

Do you run others application in background while testing? Maybe chat with encryption (quite cpu intensive)?
Can you look at your system monitor to search for cpu peaks?


I don't think that is problem with background process because i have Hi-End HW and i don't have problem with speed - games like Crysis, Lost planets, Assassin Creed with DX10 works absolutly smooth.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 20, 2008 9:13 am 
Offline
User avatar

Joined: Thu Aug 24, 2006 4:06 pm
Posts: 73
Location: SLOVAKIA
I found solution for my problem, was partly fixed with this command raydium_render_fps_limit(25), but from my point of view it's strange and maybe better is set callback for display less. My experiens is that call render display every 5ms is good => 200 times per sec, then CPU has time for other processes on background.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 33 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 24 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group