Results 1 to 17 of 17

Thread: Jotaf - Particle Systems Help

  1. #1

    Thread Starter
    Fanatic Member Mushroom Realm's Avatar
    Join Date
    Mar 2002
    Location
    Murrieta, California
    Posts
    650

    Jotaf - Particle Systems Help

    I read ur paper on particle systems, and i downloaded all the forms, and i tried to understand as much as i could. But some of it i just cant make sense of. I was wondering how u got it to draw so fast? And i was always wondering if u could try to explain how it works a little. I wanted to make some of my own custom systems, but i just cant make sense of it.

  2. #2
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    He uses SetPixel which is pretty fast - I can get loads of effects running on a GF2mx/cel 533, which is great. But it's not the fastest way... Basically his particle systems loop through the particles, do math on them to update the position, and then draw them. They follow that loop until they "die" (different for every particle system, for example if they're offscreen), and then they're created again. It's quite simple really.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  3. #3

    Thread Starter
    Fanatic Member Mushroom Realm's Avatar
    Join Date
    Mar 2002
    Location
    Murrieta, California
    Posts
    650
    Ive been trying to understand the rain system for a game im making. But i want the rain to run in front of all the pictureboxes. If i copy and paste the code it will go behind all my pictureboxes except picfront.

  4. #4
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    That's because the picturebox itself is behind all the pictureboxes... Look up a technology called BitBlt. BitBlt all your pictureboxes to one FRONT picturebox, and then use the particles over it. In this way, you can have animated pictures, transparency (ex. a colour in the bitmap is seethrough), etc.

    It's a real evolutionary step in games development.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  5. #5

    Thread Starter
    Fanatic Member Mushroom Realm's Avatar
    Join Date
    Mar 2002
    Location
    Murrieta, California
    Posts
    650
    so should i blit the background, then the pictureboxes, and then the rain, that way it will have background in back pics in middle and rain up front? How could i blit the rain with transparency.

  6. #6
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    If you're using his code, it already does it.
    And yes, that's the order you do it in.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  7. #7
    Frenzied Member Jotaf98's Avatar
    Join Date
    Jun 2000
    Location
    I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
    Posts
    1,457
    *phew* Sorry I'm so late

    Ok, huh it's like Sas says it's really simple... I can't explain the effect better than him. You have a lot of particles, each one is a rain drop. Every frame, the code just loops trough each one of them, moves it a bit down or to the left or whatever, if it's reached the bottom of the screen it moves the rain drop back up, and then draws it to the screen.

    The main reason why it's fast is because it doesn't have to draw a lot of pixels. If you think about it, an image that is 100 pixels by 100 pixels in size has to draw 10,000 pixels. If you have a rain effect with 100 rain drops, 3 pixels each, you only draw 300 pixels!

    Anyways... I don't get it, how are your pictureboxes set up, what are you trying to do with them? Usually you only have one big picturebox where you draw everything...
    Code:
    Temp = Me.GetIQ()
    'Error 9: Overflow
    'DON'T PANIC! :eek:

    To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systems here.


    Jotaf's Theories!
    "Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."

  8. #8
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Yeah, I explained it to him, about Bitblt, I think he's all set now
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  9. #9
    Frenzied Member Jotaf98's Avatar
    Join Date
    Jun 2000
    Location
    I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
    Posts
    1,457
    Heh ok thanks Sas
    Code:
    Temp = Me.GetIQ()
    'Error 9: Overflow
    'DON'T PANIC! :eek:

    To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systems here.


    Jotaf's Theories!
    "Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."

  10. #10
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Hrm? Thanks for what?
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  11. #11
    Frenzied Member Jotaf98's Avatar
    Join Date
    Jun 2000
    Location
    I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
    Posts
    1,457
    You explained all the bitblt stuff to him, so I don't have to explain anything
    Code:
    Temp = Me.GetIQ()
    'Error 9: Overflow
    'DON'T PANIC! :eek:

    To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systems here.


    Jotaf's Theories!
    "Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."

  12. #12
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    I doubt you would've if I hadn't

    Hehe
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  13. #13
    Frenzied Member Jotaf98's Avatar
    Join Date
    Jun 2000
    Location
    I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
    Posts
    1,457
    Yeah you're right... I would probably do like most people here and give him some links
    Code:
    Temp = Me.GetIQ()
    'Error 9: Overflow
    'DON'T PANIC! :eek:

    To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systems here.


    Jotaf's Theories!
    "Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."

  14. #14
    Junior Member
    Join Date
    Aug 2002
    Location
    Phoenix
    Posts
    30

    Pssst,

    Youve got PM's jotaf.


    Btw, does any one know if theres a way to "bitBlt" from an array to an hdc? If i've got an array the size of the screen with rgb info, and rather then setpixel each onto an hdc is there a way to "bitblt" it.. ??
    I'm in college now.

  15. #15
    Frenzied Member Jotaf98's Avatar
    Join Date
    Jun 2000
    Location
    I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
    Posts
    1,457
    I know, I checked my PMs like 5 minutes ago
    Use StretchDIBits, they use it to convert from an array to a DC and from a DC to an array
    Code:
    Temp = Me.GetIQ()
    'Error 9: Overflow
    'DON'T PANIC! :eek:

    To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systems here.


    Jotaf's Theories!
    "Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."

  16. #16
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    StretchDIBits is an amazing call I suggest you learn all of its ins and outs.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  17. #17

    Thread Starter
    Fanatic Member Mushroom Realm's Avatar
    Join Date
    Mar 2002
    Location
    Murrieta, California
    Posts
    650
    Just curios is this technology really called particle systems??

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width