Author Topic: Zedd Physics Library  (Read 29825 times)

0 Members and 1 Guest are viewing this topic.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Zedd Physics Library
« on: April 24, 2010, 11:49:31 am »
A seed was planted when SirCmpwn noted that he was writing a physics engine for his new game, and i insticntivly started working on my own.   ::)  Well collision was a bitch, and i went through many rewrites and many RAM clears before I even got a version that didnt crash every five seconds.  The trick was to make an engine that supported an undefined amount of polygons, but enough blabbering lets get to the specs:

Supported:
Rigid Body Physics Collisions
Friction between Objects and on Walls
NO Terminal velocity cap, objects can move as fast as they need to
Edge Sliding*
External Force Application

Planned:
Different sized objects
Objects with different masses
Built in subs for accessing different objects

And here are 3 screenshots i made to demonstrate my engine.  Note that the engine itself only handles the collision solver, anything extra like springs or buoyancy is handled by the client program.  Since the engine supports full external force application, you can attach boxes with strings, submerge them, remove gravity, or give them magnetic properties and the collisions solver will compensate.

Screenie 1:  Just a basic Demo with the plain engine.  In the beginning you can see an example of edge sliding, where boxes close to falling off with slide a bit to the right or left.  Its mostly to make box stacking more realistic because without it, boxes would stay still even if it was only partly on top of another box.  I am then applying gravity with the arrow keys to make them fly around the screen.

Screenie 2:  Now demonstrating the dynamic force application.  The code for the spring is not inside the Zedd engine, but the solver still can take in all the resulting forces of the spring and simulate the collisions accurately.  I am applying a force to one of the boxes with the arrow keys.

Screenie 3:  Now demonstrating more of the dynamic global effects you can achieve with Zedd.  I wrote a small bit of client code to handle buoyancy and let the boxes go into this tub of water.  Zedd handles the rest!  I am moving around one of the boxes and trying to stack them on top of eachother to show how well Zedd redistributes forces and transfers momentum.

RELEASE: I am not releasing the engine just yet.  There are still some bugs to hammer out, as well as implementing some screen partitioning to improve speed, because as of now, it runs a bit slow on the 6Mhz processors, and i think i can get some more speed.  I also need to implement a few more features, and write the handy subs to work with objects :)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Zedd Physics Library
« Reply #1 on: April 24, 2010, 11:58:03 am »
WOW! That's awesome!

I wonder how you manage to do all that stuff. I myself would never be able to do things this complex. The only thing I ever did that had some physics like dynamic force was Boss #3 in Metroid II Evolution and even then it had full of bugs. It would be nice if eventually you released it with tutorials or code commented in a txt file with the examples so people can figure out how to use them in their game. I especially love the 3rd part. It reminds me Super Mario world when jumping on floating blocks on the water.

Also the 2nd screenshot reminds me the java physic engine you made a while ago.

Nice job on this

Do you think I should move this in its sub-forum?

Offline Raylin

  • Godslayer
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1392
  • Rating: +83/-25
  • I am a certifiable squirrel ninja.
    • View Profile
    • Ray M. Perry
Re: Zedd Physics Library
« Reply #2 on: April 24, 2010, 12:16:44 pm »
Yes, I think you should.
This more than deserves its own subforum.
Bug me about my book.

Sarah: TI-83 Plus Silver Edition [OS 1.19]
Cassie: TI-86 [OS 1.XX]
Elizabeth: TI-81 [OS 1.XX]
Jehuty: TI-83 Plus Silver Edition [OS 1.19]
Tesla: CASIO Prizm







Offline Galandros

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1140
  • Rating: +42/-10
    • View Profile
Re: Zedd Physics Library
« Reply #3 on: April 24, 2010, 12:39:12 pm »
Interesting, I also wanted to come with a physics engine someday. And I don't know how you could come up with with such flexible engine. :o I was thinking on a way but never got it.

For making this engines you need to understand some physics. Having a list of formulas comes handy. Builderboy, what resources you have that help coding the engine? I use Wikipedia or MathWorld for math stuff, Wikipedia for algorithms but for Physics I never searched...
I am curious to see the source code because it seems very powerful and relatively ease to implement new stuff.
Hobbing in calculator projects.

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Zedd Physics Library
« Reply #4 on: April 24, 2010, 05:20:55 pm »
This is really cool! Great job on this, Builder! Can't wait to see what more you come up with :)

@Galandros
I actually have some pages that my AP Physics teacher gave us. It's full of formulas and such and I'll upload that in the Miscellaneous Discussion Board. It's similar to my Trig. Resources.
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Zedd Physics Library
« Reply #5 on: April 24, 2010, 06:43:00 pm »
Holy crap that's awesome!  :o  I couldn't even get that stuff working well in my C++ physics engine!

Its strange, I've hardly seen any calculator games with real physics engines before, but after Axe Parser, it seems like a lot more people are interested in using them for some reason (Like Portal X, Half-Life, and a few others).  Maybe they're just generally too messy when written in actual assembly and this simplifies the process...
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6266
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: Zedd Physics Library
« Reply #6 on: April 24, 2010, 07:36:50 pm »
WOW! amazing!
can't wait for you to release it so I can play around with it!
/e

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Zedd Physics Library
« Reply #7 on: April 24, 2010, 09:34:59 pm »
Yay! Finally you posted this, Builderboy :)
The boxes shake a bit in the 3rd screenie, though. Is that a feature or a bug?

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Zedd Physics Library
« Reply #8 on: April 24, 2010, 11:48:57 pm »
I think that is part of the buoyancy engine but I could be wrong.
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline mapar007

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 550
  • Rating: +28/-5
  • The Great Mata Mata
    • View Profile
Re: Zedd Physics Library
« Reply #9 on: April 25, 2010, 01:48:58 am »
I guess this is Axe?

Awesome job, pal!
« Last Edit: April 25, 2010, 01:49:16 am by mapar007 »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Zedd Physics Library
« Reply #10 on: April 25, 2010, 01:59:05 am »
Yeah, Axe language

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Zedd Physics Library
« Reply #11 on: April 25, 2010, 02:34:17 am »
Hey thanks guys :) I have actualy been working on this for a while, but only recently did I make a breakthrough in the collision code that allowed me to write demos like these. The demos are a little glitchy tho, like in the spring demo I had to remove some code in the enging to make it work right, and as bwang pointed out in he boyancy demo the water friction isn't totaly accurate.  But that stuff is mostly client error :P

As soon as I iron out a few more bugs and clean up some codes I will get a release goingwith some commented source and a few more fun demos :) I also can't wait for libraries in axe so that this will be fully supported ^^

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Zedd Physics Library
« Reply #12 on: April 25, 2010, 02:47:53 am »
That's cool :) Glad things are coming along. How long do you think everything will take?

Non Sequitur: 600th post! ;D
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Zedd Physics Library
« Reply #13 on: April 25, 2010, 12:28:52 pm »
Holy crap that's awesome!  :o  I couldn't even get that stuff working well in my C++ physics engine!

Its strange, I've hardly seen any calculator games with real physics engines before, but after Axe Parser, it seems like a lot more people are interested in using them for some reason (Like Portal X, Half-Life, and a few others).  Maybe they're just generally too messy when written in actual assembly and this simplifies the process...
I think it's mostly because there aren't a lot of people in the TI community who were into physics or were physics gurus, so they usually had rudimentary physics in their games. For example in Super Mario 1.2/2.0 when stopping walking, you stopped instantly instead of sliding a little bit. Also ASM code can be confusing when it gets large so maybe it discourages some people from having very complex physics. As for BASIC, well, it's just too slow to have any good physics inside a game.

And now we got Builderboy and Calc84maniac who are into physics stuff a lot plus the option to use a language that is almost as fast as ASM (if not the same speed?) but where graphical commands are almost as easy as BASIC :D

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: Zedd Physics Library
« Reply #14 on: April 26, 2010, 06:18:32 am »
Hey!, This looks super special awesome! The speed on this is actually quite good IMO too. I don't really know much about physics, so I currently wouldn't know where to begin with something like this. Great stuff tho. ^_^