Jump to content

  • Log In with Google      Sign In   
  • Create Account


Physics engine or DIY?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
12 replies to this topic

#1 RobMaddison   Members   -  Reputation: 640

Like
1Likes
Like

Posted 15 October 2013 - 01:53 PM

With physics engines like bullet, can you apply your own calculations to the resulting positions of rigid bodies, etc? My game is loosely based around snowboarding and whilst I'm sure I could easily model a board to slide down a slope, it might get a lot more complex when you consider the fact that being on an edge will have different physics properties to being flat on the snow.

For a few days I've been weighing up the pros and cons of doing my own physics or using something like bullet. If I do my own, obviously it'll get pretty complex but if I can't model different parts of the snowboard in a middleware physics engine I might have to consider my own cut down version.

Any thoughts?

Sponsor:

#2 Madhed   Crossbones+   -  Reputation: 2493

Like
5Likes
Like

Posted 15 October 2013 - 02:16 PM

I'd say use an existing one. You can always add special physics handling! The big engines out there are far more optimized than you would be able to in a sensible timeframe.



#3 Shane C   Crossbones+   -  Reputation: 1103

Like
0Likes
Like

Posted 15 October 2013 - 02:24 PM

I'd say use an existing one. You can always add special physics handling! The big engines out there are far more optimized than you would be able to in a sensible timeframe.


If it matters, I completely agree with him. The existing ones seem to be quite good.

Or maybe I just agree with him because I'm rather technology focused and can't see a custom made beating some of the other ones.

#4 RobMaddison   Members   -  Reputation: 640

Like
0Likes
Like

Posted 15 October 2013 - 02:41 PM

Thanks guys - I'm all for using existing middleware, as long it can be tailored to how I want my objects to act/react.

Bullet looks pretty good to me, although I've read that documentation isn't as good as it could be - the PDF manual did seem to be "look at the example and work it out for yourself" - which is ok I guess...

#5 Buster2000   Members   -  Reputation: 1418

Like
1Likes
Like

Posted 16 October 2013 - 01:39 AM

If you have a game idea (your snowboarding game) then use an engine.  You can achieve the affect you want by applying different forces on the board.

 

I'd only recommend writing a Physics engine from scratch if you wanted to do it as a learning excercise.



#6 RobMaddison   Members   -  Reputation: 640

Like
0Likes
Like

Posted 16 October 2013 - 04:38 AM

Just tried to build the latest version of Bullet in Visual Studio 2005 (v8) and I've got lots of errors where it's trying to include 'pmmintrin.h'.  According to some research, this is a file from a more recent version of Visual Studio.  I was wondering if anyone had built Bullet on VS2005?  Or should I upgrade to VS2012?

 

I'm sticking with DX9 at the moment as I don't want to concentrate a lot of time upgrading, so it would be good if I can get Bullet working with VS2005 if possible.  Probably need to post on the bullet forum but thought I'd check here first..



#7 xexuxjy   Members   -  Reputation: 561

Like
1Likes
Like

Posted 16 October 2013 - 05:26 AM

Did you use the vs2005.bat build file to generate your project? haven't tried that one for a while, but it should be valid.



#8 Waterlimon   Crossbones+   -  Reputation: 2361

Like
0Likes
Like

Posted 16 October 2013 - 07:18 AM

You should upgrade to a more recent version, VS2005 is old and lacks a lot of stuff (improved optimization, C++11 features...)


Waterlimon (imagine this is handwritten please)


#9 Hodgman   Moderators   -  Reputation: 27647

Like
0Likes
Like

Posted 16 October 2013 - 07:28 AM


Thanks guys - I'm all for using existing middleware, as long it can be tailored to how I want my objects to act/react.
I'm working on a racing game with realistic racing car physics that's all custom written, however I still use off the shelf physics engines for everything except for the tyres/sprints/aerodynamics wink.png The rigid body simulation and collision detection frameworks from existing engines are still extremely handy, meaning I just have to add some extra forces into the sim and it all works out of the box.

#10 RobMaddison   Members   -  Reputation: 640

Like
0Likes
Like

Posted 16 October 2013 - 08:52 AM

You should upgrade to a more recent version, VS2005 is old and lacks a lot of stuff (improved optimization, C++11 features...)

 

I'm just getting VS2008 and will upgrade to that.  Didn't like the look of VS2012 at all

 

 

Did you use the vs2005.bat build file to generate your project? haven't tried that one for a while, but it should be valid.

 

I just saw it now, I thought the cmake may have been enough, I'll give it a go, thanks



#11 OandO   Members   -  Reputation: 675

Like
0Likes
Like

Posted 17 October 2013 - 10:11 AM

I'm working on a racing game with realistic racing car physics that's all custom written, however I still use off the shelf physics engines for everything except for the tyres/sprints/aerodynamics wink.png The rigid body simulation and collision detection frameworks from existing engines are still extremely handy, meaning I just have to add some extra forces into the sim and it all works out of the box.

 

Do you mind if I briefly hijack this thread to ask what sort of collision resolution methods work well for racing games? Particularly given you need incredibly smooth movement over terrain...



#12 Madhed   Crossbones+   -  Reputation: 2493

Like
1Likes
Like

Posted 19 October 2013 - 06:22 AM


Do you mind if I briefly hijack this thread to ask what sort of collision resolution methods work well for racing games? Particularly given you need incredibly smooth movement over terrain...

 

I don't know about Hodgman's approach, but the most widely used and easiest to implement seems to be the raycasting model. Shoot a ray from the wheel hub downwards to find the contact point, compute forces based on the suspension spring/dampening, steering, wheel rpm, slip angle, tire model, etc. you can get as crazy as you like. 



#13 Hodgman   Moderators   -  Reputation: 27647

Like
1Likes
Like

Posted 19 October 2013 - 07:26 AM

Sorry I forgot to reply, but yeah, what Madhed said ^^^ biggrin.png

 

I use a trimesh for the race track, even though curves would be ideal, just because the art packages and the physics middleware support them. In areas where the slope of the track changes, if you use a decent number of polygons then it feels smooth.

 

The body of the car itself is a regular rigid body as supported by the physics middleware. The results of the raycasting are used to do all the wheel/tyre/suspension/transmission/engine/etc calculations, which then apply forces to the body. Soft tyres and suspension will absorb the small bumps from the trimesh, just like in real life wink.png If your tri-mesh is too bumpy though, it also affects the handling/traction of the car though, also just like real life.


Edited by Hodgman, 19 October 2013 - 07:29 AM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS