Violent Sol worlds has had an interesting journey when it comes to physics and I intent to tell that story to help inform other indie developers from getting trapped into the same pitfalls and hardships we have hit. I also want to demonstrate how you can gain confidence and do what needs to be done to make this sort of situation an absolute bonus for your game and your teams abilities to make your game better.
I'll start where we started with Violent Sol Worlds, third party physics. See we thought confidently why would we want to code a physics engine when something already exists that works. So we picked Farseer physics
This was our first choice and seemed like a great one to save us time. Let me explain what Violent Sol Worlds is. It is a top-down action survival game. The game has vehicles, structures, and laser guns. We are talking an entire procedural planet This means that the loaded world is continuously changing as you drive around a huge space.
Farseer held up well enough, and we got cars working well in it. The problems we had with farseer were dealing with the fact that we had to continue to create and destroy bodies and the idea of a physics worlds seemed to limit our capabilities for dealing with the huge procedural world. Eventually Farseer got in our way one too many times and we decided to take the physics in house.
We did not fully understand how much Farseer was causing us speed issues and other problems until we tore it out. It was amazing how us writing a quick and dirty replacement to Farseer physics cleaned up a majority of our odd slow-downs and other bugs. We wrote a primitive physics engine just to keep us working. It did the job, but it also had it's issues. The issues it has were functional not low fps.
You can see the terrible bounce effect due to math errors and such. This is the point where we are now. But it is not good enough to get us to release. So we are taking steps to resolve the physics engines issues. What are those steps?
We are throwing together a Proof of Concept project to flesh out the physics needed for the game. To do this we put together a completely separate project and started making steps to get basic physics to work with primitive shapes. I started with a simple circle on circle collision.
Collision reaction is not enough though, the objects need to act like the hold space of their own. So we got them to move out of one another if they are spawned in each other. Here you can see that in action.
At this point we are demonstrating collisions without the bounce we have in the current game build. So we are a step closer. The one thing we wanted to demonstrate next is that we can collide different shapes together without any goofy effects like before. Here we show some rectangles and circles colliding together.
From here we have to do two move things. We need to integrate the POCs physics into the current game build and we also need to get complex polygons colliding together and not just circles and rectangles. So moving forward we will be putting the primitive shapes into the game build to help keep things moving forward. Then we will get complex polygons into the game engine and hopefully physics will be to the level we need it and all under control of our development team.
Stay tuned to the next articles in this line to see how the rest of our physics story ends up.
Meanwhile got check out more articles on the development of Violent Sol Worlds at our main game page here. Also help support the team by checking out Cornflower Corbin as well. You can also make sure you know when we post any new updates by watching our project by clicking here. Thanks for all your support.