• Register

The game you are trying to view has ceased development and consequently been archived. If you are a member of this game, can demonstrate that it is being actively developed and will be able to keep this profile up to date with the latest news, images, videos and downloads, please contact us with all details and we will consider its re-activation.

Earth and the core worlds are suffering. Overpopulation and lack of resources are leading to unrest and desperation. That's where you come in. You've been recruited to colonize a planet more than 4 light years away. It's your job to save the human race from its own greed and consumption. The game is experienced from a top-down view allowing for the deliberate and creative crafting of every item, vehicle, and structure in use. Using a scriptable and dynamic artificial intelligence the AI Overlord will change up every aspect of the game. Nothing stays the same forever, making Worlds an addictively, dynamic experience with limitless replayability.

Post news Report RSS Physics Progress Report Part 2

figuring out how to get complex polygons into the POC. The first thing that needed to be tackled was how do we generate the physics bodies in a way that is both quick and moddable. I found a perfect tool for the job and use it to perform Separating Axis Theorem collisions.

Posted by on

<< Read Part 1

Violent Sol Worlds has some interesting physics issues and where I left off last time was I had a proof of concept running with some primitive shapes doing collisions. That was not good enough for the game but showed we could do some decent detection and reactions in a primitive way. Where are we now you ask?

I focused on figuring out how to get complex polygons into the POC. The first thing that needed to be tackled was how do we generate the physics bodies in a way that is both quick and moddable. I found a perfect tool for the job, PhysicsEditor. You can find it here. It is the same company that makes Texture Packer and I have to say both tools are fantastic.

PE

Using PhysicsEditor (PE) I was able to create our own file format in xml completely for VSW. The formatting was easy to setup and now the tool itself has an interface customized for the VSW option just by adding two files which we will supply with the game.

XML


Here is the interface to add a simple physics object xml usable by my simple POC.

PEInterface


There you can see my sample "player" with it's complex polygon defined in red. You can also see the rest of the values on the right that give it its characteristics when it comes to the physics in real-time. The best thing about the tool is the xml it exports is clean and can be edited on its own so modders will be able to either pickup the tool or play around in text to alter the bodies.

Enough about the tool, right? It is fantastic, but what about getting it into the game? I was able to quickly get the complex polygon loaded into the engine and drawing to the world. Here is a little peak.

ComplexPolyDrawingCorrectly


You can see the yellow outlines of the polygons drawing along with the circle outer bodies. You do not want to be doing complex polygon checks for every collisions only for precision. So the outer bodies must be colliding for a complex polygon check to be done, it saves cycles.

I also computed the normal's for the faces of the polygons which essentially are the collision normal's and the forces are in those directions. So I got those drawing as well. Here si a look at those.

DrawingNormalsOfFaces


You can see the short orange lines drawn at the middle of each face. Those show us that the face normal's are being calculated correctly. Now we have all the data in the POC engine and need to get the polygons colliding properly. How we do that is using Separating Axis Theorem SAT.

What is SAT?

The Separating Axis Theorem (SAT for short) essentially states if you are able to draw a line to separate two polygons, then they do not collide.

It is simple, but it did take some time and debugging to get it to act properly. When it was coded up and done it worked very well though in the POC. Here is a nice video of it in action in the POC.


Stay tuned to the next articles in this line to see how the rest of our physics story ends up.

Meanwhile go 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.

Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: