Skip to content

tantrafael/asteroids-2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Asteroids

Thoughts and decisions

Unity DOTS

Reasons leading me to do this exercise utilizing Unity's Data-Oriented Technology Stack (DOTS), i.e. Entity–Component–System (ECS), Burst and Jobs:

  • High consistent frame rate being of essence in virtual reality.
  • Demonstrating code that would perform at a higher scale.
  • Immanent curiosity to experiment with new technology.
  • Urge to deepen my understanding of Data-Oriented Design and especially Entity–Component–System.

Collision detection

Here, I have not shown an implementation that would scale well. It has:

  • Brute-force checking all against all; O(n²).
  • Circular collision shapes for everything.

For large numbers (hundreds, thousands) of objects of various shapes, I would implement:

  • Broad phase; quickly sort out objects far apart that cannot collide.
    • Spatial partitioning; uniform grid with spatial hashing; O(n) on average.
    • Simplified bounding shapes; axis-aligned bounding boxes (AABB).
  • Narrow phase; check objects close enough to possibly collide.
    • More accurate collision shapes; circular, rectangular, polygonal.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages