Jump to content


Photo

3d Particle System Dll. And It's Pretty Darn Fast!


  • Please log in to reply
125 replies to this topic

#101 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 17261 posts
  • Version:GM:Studio

Posted 20 October 2011 - 07:20 PM

Use my GMC name
  • 0

#102 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 17261 posts
  • Version:GM:Studio

Posted 14 November 2011 - 09:32 AM

Iccurd, you should add a way to give particles infinite life. This is great for drawing level geometry using the DLL.

part3d_type_life(particle,-1,-1); ?

Nevermind!

I just realized it already does this with part3d_type_life(particle,0,0);

Nice!

Any updates coming soon? I've been using this a lot lately.


Probably in GM9. I hear that version will have a proper interface to link GM features from within dlls. Now it's stuck with gm8 because gmapi has no support for gm8.1

And yes, read the comments for the functions, I added a few features here and there. I like the one you get the particle instance so you can manipulate it directly and in such you can tell the system to draw everything for you including your player, ais and 3d world...
  • 0

#103 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 17261 posts
  • Version:GM:Studio

Posted 14 November 2011 - 07:59 PM

No but part3d_particles_set_item_rotation will change it, so long as you use the method to create a particle that returns the particle instance

part3d_particles_create


There was a particle_get_previous to allow getting all the particles of a burst, but I think I removed it when I improved the system drawing speed.

[edit]
Ooops, that's not what the part3d_particles_set_item_rotation sets. so, no, unless you make your own draw script
  • 0

#104 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 17261 posts
  • Version:GM:Studio

Posted 04 January 2012 - 01:21 AM

UPDATE:
Fixed tiny offset of sprite when a particle is scaled down. Was barely noticeable unless you would be looking right on the point of creation of the particle (which I am in my newest invention). had to use add_scaling instead of the xscale, yscale parameters of draw_sprite_ex.


The result is an extra transform call for each particle, which may reduce the max count by a fraction...
  • 0

#105 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 17261 posts
  • Version:GM:Studio

Posted 06 February 2012 - 08:01 AM

This has always been fun to mess around with, but actually trying to use it fresh in a new game has been a nightmare!

I wasted a lot of time during Jam 5 trying to make this behave but no matter what it causes errors Posted Image

Simply importing the GMres file into my game (The DLL, the tank texture and the tank model included) and trying to put DemoOBJ into the room will cause it to throw errors up whereas in your demo having the DemoOBJ by itself does no such thing. What is wrong here! Posted Image


___________________________________________
ERROR in
action number 1
of Other Event: Room Start
for object DemoObj:

In script part3d_type_create:
Error in code at line 5:
   	ind = external_call(global.dll_part3d_type_create);
                              	^
at position 33: Unknown variable dll_part3d_type_create


More info: GM8 Project; Using everything included in the .GMres file.


Make a boot room, first room. Use this for the room code
GM3dPartSysINIT()
room_goto_next();
Still have the problem?

I think you simply did not put the DemoObj in the first room of your game though....

Make it persistent, and drop it in your first room... Or drop one in every room

It's a little too cody though...

Make a new controller object, persistent
drop it in your first room

game_start
GM3dPartSysINIT()
global.ps = part3d_system_create();
//opt create all your shared part types here

room_end
part3d_system_clear(global.ps);

game_end
//free all your part types here
part3d_system_destroy(global.ps);
GM3dPartSysUnload()


With the boot room method you be able to
access the particle global.ps anywhere in the subsequent rooms, including the create event and the room start events from other objects without fear the system is not initialized yet.
have proper support for room restart and game restart (remember to free your stuff in the room end event)

Safety tip, make your part types global and manage them in that controller.

[edit] actually, I designed it so it did not matter if you destroyed part types if some particles spawned from the template are still in the system. So you can encapsulate part types, emitters in the object that spawns them as long as you don't try to emit a particle of a type that has been destroyed...

an object create
type = part3d_type_create();
part3d_type_direction(type,0,0,360,0,1,1, 2, 2)
part3d_type_life(type,0,100)

em = part3d_emitter_create(global.ps);
part3d_emitter_stream(global.ps,em,type,1);
part3d_emitter_region(global.ps,em,x-30,x+30,y-30,y+30,z,z,ps_shape_rectangle,ps_distr_gaussian);

an object destroy
part3d_emitter_clear(global.ps,em);
part3d_emitter_destroy(global.ps,em);
part3d_type_destroy(type);

an object room_end
instance_destroy();
  • 0

#106 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 17261 posts
  • Version:GM:Studio

Posted 06 February 2012 - 08:37 PM

I think you forget to tell the system where the camera is

//your camera draw
d3d_set_projection_ext(x,y,z,
xto,yto,zto,
v1,v2,v3,lensAngle,aspect,near,far);

//match the coords and direction in the 3d ps dll
PartSysSetCamData(x,y,z,xto,yto,zto,90-lensAngle);


the particle system should default on sort by cam depth but if the above did not work, call this
part3d_system_draw_order(global.ps,2)
after you created the ps.


[edit]
Also, make sure you only use 1 ps in the game. 2 ps will not blend together.
  • 0

#107 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 17261 posts
  • Version:GM:Studio

Posted 07 February 2012 - 06:44 AM

Not sure why, if you have called the function in yours, it should work, I mean I dont do anything much in the camera but set variables and set the projection for the 3d view and mirror the info in the dll. Oh and calling Yourself 3d mouse script. You really think that is bloated though? It's like 3 functions ;)

I do call

d3d_start(); every draw. maybe comment it out if you are one of those who only call it when the room starts. I find it solves a lot of side issues. It may have nuked lights you may have defined.

and the depth of the camera may have some thing to do with your game, if you have lights or objects that are now set before the camera is set.

You can zip your gmk, the dlls and all your resources and send it to me. I can take a look.
  • 0

#108 RevenantGhost

RevenantGhost

    GMC Member

  • GMC Member
  • 106 posts
  • Version:GM8

Posted 10 August 2012 - 01:44 PM

Wow, i really wanted to use this dll, but there's almost no comments in the example, and lots of not needed stuff making everything so messy... :(
  • 0

#109 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 17261 posts
  • Version:GM:Studio

Posted 10 August 2012 - 08:15 PM

Wow, i really wanted to use this dll, but there's almost no comments in the example, and lots of not needed stuff making everything so messy... :(


All the comments are in the scripts. If you want to know how it works, read up on GM's particle system, it's a copy of that system aside from some minor changes for 3d support in most functions to include the z axis
  • 0

#110 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 17261 posts
  • Version:GM:Studio

Posted 01 November 2012 - 07:27 PM

It uses GMAPI... Which is not compatible. Until yoyo figures out a way to expose their functions to use in a dll the support stops at GM8.
  • 0

#111 BenSeawalker

BenSeawalker

    GMC Member

  • GMC Member
  • 15 posts
  • Version:GM8

Posted 29 November 2012 - 09:17 PM

The download's down again... "User does not have enough bandwidth for you to download this file. Perhaps you should encourage them to Upgrade their account."
  • 0

#112 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 17261 posts
  • Version:GM:Studio

Posted 30 November 2012 - 12:38 AM

The download's down again... "User does not have enough bandwidth for you to download this file. Perhaps you should encourage them to Upgrade their account."


You'll have to try Dec 1st.
  • 0

#113 GamerXP

GamerXP

    GMC Member?

  • GMC Member
  • 404 posts
  • Version:GM:Studio

Posted 23 January 2013 - 04:49 PM

It uses GMAPI... Which is not compatible. Until yoyo figures out a way to expose their functions to use in a dll the support stops at GM8.


Is GMAPI still don't have functions you need? It made some progress since then. Even GMOgre3D works with GM8.1 now
  • 0

#114 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 17261 posts
  • Version:GM:Studio

Posted 23 January 2013 - 09:33 PM


It uses GMAPI... Which is not compatible. Until yoyo figures out a way to expose their functions to use in a dll the support stops at GM8.


Is GMAPI still don't have functions you need? It made some progress since then. Even GMOgre3D works with GM8.1 now

It mostly because I don't have the time. The source is in the zip. all I need a a volunteer
  • 0

#115 qorwhddlrz

qorwhddlrz

    GMC Member

  • GMC Member
  • 16 posts
  • Version:GM8

Posted 29 August 2013 - 06:34 AM

GameMaker 8 Pro,

 

Help.... I can't draw 3d Particle....

Do not have one do I change the depth.

 

 I like the example 'DemoObj' the object 'Part_init' changing the name of the object wrote.

 

And Examples that exist in the 'Part3d', 'Part3d ~' object is

 

(Part_init == DemoObj) 

Part_init Object:

 

Create Event:

 

global.lighting = false;
global.culling = false;
GM3dPartSysINIT()

global.ps = part3d_system_create();

pct = 0;
pat = 0;
pshape[pct]=pt3d_shape_pixel;
pct+=1
pshape[pct]=pt3d_shape_disk;
pct+=1
pshape[pct]=pt3d_shape_square;
pct+=1
pshape[pct]=pt3d_shape_line;
pct+=1
pshape[pct]=pt3d_shape_circle;
pct+=1
pshape[pct]=pt3d_shape_ring;
pct+=1
pshape[pct]=pt3d_shape_star;
pct+=1
pshape[pct]=pt3d_shape_sphere;
pct+=1
pshape[pct]=pt3d_shape_flare;
pct+=1
pshape[pct]=pt3d_shape_spark;
pct+=1
pshape[pct]=pt3d_shape_explosion;
pct+=1
pshape[pct]=pt3d_shape_cloud;
pct+=1
pshape[pct]=pt3d_shape_smoke;
pct+=1
pshape[pct]=pt3d_shape_snow;
pct+=1

 

Game End Event:

 

part3d_system_destroy(global.ps);
GM3dPartSysUnload()

 

Room Start Event:

 

part3d_system_draw_order(global.ps, 2);

pd = part3d_destroyer_create(global.ps);
part3d_destroyer_region(global.ps, pd,0,room_width,0,room_height, -100,-200, ps_shape_rectangle)

 

Room End Event:

 

part3d_system_clear(global.ps);

 

Why Not Draw 3d Particles?


  • 0

#116 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 17261 posts
  • Version:GM:Studio

Posted 29 August 2013 - 10:37 AM

>>Why Not Draw 3d Particles?
You Forget the draw event code where d3d_set_projection_ext() is called with the matching camara setup for the system

if you want top down, no 3d I have a setup function or parameter in the particle system init I think
  • 0

#117 qorwhddlrz

qorwhddlrz

    GMC Member

  • GMC Member
  • 16 posts
  • Version:GM8

Posted 29 August 2013 - 11:09 AM

>>Why Not Draw 3d Particles?
You Forget the draw event code where d3d_set_projection_ext() is called with the matching camara setup for the system

if you want top down, no 3d I have a setup function or parameter in the particle system init I think

 

Am....

I don't now use the scripte 'PartSysSetCamData(~)'....


  • 0

#118 qorwhddlrz

qorwhddlrz

    GMC Member

  • GMC Member
  • 16 posts
  • Version:GM8

Posted 29 August 2013 - 12:44 PM

>>Why Not Draw 3d Particles?
You Forget the draw event code where d3d_set_projection_ext() is called with the matching camara setup for the system

if you want top down, no 3d I have a setup function or parameter in the particle system init I think

 

This Picture then

As shown in this picture.

If you see below this phenomenon appears

 

http://i.imgur.com/yYQfuVJ.png

 

Depth was the same symptoms I've changed.....


  • 0

#119 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 17261 posts
  • Version:GM:Studio

Posted 29 August 2013 - 05:33 PM

This is the ordering problem all gm games have, you have to sort your objects draw by setting the depth, depth = point_distance(x,y,camera.x,camera.y)

use d3dpartsys_set_depth to order the draw for far to near the camera as you would do for all you 3d objects

I recomend you have multiple "localised" particle systems in order to be able to sort the effects properly
  • 0

#120 qorwhddlr

qorwhddlr

    GMC Member

  • GMC Member
  • 21 posts
  • Version:GM:Studio

Posted 20 February 2014 - 08:49 AM

Can't 3d particle System dll put in GM:Studio?


Edited by qorwhddlr, 20 February 2014 - 08:51 AM.

  • 0

dc5w92.png


#121 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 17261 posts
  • Version:GM:Studio

Posted 20 February 2014 - 09:34 AM

Can't 3d particle System dll put in GM:Studio?

no
Implement one in gml and use the yyc. should be as fast as this
  • 0

#122 onlineman

onlineman

    GMC Member

  • New Member
  • 13 posts
  • Version:GM:Studio

Posted 29 June 2014 - 10:12 AM

everything is ****ing abandoned!
EVERYTHING !


  • 0

#123 chreechokash007

chreechokash007

    GMC Member

  • GMC Member
  • 210 posts
  • Version:GM:Studio

Posted 18 February 2015 - 08:01 AM

Dude is there any way to create 3d particles in Gm studio? 


  • 0

#124 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 17261 posts
  • Version:GM:Studio

Posted 18 February 2015 - 09:40 AM

Well yes, I'm working on one along with so many other things. with YYC a pure gml solution is feasible with similar performance. you can make a cheap one on your own with instances. Not overly effective but with YYC a cheap solution may do for your game


  • 0

#125 chreechokash007

chreechokash007

    GMC Member

  • GMC Member
  • 210 posts
  • Version:GM:Studio

Posted 18 February 2015 - 09:56 AM

Dude i would love to use your technique instead of creating my own. so when will you launch it?


  • 0

#126 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 17261 posts
  • Version:GM:Studio

Posted 18 February 2015 - 10:13 AM

I got a stack of things that keep pushing this down, so I don't know. a month maybe when I get passed my february blues


  • 1




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users