Jump to content
  • Advertisement
Sign in to follow this  
luasitdown

I want do a micor physics engine

This topic is 4526 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I heard of advanced mathematics (differential intergrals linear algebra)is not used in game development except physics. Is that true? and I also wanna know if there are common lib for solving system of equations? Or must I write different arithmetic code for different circs though the system of equations maybe similar?

Share this post


Link to post
Share on other sites
Advertisement
Advanced math is used elsewhere in games, apart from physics. For example, in some advanced lighting/illumination techniques. (You could categorize lighting/illumination as physics, but I don't think that's what you meant.) Some games implement adaptive geometry for level-of-detail, using techniques such as subdivision and B-spline surfaces. These too have a basis in advanced math. The list goes on.

There certainly are some standard libraries that you can use, such as lapack (freeware), and various commercial libraries (IMSL, NAG). With lapack, you'd have a fighting change of porting it to various consoles. Some of the real-time physics engines, such as Ageia's PhysX SDK, come with a separate utility/math library, but often the math library won't be as comprehensive as lapack, etc.

You could also look at Dave Eberly's Wild Magic toolset, which has a VERY nice and comprehensive set of capabilities, for geometry, physics, and general equation solving. Dave keeps the code up-to-date, with updates approximately on a weekly basis. And, it is free in source code form (but read the license agreement carefully!) Highly recommended.

Geometric Tools: Source Code

(Dave's company is called Geometric Tools, hence the website name.)

Share this post


Link to post
Share on other sites
just for curious:
Do the popular game on market use these 3rd part standard linear algebra lib or make it by themself?

which way is more popular?

Share this post


Link to post
Share on other sites
Most gaming companies re-invent the wheel just because of the "Not Developed Here" syndrome; if there's a bug, flaw, discrepency in a library they've went to someone else for, then they have to go through a lot of bullshit (contacting the company, seeing if they will make a fix, patching it themselves, making sure the patch works with their patch, etc etc). It's easier to roll your own and actively maintain the code if you're going to write a lot of games with it.

But, for indie purposes, I would _not_ recommend writing your own, simply because of the amount of work that goes into those engines, and the amount of mathematics that has to be proved behind it. It's much easier to grab someone else's open source code and learn it well. And once you have the principals of how someone else's system works, it's not too hard to move your code over to another engine or to write your own at some future date.

Share this post


Link to post
Share on other sites
I agree with ciroknight. Libraries are still re-invented more often than not, and not always for good reason. Look for good code, such as Eberly's Wild Magic code (Geometric Tools) and use it when you can. Saves a whole, whole lot of time and, if you're commercial, money.

Even for larger studios, writing your own code doesn't necessarily make it easier or cheaper to maintain. Well-written open-source or commercial libraries often provide you with clean source code that is intuitive, often as easy to tweak/fix/enhance as working with your own code.

One difficulty is integrating someone's math library into a game engine that is not built around the math library. Often the game engine will define things such as vector and matrix, in a way that isn't directly compatible with a third party math library such as Wild Magic or lapack or whatever. A decision to use a particular math library can often be heavily tied to the decision of which engine to use. My personal preference is to choose a matched pair. We have used the NetImmerse/Gamebryo commercial engine for projects, and have also used the Delta3D engine, which is based on OpenSceneGraph that has its own nicely-implemented math components. I have also experimented with Wild Magic, another excellent (and free) choice of a combo game engine/math library.

Dealing with physics, AI, audio...adds a level of complexity. If I use Gamebryo (which has its own vector/math stuff) for rendering, then want to integrate NovodeX or ODE physics....then I have to deal with writing glue code to hook the different libraries together, since they are built around different implementations of the same basic data structures. Some engines provide glue code for you, but you often end up picking a complete suite of components, and you may be tying yourself to not just one vendor, but a handful of specific vendors.....I encourage the use of middleware/freeware, but there is this major issue.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by grhodes_at_work
Dealing with physics, AI, audio...adds a level of complexity. If I use Gamebryo (which has its own vector/math stuff) for rendering, then want to integrate NovodeX or ODE physics....then I have to deal with writing glue code to hook the different libraries together, since they are built around different implementations of the same basic data structures. Some engines provide glue code for you, but you often end up picking a complete suite of components, and you may be tying yourself to not just one vendor, but a handful of specific vendors.....I encourage the use of middleware/freeware, but there is this major issue.

This is why I if I ever use middleware I try to use those that are as data less as possible.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!