Physics Bugs #9
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
bhop_toc jump at end fall through floorDUPLICATE OF BUG 7walk into wall without moving mouse, walk target is not refreshed at end of wallFIXED in55ff199269very small mv value fall through ground xDFIXED in81c9e3470bbhop_arcane_v2 tetris stage accelerators are too strongFIXED in c7263df4ae0ec8be9d7f51dacf1dcb550b1a98e7, cbf8a1ccfb424abaaafc78f9f127c52c62ea62a3bhop_arcane fall through logs(#24)Bug 2 identified as physics mesh faces consisting of vertices which don't lie precisely on the face. To fix: generate mesh vertices with half precision and limit the number of vertices per face to 3. Use bnum [u8;N] update to make this great.
WIP branches are
max-area-triangulationandphysics-bug2TODO: Fix concavities on source engine maps
Patch has been applied for part 1 of this bug:
cfd9550566Part 2 is to generate convex hull for bsp meshes
Bug 9 is suspected by the Quaternion to be a brush mesh which is misinterpreted by the physics mesh conversion because of identical Face hashes.
Edit:
I don't think identical Face hashes is a problem because distinct SubmeshFaceIds are still generated for each polygon regardless if it points to the same MeshFaceId.
I've been looking into the early collision end bug (not sure which one this counts under - it's where you fall off a platform too early when walking depending on how you landed on it) - so far the only substantial difference between landing on a part going towards or away from an edge is a SubmeshVertId chosen throughout the collision. If it should be different and why it causes weird collision end, no idea yet
This is bug 1, the physics is failing to transfer the point of contact across the edge boundary to another flush minkowski face.
Bug 1 has a fix in the
minkowksi-transferbranch but it accentuates the effects of deeper bugs with the minkowski MeshQuery implementation. I desperately need a face crawler state visualizer to shake out the MeshQuery bugs.Bug 10 is fixed. It was a combination of leaky acceleration state from a previous physics state (c7263df4ae0ec8be9d7f51dacf1dcb550b1a98e7), and rbx_loader interpreting Accelerator as also being boosters (cbf8a1ccfb424abaaafc78f9f127c52c62ea62a3). Note that acceleration should probably not be persistent state since it should never persist to the next state, it should always be freshly calculated.
Bug 7 is fixed. Bug 5 is a duplicate of bug 7. Predicted intersection times could exceed the maximum / minimum representable Time(i64) values, which were being used like they were implicitly infinity. Refactored face crawler to use explicit Bounds to be able to represent unbounded time limits in
81c9e3470b. Added a unit testtest_collision_small_mvin2ecaeb1615to prove that it is fixed and prevent regressions in the future.An interesting note: Bug 8 (aka surfs in general) seem to behave differently depending on the direction you go - if you're turning into either the negative X or negative Z, the surf behaves reasonably well, whereas you'll basically never be able to surf if you're going positive X or positive Z
I've attached the map (with .txt on the end so it attaches, thanks gitzaname) so you can test it yourself - red indicates negative, green indicates positive (Note: pressing r to reset just kinda breaks so avoid pressing it and rely on the triggers below)
Falling through surfs happens when you move the mouse, which activates
set_velocity_cull, which mistakenly culls the surf from the contacts.set_velocity_cullshould not really exist in the first place, I believe that a proper fix would involve redesigning when and how contacts are culled.I bet this would be a great bugfix for learning Rust, and would genuinely help the project
Bug 3 is potentially caused by the size of the hitbox being exactly the same as the size of the platforms on bhop_toc. The platforms are potentially rotated by a tiny amount, or maybe not. This means that the time that the top of the hitbox stops hitting the top of the platform is exactly the same time that the trigger is hit. Only one of the two collision events is being processed, the other is ignored because they both occur on the exact same timestamp, and zero-time events are not well tested.
Edit:
I've created the test and opened a dedicated issue: #16
You can always clip by walking into a wall and then releasing all movement keys just before you hit a wall. If you keep holding the movement keys, you won't end up clipping into it (see attached video)
Not sure matches any of the other categories
Addendum: You can also clip by being very close to the wall when you start walking. Basically, the only case where you don't clip is when you're at max walk speed
My guess would be that it's an algorithmic setup failure similar to the one described in #13.
Edit:
Maybe not. More likely it's a logic error in the
MoveStateimpls mess (i.e.apply_enum_and_input_and_bodyand friends)Worked around in
3893b2f44f. Looks like the physics gets asked to simulate a huge time stretch, and you clip through the ground instead of hitting the spawn. I reset the timer to 0 so it no longer gets requested to simulate a long duration in 1 tick.Fixed in #30
Closing this issue in favour of closable individual issues.