Page 6 of 7

Posted: Thu Aug 26, 2010 12:51 pm
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.

Posted: Thu Aug 26, 2010 6:42 pm
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

Posted: Thu Aug 26, 2010 10:29 pm
by TheMrCerebro
An editor... If alone, the particles system is powerful, with an editor and not tell you. :D
Good job!

Posted: Fri Aug 27, 2010 12:08 pm
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 ^^

Posted: Fri Aug 27, 2010 7:11 pm
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?

Posted: Sat Aug 28, 2010 3:45 pm
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: ...

Posted: Sun Aug 29, 2010 8:05 am
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.

Posted: Sun Aug 29, 2010 9:58 am
by Darktib
Yes, it is planned. And maybe it will be included in SPARK.

Posted: Sun Aug 29, 2010 10:33 am
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.

Posted: Sun Aug 29, 2010 5:33 pm
by Brainsaw
That's nice ... I'm currently downloading the package, but the internet connection seems *very* slow today :(

Posted: Thu Oct 21, 2010 12:53 am
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!

Posted: Thu Oct 21, 2010 3:17 pm
by Juff
Hi, I guess you forgot to link a lib.
What are the 16 unresolved symbols that follow this line ?

Posted: Thu Oct 21, 2010 5:45 pm
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

Posted: Thu Oct 21, 2010 9:48 pm
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

Re: SPARK open-source advanced particle engine

Posted: Sun Mar 25, 2012 7:39 pm
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()'