Useful particle effects!

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
Wolfrug
Posts: 55
Joined: Wed Oct 03, 2012 6:56 pm

Useful particle effects!

Post by Wolfrug »

Hey everyone!

So, when making dungeons, you sometimes want to add some custom particle/lighting effects, right? Stuff like earthquake dust, custom teleporter effects, fog, candle smoke...and so on. I figured it could be a good idea to share these custom effects somewhere (like here), since the trial-and-error approach to particle making means there's usually a lot of effort put into them.

To start off, here's the fog particle effect I stole from Rotten Place (...speaking of effort...) and then edited to be the thick thing it is right now:

materials.lua

Code: Select all

defineParticleSystem{
	name = "fog",
	emitters = {

		
		-- fog
		{
			emissionRate = 1.5,
			emissionTime = 0,
			maxParticles = 200,
			boxMin = {-2, 0.1, -2},
			boxMax = { 2, 0.1,  2},
			sprayAngle = {0,30},
			velocity = {0,0},
			texture = "assets/textures/particles/smoke_01.tga",
			lifetime = {10,20},
			color0 = {0.5, 0.5, 0.5},
			opacity = 0.8,
			fadeIn = 9,
			fadeOut = 9,
			size = {4, 8},
			gravity = {0,0,0},
			airResistance = 0.1,
			rotationSpeed = 0.05,
			blendMode = "Translucent",
			objectSpace = false,
		}
	}
}


objects.lua

Code: Select all

defineObject{
	name = "fog_emitter",
	class = "LightSource",
	lightPosition = vec(1.2, 0.2, 0),
	lightRange = 6,
	lightColor = vec(1, 1, 1),
	brightness = 0,
	castShadow = true,
	particleSystem = "fog",
	placement = "floor",
	editorIcon = 88,
}
And finally, effect:
SpoilerShow
Image
Add your own (with or without an actual 'emitter' object)!

-Wolfrug
Try my Mordor: Depths of Dejenol LoG-ification. Feedback much appreciated!
User avatar
HaunterV
Posts: 676
Joined: Mon Apr 16, 2012 9:54 pm
Location: Barrie, Ontario, Canada

Re: Useful particle effects!

Post by HaunterV »

exactly what I needed.
Grimrock Community 'FrankenDungeon 2012. Submit your entry now!: http://tinyurl.com/cnupr7h
SUBMIT YOUR ASSETS! Community Asset Pack (C.A.P.): http://tinyurl.com/bqvykrp
Behold! The HeroQuest Revival!: http://tinyurl.com/cu52ksc
IronMaiden
Posts: 17
Joined: Sun Oct 21, 2012 1:08 am

Re: Useful particle effects!

Post by IronMaiden »

Nice wolf :) but help a script dummy here hehe, how do you choose what room you want this in? i pasted your script in the lua files you showed but there is no fog in my dungeon.

Thanks
User avatar
Wolfrug
Posts: 55
Joined: Wed Oct 03, 2012 6:56 pm

Re: Useful particle effects!

Post by Wolfrug »

IronMaiden wrote:Nice wolf :) but help a script dummy here hehe, how do you choose what room you want this in? i pasted your script in the lua files you showed but there is no fog in my dungeon.

Thanks
The fog_emitter object is what you're looking for - that's the second definition there. Simply place that one down wherever and it'll start producing fog from that location. You can always mess around with the materials to change the type of fog - opacity, size, etc. I made mine pretty small since they often have to fit into 4x4 rooms without spilling too much into neighbouring areas (this is the boxMin and boxMax parameters, just make them bigger and you'll have a larger fog-cloud).

-WOlfrug
Try my Mordor: Depths of Dejenol LoG-ification. Feedback much appreciated!
User avatar
Asteroth
Posts: 471
Joined: Wed Oct 24, 2012 10:41 am
Location: Eastern U.S.

Re: Useful particle effects!

Post by Asteroth »

This is AWESOME, almost exactly what I need. Could it easily be made black? I need floating corruption. Anyway kudos to you none the less, this cuts out the next question I was going to ask on the board.
I am the God of darkness and corruption.
viewtopic.php?f=14&t=4250
User avatar
Fhizban
Posts: 68
Joined: Sun Oct 21, 2012 2:57 pm
Location: Germany
Contact:

Re: Useful particle effects!

Post by Fhizban »

very useful, thank you wolf rug

and once you understand everything, its so easy to use!
--
Fhizban's Asset Repository - the place where you find all my LoG contributions:
viewtopic.php?f=14&t=3904
User avatar
J. Trudel
Posts: 117
Joined: Tue Aug 28, 2012 3:05 pm
Location: Montreal, Canada

Re: Useful particle effects!

Post by J. Trudel »

Here is one very usefull for when you want to spawn a cave_in and hide it a bit : (sorry I don,t have an image yet)

material
SpoilerShow
defineParticleSystem{
name = "dust",
emitters = {


-- dust
{
emissionRate = 55,
emissionTime = 5,
maxParticles = 100,
boxMin = {-2, 0.1, -2},
boxMax = { 2, 1.4, 2},
sprayAngle = {0,45},
velocity = {0,0},
texture = "assets/textures/particles/fog.tga",
lifetime = {10,20},
color0 = {0.25, 0.2, 0.13},
opacity = 0.6,
fadeIn = 0.5,
fadeOut = 7,
size = {1, 5},
gravity = {0,-0.1,0},
airResistance = 0.1,
rotationSpeed = 0.3,
blendMode = "Translucent",
objectSpace = false,
},
{
emissionRate = 45,
emissionTime = 10,
maxParticles = 100,
boxMin = {-2, 0,1,-2},
boxMax = { 2, 3, 2},
sprayAngle = {30,30},
velocity = {0,0},
texture = "assets/textures/particles/fog.tga",
lifetime = {10,20},
color0 = {0.25, 0.2, 0.13},
opacity = 0.6,
fadeIn = 0.3,
fadeOut = 2,
size = {0.1, 0.2},
gravity = {0,-0.75,0},
airResistance = 0.1,
rotationSpeed = 0.3,
blendMode = "Translucent",
}
}
}
object
SpoilerShow
defineObject{
name = "dust_emitter",
class = "LightSource",
lightPosition = vec(1.2, 0.2, 0),
lightRange = 6,
lightColor = vec(1, 1, 1),
brightness = 0,
castShadow = true,
particleSystem = "dust",
placement = "floor",
editorIcon = 88,
}
The Lurker
User avatar
Wolfrug
Posts: 55
Joined: Wed Oct 03, 2012 6:56 pm

Re: Useful particle effects!

Post by Wolfrug »

Asteroth wrote:This is AWESOME, almost exactly what I need. Could it easily be made black? I need floating corruption. Anyway kudos to you none the less, this cuts out the next question I was going to ask on the board.
I just stole it from the developers anyway, but this is exactly why I wanted to post it. ;) For others to use!

Black -> the color parameter changes the colour of the fog, in RGB (Red-Green-Blue) format. The 0.5 makes the grey fog..um...black fog might be 1,1,1. Try it. You can also make the opacity even higher (say 0.9) to make it truly impenetrable.


-Wolfrug
Try my Mordor: Depths of Dejenol LoG-ification. Feedback much appreciated!
User avatar
Xanathar
Posts: 629
Joined: Sun Apr 15, 2012 10:19 am
Location: Torino, Italy
Contact:

Re: Useful particle effects!

Post by Xanathar »

black fog might be 1,1,1
Black fog would be 0,0,0

To create a color, take any colorpicker (like windows one) and divide each R, G, B component by 255.

0,0,0 => black
1,1,1 => white
1,0,0 => high intensity red
0,0.5,0 => medium green

and so on.
Waking Violet (Steam, PS4, PSVita, Switch) : http://www.wakingviolet.com

The Sunset Gate [MOD]: viewtopic.php?f=14&t=5563

My preciousss: http://www.moonsharp.org
User avatar
J. Trudel
Posts: 117
Joined: Tue Aug 28, 2012 3:05 pm
Location: Montreal, Canada

Re: Useful particle effects!

Post by J. Trudel »

To help you choose your colors use Gimp or Inkscape (or photoshop, but I prefer free software) color wheel. You first select the color you want, then in the option you should see on a scale of 0-255 the amount of each chanel RGB you have. Divide by 255 and you have the Grimrock equivalent.
The Lurker
Post Reply