Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 946 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
[Searching] Particle Smoke Muzzle #433169
11/25/13 18:03
11/25/13 18:03
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline OP
Serious User
Ch40zzC0d3r  Offline OP
Serious User
C

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: Ch40zzC0d3r] #433645
12/03/13 19:14
12/03/13 19:14
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline OP
Serious User
Ch40zzC0d3r  Offline OP
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
Just asking again, sorry for pushing but I cant get something like this working with particles frown

Re: [Searching] Particle Smoke Muzzle [Re: Ch40zzC0d3r] #433647
12/03/13 19:30
12/03/13 19:30
Joined: Jan 2006
Posts: 968
EpsiloN Offline
User
EpsiloN  Offline
User

Joined: Jan 2006
Posts: 968
Why cant you get it working with particles? It would require a lot of small particles to look smooth, but I think it shouldnt be that hard...

BTW , from what I saw in the video, the particles are the only way, because the smoke changes spawn point as the barrel moves, but the old smoke is still hanging somewhere lower than the barrel during reloading. This can only be done with a trail of particles left from the movement of the barrel.

Get the vertex you want to spawn from, use an effect with lots of small particles (somewhat smooth at the edges, but not too smooth) and set them with a very, very slow upwards movement and medium fading, to create a visible trail effect. I think this should look similar to the video...


Extensive Multiplayer tutorial:
http://mesetts.com/index.php?page=201
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 Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,107
Germany
Iam interested in this one too.
edit:
Quote:
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 Offline
Expert
Kartoffel  Offline
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
C
Ch40zzC0d3r Offline OP
Serious User
Ch40zzC0d3r  Offline OP
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
I would do it like you described it, but it looks like shit :|
My code:
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
C
Ch40zzC0d3r Offline OP
Serious User
Ch40zzC0d3r  Offline OP
Serious User
C

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 Offline
User
EpsiloN  Offline
User

Joined: Jan 2006
Posts: 968
Originally Posted By: rayp
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.

Extensive Multiplayer tutorial:
http://mesetts.com/index.php?page=201
Re: [Searching] Particle Smoke Muzzle [Re: EpsiloN] #433656
12/03/13 20:11
12/03/13 20:11
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline OP
Serious User
Ch40zzC0d3r  Offline OP
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
The vertices are the 2 points arround the run of the weapon, if I middle them I get the perfect middle of the run laugh
The lines are exactly the problem Im speaking of, IDK where they are comming from frown

Re: [Searching] Particle Smoke Muzzle [Re: Ch40zzC0d3r] #433657
12/03/13 20:22
12/03/13 20:22
Joined: Jan 2006
Posts: 968
EpsiloN Offline
User
EpsiloN  Offline
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.
Code:
#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.


Extensive Multiplayer tutorial:
http://mesetts.com/index.php?page=201
Page 1 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1