Hot Particles - particle editor

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
ReFreezed
Party member
Posts: 612
Joined: Sun Oct 25, 2015 11:32 pm
Location: Sweden
Contact:

Re: Hot Particles - particle editor

Post by ReFreezed »

@ChicoGameDev
I'm not completely sure, but if you go to

System Preferences > Security & Privacy > General > Allow apps downloaded from

is the setting set to "Anywhere"? (If you don't see this option, see this information)

Since the app isn't signed or anything, macOS might complain about it in stupid ways. For me (on El Capitan) it said the app was "damaged" when I downloaded the zip from GitHub before I changed the security setting (getting the app from a zip that I moved across computers using Dropbox yielded no error). So, of course, macOS is just wrong and misleading.
Tools: Hot Particles, LuaPreprocess, InputField, (more) Games: Momento Temporis
"If each mistake being made is a new one, then progress is being made."
User avatar
ChicoGameDev
Citizen
Posts: 70
Joined: Thu Feb 14, 2019 6:02 pm
Location: Switzerland
Contact:

Re: Hot Particles - particle editor

Post by ChicoGameDev »

Yes I'm used to those kind of issues on MacOS (Notarization, security and deploying on MacOs in general (day job))

This is a different kind of issue. I'm on Big Sur for information.

But don't worry too much the universal is perfect ! :D (Genius move :P)

Thanks.
Lionel Leeser

Luven : https://github.com/chicogamedev/Luven

--

Always keep Game Dev as a passion.
User avatar
ChicoGameDev
Citizen
Posts: 70
Joined: Thu Feb 14, 2019 6:02 pm
Location: Switzerland
Contact:

Re: Hot Particles - particle editor

Post by ChicoGameDev »

Little question about your tool this time.

Is this normal that the result are not the same as in the editor, in my game?

Am I missing something?

Thanks
Lionel Leeser

Luven : https://github.com/chicogamedev/Luven

--

Always keep Game Dev as a passion.
User avatar
ReFreezed
Party member
Posts: 612
Joined: Sun Oct 25, 2015 11:32 pm
Location: Sweden
Contact:

Re: Hot Particles - particle editor

Post by ReFreezed »

I'm pretty sure macOS doesn't let me update to a newer version of the OS because the computer is "too old", so unfortunately I can't do any proper testing. Good that the universal version is working though.

What exactly do you mean by results? Because the editor has more parameters than what the ParticleSystem API provides there's going to be some differences as the exported data is the result after various calculations (for example, you can stretch the time for a system in the editor, but that will affect multiple parameters of the ParticleSystem object). Or do you mean that the rendering is different? That shouldn't happen, unless maybe the dt is different (vsync is on in the editor) which could affect particle velocities and lifetimes slightly.
Tools: Hot Particles, LuaPreprocess, InputField, (more) Games: Momento Temporis
"If each mistake being made is a new one, then progress is being made."
User avatar
ChicoGameDev
Citizen
Posts: 70
Joined: Thu Feb 14, 2019 6:02 pm
Location: Switzerland
Contact:

Re: Hot Particles - particle editor

Post by ChicoGameDev »

Hello,

Thanks for your answer.

See the little video :
Particles.mp4.zip
Little capture to demonstrate
(62.01 MiB) Downloaded 296 times
I don't know if it's "slightly" different but in my opinion its very different. I change the color by code that's all the alteration I did. I ask the particles system to burst a lot of particles in one shot and it seems alright on the editor. but in the game it lack a lot of particles and punch.

Other issue, in the game only the first color of the :setColors() function is used. Why ?


Thanks
Lionel Leeser

Luven : https://github.com/chicogamedev/Luven

--

Always keep Game Dev as a passion.
User avatar
ReFreezed
Party member
Posts: 612
Joined: Sun Oct 25, 2015 11:32 pm
Location: Sweden
Contact:

Re: Hot Particles - particle editor

Post by ReFreezed »

Yeah, that is quite different. It looks like you may be doing the kick-starting incorrectly in the game (or not at all). See this example for how to do it. Although, kick-starting is usually meant for continuous particles (e.g. rain) and using it for a "sudden" effect like this is a bit weird.

About the singular color, are you altering all the colors of the particles systems? Remember that ParticleSystem:getColors() and :setColors() returns/takes multiple colors.
Tools: Hot Particles, LuaPreprocess, InputField, (more) Games: Momento Temporis
"If each mistake being made is a new one, then progress is being made."
User avatar
ChicoGameDev
Citizen
Posts: 70
Joined: Thu Feb 14, 2019 6:02 pm
Location: Switzerland
Contact:

Re: Hot Particles - particle editor

Post by ChicoGameDev »

I have not really understood the point of kick-start. And I didn't realized that was something that we got to init on our side.

So multiple colors are not managed by the particles system either? Is there an exemple to manage them?
Lionel Leeser

Luven : https://github.com/chicogamedev/Luven

--

Always keep Game Dev as a passion.
User avatar
ReFreezed
Party member
Posts: 612
Joined: Sun Oct 25, 2015 11:32 pm
Location: Sweden
Contact:

Re: Hot Particles - particle editor

Post by ReFreezed »

The way kick-starting works is just by updating the particle system a few times immediately as you spawn* them (specifically, enough times so that the very first spawned particle is about to despawn). This will make it so that the very first frame that the particles render it will look like the particle system has been going on for longer than it has.

For example, if the player enters a level where it's supposed to be snowing, you probably don't want there to be no snow particles at first because then it will look like it just started snowing. Instead you "kick-start" the particles so that it's already snowing when the player enters the level.

There's no property of ParticleSystem objects for providing this kind of behavior, so that's why you have to implement it manually. It's the same with the "emit at start" parameter which is just a call to ParticleSystem:emit() at spawn time, and the particle systems' positions which you're probably already manually handling in your game.


The colors have nothing to "manage". They are simply stored in the particle system just like spawn rate and damping etc. (as you can see in the exported .lua file). To e.g. multiply the colors of a particle system, just do something like this:

Code: Select all

local colors     = {particleSystem:getColors()}
local r, g, b, a = .5, 0, 1, .8 -- Multiply the particle colors with this.

for _, color in ipairs(colors) do
	color[1] = color[1] * r
	color[2] = color[2] * g
	color[3] = color[3] * b
	color[4] = color[4] * a
end

particleSystem:setColors(unpack(colors))

*When I say "spawning the particle system" I mean when you clone/instantiate the exported particle system for usage somewhere in the game world.
Tools: Hot Particles, LuaPreprocess, InputField, (more) Games: Momento Temporis
"If each mistake being made is a new one, then progress is being made."
User avatar
ChicoGameDev
Citizen
Posts: 70
Joined: Thu Feb 14, 2019 6:02 pm
Location: Switzerland
Contact:

Re: Hot Particles - particle editor

Post by ChicoGameDev »

Thanks for your explanation on kick-starting. I get it now.

For colors I don't really understand but in my case only the first of 4 I give to system:setColors() is used for the whole lifetime of the particle. But thanks for your insights.
Lionel Leeser

Luven : https://github.com/chicogamedev/Luven

--

Always keep Game Dev as a passion.
User avatar
ReFreezed
Party member
Posts: 612
Joined: Sun Oct 25, 2015 11:32 pm
Location: Sweden
Contact:

Re: Hot Particles - particle editor

Post by ReFreezed »

I can only assume your call to :setColors() is messed up in some way. If you share the relevant code I can maybe spot the problem.
Tools: Hot Particles, LuaPreprocess, InputField, (more) Games: Momento Temporis
"If each mistake being made is a new one, then progress is being made."
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 15 guests