Particle Designer for Monkey???

Monkey Forums/Monkey Programming/Particle Designer for Monkey???

Tri|Ga|De(Posted 2012) [#1]
I have the Particle Designer from 71Squared and I have asked on their forum if I can use the output from Particle Designer i Monkey.

This is the thread.

Maybe someone here can make a wrapper or something for Monkey!


AdamRedwoods(Posted 2012) [#2]
Not only would you have to create a monkey particle engine, but you would have to interpret the .pex files.

Starling is the closest thing I could find that gives any clear information on the pex files:
https://github.com/PrimaryFeather/Starling-Extension-Particle-System


Tri|Ga|De(Posted 2012) [#3]
Well I'm not so good at this. So I was hoping that someone had or would make a solution.

I can show what the .PEX file looks like.
<particleEmitterConfig>
	<texture name="particleTexture.png" data="H4sIAAAAAAAAAwGaBGX7iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAQAAADZc7J/AAAA5mlDQ1BJQ0MgUHJvZmlsZQAAeAFjYGCsSCwoyGESYGDIzSspcg9yjIyIjFJgv8rAzsDIAAaJycUFjgEBPhAeNvLbNYjay7ogs2ad1vz46kTgxG2Ka/z0r9ZuwKYDSYwlJbU4GcjfAsSlyQVFJQwMjDpAtnp2SJAzkB0CZPOVlxSAxFOAbBGoeiCTQdo5MSczqSixJDVFwb0osVLBOT8nv6i4IDE5FSRNXVCSWgF0AwODc35BZVFmekaJgiPQt6lAO3MLSktSi3QUPPOS9RgYkkuLyqA2MzIZMzCAwhPC/xwIDidGsTMAFkw91gWJ+yQAAANvSURBVEgNxZU7aFRREIb/uXnsZpPoxoAYxBSBKKaIKBYiqF0awTQ2iqiNoqCFnWJpkSiCFoIgIgqWKoqCxEJQQSIWBgmI+GgsBDVmNZvdTTbZ8Z85d+/mCYKFZ2DZe8/MN3PmzMwF/nHJcvaaQgShKKUiU8vpLQGgaQPqKXUJYBYzlPJSmKhK1pP2Txu1BS1oxUpKFm0uWX9qRYu2aON8fdBPvPRF5Zt0Ik1pQorSGMegMP/TmKIUUdJISnT0DX3BMAFEI3oW37EDBWSISBMRDhEAUyjR3I4W6Wod1ZPRyAKApnEX2/EGu2OExWBZMID5LxLZwDdr8Fquyq1q5HESebaMn/0y+vSY5PmUdn8GYProv4BJ5NGq9+QBDqMg0wFRBVjqVniyzuk2uYl3SwDy6NVTeCrH8Rt5OvHlAF5cMM8y81m9hCy9fPaQLYKyH2ASG/QgxmQvcvjlCK+NAAgXFy6tDSv0NFrlGb4yCxEqzECR4XfqHuTkBMZdfmEixBDqoJ6qKb/ADE/fzBQVdBd60O6yitWwieYTMpDckF2yLwJ4AKs7QxjE6qBZnmBKe9FFgJmv1x2YlOu+W62RetpxGSfi5RjCIA2UFBEZeaubdR2DnkC9dqAkD/neds23SR3tYoC1jEFMbMuUGIt81bWS1SZJsQteOTwYml5oNPcObxmD1CQKUUmRmymdlQ98DiY1HfsXA6xh50uFubcOoIpC6thc9ma+jj3NAZiBibetl26JZ8/Q+xedYS7a+K7su0Ev4GJA8GamphTKpoBmpq4s75nGN34jHSwn2512zAydVeIIOCaCsTVsybtuEu3aw8y/xBh+Ylwee110+a5pOSSMl1BIod+tYQveNJ1+7/dpbmKIG5jQfmzkLmdCjLAAmFtbFpg1bOi4DV5112g4hh8OyOG3DCKnh7HFERZD2S3DVTDXtW7crBd47gFWnY2Pue2c14vSjkMYXtSNBFTnQRceYRSDy86D87pFtuLTonlARJpG3TosQ25uc3HhRAoHHNB+6ZaP4QBWhcnSJi3IPZxJOm7xTLQUF3BF90WJXTJUyfkpR3CHZ7cBtuxU5uXu1yEtSlPwnJD0Gm7Lc+bCGsl+rXGs/vldiuvEbmo6zELdiQNy1BAJoFIXzQbm332ZqvoJIBjXfon5q29jzeJ//fsDttmrmko6AygAAAAASUVORK5CYIJuAiUFmgQAAA==">
	</texture>
	<sourcePosition x="160.00" y="211.72"></sourcePosition>
	<sourcePositionVariance x="7.00" y="7.00"></sourcePositionVariance>
	<speed value="98.00"></speed>
	<speedVariance value="211.00"></speedVariance>
	<particleLifeSpan value="3.0000"></particleLifeSpan>
	<particleLifespanVariance value="5.0000"></particleLifespanVariance>
	<angle value="357.00"></angle>
	<angleVariance value="190.00"></angleVariance>
	<gravity x="0.70" y="1.43"></gravity>
	<radialAcceleration value="0.00"></radialAcceleration>
	<tangentialAcceleration value="0.00"></tangentialAcceleration>
	<radialAccelVariance value="0.00"></radialAccelVariance>
	<tangentialAccelVariance value="0.00"></tangentialAccelVariance>
	<startColor red="0.32" green="0.39" blue="0.58" alpha="0.76"></startColor>
	<startColorVariance red="0.42" green="0.75" blue="0.88" alpha="0.08"></startColorVariance>
	<finishColor red="0.79" green="0.85" blue="0.42" alpha="0.57"></finishColor>
	<finishColorVariance red="0.45" green="0.51" blue="0.26" alpha="0.46"></finishColorVariance>
	<maxParticles value="2000"></maxParticles>
	<startParticleSize value="49.00"></startParticleSize>
	<startParticleSizeVariance value="60.00"></startParticleSizeVariance>
	<finishParticleSize value="31.00"></finishParticleSize>
	<FinishParticleSizeVariance value="0.00"></FinishParticleSizeVariance>
	<duration value="-1.00"></duration>
	<emitterType value="0"></emitterType>
	<maxRadius value="100.00"></maxRadius>
	<maxRadiusVariance value="0.00"></maxRadiusVariance>
	<minRadius value="0.00"></minRadius>
	<rotatePerSecond value="0.00"></rotatePerSecond>
	<rotatePerSecondVariance value="0.00"></rotatePerSecondVariance>
	<blendFuncSource value="770"></blendFuncSource>
	<blendFuncDestination value="771"></blendFuncDestination>
	<rotationStart value="0.00"></rotationStart>
	<rotationStartVariance value="0.00"></rotationStartVariance>
	<rotationEnd value="0.00"></rotationEnd>
	<rotationEndVariance value="1065.05"></rotationEndVariance>
</particleEmitterConfig>



MikeHart(Posted 2012) [#4]
Mmmh, might be a good addition to fE. Wanted to implement particles anyway :-)


Tri|Ga|De(Posted 2012) [#5]
Okay Mike Go for it!


Shinkiro1(Posted 2012) [#6]
I have made my own particle system based on the one from 71squared.
If you don't want to start from scratch here are some files:
https://dl.dropbox.com/u/2892658/forum/Particles.zip

It lets you load the particles in from a css file (you could change that by simply changing the LoadFromConfig method). I have also made a particle editor that saves these css files (it's written in monkey too). You maybe have to edit some parts because there may be some engine specific code in there but I tried to include everything neccessary.


MikeHart(Posted 2012) [#7]
Hi Shinkiro, would you mind if i include your code into fantomEngine? I am not sure if your post was directed towards TriGaDe or me.


Shinkiro1(Posted 2012) [#8]
@MikeHart: You can include the code :)

Here is the Particle Editor for OSX. It's not really userfriendly, you have to get used how it works
https://dl.dropbox.com/u/2892658/Apps/Particles.app.zip

Some hints:
* You can drag the fields to change their value
* Make sure emission rate is above 0 or you won't see anything
* var speed means variance in speed. same for the other 'var' properties
* To change the image for the particle press Enter. Use Tab to switch between input fields. Enter again to go back. (all images are located inside the apps data folder so you have to copy them in there).
* To Load an effect press L. Then input the exact name of the effect. All effects are saved inside the app (Resources/data/database/effects). Your files will get saved here too.
* To save a file simply press S (there is no feedback, sorry :/).
The name of your file will be what you write in the field Effect Id (when you press Enter).


MikeHart(Posted 2012) [#9]
Thanks alot man, that will give fanotmEngine a nice feature. I will try to implement it asap. Can you create a windows version for the editor?


Shinkiro1(Posted 2012) [#10]
Hey MikeHeart, sorry for the late answer.

I am currently improving my particle-engine and fixing some bugs (in the current version there is a major bug). It's nearly finished and can do anything the one from 71squared can do.

Now there are 2 options how to go from here:
1) Implement a LoadPex function and you have to use ParticleDesigner (so no windows)
2) I improve my own editor (or rewrite it) with some added features and Multiplatform support

Suggestions?


slenkar(Posted 2012) [#11]
multiplatform support!!!

how about an editor that gives out numbers that can be simply pasted into a .monkey file instead of relying on external text files.


Tri|Ga|De(Posted 2012) [#12]
How about support for both Particle Designer and Shinkiro1's designer.


Waldo Reed(Posted 2012) [#13]
If it's going into the fantomEngine then I'll be using it! And since I'm developing on PC and Mac; I've been selecting tools that run on both platforms. Multi-platform support, please!


Shinkiro1(Posted 2012) [#14]
I am pretty busy right now so I'll release the editor in around 2 weeks.

Just to let you know, I will go with option 2 for now, so improving my own editor.
The engine is already working really well and you can use multiple emitters for 1 effect (where in particle designer you can only use one). I will post here when I am finished.


Tibit(Posted 2013) [#15]
How is this coming along?

There is this Editor that also works with .pex files

It is open source flash, so can run in a browser: https://github.com/devon-o/Starling-Particle-Editor

Online Demo: http://onebyonedesign.com/flash/particleeditor/

I was looking at it for a Starling project, super cool to see when Monkey get support for it too! :)


Tri|Ga|De(Posted 2013) [#16]
Yes how is this coming along?


Shinkiro1(Posted 2013) [#17]
tommorow will be my 4th and last exam this week but then I will look to get something up as soon as possible.


Tri|Ga|De(Posted 2013) [#18]
That sounds great!


Shinkiro1(Posted 2013) [#19]
Today I worked on it a bit more.
The module is now completely separate from my engine and I renamed some classes to avoid naming conflicts. The editor itself needs some more work.


JD0(Posted 2013) [#20]
Thanks for the link to the starling particle extension editor.. I've almost got particle designer->monkey working completely. I simply ported the code that comes in the particle designer project and used Monkey's graphics for texturing, drawing and image loading.

Haven't implemented all the blending algorithms on http://www.opengl.org/sdk/docs/man/xhtml/glBlendFunc.xml maybe I can grab them out of the Starling code.


Shinkiro1(Posted 2013) [#21]
The first version of pato the particle library is now online.

Here a little rundown to get you started:
1) Grab the pato module from github: https://github.com/shinkiro1/pato
2) Place it in your monkey module folder
3) Download the example: https://dl.dropbox.com/u/2892658/Apps/Pato/example.zip

If your example runs fine then everything should work.
There are no docs for now but you should get the most important stuff out of the example.

Ok, now to create your own effects download the PatoApp.
Mac: https://dl.dropbox.com/u/2892658/Apps/Pato/PatoAppMac.zip
Windows: https://dl.dropbox.com/u/2892658/Apps/Pato/PatoAppWin.zip

With this you can create a css file that will be exported to the effects folder. It is this css file that you will load in your game. Now a little crashcourse on how to use the editor. In the beginning it might seem a bit unintuitive to use but it works really well after some time :)

When you start PatoApp you have 2 inspectors to your left and right. You can change these values by dragging them with the mouse left and right. Right-Click a property to reset it's value. Before you can see anything you will have to increase EmissionRate to above 0.

Let us view an example effect. You can load any file that is located inside the effects folder. Press 'L' and type fire (notice you don't need to specify the css extension). Whenever you make a change it will be shown immediately. Pressing 'S' saves into the current file.

To change the name of the file press 'Enter' and you will be taken to another screen. Navigate with the 'TAB' key between the 2 fields. The name displayed here will be the filename + css. You can also change the image of the particle here. Only images from the image directory can be loaded. You can go back to the editor mode with 'Enter' again.

Extra Tip: You can navigate and change values with the keyboard using the arrow keys. Up and down navigates through the various properties. Left and right changes the values. If you hold down 'Shift' you will move faster/change values faster.


dave.h(Posted 2013) [#22]
just tested this and it works great except for xna.i get the error

index was outside the bounds of the array

best results are in glfw with 59 fps.Your example looks easy to understand and implement.Thanks for all your hard work.


Shinkiro1(Posted 2013) [#23]
Hey Dave, thanks for testing.
Does the error message point to any line in the code?
Currently I can't test xna myself.


dave.h(Posted 2013) [#24]
no in fact it gives 2 errors the first in its own little jungle ide window as ive already pointed out then if i click ok on it it says

object reference not set to instance of an object

also tested html5 3-7 fps (always slow html5)
flash 27 fps

also just tested android and cant get it to work it just says application has stopped unexpectedly.tested on experia x10

sorry to be the bearer of bad news here.

must say my pc is getting quite old now pentium quad core q6600 at 2.4ghz

was gonna get a new one this week but bought mac mini so i can try that side out


Tri|Ga|De(Posted 2013) [#25]
Nice work!

But are there any chance to get a module that works with Particle Designer as I asked in my first question in this thread?


Shinkiro1(Posted 2013) [#26]
@Tri
You can write a loader yourself, it shouldn't be too hard. Take a look at the LoadFromFile() Method of the ParticleEmitter class in pato.monkey. It should be the only thing you need to change.
Sorry but I've invested the last few days to extract this from my framework and have get back to work on my own projects now.

Dave, thanks for your tests. Html was slow in my tests too (actually it's just the SetColor function).


samowitsch(Posted 2014) [#27]
Hi. Any news here for Particle Designer implementation?
Or is it possible to get the Pato Editor Source? A json file format would be very nice.