Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Work in Progress / FREE 2D Physics Engine Plugin!

Author
Message
MonoCoder
18
Years of Service
User Offline
Joined: 4th Dec 2005
Location: england
Posted: 3rd Oct 2007 21:37
I've tried using the b2getcontact commands, but whilst being highlighted in the editor, I get an error stating that the variable b2getcontact does not exist (This is with the latest version of the plugin). Have I missed something out?


Thanks.

EBA: A banner coming soon.
Then maybe a game.
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 3rd Oct 2007 23:44 Edited at: 4th Oct 2007 00:19
@MonoCoder
I will check it out

edit:
The problem was just that I had forgotten to rebuild the project one last time before I released it and the string table did not have some of the extra commands. They will be in the next release.

News
H4ck1d has kindly agreed to work on the help files, so hopefully it will not be too long before you get some proper help

Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 5th Oct 2007 00:27
The collision shape editor is coming along great. Only one small problem to do with memory, but it will hopefully be fixed soon. And then prepare for more updates to the actual plugin (Box2D V1.3 was just released so the next update should include that)

H4ck1d
18
Years of Service
User Offline
Joined: 27th Dec 2005
Location: Yes
Posted: 5th Oct 2007 01:24
Hey diggsey I figured since you weren't online I'd ask you here - do you have a program to generate a blank version of the htm files for each of the commands? I've got the tree list completed, but can't do anything about linking them up to actual help files since I need some sort of htm file generator I'm assuming? Thanks tons!

-H4ck1d

Freddix
AGK Developer
22
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 5th Oct 2007 14:48
Hi

Your plugin seem to be really excellent for 2D games but, do you think you'll release a version compatible with AdvancedSPRITES ?

Gandalf said: "All we have to decide is what to do with the time that is given to us"
Odyssey-Creators - X-Quad Editor - 3DMapEditor
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 5th Oct 2007 18:46
As far as I know, it is compatible with AdvancedSPRITES. My plugin controls only the data, not the images on screen. Those are completely controlled by the user. If AdvancedSPRITES can be rotated and positioned then it's compatible

MonoCoder
18
Years of Service
User Offline
Joined: 4th Dec 2005
Location: england
Posted: 5th Oct 2007 20:10
Will it become possible to control the system's speed by passing timers to it? At the moment, it's speed is based entirely on how fast the program is running.

For example:


Thanks.

EBA: A banner coming soon.
Then maybe a game.
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 5th Oct 2007 20:15 Edited at: 5th Oct 2007 20:17
@Monocoder
A mistake in the .ini file
There are actually three versions of the function:
b2step <worldID>
b2step <worldID>,<timestep>
b2step <worldID>,<timestep>,<iterations>

The default timestep is 1/60th of a second (Should not be above about 1/30th of a second or simulation becomes unrealistic)
The default iterations is 10 (The greater this value, the more accurate the simulation, but the longer it takes to simulate)

@H4ck1d
You can just copy the examples I sent you. The links are specified in the .txt file you use to create the treeview.

MonoCoder
18
Years of Service
User Offline
Joined: 4th Dec 2005
Location: england
Posted: 5th Oct 2007 20:16 Edited at: 5th Oct 2007 20:31
Ah, brilliant! Thanks.


EDIT: Something else, I tried a little something like pinball earlier. The ball dropped from the top of the screen to the bottom, and there was a flipper that could be used to hit it back up.

When space was pressed, the flipper would rotate and hopefully hit the ball back up. However, if the ball was somewhere between the normal and pressed area of the flipper (in between it's idle angle and it's destination angle), and space was pressed, it would end up above the ball, and the ball would just carry on falling beneath it.

So I guess my question is, is there, or will there be, a way to check the area passed through between cycles? Or, should I be going about this in another way?


Thanks.

EBA: A banner coming soon.
Then maybe a game.
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 5th Oct 2007 20:19
BTW
If anyone is making a game with this plugin, please post because the creator of Box2D (Erin Catto) is interested in what it is being used for

flashing snall
19
Years of Service
User Offline
Joined: 8th Oct 2005
Location: Boston
Posted: 5th Oct 2007 21:48
i will be putting it in mine once i get some other stuff done, and once i find some help files. i think im mainly going to use it for bullets that fly out of your gun, and MAYBE destructable objects.


"these shoes are 300 hundred dollars"-Shoes by Kelly http://smallgroupproductions.com/
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 5th Oct 2007 21:59
@flashing snall
The new 'part' commands in the next update should make destructable objects easier

H4ck1d
18
Years of Service
User Offline
Joined: 27th Dec 2005
Location: Yes
Posted: 6th Oct 2007 00:40
Quote: "You can just copy the examples I sent you. The links are specified in the .txt file you use to create the treeview."


Yes, but were you expecting me to edit the html files themselves? Because the way they are written, I'm assuming they weren't edited in notepad or anything like that . Is there some other software for editing the html files?

Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 6th Oct 2007 01:02
Oh, just use FrontPage

Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 6th Oct 2007 01:44 Edited at: 6th Oct 2007 01:49
The V1.0 of the collision editor is finished!!!

It exports to .dba code as well as saving/loading in the native format.

Controls:
Click on center cross to move a shape, rightclick + drag to rotate shape.
Drag sliders to alter box widths/heights or circle radii.
Drag vertices to change shape of polygons (remember the physics engine will only work properly with convex ones even though this editor allows you to create concave polygons). The selected shape is in white. To create shapes use the buttons on the right. Exporting to C++ code doesn't work yet.

Click here to download

Screeny:


Attachments

Login to view attachments
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 6th Oct 2007 01:48

Attachments

Login to view attachments
H4ck1d
18
Years of Service
User Offline
Joined: 27th Dec 2005
Location: Yes
Posted: 6th Oct 2007 02:19
Wow, great job! Thanks again diggsey! This should allow me to get started on the project I've been thinking of... after I finish the help files

Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 6th Oct 2007 13:14 Edited at: 6th Oct 2007 13:15
Update time!!!
LOADS of new commands in this update, you'll have to check them out for yourself

Unfortunately, this is still using Box2D V1.21 because something has changed in V3.0 which messes up almost everything! V1.21 is still bug-free though, so it shouldn't matter too much.

The existing commands remain unchanged.
Here is the download

Attachments

Login to view attachments
MonoCoder
18
Years of Service
User Offline
Joined: 4th Dec 2005
Location: england
Posted: 6th Oct 2007 16:35
Looks good. I've been trying to use the getcontact commands, but they're all a bit vague without a more in-depth description. So far, I get odd crashes and large numbers that mean very little to me. I can only assume I'm using them wrong, so any help would be appreciated.


Thanks.

EBA: A banner coming soon.
Then maybe a game.
H4ck1d
18
Years of Service
User Offline
Joined: 27th Dec 2005
Location: Yes
Posted: 7th Oct 2007 07:05 Edited at: 7th Oct 2007 07:06
I'm making headway on the help files, just hang in there guys!

[edit]
@Diggsey - is there any way to move the main control box in your shape editing program? I'm trying to use it for an 800x600 image, but the control box gets in the way

Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 7th Oct 2007 11:02
@H4ck1d
Currently, there is no way. I will add it in the next update. For the moment, you could just scale down the image in paint. Good luck with the help files

Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 8th Oct 2007 19:13
Quote: "
BUMP
"


flashing snall
19
Years of Service
User Offline
Joined: 8th Oct 2005
Location: Boston
Posted: 9th Oct 2007 04:46
agreeded!


"these shoes are 300 hundred dollars"-Shoes by Kelly http://smallgroupproductions.com/
Freddix
AGK Developer
22
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 9th Oct 2007 14:57
@Diggsey :
Cool
I'd like to add support for your plugin in PurePLUGIN.
Do you agree ?
That mean that user can use your plugins from the DarkBASIC Professional 's plugins they'll develop under PureBASIC+PurePLUGIN.
Your plugin DLL is always needed and user will have to install it, event to use it from PurePLUGIN.

Regards,
Fred
Odyssey-Creators

Gandalf said: "All we have to decide is what to do with the time that is given to us"
Odyssey-Creators - X-Quad Editor - 3DMapEditor
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 9th Oct 2007 19:47 Edited at: 9th Oct 2007 19:49
If you mention me somewhere or post a link to this thread then of course you can I don't know what this 'adding support' involves, so if you need any help or info, just MSN me or post here I think the Box2D creator would also like some credit, so a link to www.Box2D.org or something like that would be nice

Freddix
AGK Developer
22
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 9th Oct 2007 20:21
Hi,

in fact PurePLUGIN is a DarkBASIC Professional 's plugins framework

It allow user that want to create a plugin for DarkBASIC Professional using PureBASIC, to directly access the main DarkBASIC Professional commands from its plugin ....

So, with upgrades, I add ... time to time ... support for external plugins ...

That mean that a developer that want to create a plugin for DarkBASIC Professional, if he use PurePLUGIN under PureBASIC language, he can then use your plugin from inside its plugin ...

Do you understand now ?

Gandalf said: "All we have to decide is what to do with the time that is given to us"
Odyssey-Creators - X-Quad Editor - 3DMapEditor
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 9th Oct 2007 20:30
Yeah Sure, you can use it

Jeku
Moderator
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 10th Oct 2007 09:36
Stickied

Great work on this. This is definitely something people should be taking notice of.

Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 10th Oct 2007 18:56
WOOH! My first sticky
Thanks Jeku!

flashing snall
19
Years of Service
User Offline
Joined: 8th Oct 2005
Location: Boston
Posted: 10th Oct 2007 22:13
congrats. and props


"these shoes are 300 hundred dollars"-Shoes by Kelly http://smallgroupproductions.com/
Deathead
18
Years of Service
User Offline
Joined: 14th Oct 2006
Location:
Posted: 10th Oct 2007 23:15
Quote: " This is definitely something people should be taking notice of."

Lol! Stickies never get looked at as often as normal threads.

-Go onto the forums its nice! Join now!
H4ck1d
18
Years of Service
User Offline
Joined: 27th Dec 2005
Location: Yes
Posted: 12th Oct 2007 01:42
Hey I've got a question - is there a way to create a non-tippable character? ie a body in the physics engine that cannot be rotated? In newton you can make it so that the body can only be rotated on its y-axis. So I was just wondering if there was any way to do this with the 2d physics plugin? Thanks!

Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 12th Oct 2007 19:06 Edited at: 12th Oct 2007 19:07
It is currently possible by applying torque to your shape to counteract the rotational velocity. When I get the latest version of Box2D to work with it, it will have a joint specifically for it (and other joints too).

BTW
How are the help files coming along?

H4ck1d
18
Years of Service
User Offline
Joined: 27th Dec 2005
Location: Yes
Posted: 13th Oct 2007 16:41
Okay cool, I'll look forward to the next update then

Quote: "How are the help files coming along?"


Not too bad. Unfortunately, I misplaced the flash drive that had all of the data on it for a few days, so I lost a few days' work on it. Also unfortunately, my weekend is booked back-to-back, so I won't really have any time to work on it again until monday . If anyone would like, I can upload what I currently have done and someone who has some time could help out? Let me know if anyone's interested in helping out.

Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 18th Oct 2007 20:06 Edited at: 18th Oct 2007 20:07
Sorry for no updates, but I'm having some serious problems with the new versions of Box2D. Erin (The creator of Box2D) and I are trying to find out what has changed since the last version which could have caused it, but so far nothing as turned up Really annoying as this version brings loads of new features such as an easy flag to set if you want to prevent an object from rotating, and more joints such as gear and pulley joints!

Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 20th Oct 2007 12:01
I have finally fixed the problem after a week of trying
Prepare for updates...

Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 20th Oct 2007 13:07 Edited at: 20th Oct 2007 13:09
UPDATE


The plugin has been updated to use Box2D V1.4.0
Gear joint has been added
Pulley joint has been added
Can now easily enable/disable rotation
Can now easily enable/disable position
Can now easily enable/disable collision between objects attached by a joint

Download HERE

flashing snall
19
Years of Service
User Offline
Joined: 8th Oct 2005
Location: Boston
Posted: 21st Oct 2007 02:59
COOOOOLLLL!!!!!!!!
i want help files.
this is waaaay cool man.


"these shoes are 300 hundred dollars"-Shoes by Kelly http://smallgroupproductions.com/
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 21st Oct 2007 23:30
Just re-uploaded it because I accidently uploaded the debug version again

Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 22nd Oct 2007 10:53
When the next update of Box2D comes out, it will have CONTINUOUS COLLISION DETECTION, which will be cool

MonoCoder
18
Years of Service
User Offline
Joined: 4th Dec 2005
Location: england
Posted: 22nd Oct 2007 15:57
What does it do?

EBA; UI; Mario Land Ripoff.
Every time you post a joke in the form of code, mace yourself.
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 22nd Oct 2007 18:27
Well, at the moment, if you have an object that moves REALLY fast it can have passed through a thin object in one frame without ever registering a collision:


CCD extrudes the collision shape from the last frame to the current frame, so a collision will always be detected:


I hope that explains it

MonoCoder
18
Years of Service
User Offline
Joined: 4th Dec 2005
Location: england
Posted: 22nd Oct 2007 20:02
Well, now... that's the icing on the metaphorical collision cake. If this works even to the extent of loads of objects passing through each other being detected, I'm totally sold on this.

One thing, though- I briefly tried this some time ago. Getting a platform game working with this is a bit hit-and-miss. I tried to get it moving using some linear velocity commands (If I recall correctly) but on hitting a slope, the player just flopped over and got dragged up it instead. I take it motors and stuff are the way to go for this, but if so, I'll wait until the help files appear before I get in over my head.


Keep up the good work.

EBA; UI; Mario Land Ripoff.
Every time you post a joke in the form of code, mace yourself.
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 22nd Oct 2007 20:34 Edited at: 22nd Oct 2007 20:35
@Monocoder
Hence the new commands in that last release

b2EnableBodyRotation BodyID,Enable
b2EnableBodyPosition BodyID,Enable

If Enable is set, the body CAN move/rotate depending on the command. Otherwise, moving/rotating is disabled for the body. Objects can still be positioned and rotated even when their position/rotation is disabled

MonoCoder
18
Years of Service
User Offline
Joined: 4th Dec 2005
Location: england
Posted: 22nd Oct 2007 21:08
Ah- haven't had much of a chance to use it yet (except a little dabbling with the demo). Once I get to a point with my current project , which should be before long, I'll break off and have a shot at it again.


Thanks.

EBA; UI; Mario Land Ripoff.
Every time you post a joke in the form of code, mace yourself.
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 23rd Oct 2007 21:26 Edited at: 25th Oct 2007 20:59
Update time again!
Sadly CCD is not in yet, but there are more commands!

Changes:
Now uses Box2D v1.4.1
Get list of joints in a world
Get list of bodies in a world
Get list of contacts for a body
Get list of joints for a body
Renamed b2GetContactCount to b2GetWorldContactCount
Renamed b2GetCount to b2GetWorldContact

Lists of joints/contacts for a body are contained in nodes.
Here is some example code showing how to loop through all the contacts in the body 'MyBody':


And here is the equivalent for joints:


Both of those are very fast since it is just accessing internal variables, so you don't have to worry about speed as much

The new commands:


There are now over 100 commands in the plugin

Download HERE

Attachments

Login to view attachments
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 25th Oct 2007 20:58 Edited at: 25th Oct 2007 21:00
Another small update

I added an extra boolean parameter to b2DrawDebugInfo, which, if set, tells it to allow the user to drag stuff around in the simulation

Download HERE

UFO
19
Years of Service
User Offline
Joined: 11th Oct 2005
Location:
Posted: 26th Oct 2007 00:40
Thank you so much for this!

I tried to use Fizz before, but it would never work for me.
I've always wanted to do a platform game with physics.

I think I will try to code one now. I hope my programming slump is over >.<


I haven't noticed this for a while because it was stickied. I never look at stickies.

flashing snall
19
Years of Service
User Offline
Joined: 8th Oct 2005
Location: Boston
Posted: 26th Oct 2007 01:38
dude... just thinking of all the possibilities makes me druel...


"these shoes are 300 hundred dollars"-Shoes by Kelly http://smallgroupproductions.com/
TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 26th Oct 2007 11:49
Well don't! Please drool instead! Lol!

Login to post a reply

Server time is: 2024-11-24 07:46:09
Your offset time is: 2024-11-24 07:46:09