1 registered members (AndrewAMD),
946
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
[Searching] Particle Smoke Muzzle
#433169
11/25/13 18:03
11/25/13 18:03
|
Joined: Oct 2011
Posts: 1,082 Germany
Ch40zzC0d3r
OP
Serious User
|
OP
Serious User
Joined: Oct 2011
Posts: 1,082
Germany
|
Hey guys, I tried building this particle effect so often but I never succeeded... I mean the smoke coming out of th gun when you DONT fire it. Does anybody done it already? Would be awesome. VID: http://www.youtube.com/watch?v=vjB3SO1a0Pw
Last edited by Ch40zzC0d3r; 11/25/13 18:04.
|
|
|
Re: [Searching] Particle Smoke Muzzle
[Re: EpsiloN]
#433650
12/03/13 19:33
12/03/13 19:33
|
Joined: Jul 2008
Posts: 2,107 Germany
rayp
X
|
X
Joined: Jul 2008
Posts: 2,107
Germany
|
Iam interested in this one too. edit: I am 99% sure that they aren't using particles. +1 edit end @EpsiloN Are you sure its done this way ? I mean the amount of particles needed for that cant be good for the performance.
Last edited by rayp; 12/03/13 19:38.
Acknex umgibt uns...zwischen Dir, mir, dem Stein dort... "Hey Griswold ... where u gonna put a tree that big ?" 1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected rayp.flags |= UNTOUCHABLE;
|
|
|
Re: [Searching] Particle Smoke Muzzle
[Re: rayp]
#433651
12/03/13 19:37
12/03/13 19:37
|
Joined: Jun 2009
Posts: 2,210 Bavaria, Germany
Kartoffel
Expert
|
Expert
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
|
I am 99% sure that they aren't using particles.
I bet they're using a mesh which they deform in realtime.
POTATO-MAN saves the day! - Random
|
|
|
Re: [Searching] Particle Smoke Muzzle
[Re: rayp]
#433652
12/03/13 19:39
12/03/13 19:39
|
Joined: Oct 2011
Posts: 1,082 Germany
Ch40zzC0d3r
OP
Serious User
|
OP
Serious User
Joined: Oct 2011
Posts: 1,082
Germany
|
I would do it like you described it, but it looks like shit :| My code:
#include <acknex.h>
#include <default.c>
function part_ev(PARTICLE *p)
{
p->alpha -= 15 * p->vel_z * time_step;
p->size += 0.05 * time_step;
if(p->alpha <= 0)
p->lifespan = 0;
}
function part(PARTICLE *p)
{
p->vel_x = 0;
p->vel_y = 0;
p->vel_z = 1.2;
p->gravity = 0;
p->size = 0.1;
p->flags = MOVE | TRANSLUCENT | BEAM;
p->event = part_ev;
}
function main()
{
fps_max = 60;
video_mode = 10;
level_load(NULL);
ENTITY *pGun = ent_create("UZI_V.mdl", camera.x, NULL);
ent_animate(pGun, "Take", 100, 0);
camera.clip_near = 1;
camera.arc = 85;
int i = 0;
while(1)
{
proc_mode = PROC_LATE;
vec_set(pGun.pan, camera.pan);
vec_set(pGun.x, camera.x);
VECTOR v1, v2;
vec_for_vertex(v1, pGun, 1778);
vec_for_vertex(v2, pGun, 1788);
vec_add(v1, v2);
vec_scale(v1, 0.5);
effect(part, 100, vector(v1.x, v1.y, v1.z), nullvector);
/*for(i = 0; i < 50; i++)
{
effect(part, 1, vector(vPos.x, vPos.y, vPos.z + i*time_step), nullvector);
}*/
wait(1);
}
}
|
|
|
Re: [Searching] Particle Smoke Muzzle
[Re: Ch40zzC0d3r]
#433653
12/03/13 19:49
12/03/13 19:49
|
Joined: Oct 2011
Posts: 1,082 Germany
Ch40zzC0d3r
OP
Serious User
|
OP
Serious User
Joined: Oct 2011
Posts: 1,082
Germany
|
BTW, I downloaded the package which contains the images for the particles and the compiled particle effects as *.pcf files. So these are particles, Im sure, but how the hell does it work? xD EDIT: Picture of the Particle Editor (They can use rope particles -.-)
Last edited by Ch40zzC0d3r; 12/03/13 20:01.
|
|
|
Re: [Searching] Particle Smoke Muzzle
[Re: rayp]
#433655
12/03/13 20:00
12/03/13 20:00
|
Joined: Jan 2006
Posts: 968
EpsiloN
User
|
User
Joined: Jan 2006
Posts: 968
|
I mean the amount of particles needed for that cant be good for the performance. I've overused particles before, and I can say from experience, the engine can handle 300-600 particles/gun, assuming the players weapon would be the most detailed, because its right infront of the screen. The other guns could be less detailed, depending on the distance to the player. Even if you make the player's gun with 800 particles, and the others with less, IMHO the engine will handle that... *EDIT* I ran your code with the m4a1 model from the resources, and I see some strange "lines" if I move backwards. What are the 2 vertices for? Where are they located on your UZI model ?
Last edited by EpsiloN; 12/03/13 20:09.
|
|
|
Re: [Searching] Particle Smoke Muzzle
[Re: Ch40zzC0d3r]
#433657
12/03/13 20:22
12/03/13 20:22
|
Joined: Jan 2006
Posts: 968
EpsiloN
User
|
User
Joined: Jan 2006
Posts: 968
|
I dont have time to tweak it more, but here's what I've came up with in 10 mins.
#include <acknex.h>
#include <default.c>
function part_ev(PARTICLE *p)
{
p->alpha -= random(25) * p->vel_z * time_step;
p->size += 0.005 * time_step;
if(p->alpha <= 0)
p->lifespan = 0;
}
function part(PARTICLE *p)
{
p->vel_x = 0;
p->vel_y = 0;
p->vel_z = random(0.01) + 0.09;
p->gravity = 0;
p->size = random(0.1) + 0.3;
p->flags = MOVE | TRANSLUCENT;
p->event = part_ev;
}
function main()
{
fps_max = 60;
video_mode = 10;
level_load(NULL);
ENTITY *pGun = ent_create("m4a1.MDL", camera.x, NULL);
ent_animate(pGun, "Take", 100, 0);
camera.clip_near = 1;
camera.arc = 85;
int i = 0;
while(1)
{
proc_mode = PROC_LATE;
vec_set(pGun.pan, camera.pan);
vec_set(pGun.x, camera.x);
VECTOR v1, v2;
vec_for_vertex(v1, pGun, 39);
//vec_for_vertex(v2, pGun, 1788);
//vec_add(v1, v2);
//vec_scale(v1, 0.5);
effect(part, 10, vector(v1.x, v1.y, v1.z), nullvector);
/*for(i = 0; i < 50; i++)
{
effect(part, 1, vector(vPos.x, vPos.y, vPos.z + i*time_step), nullvector);
}*/
wait(1);
}
}
Fix your MDL name and, I've commented one of the vertices, because you really need only one... Include a sprite image for the particles, it'll look better. PS.: Tested with 1600 particles. Doesnt look like in the video, but in slower movements it appears smooth. Faster movements separate the particles too much, so you might need even more particles for the players gun.
|
|
|
|