Page 1 of 1

Dinosaur behaviour problem

Posted: Fri Dec 13, 2019 11:47 pm
by wanghongliang
Hi, Norbo, thanks for your amazing work on BEPU 2! I am developing a game in which many dinosaurs are wandering around,their movements are guided by A-star algorithm,and these dinosaurs can collide with each other. When no collision
happens, the positions and orientations are determined by A-star algorithm, but when they collide,the positions and orientations should be modified by BEPU 2 physics engine,how can I do that? Any help would be greatly appreciated!

Re: Dinosaur behaviour problem

Posted: Sat Dec 14, 2019 12:19 am
by Norbo
The easiest thing to do would be to have the dinosaurs modeled by a character controller (like the one in the demos), and use A* to set the character controller's target velocity. No transition between A* control and physical control required- it's always both.

If for some reason using a physical representation before collision isn't possible, then things get a little tedious- you'd need some form of collision detection to determine when the transition would occur. You could put a kinematic body in the simulation with narrow phase callbacks configured to not emit constraints for them and, when they detect collisions, create a dynamic character but... that would be quite a bit more complex.

Re: Dinosaur behaviour problem

Posted: Sat Dec 14, 2019 12:44 am
by wanghongliang
Thank you, you are so warm-hearted! I will have a try according to your guidance.By the way, since .net core 3.0 is
out for a while, when would you port BEPU 2 to .net core 3.0 and improve BEPU math library by using System.Runtime.
Intrinsics API?

Re: Dinosaur behaviour problem

Posted: Sat Dec 14, 2019 1:15 am
by Norbo
Hard to say- there are some compatibility concerns: https://github.com/bepu/bepuphysics2/issues/80

At this point, the only way to do it without disruption would be to support both (likely with some kind of codegen). That isn't terribly quick and I've got quite a bit of other stuff that takes priority for now, so I'm sorta punting the problem down the line in hopes that .NET 5 helps, or maybe something clever with source generators...

Re: Dinosaur behaviour problem

Posted: Sat Dec 14, 2019 1:47 am
by wanghongliang
Thanks,I hope BEPU 2 will be a superstar in c# game programming world!

Re: Dinosaur behaviour problem

Posted: Sat Dec 14, 2019 7:53 pm
by Norbo
Thanks,I hope BEPU 2 will be a superstar in c# game programming world!
:*