Sandbox, Xml and Physics
Videoblog #5: Click here
It’s been a while since my last update but, on the plus side, there are some brand-new Duality features to show.
First of all, there’s the new sandbox mode. In previous versions, it was only possible to run or debug your game externally. After clicking the appropriate button, the editor freezed and a new window appeared, with the game running. That’s nice and good in most cases, but prevents you from using the editor as a debugging tool.
Thanks to the new sandbox, this is something you can do now. Just click the play button and the currently opened Scene enters game mode. It behaves just as if I had launched the Scene externally, but in an editor environment. As you can see, the editor updates in realtime if the game Scene changes. I can even freeze the game at any point, edit anything I like, and hit run again. When leaving the sandbox mode, all goes back to normal.
For debugging purposes, a Log View is now part of the editor as well.
Also related to debugging: It is now possible to use Visual Studios “Debug” button in your project plugin for running your game. Hopefully this will save you a few mouse clicks.
Duality now supports Xml serialization for its Resource files. In case you’re working under a version control system like subversion, this should allow it to properly handle different file versions. To Duality, which Resource file format you use just doesn’t matter – just choose what you like. You can change your project setting in the editor and it will automatically convert all Resources to the desired format.
When modifying a Resource file externally, as soon as you save the file, it will be automatically reloaded. If you prefer an Xml editor over Duality’s one – not a problem.
The latest addition to Duality’s feature set is collision detection and physics. By adding a Collider Component to a GameObject, it will behave as a rigid body and obey the basic physical laws. The physics simulation is powered by a version of the Farseer physics engine that has been adjusted to fit Duality’s needs.
A Colliders shape is defined in in the new Collider Editor and may consist of any number of circles or convex polygons. Additional properties like density, friction or restitution define the bodies actual behaviour when interacting with others.
That’s it for now. If you want to take a look yourself: I’ve uploaded a new version of the Asteroids demo that uses physics.