A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 26

Thread: sparking some interest

  1. #1
    Senior Member ozmic66's Avatar
    Join Date
    Oct 2005
    Posts
    472

    sparking some interest

    I'm sure most of you out there are firmiliar with the verlet integration...

    The great thing about this method is that it's relatively stable and fast (which fits well with flash's speed limitations)

    i don't know how many people still care too much about what's happened with verlet since it kind of seems like an old fad now

    I myself am still trying to develop my physics skills, and my verlet engine

    so what i ask is that if anyone reading this post knows of any cool verlet examples out there (or if you've made one) then post them here for all to see

    there are many nice ones out there and what is a better way to see them all than having all you flash/physics lovers out there posting them here?

    flash, java, c, basic, anything you want that has verlet in it is fair game
    so, please, post anything cool you find!

  2. #2
    Senior Member ozmic66's Avatar
    Join Date
    Oct 2005
    Posts
    472

    first one

    i'll be the first to post

    this is one prime example of what can come out when combining flash and verlet

    Flash Dynamics Engine (flade)

  3. #3
    Junior Member
    Join Date
    Dec 2005
    Posts
    22
    Metanet's N was based on verlet physics from Jakobsen's paper. Also, it was made in flash and is a very addictive game

  4. #4
    Iron Chef In-Training OpethRockr55's Avatar
    Join Date
    Sep 2005
    Location
    Kitchen Stadium
    Posts
    313
    Well... While not groundbreaking, it is Verlet none the less. My good 'ol ragdoll, which is in the process of obtaining some angle constraints.

    Press S to ragdoll.
    Attached Files Attached Files
    Last edited by OpethRockr55; 01-03-2006 at 07:29 PM.

  5. #5
    Senior Member ozmic66's Avatar
    Join Date
    Oct 2005
    Posts
    472

    nice tutorials

    Some really nice collision detection/reaction/vectors tutorials by Tonypa
    link

  6. #6
    supervillain gerbick's Avatar
    Join Date
    Jul 2000
    Location
    undecided.
    Posts
    18,986
    Quote Originally Posted by ozmic66
    i'll be the first to post

    this is one prime example of what can come out when combining flash and verlet

    Flash Dynamics Engine (flade)
    dude, that's quite cool.

    [ Hello ] | [ gerbick ] | [ Ω ]

  7. #7
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    Thanks, ozmic66
    I dont have anything so advanced so far as verlet integration, but I have thought about it a little and might try to make something. Its not really that complicated once you understand the basic idea.

  8. #8
    Senior Member ozmic66's Avatar
    Join Date
    Oct 2005
    Posts
    472

    something i made

    this is a little example i made not too long ago with my unfinished physics engine...

    i posted this link on this forum before, but here it is..

    link
    came from this thread

    control: random sized circle
    shift: lines
    alt: boxes

    this thing is not at all optimized for efficiency so it might not run too fast on older machines

  9. #9
    Junior Member
    Join Date
    Dec 2005
    Posts
    22
    That is really nice ozmic66! I noticed the boxes dont collide with other boxes or lines, but as you say, its unfinished. It's looking really good though. Are you planning on making a game from it, or just different physics demos?

  10. #10
    Senior Member ozmic66's Avatar
    Join Date
    Oct 2005
    Posts
    472
    Yea... i'm working on that line-line collision algo. ...looking into seperating-axis (pretty nice technique)

    I started this engine because i wanted to make a flash game with physics, and i really had no good ideas for games, so i thought 'hey, why not make a physics engine and let other people make cool games with it?'
    so to answer your question ne0, the demos are only for now, until the engine is finished and we'll hopefully start seeing some games

    the only major problem i have now is overcoming flash's speed limitations:
    it is optimized for vector drawing, but not for calculations which is all that matters here

    i suppose moving it to as3 would be best as it is (as i've seen somewhere on these forums) supposed to be 10x faster

  11. #11
    Junior Member
    Join Date
    Dec 2005
    Posts
    22
    Wow, if as3 really is that fast, we could start seeing some amazing games in the near future.

  12. #12
    Senior Member ozmic66's Avatar
    Join Date
    Oct 2005
    Posts
    472

    Something i just made

    Hey, i've been kind of straying away from flash lately as i have discovered blitz3d (i've known about it for a while, but i wanted to see what it can do).

    here's a demo of the engine in blitz

    I wanted to move my flash engine to blitz3d and see how much faster it would be (plus i love 3d-2d games), and frankly i'm not impressed, so perhaps it's time for me to start thinking about serious optimizations for the engine and then apply them back to flash

    all i do right now is boxbound check the particles before i check their distance

    if anyone has any suggestions/ideas/anything that would help - please post

    p.s i wanna thank 'Bouncer' of the Blitz3d forums for some help with the 'rigidness' and the inspiration for this

    check out some videos of a cool game he's working on(Nano) also done with verlet integration
    Last edited by ozmic66; 01-09-2006 at 02:36 PM.

  13. #13
    Junior Member
    Join Date
    Dec 2005
    Posts
    22
    Another interesting article about time-stepping in verlet integration, which may be of interest.
    http://www.gamedev.net/reference/art...rticle2200.asp

  14. #14
    Iron Chef In-Training OpethRockr55's Avatar
    Join Date
    Sep 2005
    Location
    Kitchen Stadium
    Posts
    313
    Huh. TCV eh? Doesn't look to shabby. (Probably a lot harder to implement than it looks though)

  15. #15
    Senior Member ozmic66's Avatar
    Join Date
    Oct 2005
    Posts
    472

    I got something...

    I was thinking about the problem i was proposing before (look 2 posts down..or up) and i decided to try a grid solution, where each particle finds the boxes where its bounding box lies and tests those boxes for other particles

    here is a graph of the results of a test done with flash 8

    it looks like at very small numbers, brute force pervails, but its definately not worth it for more than 10 particles



    'regular method' is the normal O(n^2) algorithm

    so, it's looking pretty good - i'll try implementing it back into the engine and see how it goes

    if anyone has any suggestions, please post them
    also, any constraint math optimizations would be very welcome
    Last edited by ozmic66; 01-10-2006 at 01:50 PM.

  16. #16
    Iron Chef In-Training OpethRockr55's Avatar
    Join Date
    Sep 2005
    Location
    Kitchen Stadium
    Posts
    313
    Well, now that I've finally figured this out, I'm posting my 'enhanced' ragdoll with angular constraints. It's still a bit buggy, due to the unusual positioning of the limbs before ragdolling, but it works nonetheless. If you want the code, there is this thread, here ,that has a code, although I did modify it somewhat for both technicalities and performance.

    Onward to collision detection!
    Attached Files Attached Files

  17. #17
    Senior Member ozmic66's Avatar
    Join Date
    Oct 2005
    Posts
    472
    Cool demo OpethRock

    maybe to fix the jiggling, you should try recentering all the points of the constraints to the middle point they had before the solving

    (something like this:)

    Code:
    centerX = (pointA.x+pointB.x+pointC.x)/3
    centerY = (pointA.y+pointB.y+pointC.y)/3
    
    //solve angular constraint for points a,b,c// (b being the hinge...not that it matters)
    //...your code
    //--------------------------------------//
    
    newCenterX = (pointA.x+pointB.x+pointC.x)/3
    newCenterY = (pointA.y+pointB.y+pointC.y)/3
    
    xDiff = centerX-newCenterX
    yDiff = centerY-newCenterY
    
    pointA.x+=xdiff
    pointA.y+=ydiff
    
    pointB.x+=xdiff
    pointB.y+=ydiff
    
    pointC.x+=xdiff
    pointC.y+=ydiff
    this just might work (but it's not my idea.... i got it from flade (flash dynamics engine)

  18. #18
    Iron Chef In-Training OpethRockr55's Avatar
    Join Date
    Sep 2005
    Location
    Kitchen Stadium
    Posts
    313
    The sad thing is, that's already in the example and tested! lol

  19. #19
    Senior Member ozmic66's Avatar
    Join Date
    Oct 2005
    Posts
    472

    a great improvement

    remember that slow demo i uploaded a few posts ago?
    thanx to bouncer (again) i have a (very much) faster engine

    check it out

    (press 's' to switch between the old and new ways of computing collisions)

    also, this demo runs at 7 iterations per frame (as oppose to the old one's 2)

    download

    tell me what u think
    Last edited by ozmic66; 01-09-2006 at 02:35 PM.

  20. #20
    Iron Chef In-Training OpethRockr55's Avatar
    Join Date
    Sep 2005
    Location
    Kitchen Stadium
    Posts
    313
    Wow, Ozmic! That's really impressive! I filled the whole screen with every thing I could use and only got a tiny bit of lag. I've also become extremely interested as to where you're going with this engine.

    Kudos!

    Is this demo using the grid-based collision you coded?

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

HTML5 Development Center