[Sigma Tau] Custom Physics Engine
Previously, I mentioned I was looking into some physics engines to use for Sigma Tau. I do not prefer to make my own physics engine; it is a lot of work, for what benefit? Well, no physics engine I have looked into appears to do what I am looking for, so the benefit may outway the work. I am pursuing the option of making a new physics engine for Sigma Tau, I am optimistic, we will see how it goes.
Problems with other engines
Most physics engines are optimised for lots and lots of collisions, exemplified by every showcasing of these physics engines showing how many collisions they can handle. Sigma Tau needs to be optimized for many, many objects, with comparatively few collisions.
Common physics engines expect objects to be within a narrow scope of size. They will state outright, make sure you do not have objects smaller than e.g. a pen or bigger than e.g. a tree, or performance problems or strange behavior may occur. I cannot work with this, I will have planets colliding with bullets (although smaller than real planets, and bigger than rifle bullets). A primary cause of this, I believe, is how common physics engines handle a tolerance value. Ideally I’d like to get rid of the tolerance value, but more practically, just somehow make it dynamic to the size of the objects in the collision.
Physics engines can give strange unexpected behaviors with interactions, which I do not really understand, and so I do not have the ability to configure the physics engine to mitigate the problems. Making my own will at least give me insight into the quirky behaviors.
In-short the whole angle of attack of general purpose physics engines out there are totally different from what I want to achieve.
Because I expect few collisions, it opens up unique optimization opportunities. I can have a longer tick time without often seeing multiple collisions in a tick, making the broad phase check for intermediate collisions.
I do not need a general purpose physics engine, I expect a very limited set of abilities, without configuration. I will code a single broadphase; only a single collider shape (polygon). No joints, etc, etc.
I will not be able to optimize as well as some of the big physics engines, it is just not feasible. But, I will not need a highly optimized physics engine to achieve similar speed simply because it will be optimized for the correct things.
I am very mathematically minded, diving into this math is not outside my comfort zone, and I actually kind of enjoy it. Edge cases haunt me less than most coders because of the way I think. I am not saying I am awesomer than other people, but that this challenge is uniquely suited to my skills.
I am pursuing the option of making a new physics engine for Sigma Tau, I am optimistic, we will see how it goes.