Page 1 of 3

Particle fx program (request)

Posted: 11 Oct 2008, 02:05
by zipon
My request is to make a program like tiled just to make particle fx in and are able to see the particles while you makeing them, so you dont have to get in and out of the client all the time when make new particle fx.

Re: Particle fx program (request)

Posted: 19 Oct 2008, 15:08
by Crush
This idea is as old as the particle engine itself but unfortunately noone got around doing it yet.

Re: Particle fx program (request)

Posted: 19 Oct 2008, 17:14
by igneus
I have started to work on a small program which after some time eventually could do what you want. I have following idea:

The program is invoked from the console. Name of file with definition of the particle effect is given as a command-line argument.

[/home/igneus]$ ./tmwparticleeffect.rb hit.particle.xml

Program creates window and shows the particle effect.

Is that what you need? If it is, I might be able to make it.

Re: Particle fx program (request)

Posted: 19 Oct 2008, 17:30
by Crush
That would already be an improvement but it would be best when you could edit the effect parameters with the program and see the effect in real time.

Would you agree to release your program under the GNU GPL so that others can improve it?

Re: Particle fx program (request)

Posted: 19 Oct 2008, 17:42
by igneus
Ok, thank you for better specification.

If I manage to make something at least a bit useful, I'll of course release it under GNU/GPL.

Re: Particle fx program (request)

Posted: 21 Oct 2008, 18:47
by igneus
Work is in progress. After a few hours of speed-hacking I switched to something which may look more like a documentation project than development of a new tool for developers: I am going through the code of TMW client and making a sort of "map" of places somehow connected with the particle engine.

The next step will be to extract the particle engine from the rest of client and write some code (as slim as possible) around the engine which will read commandline arguments, create window, update it regularly, ...

First I thought I would write the program from scratch in Ruby, but I found it more safe (is it batter to say "safer" or "more safe"? - both sound strange) to reuse as much of TMW code as possible, because, even if I am short on C++ programming experience, I'm even shorter on experience with programming particle engines :-]

Re: Particle fx program (request)

Posted: 21 Oct 2008, 19:02
by Crush
Using as much original TMW code as possible is a good idea because it makes it much easier to integrate new features and bugfixes of the particle engine into your program. The best case would be when the sourcecode files particle.cpp, particle.h, particleemitter.cpp and particleemitter.h could be integrated into your project without any changes.

Re: Particle fx program (request)

Posted: 23 Oct 2008, 08:00
by igneus
It shouldn't be a problem.
Btw. it's you, who developed the particle engine? (I've seen screenshots named "Crushe's particle engine")

Re: Particle fx program (request)

Posted: 23 Oct 2008, 11:36
by Crush
Yes, the particle engine is mostly my brainchild. I did most of the conceptualisation and programming and designed most of the particle effects which are ingame.

Re: Particle fx program (request)

Posted: 24 Oct 2008, 14:52
by igneus
I'm proud to announce first version of particle effect viewer - you can find it at http://freevikings.wz.cz/particled/. It's based on a subset of code of 0.0 client (many classes including those requested by Crush are reused without any change), works as I have said before (designed to be invoked from the command line, doesn't offer any editing features).

It isn't an official release yet, because I haven't done everything needed to release the code legally (add notices that it's a derived work etc.).

Another problem is, that I can't use autotools so building procedure is a bit non-standard (described in README).

Tip: If you are trying to view particle effect "rain" and see an empty black window, try larger window with the effect placed at the bottom, e.g.

Code: Select all

$ particled -d ~/tmw/data -W 600 -H 600 -y 500 graphics/particles/rain.xml
Comments etc. are welcome.

Re: Particle fx program (request)

Posted: 01 Nov 2008, 19:30
by strikerbcb
i don´t know if you can do this ... but it´s a great idea make this particle viewer with a windowed program, using qt for example, with this the test of the particles gain more speed and more options. Put things like loop, and in the future, the ability to MAKE particle effects, than this will be a really GREAT tool for us.

But great work itself, thanks.

Re: Particle fx program (request)

Posted: 05 Nov 2008, 12:24
by igneus
Yes, I know that zipon requested a "particle effect editor" and not a viewer. I have been thinking about creating an editor since I first read zipon's post, but I think it's better to do small steps than big ones - first I had to test if I am able to program in C++ at all (the only stuff I have ever made in C++ are examples from textbooks :( ) and if it is possible to compile against Guichan and run the resulting programs (from some stupid reason I can't run TMW on my PC even if it compiles well, but the "particlEd experiment" proved that it's probably not because of Guichan).

I have been thinking a bit about how to edit particle effects and unfortunatelly I've ended with something as unfriendly as a tree-view of effect's elements and their properties. Would that be helpful? I'm not sure. Still you would have to know a lot about particle engine's internals. I can only see two advantages: you don't have to switch between two windows (text editor and effect viewer) and you don't make typos (because you don't have to type names of properties).
  • tree-view of effect's members
  • when you select any member in the tree-view, operations available appear in the window of operations and you can edit it's properties in the window of properties
  • effect can be commanded in a way common for today's media players (play, pause, stop)
Btw. what do you mean speaking about a "loop"? Possibility to restart particle effect without restarting the program? Or to make it running again and again? To start every n seconds?

Re: Particle fx program (request)

Posted: 05 Nov 2008, 13:10
by zipon
Hey Igneus

The particle program looks cool :D i cant wait till you your are done with it.
About the loop i think it is to restart the particle fx.

And thanks for taking your time to make a program like that :D

Re: Particle fx program (request)

Posted: 05 Nov 2008, 16:22
by Crush
That gui looks quite practical. I can't wait to see it in action.

Re: Particle fx program (request)

Posted: 05 Nov 2008, 21:01
by Rotonen
Realizing something with the ease of use demonstrated by the GUI mockup would greatly spark up particle effect development and bring toying around with them closer to the community.