Code center > Darwinbots3

2D or 3D?

(1/7) > >>

Cyberduke:
Hi, getting interested in this now, I have spend a good few hours now reading though the wiki and the forum for DB3 and I assumed it was going to be 2D but in the wiki it talks about a 3D simulation and plants with roots etc?

What is the current expectation for the physics simulation? And how advanced will it be?
The last time I played about with physics in a game each object in the world was approximated with a small collection of a primitive AABB  ridged body’s with an Octree for spatial partitioning as used in the broad phase collision detection. Then you can go crazy with what it actually looks like later on when rendering in the client (it was a networked game).  Though it would be cool to have a cell approximated as an OBB Polyhedron then it could really change shape and to join two cells you would pick the nearest face on each cell and join up the 6 vertexes.

As for digging, I have seen the fully destructible world demos but I wouldn’t know how to implement an ant digging a tunnel without creating the ground/wall from lots of smaller ‘blocks’ that can be excavated/destroyed.

2D would be simpler, by not a lot in any one area just overall, mainly it’s a little bit simpler and quicker for graphics (lots of objects onscreen), Collision detection, Quad tree instead of Octree.
Having said that 3D would be cool, but you have just given yourself a load of UI issues as I found out with my space RTS, you’re forced into coming up with some really innovative control schemes just to keep the UI usable if its not FPS based.

Numsgil:
I was playing around with the idea of 3D at some point, but I abandoned it when I couldn't think of a decent way to present it to the user or the bots.  The technical challenges aren't hard, it's more a UI and DNA thing.

The physics... this is complicated.  I've been back and forth trying to decide between using an existing library and building my own.  Most existing libraries don't quite work like I want them to.  I understand most of the basics of physics engines so it's tempting to build my own, but things like joints can be confusing and deal with a level of math I never learned (Jacobian matrices).  The bots themselves will be represented in physics by capsules: essentially two half circles of potentially different radii joined by a quad.  Or two full circles joined by a quad.  Same thing really.

Digging would probably be done with lots of smaller blocks, yeah.  Maybe individual pixels even.  Or maybe something that isn't square: have a hex grid for digging.

Cyberduke:
I thought chipmunk was the undisputed current flavour of the day in regards to 2D physics libraries I think I have seen an XNA port floating about somewhere too. From the demos I have seen it should be able to handle 2000 objects with ease, say a 1000 for cells and a 800 for clutter/structure in the environment and 200 for projectiles. I have only played about with 3D physics libraries and my own very basic 2D physics before though.

Numsgil:
Chipmunk was one of the first I played with.  I was initially impressed but something turned me off, I don't remember what (this would be over a year ago, so it's probably evolved since then).  I think it was stacking.  My expectations for stable stacking are probably too high.  I briefly left some comments in their forum I think, so maybe I can go back and figure out what my issue was.

At another point I played with building a .Net wrapper around Box2D (Eric Catto's C++ library that Chipmunk is loosely based on, IIRC).  Something turned me off this path, too.  Might have been stacking again, but I can't remember.  It also wouldn't have been XBox friendly (no unmanaged code allowed).

Then I spent about 8 months off and on (mostly on) playing with the idea of a non step based physics engine.  Basically I'd calculate exact times of impact for all collisions projected indefinitely in to the future.  It works pretty well for circles moving without drag (involves solving some quartics), but anything more complicated is difficult to impossible with present technology (a great deal of original research would need to be done.  It's probably a masters or PhD thesis amount of work.)

So now I'm back full circle to thinking about a premade library.  It needs to be all done in .NET so that I can load it on to my XBox, which leads back to Chipmunk probably.

BTW, it's nice to have someone else who's physics knowledgeable.  When I started with Darwinbots I knew absolutely nothing about physics (my first big breakthrough was realizing you didn't need a square root to compare distances between points with other distances between points.  And using vectors was big, too.)  That was maybe 4 years ago or more, and I've learned a lot, but I'm still just playing it by ear.

ah, I figured it out.  Chipmunk isn't native .NET, so you need either a port or a wrapper for it to work.  I got part way through a wrapper, then got frustrated and went to build my own.  Then got frustrated and went to Box2D for some reason and built another partway wrapper.  Then got frustrated and went to build my own again, then got frustrated and here we are.

Cyberduke:
Well ok let’s try listing all the 2D managed physics libraries we can find then go though each one and review it.
Starting with...
http://www.codeplex.com/Wiki/View.aspx?Pro...=FarseerPhysics
http://physics2d.googlepages.com/
My quad tree used the geometry from Physics2D.net (again with its roots in Box2D)

Ideally it would be good to have the physics as a completely separate module that could be swapped out for another one on a whim. That way you could play-test them all

Also in regards to stacking, I don't think I have ever seen a physics engine do it perfectly. it's normally a matter of playing about with the parameters until you get something you can live with.

Navigation

[0] Message Index

[#] Next page

Go to full version