BASIC

Author Topic: SpriteZ - 2d particle engine (Updated: June 15,2012)  (Read 18102 times)

Offline Hemlos

  • To boldy go where no pixel has gone before!
  • Global Moderator
  • Prof. Inline
  • *******
  • Posts: 1635
  • Particle Hawk
    • View Profile
An API for a 2d particle engine.

SpriteZ.gbas

Download, includes 4 working sample projects, and a help file:
Arrowmode
Zonemap
Gravity
Animated

Update:
A few options have been improved for easier to understand useage.
Also a new option is in the api: (friction)


Feel free to ask questions here.
This project is 3 years+ in the making.
This project is open sourced, and free for anyone to use and publish in thier software.

PS. The only thing i kindly ask in return is for programmers to show me what theyve done with the engine, so please, let all of us see what you published(ill buy a user copy of anything made using this engine)!!!

PPS. 3d...well, its going to take a huge effort to complete, im going to try this year.
Link to download below:

[attachment deleted by admin]
« Last Edit: 2012-Jun-15 by Hemlos »
Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)

Offline mgarnett

  • Mc. Print
  • *
  • Posts: 3
    • View Profile
Re: SpriteZ - a 2d particle system
« Reply #1 on: 2009-Sep-28 »
Hi Hemlos,

I'm a new user in these forums and I have recently been following the SpriteZ thread.  By posting this source, are you still going to continue development of the system?

I haven't used the system yet, I'm still working my way through the "built-in" features but I was eagerly anticipating the 2D and 3D versions of your library.

Cheers

Mark

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 5021
  • O Rly?
    • View Profile
Re: SpriteZ - a 2d particle system
« Reply #2 on: 2009-Sep-28 »
Nice work, Hemlos!
I <3 DGArray's :D

PC:
AMD Ryzen 7 1700 @3.9GHz, 16GB HyperX Fury 3000MHz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard

Offline codegit

  • Dr. Type
  • ****
  • Posts: 270
    • View Profile
Re: SpriteZ - a 2d particle system
« Reply #3 on: 2009-Sep-28 »
Hemlos

Thank you, if I use it in my game I will mention you. I am still prepared to pay for a commercial version as I do not think your work should go unrewarded.  :good:
------------------------------------------
1 X Acer TravelMate 4270, laptop, XP PRO
1 X Dell Studio 17 laptop, Windows 7
1 X MacBook Pro 2,2 GHz Core 2 Duo, 2 GB RAM, 160 GB HDD, 9400M
2 X iTouch
1 X HTC Desire (Android 2.1)
iPad soon to be added

Offline 9940

  • Mr. Drawsprite
  • **
  • Posts: 53
    • View Profile
Re: SpriteZ - a 2d particle system
« Reply #4 on: 2009-Sep-28 »
Thanks !
The 3d version will be open too ?

Offline Hemlos

  • To boldy go where no pixel has gone before!
  • Global Moderator
  • Prof. Inline
  • *******
  • Posts: 1635
  • Particle Hawk
    • View Profile
Re: SpriteZ - a 2d particle system
« Reply #5 on: 2009-Sep-28 »
@Schranz0r:
Thanks friend, im glad you pushed me into making this library.
Its alot more versatile than we originally discussed.

@mgarnett:
Yes, i will maintain this 2d library, as GLBasic evolves, so will this api.

@9940:
No, it wont be open source.

@all tweakers:
I know people are playing with it alot now, and many people are going to attempt "tweaking" and what-not.
I have spent alot of time merging all the physics, and some thing can be speeded up ABSOLUTELY, but it will reduce performance(if not destroy completely) and quality in other areas!
If you find things that can be improved, let me know, ill research the changes to see if it is going to be compatible with the whole library.
At the cost of performance or quality, i will not be making major changes.
If i notice things can be improved, i will update this library accordingly, as i will use this library to make software for my own purposes.
To be honest with everyone, i dont recommend tweaking this library at all, as you may induce memory leaks.
Also, making an addition or changes can have profound and undesirable affects throughout the library.
The only things that might need to be altered, are the things that may hinder platforms other than win32.

« Last Edit: 2009-Sep-29 by Hemlos »
Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)

Offline Hemlos

  • To boldy go where no pixel has gone before!
  • Global Moderator
  • Prof. Inline
  • *******
  • Posts: 1635
  • Particle Hawk
    • View Profile
Re: SpriteZ - a 2d particle system
« Reply #6 on: 2009-Sep-28 »
I added a sample to SpriteZ.rar, it demonstrates how to setup the auto-animation ability.

Note: This animation mode does one full pass through the animation, during the life of a particle.
It doesnt matter how many frames your animation has, this mode splits up the lifetime into the number of frames the animation has.
So in this sample, i used 2 seconds lifetime, and it rolls through 12 frames during this time.
As you will notice the frame size set is 32,32.
There are 12 frames in the animation image, size of the image is 128x128.
You can make the animation larger, such as, 256x256, just resize it, and copy over more frames into the empty area. As long as you leave the frame size 32x32, you wont need to change any code...only the image.
« Last Edit: 2009-Sep-28 by Hemlos »
Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)

Offline WPShadow

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1667
    • View Profile
    • http://lostrevenant.blogspot.com
Re: SpriteZ - a 2d particle system
« Reply #7 on: 2009-Sep-28 »
It's really great!!!

If 3D is in too, I'll use it for LR, if it's allowed
AMD X2 4600, 2 GB Ram, ATI X1950 XTX, XP PRO SP2: GLB Premium 10.beta_dingsi, <(´.´<) Kirby Dance (>`.`)>
http://lostrevenant.blogspot.com
alea iacta est

Offline Hemlos

  • To boldy go where no pixel has gone before!
  • Global Moderator
  • Prof. Inline
  • *******
  • Posts: 1635
  • Particle Hawk
    • View Profile
Re: SpriteZ - a 2d particle system
« Reply #8 on: 2009-Sep-28 »
@WPShadow:
You may use it in LR if you like, however, SpriteZ is only 2d atm.
Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)

Offline WPShadow

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1667
    • View Profile
    • http://lostrevenant.blogspot.com
Re: SpriteZ - a 2d particle system
« Reply #9 on: 2009-Sep-29 »
No problem, there are many parts ingame, where I can use it!!!  :good:
AMD X2 4600, 2 GB Ram, ATI X1950 XTX, XP PRO SP2: GLB Premium 10.beta_dingsi, <(´.´<) Kirby Dance (>`.`)>
http://lostrevenant.blogspot.com
alea iacta est

Offline kaotiklabs

  • Dr. Type
  • ****
  • Posts: 313
  • Spain is diferent
    • View Profile
Re: SpriteZ - a 2d particle system
« Reply #10 on: 2009-Sep-29 »
Tested on Iphone 3.1 SDK and working  :good:
Just remember to check the case sensitive paths.

Pretty good job mate!
« Last Edit: 2009-Sep-29 by kaotiklabs »
Vote Cthulhu! Because the stars are right!!!!
Ia Ia Cthulhu F' tang!

Offline Hemlos

  • To boldy go where no pixel has gone before!
  • Global Moderator
  • Prof. Inline
  • *******
  • Posts: 1635
  • Particle Hawk
    • View Profile
Re: SpriteZ - a 2d particle system
« Reply #11 on: 2009-Sep-29 »
Tested on Iphone 3.1 SDK and working  :good:
Just remember to check the case sensitive paths.

Pretty good job mate!

Thanks for the compliment :)

Amazing! I was worried it wouldnt work with the math in an iphone.
Thats really good news.

@E:
If anyone has an idea, and has a hard time producing it with SpriteZ, tell me what it is.
I can create a set for you very quickly, without the need of wasting alot of time with trial and error.
I can help you(anyone) create a set of parameters, to produce the output(design/look/functionality) you desire.
Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)

Offline Hemlos

  • To boldy go where no pixel has gone before!
  • Global Moderator
  • Prof. Inline
  • *******
  • Posts: 1635
  • Particle Hawk
    • View Profile
Re: SpriteZ - a 2d particle system
« Reply #12 on: 2009-Oct-01 »
I Updated the download.

SpriteZ(2d) Fixes made:
- screen dimensions memory, allocated internally now.
- time limits removed, redundant code
« Last Edit: 2009-Oct-01 by Hemlos »
Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)

Offline Hemlos

  • To boldy go where no pixel has gone before!
  • Global Moderator
  • Prof. Inline
  • *******
  • Posts: 1635
  • Particle Hawk
    • View Profile
Re: SpriteZ - a 2d particle system
« Reply #13 on: 2009-Oct-27 »
Tip:
Call the GLBasic MOUSE functions near the end of the main loop, after the last emitter_ call.

This will prevent any slow mouse reactions, due to SpriteZ being a high frequency routine.
Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)

spoke

  • Guest
Re: SpriteZ - a 2d particle system
« Reply #14 on: 2010-Jan-03 »
nice job Hemlos   :good: