Jump to content

Physics has me stuck


Rick
 Share

Recommended Posts

The physics performance is so bad when compared to LE 2 that I feel like I'm stuck. In my little challenge scene I'm getting 10-20fps which makes the controller zoom around sometimes and normal speed others. I'm flying through large CSG objects even. How can the performance be this bad in LE3 vs LE2? I have the exact same PC and it's so much worse with way more unreliable physics. I just don't get it, but I feel like something has to be done with this.

  • Upvote 2
Link to comment
Share on other sites

If you don't post an example, preferably with source code so i can debug it, there's nothing for me to respond to. The physics in Leadwerks 3 should be quite a bit faster than Leadwerks 2.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Here is a test I did earlier for both Leadwerks 2 and Leadwerks 3 (Lua source code for both included).

 

The results speak for themselves.

 

Le2: 1000 boxes. lowest FPS: 34

Le3: 150 boxes. lowest FPS: 2 (plus occasional crash of the program)

 

 

 

  • Upvote 6
Link to comment
Share on other sites

So my machine isn't as powerful as Aggror's BUT:

 

LE2: I get a solid 45fps and it's smooth for about 30 seconds. Eventually, it bogs down to 3 fps or so and gets very choppy. This is after hundreds of boxes have fallen though.

 

LE3: It takes literally 3 seconds before the entire thing freezes on me. Right when a couple start hitting the ground all hell breaks loose.

 

 

I hope this is a clear example as to the horrible physics performance between the 2 engines.

  • Upvote 1
Link to comment
Share on other sites

How many times per second are you checking and updating?

 

This should have no impact. In my setup I have 1000 physics updates per second, with 25, 40 or 50 "major updates" spaced evenly... It was just as smooth as when I was using 25, 40 or 50 steps per second, but it now produces the same results whatever the update rate is.

 

My advice to anyone having trouble using the integrated physics engine is, provided you're using the C++ interface, ignore it and use any physics library of your choice. Seriously, the fact I could do it speaks volumes of how easy it is...

LE Version: 2.50 (Eventually)

Link to comment
Share on other sites

My advice to anyone having trouble using the integrated physics engine is, provided you're using the C++ interface, ignore it and use any physics library of your choice.

Not everyone will have that skill. Even if you could integrate a different physics engine, you have all these editor options, navmesh etc that is no longer working.

 

Newton3 is good enough for almost everyone, but there has to be something wrong with the integration here.

Link to comment
Share on other sites

My advice to anyone having trouble using the integrated physics engine is, provided you're using the C++ interface, ignore it and use any physics library of your choice.

 

Thanks for 3D artists and non core eprogrammers blink.png (eve, if i dream of Bullet Physics or Nvidia Physix)

 

 

LE 2 test :

90 FPS at beginning, some boxes droppinf

17 FPS near 1000 Boxes when last boxes are falling

When all box dropped adn stable on floor : 47-50 FPS

 

 

LE3 test:

50 FPS beginning :some boxes falling (Yes even some 20 boxes or some more at beginning and LE3 already shows a huge visible slowdown to 15-10 FPS)

0,6 FPS when last boxes falling

50 FPS when all are dropped and stable on floor

 

 

I can't imagine in LE3 a real game with level, character, particles, shaders and that boxes physics you could gameplay physics shoot how low would be frame rate.

Stop toying and make games

Link to comment
Share on other sites

I added bullet to LE3 just to see how hard it was. It took me 30 minutes to figure out how to compile the lib in a LE3 project, and additional 15 minutes to collide one sphere on ground. (using the hello world example on their wiki.)

 

Very cool picture : (ground was invisible and I used a box as my sphere, but it fell 50m to the ground) smile.png

 

bullet.jpg

 

 

To cover all aspects of physics bullet provides it would probably take weeks/months of programming making tools etc.. ( I don't know) to change physics engine, however bullet have many examples in their api, from cars to ragdolls etc.. not going anywhere with this, but if you really want to, you can yourself smile.png

 

Pretty sure Newton is a decent lib, but probably needs some optimizing.

  • Upvote 1

HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB

Link to comment
Share on other sites

not going anywhere with this, but if you really want to, you can yourself

No thanks. should be a complete kickstarter project done by some thrid party guy for Leadwerks 3.

But even actually there is so much stuff that is missing with newton : car, clothes, ineteractive clothes , physic axis constraints, different joints ...

It could be better to change engine now as LE3 is just basically integrated ?

(Even Nvidia not only Bullet is good on some other engines; just seeing games that are made using it)

Stop toying and make games

Link to comment
Share on other sites

It's quite possible something is set up incorrectly and causing low performance. Whatever it is, I will find it. Next week I get to start doing nothing but programming. I am really looking forward to it.

  • Upvote 4

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

If you upgrade to Newton 3.10 you get slightly better fps and abit more boxes. (from what I could test, fps drops o about 200 boxes instead of 150)

 

Maybe it's just circumstantial, but if you want to try yourself :

 

1. Download 3.10 here : http://code.google.com/p/newton-dynamics/downloads/list

2. Backup contents of : C:\Leadwerks\Engine\Source\Libraries\NewtonDynamics

3. Unrar 3.10 here

4. Recompile your project.

HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB

Link to comment
Share on other sites

Here's something you can do right now to test it:

http://newtondynamics.com/wiki/index.php5?title=NewtonSetSolverModel

 

In Leadwerks 2, the default setting is 1. In Leadwerks 3, the default setting is currently 0. To adjust this, use this code:

World* world = World::Create()
NewtonSetSolverModel(((NewtonDynamicsSimulation*)world->simulation)->newtonworld,1)

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

My game is in Lua, so I added the following line of code at the bottom of the App:Start() in C++ after it calls Lua's App:Start() (since that's what creates the world).

 

NewtonSetSolverModel(((NewtonDynamicsSimulation*)World::GetCurrent()->simulation)->newtonworld, 1);

 

 

This didn't make any difference that I could see in my game.

Link to comment
Share on other sites

And C++ don't helps to speed up engine sad.png

(just kidding as Lua user mainly)

 

But im' not so wrong, if some stuff is slow or not that fast, you can have C++ it won't make it.

If another engine uses Lua, but all GUI, Physics are fully optimized and fast, indeed at the end, the game will be faster in that one than the other C++ with problematic physic component integration.

 

As i will stay with simple characters in LE3 for the moment, it's ok, but if i use more physics indeed i'll be in your not so good same position laugh.png with engine and physics

Stop toying and make games

Link to comment
Share on other sites

@YouGroove This issue has nothing to do with simple/complex characters. Via the cubes dropping test ANY physics is much much slower in LE 3 and it will affect any game made in LE 3 that uses physics at all.

Link to comment
Share on other sites

I am fairly confident that code above will increase the speed of the falling boxes program. I cannot debug your specific application because you have not posted anything.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

We can ask Agrorr if he has time to implement that code in the LE3 Exe test he posted ?

Perhaps it will change the physic speed.

 

Newton 3 sweept collision don't work well in one example test i have, putting that setting, will speed up physics perhaps, but will make sweept collision working more bad also ?

 

Well this is tests to make.

Stop toying and make games

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...