How Long Does It Take to Build a Simple Physics Engine?
Asked by
MellowOrbit7
I've been working on a small 2D physics engine in C++ using SFML. So far I've implemented basic translation and I'm currently improving the collision system. I'm not a computer science studentโI'm studying mechanical engineering and coding as a hobbyโso I've also been spending a lot of time learning the underlying concepts and math. After more than 20 hours of work, I'm worried that I'm progressing too slowly. How long would it reasonably take to build a simple physics engine in this situation?
Answers
The target matters more than the clock. A solo developer might implement everything needed for a small game in a day or two, while a commercial studio may spend years building a robust general-purpose system. Decide what your engine needs to support, such as 2D shapes, real-time performance, or convincing game behavior, and stop expanding the scope once it meets that goal.
Reply to this answer
Donโt judge the project by how many hours have passed. Twenty-two hours is a small investment in programming, especially for a first serious technical project. Many people spend months or years on personal games and tools, and learning steadily is more important than finishing quickly.
Reply to this answer
There isnโt one standard completion time because โphysics engineโ can mean very different things. A basic gravity-and-motion demo might take an hour, while a simple billiards-style simulation could take a few days. Adding accurate collision response, performance improvements, rotation, friction, deformable objects, fluids, or 3D can turn it into a project that lasts months or years.
Reply to this answer
Twenty or so hours is barely anything for a project like this, especially when youโre learning the math at the same time. Collision detection and response can easily take weeks to understand and implement properly. The experience with vectors, transforms, and physical reasoning is valuable, so donโt treat the time as wasted.
Reply to this answer
Even a stripped-down 2D engine is a substantial learning project. Youโll probably make faster progress if you focus on one narrow milestone at a timeโsuch as moving bodies, detecting circle collisions, resolving them, and then adding features like friction. Also, using an existing physics library for games is a perfectly reasonable alternative; building one yourself is mainly useful for learning.
Reply to this answer
Add your answer
Answers are reviewed before publication.
Related Discussions