Bullet C4 Engine win32 Demo * updated v0.4

Show what you made with Bullet Physics SDK: Games, Demos, Integrations with a graphics engine, modeler or any other application
Post Reply
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Bullet C4 Engine win32 Demo * updated v0.4

Post by Erwin Coumans »

Bullet C4 Physics Win32 Demo

Download BulletC4 for Bullet 2.23 and C4 version 129 here. This link includes a win32 executable and full source code for embedding Bullet (still requires Bullet 2.23 and C4 sources).

It features real-time simulation with interpolation of the worldtransforms for smaller timesteps

Usage: Start C4.exe, Start New Game, Start
Mouse buttons to interact, A,W,D keys to navigate, escape to toggle menu

Source Code:
The integration source code is in the Game Code folder.
Download and feedback on the Bullet open source library at http://bullet.sf.net

Thanks to Steve 'flashjackson' Montgomery for the integration help, and Eric Lengyel for the C4 engine.

Erwin Coumans
http://bullet.sf.net
Last edited by Erwin Coumans on Mon Nov 20, 2006 4:45 pm, edited 4 times in total.
calli
Posts: 34
Joined: Tue Jul 12, 2005 1:15 pm

Post by calli »

Whoho. FUN ;-)

More Weapons please ;-)

Where are the servers, is MP already working?

Carsten
JamesH
Posts: 19
Joined: Mon Oct 16, 2006 6:19 pm

Post by JamesH »

The C4 demo is built on top of build 128 of the C4 engine. This build has multiplayer functionality built in, it works well over the LAN and we have had some success over the Internet as you can see here (19.5Mb). I would imagine that the physics code does not work yet over multiplayer.

Build 129 due in the next week or so should finish off the main core multplayer functionality. A roadmap can be seen here
Gauntlet
Posts: 1
Joined: Thu Sep 14, 2006 7:46 pm
Location: Austria

Post by Gauntlet »

Thanks Erwin! That was a really short time you needed to implement it :)
I really like Bullet and will stick with it quite surelly, so your C4 integretation came really handy - especially since I'm not that that familiar with Bullet until now, though I hope to catch up as fast as possible.

The demo worlds are really cool. I hope to also get some nice code running soon.

Gauntlet
btanner
Posts: 5
Joined: Sun Nov 19, 2006 10:53 pm

Building on a Mac

Post by btanner »

Edit: The next part of this post is largely irrelevant because I think I solved the problem. In BulletC4MotionState.cpp and .h, the method: getWorldTransform should be const! A-ha!

Hi Erwin. I've been trawling the forums here and on C4 for the last few days deciding on whether to take the plunge... and I did. The decision was partially based on how friendly and helpful you and Eric seem to be :P

I am trying to use your integration with C4 in order to build an artificial intelligence simulator for some research I'm working on.

Anyways, I naively included the new files from the BulletC4Physics directory of your integration demo. I then replaced replaced the MGWeapons.cpp and MGGame.cpp from my project with yours files.

Finally, I pointed XCode to the source directory from a *newer* download of bullet (2.32 is the distribution I have, but the integration I downloaded is from 2.23). I have an error when compiling.

It doesn't like you doing:
btMotionState* motionState = new BulletC4MotionState(node,centerOfMassOffset);

inside

void BulletPhysicsMgr::AddObjects(World *theWorld)

It's not happy about you doing that because BulletC4MotionState has not implemented:
virtual void getWorldTransform(btTransform& worldTrans);

virtual void setWorldTransform(const btTransform& worldTrans);

I'm too new with C4 and Bullet to know why this has happened. I clearly understand the problem, just not why it exists... seems like you would have had trouble compiling too. The only thing I can think of is that these weren't pure virtual in btMotionState in a previous release?

Anyways, any suggestions?

Also: when I get past the compile stage and have to link this is going to explode. Do you know exactly what I need to link to in the Bullet distribution. It was nice of your to provide a VC++ project, but I'm working with Mac build libraries and XCode, so it's too different for me to know.

Thanks in advance!

Update: Somehow, I managed to get it compiled and linked. The Bullet 1 and Bullet 2 demos ran fast! I was really excited to run the PhysX demo, but the gravity controls didn't seem to work and the objects seemed really heavy... I could hardly move them around with my rocket launcher. What gives?
btanner
Posts: 5
Joined: Sun Nov 19, 2006 10:53 pm

Last question of the evening

Post by btanner »

At the risk of wearing out my welcome... I'm going to ask more questions.

How did you put bulletphysicscontrollers on the objects in the map in the bullettest world. When I add new objects, they do not fall :(

Thanks in advance!

-Brian
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: Last question of the evening

Post by Erwin Coumans »

btanner wrote:At the risk of wearing out my welcome... I'm going to ask more questions.

How did you put bulletphysicscontrollers on the objects in the map in the bullettest world. When I add new objects, they do not fall :(

Thanks in advance!

-Brian
Latest Bullet integration is compatible with both Newton and PhysX C4-integrations. One method is to open the world in the world editor, and assign a Physics Controller to the node. You can ask more details how to do this, on the C4 forums.

Thanks,
Erwin
btanner
Posts: 5
Joined: Sun Nov 19, 2006 10:53 pm

Thanks Erwin

Post by btanner »

I'm new to both the bullet and C4 communities, and I'm not sure yet what the general behavior/strategy is within these groups. I'm taking your physics integration and running with it. I could just keep it to myself... but if I make improvements or fix bugs (or run into what I think are bugs), is there a place I could post about it... or ... something?

For example, if you load, unload, load a bullettest map from the console, it crashed my C4. The destroy method didn't have a null pointer check, and I think it was getting called multiple times, once when the world was unloaded and again when a new game was started.

Does anyone care about these types of fixes? Also... when you release a new integration, shall I just start over with your new code?

I realize this C4 integration is not your top priority... just wondering if there is a plan to run the integration as a persistent project (perhaps on the C4 site), or an ever improving demo.

Cheers.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: Thanks Erwin

Post by Erwin Coumans »

btanner wrote:I'm new to both the bullet and C4 communities, and I'm not sure yet what the general behavior/strategy is within these groups. I'm taking your physics integration and running with it. I could just keep it to myself... but if I make improvements or fix bugs (or run into what I think are bugs), is there a place I could post about it... or ... something?

For example, if you load, unload, load a bullettest map from the console, it crashed my C4. The destroy method didn't have a null pointer check, and I think it was getting called multiple times, once when the world was unloaded and again when a new game was started.
Your contribution/help is welcome, preferably on this forum if it is Bullet specific.
Does anyone care about these types of fixes? Also... when you release a new integration, shall I just start over with your new code?
I realize this C4 integration is not your top priority... just wondering if there is a plan to run the integration as a persistent project (perhaps on the C4 site), or an ever improving demo.
Cheers.
I definately care about your fixes. Eric, the C4 developer wants to make some more unified physics-integration. I want to help him with COLLADA Physics. So hopefully things stabilize on the C4 side of things.

It's a bit early to see where things lead, but for now, C4 is a very nice Bullet testbed.

Would you have some time to help with documenting Bullet integration on the C4 wiki?

Thanks,
Erwin
btanner
Posts: 5
Joined: Sun Nov 19, 2006 10:53 pm

Help Documenting

Post by btanner »

I can make time to help. Documenting the integration would be very useful for me, because I want to really understand things so that I can develop my research platform.

Not quite sure what the general form of the wiki article would take... whether it would be more like general documentation or like a tutorial, or perhaps both. I suppose the tutorial side of things could be small because you can just drop in the new files and add the appropriate libraries and headers to the project.

Anyways, just keep me posted on what you're thinking about for the wiki, and how I might help...
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: Help Documenting

Post by Erwin Coumans »

There are 2 forms of documentation that will be useful:

- Game Editing using Bullet-C4
- Coding: Bullet-C4 code integration

Game Editing would be the best start I think. You can just point to the download for the binary dll's. I can provide both Win32 and Mac OS X versions of Bullet for C4. There is some PhysX Game Editing, that you can re-use. In the next version, I will add constraint binding, similar to PhysX-C4. I think its based on properties.

Game Editing using Bullet C4 is also compatible with most Newton C4 integration: this is based on PhysicsController.

It would be good to document

1) how to create basic shapes:
primitives: sphere, cylinder, cone, box,
meshes: static triangle mesh and dynamic convex mesh (COLLADA import)

2) How to assign mass to rigidbody, to distiguish static (mass = 0), and dynamic/moving

3) debugging console commands like pdebug, pshot etc.

Thanks,
Erwin
btanner
Posts: 5
Joined: Sun Nov 19, 2006 10:53 pm

Sounds great

Post by btanner »

Sounds good, but perhaps I should wait a bit before I volunteer to jump right in. I started working with C4 and Bullet on Sunday, and I'm unfamiliar with most of the things you mentioned.

Perhaps I should read the Newton integration tutorial on the C4 site to learn a bit more about how the physics engine interacts with the game engine.

I also don't know how to do 1, 2, or 3. For now, that list gives me a good todo list for what I look into.

Edit: Ok, so I read over the Newton integration guide and I formalized a lot of intuition I had about the Bullet integration. Seems like you and Steve just ported the Newton integration to Bullet (or vice versa), which is cool. I don't quite know if for 1+2 you meant just how to set these things up in the World Editor (Which seems pretty easy), or doing it programatically. The former is really easy, the latter I don't quite know how to do yet, working on it. I'll come back and post more if I find out something useful in my playing.

Right now, with the integration, if you try and attach a physicsbodycontroller with mass=0 (static right?) in the "Lasers" map, it works fine. IF you try and make it dynamic, the shape sortof warps way off the screen (set bullettime very low to see it). I'm not sure why that is.
Post Reply