Dinosaur behaviour problem

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
wanghongliang
Posts: 8
Joined: Sun May 05, 2019 2:01 pm

Dinosaur behaviour problem

Post by wanghongliang » Fri Dec 13, 2019 11:47 pm

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!

Norbo
Site Admin
Posts: 4852
Joined: Tue Jul 04, 2006 4:45 am

Re: Dinosaur behaviour problem

Post by Norbo » Sat Dec 14, 2019 12:19 am

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.

wanghongliang
Posts: 8
Joined: Sun May 05, 2019 2:01 pm

Re: Dinosaur behaviour problem

Post by wanghongliang » Sat Dec 14, 2019 12:44 am

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?

Norbo
Site Admin
Posts: 4852
Joined: Tue Jul 04, 2006 4:45 am

Re: Dinosaur behaviour problem

Post by Norbo » Sat Dec 14, 2019 1:15 am

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...

wanghongliang
Posts: 8
Joined: Sun May 05, 2019 2:01 pm

Re: Dinosaur behaviour problem

Post by wanghongliang » Sat Dec 14, 2019 1:47 am

Thanks,I hope BEPU 2 will be a superstar in c# game programming world!

Norbo
Site Admin
Posts: 4852
Joined: Tue Jul 04, 2006 4:45 am

Re: Dinosaur behaviour problem

Post by Norbo » Sat Dec 14, 2019 7:53 pm

Thanks,I hope BEPU 2 will be a superstar in c# game programming world!
:*

Post Reply