Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, SBGuy, Petra), 801 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Smoke/Gas effect #454962
09/30/15 19:14
09/30/15 19:14
Joined: Jun 2010
Posts: 71
L
LawnmowerMan Offline OP
Junior Member
LawnmowerMan  Offline OP
Junior Member
L

Joined: Jun 2010
Posts: 71
I need the ambient effect of evaporation gas from swampy water, smoke or something like. It is for static cut scene in my horror game. I'm sure I've seen it somewhere before, but after days of searching, I have not found anything like it. If anyone could share some code or texture I would be most grateful.

Thanks!

Re: Smoke/Gas effect [Re: LawnmowerMan] #454963
09/30/15 19:25
09/30/15 19:25

M
Malice
Unregistered
Malice
Unregistered
M



Particle effect maybe,
Screen shader maybe

Re: Smoke/Gas effect [Re: ] #455099
10/09/15 10:26
10/09/15 10:26
Joined: Jul 2001
Posts: 4,801
netherlands
Realspawn Offline

Expert
Realspawn  Offline

Expert

Joined: Jul 2001
Posts: 4,801
netherlands
is there a picture so you can show what you mean ? laugh


Find all my tutorials & Workshops at : www.rp-interactive.nl

Creativity starts in the brain
Re: Smoke/Gas effect [Re: Realspawn] #455105
10/09/15 19:18
10/09/15 19:18
Joined: Jun 2010
Posts: 71
L
LawnmowerMan Offline OP
Junior Member
LawnmowerMan  Offline OP
Junior Member
L

Joined: Jun 2010
Posts: 71
I not found the best example, but something like this https://www.youtube.com/watch?v=yUdJU5xEajI

Re: Smoke/Gas effect [Re: LawnmowerMan] #455106
10/09/15 21:28
10/09/15 21:28
Joined: Jul 2001
Posts: 4,801
netherlands
Realspawn Offline

Expert
Realspawn  Offline

Expert

Joined: Jul 2001
Posts: 4,801
netherlands
This one creates excellet fog you can make thicker or more
translucent. Make sure you have 2 dust graphics if you use it.


Code:
#define max_alpha skill1
#define max_fog 150

var cam_fog = 100; // needs to be a variable so it can get closer and further away to the camera as needed
VECTOR wind;

void set_alpha() 
{
	var fade_speed = 0.5;
	// fade model in
	my.alpha=70;
	my.max_alpha = integer(random(30));
	if(my.max_alpha < 10){ my.max_alpha = 25; }
	
	while(my.alpha < my.max_alpha)
	{
		my.alpha += fade_speed*time_step;
		wait(1);
	}
	my.alpha = my.max_alpha;
}

void fog_wind()
{
	while(1)
	{
		// new wind direction...
		vec_set(wind.x, vector((random(1) - .5)*1.5, (random(1) - .5)*1.5, random(1)*.4));
		wait(-5 + random(3));
	}
}

void move_fog()
{
	var roll_speed;
	var fade_distance = cam_fog+(cam_fog/6);
	var fog_speed = 20;
	
	roll_speed = random(2)-1; 
	
	while(me)
	{
		my.roll += roll_speed*time_step; //roll this sprite
		
		// update position globally
		c_move(my, nullvector, vector(random(fog_speed)*wind.x*time_step, random(fog_speed)*wind.y*time_step, 0), IGNORE_PASSABLE);
		
		// fade sprite when close to camera
		if(vec_dist(my.x, camera.x) < fade_distance) 
		{
			my.alpha = minv(my.max_alpha, vec_dist(camera.x, my.x) * my.max_alpha / fade_distance);
		}
		
		wait(1);
	}
}

void autofog()
{
	VECTOR cam_pos;
	var randint;
	
	vec_scale(my.scale_x, 0.8);
	set(my, PASSABLE | TRANSLUCENT); // can add BRIGHT, but slows FPS down
	
	//fade in slowly
	set_alpha();
	move_fog();
	
	while(me)
	{
		if(my.alpha < my.max_alpha) { my.alpha += time_step; }
		
		vec_set(cam_pos, camera.x);
		cam_pos.z = my.z;
		
		if(vec_dist(my.x, cam_pos) >= cam_fog)
		{
			// fade the fog out
			while(my.alpha > 0) { my.alpha -= time_step; wait(1); }
			
			// set on new position at edge of fog distance
			vec_set(my.x, vector(cycle(my.x, camera.x - cam_fog, camera.x + cam_fog), cycle(my.y, camera.y - cam_fog, camera.y + cam_fog), camera.z - random(100) + random (200)));
		}
		
		wait(5);
	}
}

void generate_fog()
{
	var randint; // random fog sprite
	var fogcount;
	
	VECTOR pos_place;
	
	fog_wind(); // sets a random fog position every so often
	
	for(fogcount=0; fogcount<max_fog; fogcount++)
	{
		// set random position around camera
		vec_set(pos_place.x, vector(((camera.x - random(cam_fog)) + (camera.x + random(cam_fog))), ((camera.y - random(cam_fog)) + (camera.y + random(cam_fog))), ((camera.z - random(cam_fog/4)) + random(cam_fog/2))));
		//		vec_set(pos_place.x, nullvector);
		
		// get a random number
		randint = integer(random(2));
		// create different fog, based on random number
		if(randint == 0){ ent_create("Dust_1.tga", pos_place, autofog); }
		if(randint == 1){ ent_create("Dust_2.tga", pos_place, autofog); }
	}
}



Find all my tutorials & Workshops at : www.rp-interactive.nl

Creativity starts in the brain
Re: Smoke/Gas effect [Re: Realspawn] #455121
10/10/15 15:05
10/10/15 15:05
Joined: Jun 2010
Posts: 71
L
LawnmowerMan Offline OP
Junior Member
LawnmowerMan  Offline OP
Junior Member
L

Joined: Jun 2010
Posts: 71
Thank you, I already have this code in my game. Sorry my example video is not good. I found good example in video from Superku game https://www.youtube.com/watch?v=hIsjyAhVo68
I need to smoke coming from the ground, or swamp, as in the video at 1:07 where smoke coming from lava, and slowly disappearing not so far from land.

Re: Smoke/Gas effect [Re: LawnmowerMan] #455152
10/11/15 17:16
10/11/15 17:16

M
Malice
Unregistered
Malice
Unregistered
M



@Lawn---Man, I need more info about your project. You referenced Superku, is you project a 2d,2.5d, 3d side scroller like Superku?

If so here are a few ideas.
Use a 2d animated sprite, attach the base to your swamp. Basically build a 2d image that graduates to full fade (32 tga alpha), apply a solid noise to it. Then use it to produce a animated sprite.

2) Use a single tga with noise, then use a shader to animate it and fade it's (possibly with a second alpha image)

3) use a 3d cube, assign a white noise texture to it, set all sides but the front facings with a full alpha texture, Use the mtl_turbulent for the standard lib to move the surface texture of the cube in a smoke like manner. Or the mtl_uvspeed possibly.

Re: Smoke/Gas effect [Re: ] #455184
10/12/15 15:37
10/12/15 15:37
Joined: Jun 2010
Posts: 71
L
LawnmowerMan Offline OP
Junior Member
LawnmowerMan  Offline OP
Junior Member
L

Joined: Jun 2010
Posts: 71
Project is 3d, but the level in which is the swamp has a static camera that looks forward, without rotation, and the player should kill the monsters that come out of the swamp, just moving the target and not the camera. I just need some effect evaporation from swamp watter to make it look better, almost identical as in the second video
Malice, thank you for help. I will put aside your ideas 1 and 3. The first one beacuse it is really hard find some good and free animated sprite for this, and second I guess it is for free camera. Idea 2 sounds like that's what I need, but unfortunately I do not understand the shaders, and I do not have a idea how make texture fading, like in particles.


Moderated by  adoado, checkbutton, mk_1, Perro 

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