I’ve been in autopilot mode during the last month or so and thus it was hard for me to keep the blog updated. A lot of exiting things have been added to Crimild lately (and to everyone’s surprise, just one or two little refactors) and I promise I will describe them during the following weeks. But for now let’s focus on the newest addition to the engine: the Sandbox
What is the Sandbox?
While we we’re discussing about our next project at Building Brothers, we realized that a tool was needed in order to speed up development process, not only on the technical aspects, but also on level design, assets and gameplay. Our Game Designer needs a tool to create a level and test any new feature, making changes in real-time if needed without having to wait to developer to implement them. Artists needed a way to update models and textures and verify that they look correctly without the need of a new build. And developers needed a tool to implement and test new features as fast as possible through the use of scripting and shader editors. And so the Sandbox was born.
Crimild’s Sandbox is a desktop application which goal is to help developers and designers alike by including a WYSIWYG scene editor, scripting and debugging tools and some other features that will be disclosed as they’re implemented. It currently runs only on Mac OS X, but it will be available on Windows and Linux as soon as I have the time to do so.
Is the Sandbox a Game Editor?
The short answer is “no” (although a more optimistic one would be “not yet”). As it is right now, the Sandbox is more of a testing tool than an editor. Of course, you can use it to build scenes and later import them into your projects. But the whole idea of the Sandbox is to be able to experiment with any new feature and then see how it behaves in real-time. Since the Sandbox uses the same rendering techniques as any other Crimild-based app, you can rest assure that if something works in the Sandbox, there is a pretty big chance that it will work on your program. Of course, platform-specific constrains may still be an issue but the Sandbox will help you isolate them.
What’s included in the box?
The Sandbox is still in a very early stage of development, with only a couple of features already working. Among them we have a Scene Hierarchy Viewer that let us understand how a scene is composed by displaying a tree of nodes. In addition, a Node Inspector displays information about a selected node in the scene, along with a list of components attached to it. If a ScriptComponent is found, a Script Editor is available for the user to edit the script in real-time without having to restart the application. A simple Pathfinding tool is also included, allowing level designers to place waypoints comforming a walkable path for characters.
The Sandbox has two modes: Editor Mode and Simulation Mode. The former one will let you create and change a scene using any of the available tools. You can add new nodes, components, cameras, scripts, etc. Once you have your scene ready, you enter Simulation Mode by clicking the Start Simulation button. In this mode, scripts and other behaviors are executed. It is possible to edit scripts while the simulation is running and see the changes take place in real-time.
New Crimild features
I’m going to dedicate full posts to each of the latest changes in Crimild, but here’s a brief introduction to the ones related to the Sandbox:
HTML interfaces with WebKit/Awesomium
XML Scene Factory
The Scene Factory is a new addition to Crimild that let developers define new scenes using XML, declaring nodes and custom components, in addition to Lua scripts and OpenGL shaders. New scenes can be created and used in your programs without having to wait for a new build.
I mentioned this several times in this post: Crimild has support for Lua scripts. Yeah!! A new ScriptComponent class has been added to the engine that handles script compilation and execution. Scripts can be created on the Sandbox and built on the fly without having to restart the application. Scripting support is a huge speed boost for the development process
Even in its current state, the Sandbox has proven to be a great tool for rapid prototyping of scenes. I successfully managed to position cameras and make them behave as I commanded by using Lua scripts. Also some simple pathfinding techniques have been tested on the Sandbox to be later used in our next projects.
As for the future, I’m planning on adding a lot of debugging tools and probably a shader program editor. Some sort of binary file format specification will be needed at some point in order to save our scene and import it in another project, but we can manage with XML so far. There are too many features that can be added in future iterations that is hard to tell how big this thing can become.