SPARK open-source advanced particle engine

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Darktib
Posts: 167
Joined: Sun Mar 23, 2008 8:25 pm
Location: France

Post by Darktib »

Thanks!

This editor create and save xml files (for the moment) which looks like

Code: Select all

<?xml version="1.0" ?>
<scene type="spes" version="1" spkversion="1.05" software="Spark Particle Editor">
    <zone name="center" lock="1">
        <plugin id="Plugins/Plugin1.dll/point" />
        <references />
        <properties>
            <prop name="posX" value="0" type="double" />
            <prop name="posY" value="0.02" type="double" />
            <prop name="posZ" value="0" type="double" />
        </properties>
    </zone>
    <zone name="ground" lock="1">
        <plugin id="Plugins/Plugin1.dll/plane" />
        <references>
            <ref id="obstacle" />
        </references>
        <properties>
            <prop name="nX" value="0" type="double" />
            <prop name="nY" value="1" type="double" />
            <prop name="nZ" value="0" type="double" />
            <prop name="posX" value="0" type="double" />
            <prop name="posY" value="0" type="double" />
            <prop name="posZ" value="0" type="double" />
        </properties>
    </zone>
    <modifier name="obstacle" lock="1">
        <plugin id="Plugins/Plugin1.dll/obstacle" />
        <references />
        <properties>
            <prop name="active" value="true" type="bool" />
            <prop name="bouncingratio" value="0.6" type="double" />
            <prop name="friction" value="1" type="double" />
            <prop name="local" value="true" type="bool" />
            <prop name="trigger" value="8" type="int" />
            <prop name="zone" value="ground" type="QString" />
        </properties>
    </modifier>
</scene>
There are 2 examples in the zip.
Brainsaw
Posts: 1183
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post by Brainsaw »

OK, I just took a look at the editor. Nice I have to say. But for the examples: how do you load the xml files? I don't really see examples (OK, there is an example folder, and there are "main.cpp" files, but they look like this:

Code: Select all

// Include Macros definitions
#include <PluginDefs.h>

// Include plugins
#include "QuadRenderer.h"
#include "LineRenderer.h"
#include "PointRenderer.h"

// Register plugins
START_REGISTERING
	REGISTER_RENDERING_PLUGIN_AS(QuadRenderer,"quads","Irrlicht")
	//REGISTER_RENDERING_PLUGIN_AS(LineRenderer,"lines","Irrlicht")
	REGISTER_RENDERING_PLUGIN_AS(PointRenderer,"points","Irrlicht")
	REGISTER_RESOURCE(SPEIrrlichtRenderersRes)
END_REGISTERING

// Export plugins
EXPORT_PLUGINS
A little hint would be fine. I there some load function that needs to be added? I would really love to use the system (and create another IrrEdit plugin using it), but I need a starting point.

Anyways, the editor is really cool
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
TheMrCerebro
Competition winner
Posts: 80
Joined: Tue Jun 29, 2010 10:06 pm
Location: Valencia, Spain

Post by TheMrCerebro »

An editor... If alone, the particles system is powerful, with an editor and not tell you. :D
Good job!
Follow me on twitter: @themrcerebro
Darktib
Posts: 167
Joined: Sun Mar 23, 2008 8:25 pm
Location: France

Post by Darktib »

Thank you!

@brainsaw: Examples are in the folder 'effects', there are a fire effect (the one from the SPARK demos) and an effect playing with interpolators.
The 'main.cpp' is in the 'plugin sdk', it's not for an effect but for a plugin, in order to extend the editor.

To load effect files (*.spes), first you need a xml parser (the editor uses TinyXml). Node are stored by types (zone, modifier, etc...) and by plugins.
Each plugin handle a SPARK module. To see loaded plugins, you can look at the log file or in the menu Plugins -> View plugins
For example, the plugin handling sphere zones is "SPEZones.dll/sphere".
You can safely ignore the 'lock' attribute, it will only be used by the editor. References are here to allow the editor to be extendible, I don't think you really need it. After that, you have properties.

In the future I plan to add a extensible binary scene loader for SPARK - maybe next year, I am very busy with my courses ^^
Brainsaw
Posts: 1183
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post by Brainsaw »

Oh ... I see ... you've been talking about the particle demos, I've been talking about a demo program. Is there some sort of loader (there obviously is one, because the editor can load the files ;) ), and is it realeased somewhere?
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
Darktib
Posts: 167
Joined: Sun Mar 23, 2008 8:25 pm
Location: France

Post by Darktib »

Oops^^

So, your question is "How the editor can parse XML ?" or "How the editor loads xml files ?" ?

For the first question, the answer is TinyXML.
For the second question, when the editor loads an xml file, it does almost not involve SPARK code: the editor is built on a database containing all elements you created (SPARK modules, textures, 3D objects - note that 3D object managing is not implemented yet). Here is a light and old sheme of the architecture of the editor:
Image

Well, I'm not sure I have entirely understood you question :oops: ...
Brainsaw
Posts: 1183
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post by Brainsaw »

I think this comes closer. Are you planning to release a loading function to load and display the particle system created with the editor. I was thinking about something like

Code: Select all

System *mySystem=System::loadParticleSystemFromFile("myFileCreatedWithTheEditor");
This would be fine. It wouldn't be necessary to care about the internals, just use what was created with the editor.
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
Darktib
Posts: 167
Joined: Sun Mar 23, 2008 8:25 pm
Location: France

Post by Darktib »

Yes, it is planned. And maybe it will be included in SPARK.
kvakvs
Posts: 30
Joined: Wed Oct 14, 2009 1:50 am
Location: Sweden
Contact:

Post by kvakvs »

Brainsaw wrote:I think this comes closer. Are you planning to release a loading function to load and display the particle system created with the editor. I was thinking about something like

Code: Select all

System *mySystem=System::loadParticleSystemFromFile("myFileCreatedWithTheEditor");
This would be fine. It wouldn't be necessary to care about the internals, just use what was created with the editor.
For loading library, you can use my editor instead, and there is C++ particle loader included. There's already one game released using it, so with some dedication you are able to create production quality particle effects too.

Read and download here
http://spark.forum0.net/evolution-en-f1 ... ct-t54.htm

Also Darktib promised to support my XML format in his editor, so all your work will be possible to transfer to Darktib's editor, when its ready.
Brainsaw
Posts: 1183
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post by Brainsaw »

That's nice ... I'm currently downloading the package, but the internet connection seems *very* slow today :(
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
Abraxas)
Posts: 227
Joined: Sun Oct 18, 2009 7:24 am

Post by Abraxas) »

To the spark developers:

I'm not an expert programmer when it comes to linking and things outside plain code. I'm trying to build a solution with spark but I always come up with "unresolved externals".

What I did was copy pasted the first irrlicht tutorial, pasted in the irrlicht stuff and SPARK + SPARK_IRR .lib and .dlls.

Code: Select all

// external libs
#include "include\include\irrlicht.h"

// SPARK lib
#include "include\SPK.h"
#include "include\SPK_IRR.h"

#pragma comment(lib, "Irrlicht.lib") 
#pragma comment(lib, "Spark.lib") 
#pragma comment(lib, "Spark_IRR.lib") 


I still get:
1>F:\Programs\Test\Debug\Irr Spark Test.exe : fatal error LNK1120: 16 unresolved externals

What else do I need to do to make this compile? Thanks!
Juff
Posts: 18
Joined: Fri Oct 30, 2009 7:53 pm

Post by Juff »

Hi, I guess you forgot to link a lib.
What are the 16 unresolved symbols that follow this line ?
Abraxas)
Posts: 227
Joined: Sun Oct 18, 2009 7:24 am

Post by Abraxas) »

1>LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>Spark.lib(SPK_All.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_ostream<char,struct std::char_traits<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const&)" (__imp_??$?6DU?$char_traits@D@std@@V?$allocator@D@1@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z)
1>Spark.lib(SPK_All.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) bool __cdecl std::operator<<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_??$?MDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@0@Z)
1>Spark.lib(SPK_All.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: int __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::sputn(char const *,int)" (__imp_?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPBDH@Z)
1>Spark.lib(SPK_All.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Lock(void)" (__imp_?_Lock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ)
1>Spark.lib(SPK_All.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Unlock(void)" (__imp_?_Unlock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ)
1>Spark.lib(SPK_All.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) protected: char const * __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::_Myptr(void)const " (__imp_?_Myptr@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IBEPBDXZ)
1>Spark.lib(SPK_All.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: int __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::compare(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)const " (__imp_?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEHABV12@@Z)
1>Spark.lib(SPK_All.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: unsigned int __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::length(void)const " (__imp_?length@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ)
1>Spark.lib(SPK_All.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: char const * __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::c_str(void)const " (__imp_?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ)
1>Spark.lib(SPK_All.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::~basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(void)" (__imp_??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ)
1>Spark.lib(SPK_All.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z)
1>Spark.lib(SPK_All.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(char const *)" (__imp_??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z)
1>Spark.lib(SPK_All.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(void)" (__imp_??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ)
1>Spark.lib(SPK_All.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: int __thiscall std::ios_base::width(int)" (__imp_?width@ios_base@std@@QAEHH@Z)
1>Spark.lib(SPK_All.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: int __thiscall std::ios_base::width(void)const " (__imp_?width@ios_base@std@@QBEHXZ)
1>MSVCRTD.lib(crtexew.obj) : error LNK2001: unresolved external symbol _WinMain@16
1>F:\Programs\Test\Debug\Irr Spark Test.exe : fatal error LNK1120: 16 unresolved externals
kidhr
Posts: 9
Joined: Fri Oct 01, 2010 5:04 pm

Post by kidhr »

Hi :wink:

I had the same errors recently when i've tried to compile irrlicht samples projects with spark dynamic libraries. (SPARK_project_1_05_04)
(I use msvc 2005 and 2010 express for my tests)

First, try to compile with static libraries.
Perhaps you will have errors on unresolved randomseed and useVBO functions
In this case recompile SPARK_project_1_05_04 projects to get new libs "spark.lib and spark_irr.lib"
(debug will be spark_debug.lib and spark_irr_debug.lib)

Compile your project (or Spark Irrlicht samples) with the new libs, It should be good.
(you don't need to use new dlls)

I hope this will help
RdR
Competition winner
Posts: 273
Joined: Tue Mar 29, 2011 2:58 pm
Contact:

Re: SPARK open-source advanced particle engine

Post by RdR »

I checked out the latest version of SPARK2 (revision: 346) and I tried to compile the Irrlicht demo (SPKTestIrrlicht.cpp)

But then I got the following errors:

Code: Select all

/usr/local/lib/libSPARK_IRR.a(SPK_IRR_QuadRenderer.cpp.o): In function `SPK::IRR::IRRQuadRenderer::IRRQuadRenderer(irr::IrrlichtDevice*, float, float)':
SPK_IRR_QuadRenderer.cpp:(.text+0x3d): undefined reference to `SPK::QuadRenderBehavior::QuadRenderBehavior(float, float)'
SPK_IRR_QuadRenderer.cpp:(.text+0x4d): undefined reference to `SPK::Oriented3DRenderBehavior::Oriented3DRenderBehavior()'
/usr/local/lib/libSPARK_IRR.a(SPK_IRR_QuadRenderer.cpp.o): In function `SPK::IRR::IRRQuadRenderer::IRRQuadRenderer(irr::IrrlichtDevice*, float, float)':
SPK_IRR_QuadRenderer.cpp:(.text+0xfb): undefined reference to `SPK::QuadRenderBehavior::QuadRenderBehavior(float, float)'
SPK_IRR_QuadRenderer.cpp:(.text+0x10b): undefined reference to `SPK::Oriented3DRenderBehavior::Oriented3DRenderBehavior()'
 
Post Reply