Particle Monkey

Thanks for the heads up. I got the demo example to run with Java 11 when I added jme3-lwjgl3 to my dependencies in build.gradle. This might pose a problem though, as the Particle Monkey itself declares that it needs jme3-lwjgl in its own build.gradle and I don’t think having both at the same time is a good idea.

I needed that to run the demo but it probably makes sense to separate out the demo for that reason. I’m going to try to get a version compiled with java 8 out soon. I have some changes i’m separating out because they aren’t ready yet still.

Hi @glh3586,

I’ve been using ParticleMonkey in my project a lot lately and am wondering if you are still actively maintaining the library and accepting issues or contributions on the github repo?

I’m still learning how to use Emitters to their full potential, so I am not entirely sure if I’ve found an issue with particlemonkey or if the error is on my end, but it seems like I may have run into a potential issue where the particles are facing the wrong direction and appear distorted whenever I rotate the Emitter to make the particles emit in a different direction. (I’m trying to get a Cone emitterShape to emit particles from the tail of a projectile that travels in an arc across the sky, sort of like a rocket ship that shoots flames out the back end in the direction opposite of its current velocity).

Also just wanted to say that ParticleMonkey is an extremely impressive library and is a huge improvement compared to the stock jme particle emitter, so thank you for contributing this great library. I’m looking forward to making a lot of cool spells and special effects with it :slightly_smiling_face:

1 Like

I am still slowly working on it. I recently reworked the entire project structure and I don’t think that has been pushed to github yet. Most of my time has been spent working on an editor for the library which has eaten up a lot of my limited time.

Do you have particlesFollowEmitter set to true for your bug? Also, what is the billboard mode and Particle Mesh Type (default is triangle I believe)? If you have more details or a screenshot it would be helpful.

2 Likes

Yes, although when I tried setting this to false, the particles do not show up at all anymore.

I didn’t change it so it should be the default Camera mode

I also did not change this so I believe it should also be the default Triangle mode.

Here is the code for creating the Emitter, its copy/pasted from one of the ParticleExamples that I’ve been using as a template, and then I made some some minor changes.

        Material mat = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Particle.j3md");
        mat.getAdditionalRenderState().setFaceCullMode(RenderState.FaceCullMode.Off);
        Texture tex = app.getAssetManager().loadTexture("Effects/Particles/part_light.png");
        mat.setTexture("Texture", tex);
        
        Emitter  emitter = new Emitter("test", mat, 120,
            new ColorInfluencer(),         
            new SizeInfluencer()
        );
        
        Curve x = new Curve()
            .addControlPoint(null, new Vector2f(0.0f, 4.0f), new Vector2f(0.2f, 6.0f))
            .addControlPoint(new Vector2f(0.22f, 3f), new Vector2f(0.4f, 0.2f), new Vector2f(0.6f, 0.1f))
            .addControlPoint(new Vector2f(0.8f, 0.1f), new Vector2f(1.0f, 0.1f), null);
        
        emitter.getInfluencer(SizeInfluencer.class).setSizeOverTime(new ValueType(x.clone()));        

        emitter.getInfluencer(ColorInfluencer.class).setColorOverTime(new ColorValueType(
            new Gradient()
                .addGradPoint(new ColorRGBA(0.5f, 0.9f, 0.1f, 0.5f), 0.0f)
                .addGradPoint(new ColorRGBA(0.75f, 0.64f, 0.2f, 0.12f), 0.89f)
                .addGradPoint(new ColorRGBA(0.64f, 0.85f, 0.1f, 0.0f), 1.0f)
        ));
                
        emitter.setStartColor(new ColorValueType(new ColorRGBA(0.6f, 0.71f, 0.2f, 0.9f)));
        emitter.setStartSpeed(new ValueType(16f));
        emitter.setLifeMinMax(new ValueType(1.0f), new ValueType(1.2f));
        emitter.setStartSize(new ValueType(1f));
                
                
        emitter.setEmissionsPerSecond(20);        
        emitter.setParticlesPerEmission(1);
        
        emitter.setParticlesFollowEmitter(true);        
        
        EmitterCone cone = new EmitterCone();
        cone.setAngle(0.1f);
        emitter.setShape(cone);

Here is a screenshot showing how this Emitter looks when its attached to a non-rotating node with identity rotation, compared to when the same Emitter is attached to a Node that rotates to face the direction that the projectile is going:

https://i.imgur.com/gXzLZFg.png

Let me know if I should provide anymore information, hopefully the screenshot on the right side shows the problem well enough, otherwise I can also try to make a short video clip to show it better.

Alright, thanks! I can reproduce this pretty easily in my editor and I’m pretty sure I know where the problem is. I’ll have to test it out.

2 Likes

Yup, found the issue. I’ll have to do some testing on the other billboard modes to be sure it’s all sane. I’ll see if I can push it to GitHub sometime soon.

3 Likes

It’s nice to see that particles are being discussed
I have a question.
*About whether particle effects can be converted from Blender?
*Where can I get ParticleMonkey documentation?
Where can I get the JAR package.
Somehow I couldn’t generate Javadoc when I built it

* What went wrong:
Execution failed for task ':javadoc'.
> Javadoc generation failed. Generated Javadoc options file (useful for troubleshooting): 'K:\particlemonkey-1.0.2\build\tmp\javadoc\javadoc.options'

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

Modify :

Deleting this character compiles successfully

Awesome, thanks for the quick help! I look forward to the next release, whenever it is ready of course :slightly_smiling_face:

I am also very excited for the visual particle editor once that is ready as well. Creating particle effects by code and having to run the app to see the changes every time can be a tedious trial and error process, although learning to create Emitters without a visual editor has definitely been a valuable learning experience and has given me a better understanding of the code, which is always a good thing, especially since there will still be times that an Emitter needs minor adjustments with code at run-time, even if it was created in an editor.

They cannot.

Here is the ParticleMonkey wiki which I have found very useful, and you can also learn a lot from playing around with the code in the particle examples.

Have you had problems generating Javadoc at build time?

I just tried locally and didn’t have an issue, but I’ve made a lot of changes since the last release.

It was on bintray. I’ve been trying to get it on Maven, but it’s been more than a little painful. Honestly, one of the big reasons I haven’t pushed any of my changes has to do with that.

My understanding of lemur has held me back on this one. I’ve just about got my curve editor figured out. I have a little bit more I need to polish on that, finish exposing all the emitter attributes, and then finish a lot of generic “editor” stuff. I also probably need to figure out lemur styling, but that’s at the bottom of my list.

3 Likes

Then it should still be.

I did this recently for all of my projects. (If you use a gradle build then) Let me know if you need some advice setting it up. Turned out to be more straight-forward than I feared (but my fears were pretty giant) and only took me a Saturday to convert half-a-dozen projects in the end.

1 Like

I finally put in some time and after a few big mistakes I was able to convert the project. It’s now on maven with the tag:

implementation 'com.epagagames:particlemonkey:1.1.0'

I needed to rename the package structure to make it work and pushed the current changes to GitHub. The examples have been pulled out of the library and will be moved into their own repo shortly.

I used your projects as an example to get going which was super helpful. :+1:

5 Likes