In combination, this build brings numerous performance improvements (especially in collider heavy worlds and loading worlds), numerous improved interactions with colliders (less jitters, less passing through colliders at high velocities, no more bumpy colliders that are actually smooth, no more physics interactions lagging a frame behind or users getting dropped out of vehicles and many more) and even some new features!
For example we now support step up logic, making it easier to walk up not only small, but also really large obstacles. CharacterController can now use any shape and even simulate rotation and it will respect your height - if you crouch, you can now pass under obstacles! There's much more, including new collider types, check the details below.
Also importantly this upgrade lays foundations for futher optimizations and new features like full rigidbody support (that is NOT part of this update, although you can get simple rigid-body like behavior with CharacterControllers, you can learn more here: https://github.com/Neos-Metaverse/NeosPublic/issues/22). There's a lot more coming in the future, check out the Physics roadmap to see what's coming: https://github.com/Neos-Metaverse/NeosPublic/projects/19 As long as you understand the current limitations though, please have fun! :smile:
Hopefully you'll see a nice performance boost already though - it will probably depend on the situation and world - some worlds will see a significant boost, while others not as much. There are more optimizations planned however, so this is just an important step forward for those.
There's also a huge thanks to @Shifty | Quality Control Lead and her QC team for helping out catch all the early bugs, as well as @Danger Tester's who participated in the public testing: @Shadow Panther [RU/EN, UTC+3], @Beaned, @ohzee, @Zyzyl, @Alex from Alaska, @Snooper, @Pat cat, @LucasRo7, @Turk, @Enverex, @MattyK, @Cyro, @Modern, @1amNick, @Hayden, @Toxic_Cookie | NTC CEO, @Elizabeth Dayax , @Epsilion, @epicEaston197, @DrFrank, @TheBasementNerd (she/her), @Alex rainbowdashie, @Sloppy McFloppy , @Ian Corvid, @Kulza, @Tatsu Kimiero, @Sylva, @Gawdl3y#4269 and everyone who tested without reports
There might still be some bugs and such, but hopefully nothing too game breaking anymore. We'll fix anything that comes as we go, so please make a report on GitHub if you find anything!
Also note that initially some worlds might be a bit heavier on load, as existing content doesn't have the new asset variants generated. As those worlds are loaded and visited, this should get gradually better.
New Features:
- Replaced the BEPUv1 physics engine with BEPUv2 (find more here: https://github.com/bepu/bepuphysics2) - prioritized due to being one of the top voted GitHub and Patreon issues (typically moving between 1st and 2nd place)-- This is a complete rewrite ot the physics engine, the only thing it shares with BEPUv1 is the name and it's developer
-- This version of the engine is significantly more optimized, reducing CPU and memory usage
-- It uses its own memory management system, reducing stutters and performance loss caused by the Garbage Collector
-- Collider interactions are significantly improved, fixing numerous issues (e.g. some mesh colliders being bumpy despite having smooth surface and you should pass through colliders less)
-- Numerical stability of collisions has been improved, reducing jittering with large offsets and colliders or when you're very small
-- It's low level interface allows much more efficient integration with Neos and better fit the functionality with Neos' systems
-- This should fix Cylinder Collider hull sweep issues (reported by @H3BO3, GH #1083)
-- Reimplemented fast boolean sweeps directly into BEPUv2 in a more efficient manner, significantly reducing (potentially fully removing) memory allocations of those operations
- Re-engineered physics engine integration with Neos
-- This is a complete rewrite on how physics engine integrates with Neos for better efficiency and flexibility
-- BEPUv2 is significatly more tightly integrated with Neos, rather than being separate part, reducing performance overhead and simplifying fixing of issues and addition of new features
-- All existing colliders and interactions have been reimplemented for feature parity to preserve functionality of existing content
-- Main world interactions and colliders used for Haptic feedback are now completely separate simulations that also compute in parallel, improving performance
-- Parts of physics update now run asynchronously, improving the overall framerate
-- Moved/scaled transforms are now tracked separately for physics and other components
-- Implemented RaycastOne as natively supported operation, skipping any raycast tests for objects than the current nearest found hit and completely avoiding list allocations to hold the temporary results
-- Implemented SweepOne and BooleanSweepOne as natively supportd operations, analogous to RaycastOne
-- Expanded and re-ordered engine update stages for more consistent behaviors - physics now updates early in the stage, rather than late
--- This (in combination with other changes) fixes physics lagging a frame behind for non-host users when parented under fast moving objects (reported by @Hayden, @H3BO3, GH #2248)
-- Ensured that collider types properly sleep and avoid waking up each other, significantly reducing CPU usage in collider/trigger heavy worlds (e.g. Minecraft import maps)
-- IMPORTANT: BEPUv2 doesn't support Cone Colliders natively, Neos transparently emulates them with a convex hull, but they are less efficient as a result. It's generally recommended to user other primitive shapes where possible, but they will still work
-- ConeColliders being offset incorrectly is now fixed (reported by @chemicalcrux, GH #1471)
-- Convex Sweep hits at zero distance are now properly handled (this fixes laser curling back when at inspector edges and randomly jumping around in some other cases, reported by @H3BO3, GH #492)
-- Added ability to internally sweep collider components using their current shape
-- MeshCollider and ConvexHull acceleration structures are now double-buffered for procedural meshes, fixing some mesh interactions randomly flickering (e.g. when deleting LogiX wires that are moving)
-- Implemented a more efficient event system, significantly reducing memory allocations and CPU overhead when collisions are occuring and skipping computations in some cases when collisions aren't listened to
-- Reimplemented timestepping to provide more stable stepping for the physics system, reducing instability issues that could cause jitters or passing through colliders in some cases
-- Implemented heuristics for MeshColliders for computing speculative margins based on average triangle density, to improve interactions, but avoid performance issues with denser meshes
-- Fine tuned the integration for good overall performance and behavior
- CharacterController can now use any convex collider shape instead of just capsule
-- It will use the first Collider placed on the same slot that is set to "CharacterController" type
-- Existing CharacterController instances are auto-upgraded
-- This also means you can customize the offset and change shape in realtime (previously requested by @Robyn (QueenHidi), GH #1843)
-- The Mass property is now localed on the Collider, but only applicable for dynamic bodies (e.g. CharacterController)
- Implemented step up logic for CharacterController, which allows walking up both small and tall obstacles (previously requested by @Enverex and many others)
-- Technically the step up height is unlimited, but sensible values (probably 100 cm at most) are recommended, as higher values will cause odd behaviors.
-- When colliding with an obstacle, the current shape is offset upwards and swept in the direction of movement to check if the space in front is free. If there are no obstacles, the character will step up the obstacle (it'll be considered a support)
-- StepUpHeight determines the maximum height that the character controller can step up.
-- StepUpCheckDistance determines the distance the shape is swept in the movement direction to determine if it's free of other obstacles
- Completely vertical (90 degrees) MaximumTractionSlope and MaximumSupportSlope is now supported on CharacterController, allowing you to configure the CharacterController to climb up walls
- Added "Debug Visuals" property to CharacterController
-- Non-null value will display the visuals for specified amount of seconds
-- This shows all potential contacts when interacting with the environment, which can be useful for debugging purposes
-- Note that this is very performance and network heavy to use! Only use for debugging purposes
- Implemented SingleShapeCharacterControllerManager which manages the capsule collider height based on user's height, making the character shape respect player's height (previously requested by @Enverex, @Abysmal, @Shadow Panther [RU/EN, UTC+3], @Raith (CytraX) | Programmer, @Turk and others)
-- This means if you now crouch, you can pass below obstacles, but you also become slightly wider (this is configurable)
-- Increased the default radius of the character controller slightly for better interactions
-- Desktop HeadSimulator is now aware of obstructions when crouching, preventing the player from standing up after crouch is released if they're under a character collider
- Added "KillVerticalVelocityAfterStepUp" to the CharacterController (based on report by @Shadow Panther [RU/EN, UTC+3])
-- This will convert any vertical velocity into directional one in the current planar direction of the movement and push the player back down, preventing the player from getting too much air when running off a ramp or stairs
-- Note that this is off by default, as it can make stairs feel very bumpy
- Added ability to unlock rotation simulation on CharacterController
-- IMPORTANT: While this allows you to use character controller as simple rigid-bodies, this is NOT a proper rigidbody support. You will run into following issues:
--- High CPU & Network usage
--- Glitchy behavior - character controller has extra things and simulates on a single user, making it randomly teleport if another user interactions
--- Lack of control - it's always frictionless and you cannot create constraints and build more complex things
-- This is primarily meant for more realistic Zero-G locomotion and similar uses, but if you understand the limitations, have fun with them!
-- Learn more about Rigidbody simulation here: https://github.com/Neos-Metaverse/NeosPublic/issues/22
- Added Sidedness to MeshCollider
-- Mesh colliders can now be Front sided only, instead of always being DualSided, providing better efficiency and improved interactions (e.g. you won't get trapped behind geometry or partly through the ground, but get pushed out instead)
-- Added heuristic that automatically converts CharacterCollider MeshColliders to Front sided in most cases for improved interactions
--- If there are dual-sided materials on the same Slot it will stay dual-sided
--- If there's negative scaling on the collider, it will be kept dual-sided as well
- Added StaticTrigger and HapticStaticTrigger collider types, which provide more efficiency as long as they are not moved in the world
-- If you know for certain that your trigger won't be moving in the world (either directly or through its parents), it's recommended to use these types
- Added StaticTriggerAuto and HapticStaticTriggerAuto.
-- These behave same as the versions above, but they track whenever they're moved. If they're moved for a few frames, they will auto-switch to Trigger/HapticTrigger
-- Any old content using Trigger or HapticTrigger is autoconverted to these types, so they can get benefit of static triggers without being manually updated
-- For new content it's not recommended to use these. Instead make a decision betwen Trigger / StaticTrigger on the usage pattern for your content to avoid the overhead of tracking
- ApplyCharacterImpulse and ApplyCharacterForce now respect the CharacterController mass by default (based on report by @Zyzyl)
-- This can be disabled by passing true to the new IgnoreMass input
-- Old nodes are auto-upgraded to have True value plugged for backwards compatibility
- Added TriangleCollider
-- Note that the triangle is one-sided, you will only collide from the front. Colliding with edges will be currently random - sometimes you'll pass through edges, sometimes you'll collide with them (see more here: https://github.com/bepu/bepuphysics2/issues/134#issuecomment-904201884)
Minor New Features:
- When pasting neosrec:/// URL from the clipboard that links to a world, the world is now loaded- Added TriangleDiagnosticMesh, which allow vertex coloring a single triangle with given index and displacing it along vertex normals
-- This is mainly for diagnosing geometry issues in-game, but can be useful if you need a single triangle
- Added ability for highlights to avoid tracking the position (currently internal)
- Added "Triangle" to Create New -> 3D Model dialog
Optimizations:
- Mesh Collider acceleration structures and Convex Hull colliders for static assets are now computed using the asset variant system-- This significantly reduces memory and CPU usage when loading worlds and items, since previously those were always computed on the fly, but they are now pre-computed and cached
-- This should also speed up the loading process and make colliders available sooner, since loading a pre-generated copy takes a fraction of time than computing it from scratch
- Replaced many common usages of RaycastAll with RaycastOne for improved performance and reduced memory allocations - this includes particle system collisions too, which are very raycast heavy and RaycastOne and Raycaster logix nodes
-- This should produce no change in behavior, only save some CPU time and memory allocations
- Replaced common usages of convex sweeps and overlaps with (Bool)SweepOne and OverlapOne where applicable for some small performance gains in those behaviors
-- Similarly the behavior should be the same, but CPU and memory usage can be reduced
-- Interaction Laser sticking or spawn area player checking now use these checks
- Added triangle density heuristic to interaction laser to prevent convex sweeps against mesh colliders that are too dense relative to the size of the sweep, causing performance issues when the laser tries to stick to a dense mesh collider
-- Instead the laser will just stick to the last known point, instead of sliding around the object
-- If you'd like the sliding behavior when sticking, please setup your objects with primitive colliders (ideally), convex hull collider or at worst optimized mesh collider with large triangles
-- There's extra heuristic for laser avoiding sticking to dense meshes when the metadata isn't computed yet
- Added ability to internally configure convex sweep convergence and iteration parameters, allowing various sweep queries to trade off precision for performance
-- Fine tuned laser sticking convex sweep for better performance
-- Boolean sweeps/overlaps now have any iterations completely disabled, as they do not need them
- Implemented an IL patcher for System.Numerics.Vectors to optimize it for Unity's embedded Mono runtime, removing numerous memory allocations and significantly improving performance within Unity
-- This library is used not only by BEPUv2, but also other libraries like System.Text.Json (used for communicating with the cloud API)
- Transform change tracking is now split between scale changes and position/rotation changes
-- This reduces wasted calculations, since calculations that only need to happen due to changes in scale (which are rare) happening when the hierarchy is moved/rotated (which happens frequently)
- Optimized background worker to reduce stalls and wasted cycles
- Asset variant system will re-check the cloud for generation variant prior to computing it locally if sufficient time has passed between scheduling the computation and actually computing it
- Asset References set to null will now free the previous target asset, allowing it to be unloaded
- Reworked scheduling of local asset metadata computations, to only run on limited number of cores, rather than starting unlimited number of tasks, resulting in heavy system resource usage (essentially it should now murder your PC less, previously reported by @Hayden)
-- It will run at most on quarter of the available CPU cores
-- The computation tasks will check if the cloud metadata has been computed in the meanwhile if enough time passes between scheduling and actual computation, skipping unecessary local computations
-- This would be particularly noticeable when going into new regions of the Minecraft import maps due to heavy number of mesh assets, but should help reduce overall amount of stuttering in Neos
- Tweaked asset loading process to avoid running lock-heavy parts on the dedicated background workers, but ensure that actual loading of the data is done on dedicated backgrounds threads
-- This should help improve stuttering and overloading the system when loading significant amount of assets due to Task scheduler spawning large numbers of threads (based on a report by @Hayden)
- Restricted local asset variant generation to just a single core, to avoid the heavy processing from impacting the regular performance too much
- Fixed asset variant generation sometimes not running on the dedicated background worker threads, potentially causing singificant stutters and freezes
- Headless now runs audio events at the actual rate they would fire at, rather than every frame
-- This can help reduce CPU usage in certain cases, particularly with higher tick rates
- Headless no longer setups avatar proxy objects in Userspace, saving some extra performance
- Fixed CharacterTeleporter sometimes keeping references to objects after being destroyed, potentially preventing GC from deallocating large chunks of memory
Tweaks:
- Removed deprecated SphereDetector LogiX node- Added diagnostics to serialization errors when communicating with the cloud API
- Automatically switch any MeshColliders set to Active to Static, since these were previously filtered
-- It's strongly advised against using Active collider with MeshCollider, as it will have very adverse performance effects. Use primitive colliders instead.
-- If this breaks any existing content, let us know and we'll see if we can make some tweaks
- Updated Minecraft importer to use StaticTrigger for new imports for its culling system (based on report by @Enverex)
- CharacterForceField/Parenter/Teleporter will no longer act on character controllers that are currently kinematic (not simulated)
-- This fixes them interfering with vehicles and similar setups, applying the actions only on the vehicle character controller (reported by @MattyK)
- Increased maximum SmoothTurnSpeed and NoclipSpeed in the Settings
- ConvexHull collider now updates itself when the referenced mesh updates as well, making sure it respects its changed shape
-- Note, it's STRONGLY discouraged to use mesh that changes frequently (e.g. procedural mesh) as collider, as rebuilding the collider is relatively slow operation
- AxisRotationAligner now immediatelly updates rotation when written by external source, preventing 1-frame jitters
- Added TriggersOnly to any collision listener components (e.g. Character Parenter/ForceField/Teleporter/Trigger) which will filter any events coming from non-triggers (true by default)
-- For any existing content, auto-upgrade heuristic is performed - if there's no triggers on the same slot, it will be disabled. This preserves function of old content, while fixing glitchy behaviors when both trigger and static colliders are present
- Merged Russian locale additions by @Shadow Panther [RU/EN, UTC+3]
- Merged Korean locale additions by @MirPASEC
- Merged Czech locale additions by @rampa_3 (UTC +1, DST UTC +2)
- Merged Japanese locale additions by @Aesc/あすく
Bugfixes:
- Installed locomotion modules no longer have random offsets- Fixed LogiX collision events sometimes not unregistering
- Fixed Character EventTrigger/ForceField/Parenter/Teleporter double-triggering on event coming from static colliders when they're present on the same slot as the trigger
- Fixed CharacterParenter dropping users due to rapid movement (reported by @Shifty | Quality Control Lead, @H3BO3, @Enverex, @Beaned and many others, GH #1327)
- Added guard against exceptions in the LogiX tip when deleting wires and the current distance between the initial point and Tip is zero
- Fixed CDFT awards sending CDFT token withdrawal notifications (reported by @Karel | CEO)
- Fixed meshes with invalid bones (e.g. NaN bindposes) causing exceptions when computing the mesh metadata
- Fixed help buttons not working for VHACD, NewWorld Dialog and others
- Fixed items and tools with driven root equipping at an odd angle (reported by @Modern and @Shadow Panther [RU/EN, UTC+3])
-- Note: It's not recommended to drive position, rotation and scale of the root of a tooltip, but rather drive a child underneath!
- Fixed BoundingBoxDriver driving position to near-infinity when the target bounds aren't valid
- Fixed TextGizmo edit icon being moved to near infinity before the text fully initializes
- Fixed cached transform parameters getting out of sync when position, rotation or scale of the object is driven and it gets reparented (reported by @Shadow Panther [RU/EN, UTC+3])
-- This could cause the colliders, bounding boxes and other things to lag behind, staying in the old place before reparenting



Changed depots in android-preview branch