Jump to content


Photo

Gmode Physics V0.50b - Gm 6/7/8 Support


  • Please log in to reply
80 replies to this topic

#1 Keth

Keth

    GMC Member

  • New Member
  • 164 posts

Posted 03 September 2008 - 06:19 PM

Posted Image
GMODE is 2D physics library based on ODE (Open Dynamic Engine) physics.

Follow progress on Twitter here.

UPCOMING FEATURES IN GMODE V2.0!
Contact me (MSN/PM) if you would like to test the alpha before v2.0 gets released as beta.
  • [DONE] Whole code will be rewritten (C++ this time) and physics will be based on newest ODE svn version
  • Proper documentation of all functions
  • [DONE] Cleaner, easier to use code
  • [DONE] All ODE functions are compiled inside GMODE.dll. This means ODE.dll will no longer be used separately.
  • [DONE] All memory leaks are fixed (not a single leak of a byte with 3000 bodies and constant flow of them)
  • [DONE] Huge speed improvements (around 410% faster comparing the older version of GMODE)
  • Collision layers between bodies
  • [DONE] Realistic fluids simulation example (see videoes below for an example)
  • [DONE] Stiffness and repulsion of each particle body (with the right settings, you can re-create particle movement such as water, sand, mochi, tensile, smoke, fire, air, etc)
    Example: http://www.youtube.c...h?v=BIjSvkT8nKk
    Stress Test: http://www.youtube.c...h?v=yoV9N8Yw3pI (the performance will still keep improving)
  • [DONE] 100% Stability guaranteed as long as large forces/frictions aren't applied
  • [PROGRESS] Multi-threading is the thing I am focusing on mostly (has been over 2 weeks) and it seems to be going well (significant speed
    improvements)
  • Wiggling particles (just to add some realism - e.g. for sparks)
  • Dynamic convex/concave shapes - will be implemented in late testing
  • Blob bodies, destructible bodies and meltable bodies - those are pretty much future plans and considering the performance none of those are going to be a problem
  • Bugs? Suggestions?
  • Breakable joints?
NEW! Features v0.50b:
  • Support for Gamemaker 7 and 8 (GM6 version will no longer be updated - you can use old one though)
  • Cleaner function names (few got renamed)
  • New arguments for physx_start and physx_body_update
Features v0.30:
  • Trimesh avaible (static only)
  • New examples (motor and playground)
  • Lots of new functions (damping, max rotation, pausing physics, fixed step etc)
  • New line shape which can be used as terrain aswell
  • Minor optimizations
Features v0.26:
  • New functions
  • Up to 50% faster (only while having more than 100 bodies)
  • Joints added (fixed, hinge and slider)
Features v0.2 Beta:
  • Realistic rigid-bodies
  • Really simple to use
  • Find out exact collision points
  • Disable or enable collision between given bodies
  • and more...

Keep in mind this is just a beta. I did not focus on the features but stability and speed.
Upcoming versions will include lots of speed improvements.

Please report all the bugs and post suggestions for next release!

Screenshots:
Posted Image

Posted Image

Links:

For Gamemaker 7.0+ (GEX):
Posted Image
Link dead? http://www.mediafire.com/?immqymnz24e

For any other language e.g. C++ (DLL only):
Click here to download!

Old version of GMODE v0.30 for Gamemaker 6.0 (DLL):
Posted Image

Edited by Keth, 11 July 2010 - 03:37 PM.

  • 0

#2 posva

posva

    GMC Member

  • New Member
  • 610 posts
  • Version:GM8

Posted 03 September 2008 - 06:50 PM

if it don't work with GM 7 i can't try it :lol:
  • 0

#3 Keth

Keth

    GMC Member

  • New Member
  • 164 posts

Posted 03 September 2008 - 07:05 PM

if it don't work with GM 7 i can't try it :lol:


The EXE file attached inside the archive will work.
You just won't be able to compile gm6 file.
  • 0

#4 TheMagicNumber

TheMagicNumber

    GMC Member

  • GMC Member
  • 5247 posts
  • Version:Unknown

Posted 03 September 2008 - 08:35 PM

Wow, I've heard people say that GM can't handle 100 physical objects and maintain FPS. You had more. Great work.

I really think it can use a fix for GM7 but it's fine for me.

Edited by GMREC1111, 03 September 2008 - 08:36 PM.

  • 0

#5 Keth

Keth

    GMC Member

  • New Member
  • 164 posts

Posted 03 September 2008 - 09:27 PM

Wow, I've heard people say that GM can't handle 100 physical objects and maintain FPS. You had more. Great work.

I really think it can use a fix for GM7 but it's fine for me.


Thanks for the support!
GM7 is supported now.

Edited by Keth, 01 May 2010 - 09:43 PM.

  • 0

#6 Newly Discovered

Newly Discovered

    Harmonious Genius

  • New Member
  • 2467 posts
  • Version:GM8

Posted 03 September 2008 - 09:32 PM

neat, but you have a long way to go if you're attempting a full engine. two shapes that roll around isn't going to cut it.
good luck.
  • 0

#7 Keth

Keth

    GMC Member

  • New Member
  • 164 posts

Posted 03 September 2008 - 11:13 PM

I have tried to optimize the physics using packed data (1 call per step for all bodies) but parsing the long string containing x,y,rotation for 100 bodies is a lot slower.
The Gamemaker isn't that fast in long string handling.

I guess this is the fastest way possible to do physics in Gamemaker.
The only things left now are features I will work as soon as I will find some free time.

Edit: I managed to optimize it 50% faster in 0.26 version.
See physx_body_update script for details.

Edited by Keth, 06 September 2008 - 09:23 AM.

  • 0

#8 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Global Moderators
  • 14446 posts
  • Version:GM:Studio

Posted 03 September 2008 - 11:59 PM

I have tried to optimize the physics using packed data (1 call per step for all bodies) but parsing the long string containing x,y,rotation for 100 bodies is a lot slower.
The Gamemaker isn't that fast in long string handling.

I guess this is the fastest way possible to do physics in Gamemaker.
The only things left now are features I will work as soon as I will find some free time.



Refer to the bullet dll thread for tips on how to bypass GM's API speed issues.


I get an Unexpected Error. Under GM7 and Vista.
  • 0

#9 Keth

Keth

    GMC Member

  • New Member
  • 164 posts

Posted 04 September 2008 - 01:16 AM

I have tried to optimize the physics using packed data (1 call per step for all bodies) but parsing the long string containing x,y,rotation for 100 bodies is a lot slower.
The Gamemaker isn't that fast in long string handling.

I guess this is the fastest way possible to do physics in Gamemaker.
The only things left now are features I will work as soon as I will find some free time.



Refer to the bullet dll thread for tips on how to bypass GM's API speed issues.

Thanks about the speed issue information. I think this might be faster way.

I get an Unexpected Error. Under GM7 and Vista.

GM7 supported now.

Edited by Keth, 01 May 2010 - 09:44 PM.

  • 0

#10 TheMagicNumber

TheMagicNumber

    GMC Member

  • GMC Member
  • 5247 posts
  • Version:Unknown

Posted 04 September 2008 - 10:22 AM

I see you've come to a good start, it's nice and simple. Just needs more predefined shapes and custom defining of shapes.
  • 0

#11 OpticalLiam

OpticalLiam

    GMC Member

  • New Member
  • 782 posts

Posted 04 September 2008 - 01:45 PM

Very nice work, I managed to get around 450 circles before it started to dip below 100FPS. Now you need to add support for rigid bodies of any shape.
  • 0

#12 TheMagicNumber

TheMagicNumber

    GMC Member

  • GMC Member
  • 5247 posts
  • Version:Unknown

Posted 04 September 2008 - 07:35 PM

Can you also fix the counter, it doesn't reset. Use instance_count(object) to get it or reset each time you hit R.
  • 0

#13 fire_soul453

fire_soul453

    aarons video games

  • GMC Member
  • 542 posts

Posted 05 September 2008 - 01:59 AM

Pretty cool. Might be useful once you update it more. Keep working on it.
  • 0

#14 ShaX

ShaX

    GMC Member

  • New Member
  • 246 posts

Posted 05 September 2008 - 04:15 AM

Ah, excellent! I am a very big fan of the ODE engine and use it almost exclusively in my developments. Steffen Itterheim has ported almost the entire ODE library to Game Maker back in 2004, and that's what I've been using since, but there are many flaws and/or errors with his dll and, well, he really doesn't come around here any more. So I look forward to your implementation and will be checking up for future updates frequently. Best of luck!
  • 0

#15 Paper Carnival

Paper Carnival

    GMC Member

  • New Member
  • 12 posts

Posted 05 September 2008 - 08:59 AM

This is amazing. Great job! I'll want to use it for my game, so I'm anxiously waiting for GM7 compatibility.

Edit: Can we apply a force to a specific object, or create explosion effects, etc? Or is that a feature to be implemented later?

Also, if possible, I'd suggest more options on how to dynamically affect the ODE "world" through Game Maker (eg set the x, y and rotation of a material).

Edited by Paper Carnival, 05 September 2008 - 09:10 AM.

  • 0

#16 them4n!ac

them4n!ac

    GMC Member

  • New Member
  • 1170 posts

Posted 05 September 2008 - 09:34 AM

please fix the memory leaks! ;)
Posted Image

EDIT:
and why there's PhysX?
that's a copyrighted trademark, you can't use it like this ^_^

Edited by them4n!ac, 05 September 2008 - 09:35 AM.

  • 0

#17 Keth

Keth

    GMC Member

  • New Member
  • 164 posts

Posted 05 September 2008 - 01:46 PM

please fix the memory leaks! ;)
<image>

EDIT:
and why there's PhysX?
that's a copyrighted trademark, you can't use it like this ^_^


Damn, I totally forgot about checking memory leaks.
Thanks for information!

About PhysX, On the beggining I've been doing AGEIA PhysX with those functions but then I changed to ODE because doing 2D in PhysX was a lot harder.
Now there is a lot of changing but I'm sure that AGEIA doesn't mind :D

Edit:
There is no memory leak. My memory usage for rigid_bodies.exe is static after creating 200 bodies (15,536 and doesn't change for 5 minutes).
Have you been adding new bodies while the graph was going up?

Edited by Keth, 05 September 2008 - 01:52 PM.

  • 0

#18 them4n!ac

them4n!ac

    GMC Member

  • New Member
  • 1170 posts

Posted 05 September 2008 - 03:22 PM

Delete the bodies, and you'll see the leak. ;)
Memory allocation doesn't make the leak if that memory is freed after usage. ^_^

Edited by them4n!ac, 05 September 2008 - 03:22 PM.

  • 0

#19 Keth

Keth

    GMC Member

  • New Member
  • 164 posts

Posted 05 September 2008 - 03:25 PM

Delete the bodies, and you'll see the leak. ;)
Memory allocation doesn't make the leak if that memory is freed after usage. ^_^


Oh, thanks for information.
Will be fixed in next release.
  • 0

#20 TheMagicNumber

TheMagicNumber

    GMC Member

  • GMC Member
  • 5247 posts
  • Version:Unknown

Posted 06 September 2008 - 02:50 AM

Hmm, do you know if ODE has deactivating objects? As in, if it doesn't move for a while, it is cut out of the loop to not waste speed?
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users