Comments (7)
The sponsors AI also relied on the newts being around to provide nonzero movement influence; if they reach the final target, there will be a divide by zero. Went ahead and guarded against it in 22dac46.
from bepuphysics2.
Final I found is postmetric
is NaN, because of NaN of child
(Max
and Min
are all NaN) in below code:
struct Tree
{
unsafe float RefitAndMeasure(ref NodeChild child)
}
from bepuphysics2.
In the CharacterDemo? Could you provide the modified version that reproduces the problem?
from bepuphysics2.
new 1000 SponsorCharacterAI
in Demos.Demos.Characters.CharacterDemo
, like below
const int characterCount = 1000;
characterAIs = new QuickList<SponsorCharacterAI>(characterCount, BufferPool);
var characterCollidable = Simulation.Shapes.Add(new Capsule(0.5f, 1f));
for (int i = 0; i < characterCount; ++i)
{
var position2D = newtArenaMin + (newtArenaMax - newtArenaMin) * new Vector2(random.NextSingle(), random.NextSingle());
var targetPosition = 0.5f * (newtArenaMin + (newtArenaMax - newtArenaMin) * new Vector2(random.NextSingle(), random.NextSingle()));
characterAIs.AllocateUnsafely() = new SponsorCharacterAI(characterControllers, characterCollidable, new Vector3(position2D.X, 5, position2D.Y), targetPosition);
}
from bepuphysics2.
Just adding a bunch of characters like that doesn't reproduce a crash after about an hour of idling. Attempting to update them does if there are no newts, because SponsorCharacterAI
expects a nonzero number of newts, but that should be a pretty instantaneous crash.
What other changes were made to the CharacterDemo
, if any? And is this using the latest master version?
from bepuphysics2.
Comment code associated with newt
like below, and remove spooked condition let it jump sometimes:
//for (int i = 0; i < newts.Count; ++i)
//{
// ref var newtPosition = ref simulation.Bodies[newts[i].BodyHandle].Pose.Position;
// var offset = newtPosition - body.Pose.Position;
// var distance = offset.Length();
// if (distance > 1e-10f)
// {
// var influenceMagnitude = 1f / (distance * 0.1f + .1f);
// influenceSum -= new Vector2(offset.X, offset.Z) * influenceMagnitude / distance;
// }
// if (distance < 20)
// {
// spooked = true;
// }
//}
////We want target position relative influence to be consistent regardless of newt count.
//influenceSum /= newts.Count;
then CharacterAI will move and jump.
I has tested in the master code and v2.4.0, have the same exception.
from bepuphysics2.
Thanks reply.
I have tested for a long time and not exception, it look work well.
from bepuphysics2.
Related Issues (20)
- Consider incremental tree refines on insertion HOT 1
- Instability caused by ApplyImpulse HOT 1
- Tree metanodes contain obsolete data
- Regressions on 16-wide vectors HOT 1
- Consider `Compound` vs `BigCompound` heuristic helper
- Building convex hull fails for a specific mesh (.obj included) and results in memory corruption HOT 5
- Risky stackallocs
- Spin/Friction Issues with the Character Demo HOT 2
- Remove constraint while retaining other constraint references HOT 7
- Handle versioning
- NaNs after collision bug ? HOT 1
- Assertion raised in AddUnsafely HOT 11
- 2.5.0-beta.20 - Convex hull error HOT 8
- Flat "fractal like" mesh fails to compute convex hull (unsure if bug or expected) HOT 4
- it should be b*b -4*a*c here? HOT 1
- Individual Mesh-Mesh Collision HOT 11
- Changing demos tickrate HOT 1
- Demos do not work on Mac OSX HOT 4
- BepuUtilities: Implementation for Matrix4x4Wide? HOT 2
- Freeze and explosive memory growth when newing a ConvexHull with specific input HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bepuphysics2.