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.

Author
Message
Mike Johnson
TGC Developer
18
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 29th Jun 2010 10:28


Box2D has been released!

Box2D for DarkBASIC Professional lets you realistically simulate complex 2D environments, opening up a whole range of possibilities for both 2D and 3D games alike. Box2D can be used whenever the movement is limited to two dimensions, regardless of whether you use 2D sprites or 3D objects to render your scene.

The installer includes a number of demos and a set of tutorials designed to teach you the vast feature set of the add-on while you create your very own game of pinball.

For more details go to http://www.thegamecreators.com/?m=view_product&id=2257
knxrb
FPSC Tool Maker
12
Years of Service
User Offline
Joined: 10th Oct 2008
Location: United Kingdom
Posted: 29th Jun 2010 13:19 Edited at: 29th Jun 2010 13:29
Aww cool Is there a list of the commands that are in the new pack somewhere or is everything from Box2D in it?

knxrb

baxslash
Valued Member
Bronze Codemaster
14
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 29th Jun 2010 13:45
This is amazing, buying it right now...

Diggsey
15
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 29th Jun 2010 16:54 Edited at: 29th Jun 2010 18:38
Quote: "Is there a list of the commands that are in the new pack somewhere or is everything from Box2D in it?"


There are 270 new commands in the plugin, so a list might be a bit meaningless. However, I can say that almost every public method or variable from Box2D engine are accessible, along with a large number of methods to simplify the use of the engine from DBPro.

I included the raw text from the contents page of the help file anyway:


The part before the "/" just identifies the section to which the command belongs (all commands dealing with bodies, etc. are grouped together to make it easier to find a particular command)

[b]
baxslash
Valued Member
Bronze Codemaster
14
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 29th Jun 2010 22:52
Great I have a download and an activation key but I get "Product unknown", is there an update needed for DBP?

Diggsey
15
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 29th Jun 2010 22:54
Upgrade 7.5 is required

[b]
baxslash
Valued Member
Bronze Codemaster
14
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 29th Jun 2010 22:58 Edited at: 29th Jun 2010 23:05
Wow! Fast reply, thanks diggsey. Updating now, I had a problem with DarkCLOUDS when I last used 7.5 which would really screw me up so I'm hoping that's fixed!!

I'm really looking forward to trying this out though, great work fella!

EDIT: This is great!! I love the demos and the plugin seems super quick! My DC problem is gone too by the look of things.

The only problem now is that I may have to start another project to justify the expense!!! Oh dear, nevermind

Diggsey
15
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 29th Jun 2010 23:36
I'm very pleased that you like the plugin!
Thanks for buying

[b]
Neuro Fuzzy
14
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 30th Jun 2010 04:51
Wow! cool!

...but... is the help documentation updated? I couldn't figure out a lot of the commands last time I tried to do it. Never could get the magnitude of force of a collision :\


Is't life, I ask, is't even prudence, to bore thyself and bore thy students?
Diggsey
15
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 30th Jun 2010 18:31 Edited at: 30th Jun 2010 18:32
The plugin has complete help files and a set of tutorials.

Currently, the only way to detect the magnitude of a collision is to compare the velocities of the contact points, or if that level of accuracy is not required, the velocities of the bodies involved may be sufficient.

[b]
Van B
Moderator
18
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 30th Jun 2010 20:31
Strange, I got it installed and everythings seems fine, then I get a 'Could not understand command at line 9' on the first tutorial (similar error on all the examples).

I checked, definitely have the keywords in the right place, and I'm on update 7.5.

Plugin looks great, I wanna play!


Health, Ammo, and bacon and eggs!
Mnemonix
18
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: Skaro
Posted: 30th Jun 2010 21:07
Any chance of a GDK version?

Your signature has been erased by a mod because it's larger than 600x120
Neuro Fuzzy
14
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 30th Jun 2010 21:38 Edited at: 30th Jun 2010 21:40
box2d is an engine aimed at c++ programmers, you don't need a wrapper http://www.box2d.org/

[edit]
also, cool about the help files! Getting the velocity of a contact point is good enough for me. May buy this in the near future.


Is't life, I ask, is't even prudence, to bore thyself and bore thy students?
Van B
Moderator
18
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 30th Jun 2010 21:40
Oops. Had an old version still installed, which was causing the problem.


Health, Ammo, and bacon and eggs!
CresCo
11
Years of Service
User Offline
Joined: 11th Aug 2009
Location:
Posted: 2nd Jul 2010 22:44
I'm having the same problem as Van B when compiling the tutorials (1 and 2), but I don't think I have an old version of DBPro still installed... here is the error report just in case the problem lies elsewhere [I will try this plugin on a different machine later and report back]:

From tutorial 2



Also, what does the following code do exactly?


Thanks,

Jeff

CresCo Games: makers of fine software since 2004
Diggsey
15
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 5th Jul 2010 19:17
Hi,
VanB meant he had an old version of the plugin installed (there used to be a free version, but it was missing alot of things, including help files!)

Look in your "Compiler\plugins-user" folder, and delete the file "Box2DPlugin.dll". This should fix the problem.

As for those data statements, they just specify the coordinates of the vertices of a shape. The code reads each pair and connects them up with edge shapes to make a complete polygon.

The tutorials which come with the plugin explain how I created those data statements.

[b]
Alien Menace
AGK Developer
16
Years of Service
User Offline
Joined: 11th Jan 2005
Location: Earth (just visiting)
Posted: 6th Jul 2010 19:48
I was very pleasantly surprised to see this. My only real compaint so far is that there are only 4 demos, So I wouldn't say there are a "number" of demos but rather a "few" of them. The tutorials are pretty good though and all the commands are well documented. I'd like to see a lot more examples especially ones that illustrate concepts like buoyancy and using Box2D with 3D objects. All in all, I'm very glad this went commerical. We finally have complete documention to go along with an excellent plugin. Good work Diggsey!

Intel Core Duo2 E6850 3.0 GHz - 2x Geforce 8800 GTS SLI - 6GB RAM - Creative X-FI - Windows 7 64-bit.
Diggsey
15
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 6th Jul 2010 21:05
@Alien Menace
Thanks for the feedback!

I'll make some more demos and I'll also release some pre-compiled demos so that everyone can try it out.

Boyancy is not built into the engine, but for simple boyancy it's only a few commands so I'll try to get that in.

[b]
Alien Menace
AGK Developer
16
Years of Service
User Offline
Joined: 11th Jan 2005
Location: Earth (just visiting)
Posted: 7th Jul 2010 10:39 Edited at: 7th Jul 2010 11:49
Excellent, can't wait to see it. I do have a question. I have a body that consists of a dynamic fixture and a sensor fixture. I want to see if the sensor fixture part of the body is making contact with anything... not sure how to check for that. I don't want to check the whole body, just the sensor fixture.

Thanks again!

Intel Core Duo2 E6850 3.0 GHz - 2x Geforce 8800 GTS SLI - 6GB RAM - Creative X-FI - Windows 7 64-bit.
Diggsey
15
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 7th Jul 2010 16:11 Edited at: 8th Jul 2010 16:13
You can use b2FindBodyContacts to generate a list of contacts with the body containing your sensor. Loop through them all and check if one of the fixtures involved in the contact is the sensor:



'body' is the body containing the sensor, and 'fixture' is the sensor fixture to check.

[b]
Alien Menace
AGK Developer
16
Years of Service
User Offline
Joined: 11th Jan 2005
Location: Earth (just visiting)
Posted: 7th Jul 2010 20:35
That worked great, Thanks Diggsey. I am using the example from the 2nd tutorial to make a test object using data statements which does seem to works... the bodies do react to it and all but the problem is that it is not appearing under debug draw (the other bodies all show up fine).



I've also tried assigning an image to this body using:

load image "images\wall-1.png", 1, 1
b2SetBodyImage LevelBody, 1,1

The image does display but the offset is way off.

Thanks.

Intel Core Duo2 E6850 3.0 GHz - 2x Geforce 8800 GTS SLI - 6GB RAM - Creative X-FI - Windows 7 64-bit.
Diggsey
15
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 7th Jul 2010 21:29 Edited at: 7th Jul 2010 21:30
Currently, because the plugin draws the interior of shapes, edge shapes do not show up in the debug renderer (as they have no interior).

Images are always centred on the body, so you need to set up the shapes accordingly.

You can easily offset the shapes you add to the body by changing the code to create the edge shapes:


You can then tweak the values of these offsets to get the image to align perfectly.

[b]
Diggsey
15
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 8th Jul 2010 16:30
I've attached a compiled demo showing how you can use 3D objects with Box2D, and also showing off the use of friction joints and damping in a top-down view.

The code is included.

[b]

Attachments

Login to view attachments
baxslash
Valued Member
Bronze Codemaster
14
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 8th Jul 2010 17:06
Nice Demo Diggsey!

I really must get stuck into learning this plugin now I've gone and bought it!

CresCo
11
Years of Service
User Offline
Joined: 11th Aug 2009
Location:
Posted: 8th Jul 2010 20:03
Hmm, I looked in my compiler\plugins-user folder but I don't have any old version of the dll; there is only the version in compiler\plugins-licensed.

Any thoughts on other issues that might cause the problems I detailed above? [I triple checked and I am definitely running DBPro version 1.075]

Thanks

CresCo Games: makers of fine software since 2004
Zubby1970
13
Years of Service
User Offline
Joined: 22nd May 2008
Location:
Posted: 9th Jul 2010 00:13
can you asigne a picture to the world so i can have a back ground image?

There can only be one
Diggsey
15
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 9th Jul 2010 14:53 Edited at: 9th Jul 2010 14:56
@CresCo
Make sure you have activated the plugin (Run TGCOnline.exe in the compiler folder and enter your email and license key).

You can check if it has been activated successfully by running 'TGCCertificateViewerKEEPACTIVE.exe' (also in the compiler folder).

It will show a bunch of icons. The last icon in the list should not be greyed out, and when you hover over it, it should say 'Box2DPlugin(valid certificate)'

If that doesn't work, the only thing I can think of is uninstalling and reinstalling. You can find the uninstaller in the start menu (All Programs -> The Game Creators -> Expansion Packs -> Box2D -> Uninstall)

@Zubby1970
To do that, you can simply call the DBPro command 'paste image' before calling b2DrawWorld. That will draw an image to the screen at a location you specify. (0, 0 for the top left)

[b]
CresCo
11
Years of Service
User Offline
Joined: 11th Aug 2009
Location:
Posted: 9th Jul 2010 19:05
Ah, there we go. I could have sworn I activated it but apparently I missed that step...

Thanks for the help; I'm looking forward to playing with this great plugin!

CresCo Games: makers of fine software since 2004
Zubby1970
13
Years of Service
User Offline
Joined: 22nd May 2008
Location:
Posted: 9th Jul 2010 20:21
does anyone have some demo code on collision detection that part seems to have been omitted, from the tuts although i have just skimmed through them. but all i want to do is check which object has collided with another, so i can add sound effects in or check to see if the main charecture has hit wood or concrete or something soft.

would appreciate any help on this, thanks guys.

There can only be one
Diggsey
15
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 10th Jul 2010 00:34
@Zubby1970
If you want to detect any collisions with a particular body, you can use this code:


This will loop through all contacts involving the body, and for each contact it finds, it will check if it involves a second body called 'testBody'.

In this case, the code inside the 'if' statement will be run if 'body' and 'testBody' collide.

[b]
Zubby1970
13
Years of Service
User Offline
Joined: 22nd May 2008
Location:
Posted: 10th Jul 2010 00:56
thank you very much ill try to make sense of that and see how it goes once again thanks for your time.

There can only be one
tiresius
18
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 11th Jul 2010 07:32
This makes me want to make a 2D game using it. Well done!

It may help sales if you provide a zip of demo binaries so we can see what the library is capable of.


A 3D marble platformer using Newton physics.
Diggsey
15
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 11th Jul 2010 13:59 Edited at: 15th Jul 2010 13:53
I've attached a zip of compiled demos to this post. Enjoy

[b]

Attachments

Login to view attachments
Jammy
18
Years of Service
User Offline
Joined: 15th Jan 2003
Location: Scotland
Posted: 13th Jul 2010 22:11
I’m Very Impressed and will surly buy this in the future. Just a quick heads up. Looks like you missed out the tyre image from your demo zip file, as i get a "could not load image at line 13" error when running the Mini Demo. All the others run fine and look great. Well done.

Diggsey
15
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 14th Jul 2010 00:59
Fixed, thanks for pointing that out!

[b]
Sph!nx
12
Years of Service
User Offline
Joined: 3rd Dec 2008
Location: The Netherlands
Posted: 14th Jul 2010 13:27
Wow, Great work! I just bought it, I cannot leave this out of my collection of code modules!

Thanks guys!

Regards,
Sph!nx
Jimmy
17
Years of Service
User Offline
Joined: 20th Aug 2003
Location: Back in the USA
Posted: 15th Jul 2010 08:02
I'm getting a "File does not exist at line 200" error with the updated Mini demo.

NaGaFailMo.
Diggsey
15
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 15th Jul 2010 13:54
Fixed now.

[b]
Virtual Nomad
Moderator
15
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 22nd Jul 2010 20:22
either the use of robodoc + lack of proof-reading before publishing, my system, or the installer is at fault, but all the help files regarding commands containing underscores have the "_" replaced with "5F", disallowing involved html files to function properly via F1 command help.

further, the list of commands contained in the post above seems to have omitted the same commands containing underscores (some ~20 commands).

if others are seeing the same thing, perhaps a fix is required.

Virtual Nomad @ California, USA
AMD Phenom™ X4 9750 Quad-Core @ 2.4 GHz . 8 GB PC2-6400 RAM
ATI Radeon HD 3650 @ 512 MB . Vista Home Premium 64 Bit
Diggsey
15
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 22nd Jul 2010 21:01 Edited at: 22nd Jul 2010 21:02
There is indeed a problem with the keywords file causing links with an underscore in to break. As a quick fix, you can replace your keywords file with the one attached to this post.

I'll update the installer ASAP.

In the post you linked to every command is listed, including all 26 commands containing underscores, so I can't see the problem?

[b]

Attachments

Login to view attachments
Virtual Nomad
Moderator
15
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 22nd Jul 2010 21:22 Edited at: 22nd Jul 2010 21:23
Quote: "so I can't see the problem?"

ah, you're right, there. what caused me to discover the errors was my hitting f1 as i followed the b2 commands in the Bridge.dba. when i got to b2BodyType_Dynamic(), the problem showed itself. since it contained "body" in it, i assumed it belong to the "Body/..." set of commands above. now i see them (all) under "Enums/".

re: "quick fix", i already started renaming the 5F htmls, replacing with _'s.

Virtual Nomad @ California, USA
AMD Phenom™ X4 9750 Quad-Core @ 2.4 GHz . 8 GB PC2-6400 RAM
ATI Radeon HD 3650 @ 512 MB . Vista Home Premium 64 Bit
Diggsey
15
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 22nd Jul 2010 21:37
If you think it will be quicker you can always run the uninstaller from the start menu, reinstall and then copy the keywords file.

Those commands are under 'enums' because they perform no actual function, they simply return constants that make the code more readable and it seemed more helpful to group them there rather than put them with the other commands.

[b]
Virtual Nomad
Moderator
15
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 22nd Jul 2010 22:12 Edited at: 22nd Jul 2010 22:30
decided to have some fun with it:



exe attached
seemed to work fine. use at your own risk

add: this will break the See Also links and commands.html file. best to wait for proper fix

Virtual Nomad @ California, USA
AMD Phenom™ X4 9750 Quad-Core @ 2.4 GHz . 8 GB PC2-6400 RAM
ATI Radeon HD 3650 @ 512 MB . Vista Home Premium 64 Bit

Attachments

Login to view attachments
mieketsai
10
Years of Service
User Offline
Joined: 23rd Jul 2010
Location:
Posted: 23rd Jul 2010 11:16
awesome!
Diggsey
15
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 3rd Aug 2010 01:45
@Virtual Nomad
The installer has been updated to fix the links in the keywords file.

[b]
cloudy
10
Years of Service
User Offline
Joined: 30th Jun 2010
Location:
Posted: 5th Aug 2010 09:42
it make me happy!

CresCo
11
Years of Service
User Offline
Joined: 11th Aug 2009
Location:
Posted: 18th Aug 2010 08:43
@Diggsey -- is it possible to use Box2D to "rig" existing sprites with Box2D physics-enabled armatures? It would be great to be able to apply real physics effects to imported 2D art resources!

As an aside, anybody interested in playing with physics effects should check out the Octave Engine tech demo called OE-Cake. The Wiki for it is in English and can direct you to an active download.

Thanks,

CCJ

CresCo Games: makers of fine software since 2004
laptop battery
10
Years of Service
User Offline
Joined: 20th Aug 2010
Location:
Posted: 20th Aug 2010 11:13
Any chance of a GDK version?

Diggsey
15
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 23rd Aug 2010 01:04 Edited at: 23rd Aug 2010 01:05
@CresCo
If you mean convert a bitmap to a number of collision shapes, you can either do it by hand when you make the bitmap, or you could try using something like this: http://vectormagic.com/home and then convert that to usable information.

As an alternative, you could do this:
- Imagine a square containing the image
- Divide the square into four smaller squares
- For each square, detect if all the pixels inside that square are solid
- If any pixels are not solid, and the square is larger than a single (or a few) pixels, divide this square into four smaller squares and repeat for each of these

Create an actual collision shape whenever you stop sub-dividing a square.

@laptop battery
You can use the C++ Box2D library directly from GDK so this plugin is not needed.

[b]
knxrb
FPSC Tool Maker
12
Years of Service
User Offline
Joined: 10th Oct 2008
Location: United Kingdom
Posted: 23rd Aug 2010 05:42 Edited at: 23rd Aug 2010 05:46
What about a DarkGDK.Net version or is there already a way of using Box2D in VB.Net with DarkGDK.Net sprites?
I would buy it if it's possible to use in VB.Net with DarkGDK.Net.

knxrb

Login to post a reply

Server time is: 2021-06-21 17:16:07
Your offset time is: 2021-06-21 17:16:07