Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / SPARK 3D Particle engine wrapper for DBpro

Author
Message
Hotline
15
Years of Service
User Offline
Joined: 22nd Aug 2008
Location:
Posted: 1st Jun 2011 17:02 Edited at: 21st Nov 2011 03:56
Version 1.2 Released



The new version is available in the Program Announcements board
CLICK HERE TO GET THE LATEST VERSION OF THE WRAPPER


Thanks

The Slayer
Forum Vice President
14
Years of Service
User Offline
Joined: 9th Nov 2009
Playing: (Hide and) Seek and Destroy on my guitar!
Posted: 1st Jun 2011 17:35
Wow! Nice, Hotline! Really nice! If this plugin can do what it says, then this will be a great addon!
How about the speed it runs in DBPro?
When do you think this plugin will be ready for use?
I really like the sound of those features!

Keep it up!

Cheers

SLAYER RULES! YEAH, MAN!!
Hotline
15
Years of Service
User Offline
Joined: 22nd Aug 2008
Location:
Posted: 1st Jun 2011 17:50
Hi ! The first release will be ready in few days maybe a week ( without some help files... ) And about the speed : it is way way faster than the DBPro's built in particle commands (uses DX9 point sprites or quads not object/limb structure) but i can't do a proper test as i have pretty old pc...
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 1st Jun 2011 18:41
That smoke trail behind the rocket is something I tried for weeks with the DarkPhysics particle system, and never could get it to work reliably. At certain camera angles the trail would either disappear or not even show up at all.

Very nice work!! Can't wait to try it out.

=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 1st Jun 2011 19:48
Yeah, looks awesome Will be watching this with interest.

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 1st Jun 2011 19:51
Fantastic. I want it already!

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 1st Jun 2011 20:53
I'm definitely interested. I've been thinking about making an effect system (plugin) but one that could work more generally with a time line and frames, and not bound to particles. However, as I'm seeing this wonderful stuff, I think I'm going to postpone the idea and see what this SPARK can do first.

I'll be checking this.
Sven

thenerd
15
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 2nd Jun 2011 02:34
I'm going to be following this... looks like a great plugin. Can't wait for the release.

SH4773R
14
Years of Service
User Offline
Joined: 18th Jan 2010
Location: AMERICA!!!
Posted: 2nd Jun 2011 03:40 Edited at: 2nd Jun 2011 03:55
This looks great, I think when it comes out ill implement it into my engine

Hotline
15
Years of Service
User Offline
Joined: 22nd Aug 2008
Location:
Posted: 10th Jun 2011 22:56
The 1.0 is released ! You can find the download link and the info in my first post ! Thanks

Have fun with it !!!
tschwarz
19
Years of Service
User Offline
Joined: 13th Feb 2005
Location: 127.0.0.1
Posted: 11th Jun 2011 04:48 Edited at: 11th Jun 2011 04:49
Downloaded and Donated. Glad you finished the wrapper. So far, looks great and demos run great. Please add more to it when you have time. I hoped you would finish it the first time a saw this post. Thank you,

regards

Shall we play a game?” - Joshua
Hotline
15
Years of Service
User Offline
Joined: 22nd Aug 2008
Location:
Posted: 11th Jun 2011 17:50
Thank you very very much tschwarz !
Mudbud Productions
12
Years of Service
User Offline
Joined: 1st May 2011
Location: Cloud 9
Posted: 11th Jun 2011 21:45
well once I learn this maybe I can make a help guide... This is really cool, love the demo too.

Silence is golden but duck tape is silver - Anonymous
revenant chaos
Valued Member
17
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Robbinsdale, MN
Posted: 12th Jun 2011 09:39
Hi Hotline,
This is awesome, great work! Is there a way to "Mask" the particles to render to particular cameras?
miso
13
Years of Service
User Offline
Joined: 16th Jun 2010
Location: Budapest, Hungary, 127.0.0.1
Posted: 12th Jun 2011 15:20
Thank you Dookie.

No place like 127.0.0.1 .
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 13th Jun 2011 11:21
Great news I'll download it and try it ASAP... I'll donate too as soon as I have tried it out

Duke E
15
Years of Service
User Offline
Joined: 10th Mar 2009
Location:
Posted: 13th Jun 2011 12:05
Looks very nice indeed.

I tried to use "Set Display Mode Width,Height,Depth,Sync" so I could compare the CPU utilization (all demos run un-synced). It seems to reset the system though, maybe need to reinitialize it or something after changing the screen?

Regards
Hotline
15
Years of Service
User Offline
Joined: 22nd Aug 2008
Location:
Posted: 13th Jun 2011 15:23 Edited at: 13th Jun 2011 15:49
revenant chaos : Thanks ! Well currently systems are rendered to cam 0 , but i will add a SP SET SYSTEM CAMERA command to next release.
miso : Thanks
baxslash : Much appreciated ! Thank you
Duke E : Yes you right ! But this happens to me all the time ! When i change window mode to fullscreen or fullscreen to window the variables,arrays,models are deleted.Did someone else noticed this issue with DBPro? Anyway i will try to find the solution for that.
Try setting the display mode in the editor's properties window.That will work!

Ok the next release will be ready in 1-2 weeks.Thanks for everyone ! And started a WYSIWYG editor project for Spark
Hotline
15
Years of Service
User Offline
Joined: 22nd Aug 2008
Location:
Posted: 13th Jun 2011 15:32 Edited at: 13th Jun 2011 15:52
There's a very annoying display bug in DBPro ! Just tested it !

a code




you will get a "Image does not exist at line..." error.

same with objects




Even with objects created in DBPro :

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 13th Jun 2011 15:51
This is not a DBP bug, it's well known and documented here on the forums. The problem is that when you switch modes any pre-loaded media is removed. I believe it's a direct X issue and normal behaviour.

Most games that use this mode (in any language) either allow the game to crash or re-load the media when they change the display mode.

The most common thing to do is decide what display mode to use before you load any media. Simple.

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 13th Jun 2011 15:54
Quote: "Duke E : Yes you right ! But this happens to me all the time ! When i change window mode to fullscreen or fullscreen to window the variables,arrays,models are deleted.Did someone else noticed this issue with DBPro? Anyway i will try to find the solution for that."


Most plugins include some sort of reset command to allow the user to reinitialize the plugin after the display mode has been changed.

Also, is the graph demo supposed to do something?

Nice plugin!
Sven B

Hotline
15
Years of Service
User Offline
Joined: 22nd Aug 2008
Location:
Posted: 13th Jun 2011 16:23 Edited at: 13th Jun 2011 21:07
Yes the graph demo should demonstrate the graph interpolator , and it works for me.You can move with the arrowkeys and rotate the cam with mouse.Whats exacly the problem with it? (screenshot attached)

EDIT:
The 04_GraphDemo is compiled with wrong texture path
Just change



to :

Attachments

Login to view attachments
Hotline
15
Years of Service
User Offline
Joined: 22nd Aug 2008
Location:
Posted: 13th Jun 2011 16:40
Ok i fixed the display mode switching bug .It will be added in the next release.You should set the display mode in the editor's properties till then.
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 13th Jun 2011 21:34
Quote: "EDIT:
The 04_GraphDemo is compiled with wrong texture path
Just change "


Ah yes thanks. I only ran the compiled versions included with the plugin (I didn't try to compile the DBA file so I didn't notice). Thanks.

This plugin really looks promising!

Cheers!
Sven B

Gencheff
13
Years of Service
User Offline
Joined: 12th Jun 2010
Location: UK by way of USSR
Posted: 15th Jun 2011 21:53
Hey there fella.Excellent plugin and demos as well.

I've donated a fiver to help you with your developments(not really,was just in a good mood).

Samotnijat vylk nasred gorata.
-3D,2D Artist,Animator,Web developer and Programmer.
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 16th Jun 2011 19:43
It's looking pretty good. I tried to play around with it for a bit, but unfortunately the help files aren't really completed so I got a bit demotivated. I also checked out the example program, which seemed to contain enough information to replicate the demo, but wasn't enough for me to get a good grip on the plugin.

There seem to be a lot of key commands available that have not been added to the help files (zone commands, the renderer stuff, the last parameter of sp create emitter, etc.) so I'm gonna wait for the next update ^^.

Cheers!
Sven B

Hotline
15
Years of Service
User Offline
Joined: 22nd Aug 2008
Location:
Posted: 2nd Jul 2011 10:54
New version available !! (see the first post)
NOTE : to get new commands highlighted in the editor :
1 Delete the old spk_keywords.ini
2 start DBPro editor , then close it.
3 copy the new spk_keywords.ini
miso
13
Years of Service
User Offline
Joined: 16th Jun 2010
Location: Budapest, Hungary, 127.0.0.1
Posted: 2nd Jul 2011 11:16
Great, I will test tonight. Keep up the good work.

No place like 127.0.0.1 .
thenerd
15
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 2nd Jul 2011 16:09
This is great.

I have a request for the zones. Could there be a new type of zone, called an Object zone, that would produce particles within the bounds of a certain object. That way, you could produce more complicated zone shapes easily just by using vertex data to create an object with the shape you wanted for the zone.

Indicium
15
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 2nd Jul 2011 16:42
This looks absolutely amazing, if I ever use it in a project I'll be sure to donate to you.

Hotline
15
Years of Service
User Offline
Joined: 22nd Aug 2008
Location:
Posted: 2nd Jul 2011 22:19 Edited at: 4th Jul 2011 12:19
Quote: "This is great.

I have a request for the zones. Could there be a new type of zone, called an Object zone, that would produce particles within the bounds of a certain object. That way, you could produce more complicated zone shapes easily just by using vertex data to create an object with the shape you wanted for the zone."


Well it wouldn't be easy but it's not impossible ! The easiest way is adding a triangle zone (3 vectors for vertices and 1 for the normal) then build a "triangle tree" based on a DBPro object.But this kind of a zone requires very complex calculations in both emitter definition and collision detection so it may dramatically slow down your app... but i'll see what i can do.

NOTE: The 1.1 version of the wrapper was uploaded with wrong dll ! (sorry about that).The only difference is the SP SYSTEM EXISTS command (not working properly in the currently uploaded version! otherwise it's OK !) I will upload the new one tomorrow because i'm in a hurry...

EDIT: I have uploaded the new 1.1b version.All SPARK users should update to this version,(which is available in my first post as an attachment)
The Slayer
Forum Vice President
14
Years of Service
User Offline
Joined: 9th Nov 2009
Playing: (Hide and) Seek and Destroy on my guitar!
Posted: 4th Jul 2011 17:47
Very nice plugin, Hotline! I love it! I played around with the firecamp demo and made it to adjust the colours of the flames and smoke. Pretty sweet.
Also, the feature to save and load systems is great! This allows the reusability of created systems.
Ow, and great job getting the commands to show in the help files.

Great job, Hotline!

DevilLiger
20
Years of Service
User Offline
Joined: 21st Nov 2003
Location: Fresno,CA,USA
Posted: 6th Jul 2011 00:55
cool plugin.

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 7th Jul 2011 18:23 Edited at: 7th Jul 2011 19:09
Very impressive demos. I'll be looking at this very closely. Thanks.

Edit

This looks very professional - and the code does "exactly what it says on the tin". For example I took the statement in the "05_FireDemo.dbpro" demo about saving and loading a fire system literally and produced the attached demo (just put it in your ".../Projects/SPARK_Demos" folder).

The Help files were clear and accurate and the demo worked first time.

Thank you.

Attachments

Login to view attachments
Hotline
15
Years of Service
User Offline
Joined: 22nd Aug 2008
Location:
Posted: 8th Jul 2011 00:00
Thank You very very much Green Gandalf ! But the coolest thing is that you don't need to load the particle textures with LOAD IMAGE ! The plugin does this for you automatically ! Texture names and paths are automatically saved in the file (so you can delete line 23 and 24 in your code) ! sp load system filename$ , proto , textureIndexStart , where the textureIndexStart parameter is the DBPro image index start where the textures (used by spark) will be loaded. The loading routine starts counting from textureIndexStart till he finds a free image index then loads it.
There's also a command associated with the sp load command :
The SP GET LAST ERROR() which returns the error/warning code (defined in spark.dba) of the last error/warning occured during the loading procedure !
Cheers
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 8th Jul 2011 01:27
Yes, I wondered whether I needed to load those. It wasn't clear. It also wasn't clear whether I could find out the image ids if I did it your way so I guessed I could load them anyway. It worked so I didn't investigate further. Even so the code is very clean and works well.

Thanks for clarifying that.

Sounds like your error handling works well too.
Travis Gatlin
14
Years of Service
User Offline
Joined: 14th May 2009
Location: Oxford, Alabama
Posted: 8th Jul 2011 20:21
I hope this plugin works on my computer! Cause for the game i'm making now, i'll really need it, and plugins are infamous for not running on my computer!

Your signature has been erased by a mod please reduce it to no larger that 600 x 120.
Hayer
18
Years of Service
User Offline
Joined: 4th Nov 2005
Location: Norway
Posted: 10th Jul 2011 00:24 Edited at: 10th Jul 2011 00:33
Hm-m.. Tried to get it working - had little success with the first example.

Trying to reproduce the example 6 I got this error



Just crashes at start up.


Edit:

Removing this


seems to 'fix' it..


Edit again:

'sp scale system expolsionPrototype, 200' also cause crash at start up. Tried to scale both the prototype system and the copied one.

Keep it simple.
Questions? Mail me
Hotline
15
Years of Service
User Offline
Joined: 22nd Aug 2008
Location:
Posted: 10th Jul 2011 12:07 Edited at: 10th Jul 2011 12:09
Hi ! The first thing : You shall never scale a system that is a copy of a prototype and has some shared elements (renderers like in the explosion demo) in this case you can scale only the prototype.

Theoretically if you chage the



to :



It should work but its not recommended.The scale command only adapts the size of your particle prototype to your scene (e.g : biger/smaller game levels / models).(i working on a new scale system that will work on shared elements too but i need to modify the whole SPARK engine for this... so it's not easy )

The socond thing :
Spark commands returning pointers to systems , renderers , etc . Working with pointers is a bit tricky.They are very easy to use but they can become very dangerous in no time (accessing wrong/invalid memory address will cause a crash in 100% !)

Regarding to your example : Make sure your "explosionProtype" variable points to a valid system created by SPARK .



Make sure all other elemets , such as zones , interpolators , etc are all pointing to a valid SPARK element.

3rd thing :
Make sure the spark.dba file is included into your project.

Regards !
(PS : if you still have problems don't hesiatate to post here.)
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 10th Jul 2011 17:06 Edited at: 10th Jul 2011 17:11
This looks interesting. One of the reasons I purchased DB Pro on first release was the particle support. It turned out to be useless though I certainly like the video at the top of the page, and the way the different colours flicker in and out on the fire example, very nice looking.

http://s6.bitefight.org/c.php?uid=103081
Hayer
18
Years of Service
User Offline
Joined: 4th Nov 2005
Location: Norway
Posted: 10th Jul 2011 17:56 Edited at: 10th Jul 2011 17:59
Well, now I've included the spark.dba and tried this just to be sure its not a null pointer or whatever it will be if I pass null from DBPro to a DLL..



Gives the same crash..

Edit:
Here is the whole 'create system'-snippet


Here is how I display it


If I don't scale it & remove the smoke it works.. but then it's to small..

Keep it simple.
Questions? Mail me
Hotline
15
Years of Service
User Offline
Joined: 22nd Aug 2008
Location:
Posted: 10th Jul 2011 22:20 Edited at: 10th Jul 2011 22:56
Thanks for your reply i will look at the code as soon as possible ! The major problem is that the SPARK wrapper's structure is very complicated at the first look , and if you want to use it you definitely must know what are you doing ! to get around this problem i've started writing an editor which will be 100% compatible with dbpro and will have the following features :

-WYSIWYG interface
-win32 gui with drag&drop and copy/paste support.
-save and load projects
-export particles and load back in dbpro with SP LOAD SYSTEM command
-load .x and .dbo levels , place systems (torches , sparks , rain , etc) and save all particle systems as one scene file , then load it back into your game with only one single command : SP LOAD SCENE , so henceforth you don't need to write a single line of code in dbpro.

Also the next version of the plugin will have some new commands which will simplify the plugin a littlebit.: SP SET NAME SystemID , name$ and SP DELETE BY NAME name$

example :



EDIT:
Are you sure that SP SCALE SYSTEM causes the crash ? i tested the scale in 06_explosionDemo and worked perfectly.Can you post the whole code ?

EDIT2:

I think i found the problem.In your previous post ("removing this" code snipet) something is missing.you set the smokeRenderer to shared... but you didn't created the smokeRenderer.So the "smokeRenderer" points to an invalid memory address.

your code :



corrected code :

miso
13
Years of Service
User Offline
Joined: 16th Jun 2010
Location: Budapest, Hungary, 127.0.0.1
Posted: 10th Jul 2011 23:39
So SP LOADSYSTEM loads all the images, using dpro image ids. That can mess my whole resource handle system. (Also in some cases it may duplicate images.) Is there any way to load them without the images, and setup the needed images inside the dpbro code?

Or at least, get back the all the ids that has been reserved after a load?

No place like 127.0.0.1 .
chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 11th Jul 2011 00:22
awesome !! good job...I like it

Cheers.

I'm not a grumpy grandpa
Hayer
18
Years of Service
User Offline
Joined: 4th Nov 2005
Location: Norway
Posted: 12th Jul 2011 03:13
Make it ASAP! I wantz & needz it! D:

Pleeeeeeease

Keep it simple.
Questions? Mail me
Wilf
Valued Member
17
Years of Service
User Offline
Joined: 1st Jun 2006
Location: Gone to Unity.
Posted: 21st Jul 2011 22:52
Any news?
Symon
20
Years of Service
User Offline
Joined: 29th Aug 2003
Location:
Posted: 26th Aug 2011 23:21
hi,im asking lots today, Ive got a hold of this hoping to make detection zones.
How would i go about Checking? a sphere zone that moves(attached to DB object) position that x,y,z into other emitter/zones/group/systems and get the emitter id to trigger something e.g gravity. Thanks for any help.
Hotline
15
Years of Service
User Offline
Joined: 22nd Aug 2008
Location:
Posted: 28th Aug 2011 05:23 Edited at: 28th Aug 2011 05:28
Hi i'm affraid thats not possible with SparkWrapper (currently!) as the Spark's collision detection is not included in my wrapper.The collision detection is very rough at the moment and needs lot of improvements.
1 .the box zone's collision detection not working properly
2 .There's no mesh/object zone (under development)

It's recommended to use some external collision detection library (Sparky's collision , Newton , PhysX , etc) for this.
You can get the id's of each spark object (zones , emitters , modifiers) with :


and perform the actions manually (trigers coded in dbpro)

And currently there are no commands for activate/inactivate zones/emitters/renderers , but i will add it to the next release.

If the Developers of SPARK will finish the collision detection library , i will immediatelly update my wrapper , and upload (hopefully) the final version of the wrapper (including missing commands, help files and collision detection)

Regards.


EDIT : And i will add a command for attaching Zones to dbpro objects (collision detection for moving objects)

SparkWrapper An advanced 3d particle system for DBPro
http://forum.thegamecreators.com/?m=forum_view&t=185523&b=1
Symon
20
Years of Service
User Offline
Joined: 29th Aug 2003
Location:
Posted: 28th Aug 2011 17:24
Hi, thanks you for the hint of .dll After reading this I managed to find (matrixutil 21 zone) which i'd already installed which has simple zone detections.

Matrix1Utils plugins collection
http://forum.thegamecreators.com/?m=forum_view&t=85209&b=18
DevilLiger
20
Years of Service
User Offline
Joined: 21st Nov 2003
Location: Fresno,CA,USA
Posted: 1st Sep 2011 02:55
wow just finally saw the video and i think it looks great.

Login to post a reply

Server time is: 2024-03-29 14:15:17
Your offset time is: 2024-03-29 14:15:17