Ball of Balls
A downloadable demo for Windows
Ball of Balls is a simple tech demo that can be used to explore the performance difference between traditional scenegraph (gameobject) and DOTS (ECS) techniques in Unity for rendering and managing large numbers of physics-enabled colliding objects.
The following settings are available:
- NS: Number of balls
- U0: Initial speed (direction is random)
- FF: Force factor for keyboard-based manipulation
- SE: Spawn extents (around world origin)
- BS: Ball scale
Press reset to reset the scene by spawining balls as defined in the settings.
Toggle bounding box on and off in real-time.
Left mouse drag to orbit camera. Mouse wheel to adjust viewing distance.
Use WASD and arrow keys to apply a force to all balls (only available in scenegraph mode).
Change between scenegraph and DOTS mode in real-time. In each case, each ball is converted on-the-fly to a gameobject or entity, respectively, with the same translation, rotation and velocity vectors, so that the effect continues seamlessly.
Note that conversion is seamless but with a slight delay depending on the number of objects converted, since all objects are converted in a single frame. This is intentional and used instead of a job-based conversion over multiple frames so that the simulation proceeds based on either gameobject or entity physics and not a mix of the two, which would lead to unpredictable -and potentially observably erratic- results.
Take extra caution with the various settings. The program does not check the values you provide in any way. Make small, progressive changes, especially to the number of balls and the ball scale settings, to avoid stressing your system or rendering it completely unresponsive due to, e.g., too many balls or an infinite collision-resolution loop caused by too many or too large balls confined within the bounding box.
Ball of Balls is a just a demo. As such, it does not mean to demonstrate optimal or otherwise preferred programming techniques -especially in relation with entity management and conversion and the DOTS framework in general- and should not be used as such.
The source code for Ball of Balls is available as a GitHub repository.
Status | Released |
Category | Tool |
Platforms | Windows |
Author | ganast |
Tags | demo, dots, ecs, performance, Unity |
Asset license | Creative Commons Attribution_NonCommercial_NoDerivatives v4.0 International |
Leave a comment
Log in with itch.io to leave a comment.