Author Topic: Zedd Physics Library  (Read 29486 times)

0 Members and 2 Guests are viewing this topic.

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Zedd Physics Library
« Reply #90 on: October 13, 2010, 05:29:32 pm »
Wow.  I can't wait for a demo.  Wow. ;D

SirCmpwn

  • Guest
Re: Zedd Physics Library
« Reply #91 on: October 13, 2010, 06:37:23 pm »
Wow BuilderBoy!  Nice!  My physics engine also supports calculating collisions with maps, static (non-movable) objects, and has two bytes per object reserved for user data (such as a sprite).  It does variable widths, too.  I want to see some competition here :)

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Zedd Physics Library
« Reply #92 on: October 13, 2010, 06:42:00 pm »
Whoa, Zedd lives again! Excellent :D

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 #93 on: October 13, 2010, 06:46:21 pm »
Competition it is then :) I plan on implementing static objects, as that is probably useful, and the map code would just be an extension of the current floor code, so that shouldn't be too hard.  I am particularly happy with my mass code however ^^ And graphics are coupled directing into the Zedd engine so sprite number is going to be built in, also with an option to draw a rectangle (multiple types) instead of a sprite.  You will also be able to customize the locations of your sprite buffers and the object buffer that Zedd uses.  How many bytes per object are you using?  I currently am using 16, although some of it is empty and some of it can be optimized.

SirCmpwn

  • Guest
Re: Zedd Physics Library
« Reply #94 on: October 13, 2010, 06:53:15 pm »
I'm using 16, I believe, including space I have set aside for mass, which is currently unimplemented.  I leave all the drawing up to the user, and I'm going to use a callback sort of routine to allow them to draw all the objects without using a second loop.  The map is also totally user-specified, although the engine does provide a map drawing routine.  I'm trying to leave the user free to do what they like, I just provide an object management system.

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 #95 on: October 13, 2010, 06:58:21 pm »
Map is user specified meaning what?  And yeah thats also the approach im taking with Zedd, i just decided having the graphics engine built into Zedd would make it faster, and in some cases easier to manage, since you don't have to worry about sprite offsets, you just specify a sprite number.

Im also including tons of helper subroutines that do things like access objects locations, velocities, and global forces.  Global forces are something i implemented so that Zedd wasn't going to turn into a Gravity specific engine.  It runs in default with all of the objects floating in Zero-G.  But when you initialize the Zedd engine, you can specify some global forces that are applied onto the objects every frame, and so you can do things like gravity.  But with this you can also bypass gravity and flip the world upside down if you want :D

SirCmpwn

  • Guest
Re: Zedd Physics Library
« Reply #96 on: October 13, 2010, 07:01:15 pm »
ooo, global forces sounds nice.  Mine doesn't use that, the user has to specify the gravity.  It runs in zero-g by default, too.  As for user-specified maps, I mean that they provide the data and are free to draw it however they like.

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 #97 on: October 13, 2010, 07:04:43 pm »
Ah gotcha, yeah drawing of tilemap would be handled by the user in my case as well, although i am going to implement tilemaps way in later development because i plan on implementing things like scrolling and such.  And currently i was silly when implementing global forces, and so every object has a copy of the global forces, a total of 4 bytes that are also stored in the World data x.x well thats 4 bytes i have free now :) Zedd has 16 bytes to store world data such as number of objects and other things like global forces.

I also have Zedd set up so that it doesn't modify the user variables ^^ Although i plan on making it slightly more elegant than just backing up the vars before and after simulation :P

SirCmpwn

  • Guest
Re: Zedd Physics Library
« Reply #98 on: October 13, 2010, 07:08:44 pm »
What is the precision of your objects?
Also, let's see who can get hinges and springs done first :)

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 #99 on: October 13, 2010, 07:12:21 pm »
x256 for Zedd.  And as for hinges and springs, those are not going to be a part of Zedd, as they are more of client code.  I will probably release a physics expansion kit later that uses Zedd as the base, but right now Zedd is going to stay a collision solver, a base solver to provide advanced physics collisions in a physical environment (oooh that sounds catchy :D)

And even so, you can go tackle hinges on your own :P I'm going to stick with springs myself, hinges are a nightmare to code, haven't gotten a working one myself yet.

SirCmpwn

  • Guest
Re: Zedd Physics Library
« Reply #100 on: October 13, 2010, 07:18:00 pm »
If you use 256, you can only scroll up to 255 pixels.  My engine uses x64, which is a bit slower, but it allows for 1023 pixels before wrapping.

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 #101 on: October 13, 2010, 07:22:03 pm »
yeah i am aware of this, but i chose speed over size, that is after all over 2.5 screens wide already, and 4 screens tall.  i don't think i need hard physics in a window any more than that :) Any farther from the view screen and i am most likely just going to freeze physics or go to a rudimentary less accurate system using x1 simulation accuracy, which pretty much sucks, but if you cant see it all that matters is that it doesn't fall apart :P

SirCmpwn

  • Guest
Re: Zedd Physics Library
« Reply #102 on: October 13, 2010, 07:28:18 pm »
Fair enough :)

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 #103 on: October 13, 2010, 07:31:19 pm »
Heh indeed :) I am actually in the process of writing a sandbox that uses Zedd as a subroutine, and it is coming along nicely ^^ Soon you shall all be able to play! :D

SirCmpwn

  • Guest
Re: Zedd Physics Library
« Reply #104 on: October 13, 2010, 07:34:03 pm »
I look forward to breaking playing with it ;)