Saturday, October 16, 2010

Long overdue update

It has been a long time since I have written about the editor. I took a break for a while, not because I wanted to but due to circumstances at work that drained my desire to program. That has been resolved and I have been working steadily on the editor again.

I have designed a new content browser that looks eerily similar to Unreal's UDK content browser. Here it is with some sample content shown:

It does support the same real-time preview when you hover over each item. This helps a lot to identify the correct item before you place it. You can simply drag and drop from here into the scene.

The sample content that is visible in the shot is actually from an awesome game made with Ogre called TorchLight. I am simply using their assets for testing purposes since they look really good and are already in Ogre format. I wanted some real data to play with so I also wrote an importer for their levels which show up pretty well in the editor. I am still missing items such as particles, etc but I have the geometry loading so that I can work on my placement tools first.

I also fleshed out the undo/redo system so that every single operation in the editor (even loading a TorchLight level) is now an undoable operation. I do not want a single thing to happen that cannot be undo. I've implemented a History panel so that I can see the actions that were performed as well as what is about to be undone. The following shows the history stack (grows upwards from the bottom) as well as any actions that have been undone in blue.

I have made a lot of small improvements to the editor such as adding icons to everything, grid snapping, etc. I have also removed every single crash that I have seen to date. I am currently unable to crash the editor and every operation is undoable and redoable which I believe is very important to a good workflow. An editor isn't very good if it crashes on you all the time or if you make a mistake and have to start over.

I've also added a simple form of prefabs as well as the ability to clone an existing object in the scene simply by holding the Alt key and translating the object. This makes placing meshes such as floor tiles extremely easy. I will showcase these 2 features in the next video.

Wednesday, June 03, 2009

Drag and drop materials

Keeping in line with the 'everything is visual' motivation of the editor, I have added the ability to drag and drop materials from the resource browser onto the 3D scene. The materials themselves offer a live preview in the resource browser while the mouse is over it. As it is dragged into the scene, cursor feedback shows when the material can be dropped and when it cannot. I may add the ability to actually live preview it in the scene as well, applying it to the current object that is under the cursor.

View in High-Definition (Recommended)

Download Original (3.26 MB)

Material assignment from Shawn Carroll on Vimeo.

Tuesday, May 26, 2009

Generalized resource preview

I spent a bit of time and have abstracted the resource browser and the thumbnail creator to support any SceneObject instance. All that is required is that a SceneObjectFactory be created that can return the template names of that particular SceneObject type as well as a function that can generate a SceneObject from a template name. The rest is completely generic.

Here are particle systems working inside of the resource browser. Now that I have the standalone SceneObjects done, I'll have to support things such as materials that have a 3D representation [a plane with the material on it or sphere or whatever] but aren't directly objects themselves. This will be the second phase of the browser which I will get to later.

View in High-Definition (Recommended)

Download Original (3.05 MB)

Live particle system preview from Shawn Carroll on Vimeo.

I love you Ogre/Mogre

After getting home from work, I decided to add a live preview to the resource browser. This essentially lets you see a real-time rendering of the object that is being displayed. For particle systems, it will actually show you the particle systems working in real-time directly in the resource browser. This should allow you to find just the right effect quickly.

I'll be abstracting this into my generalized resource system that I had working in my old editor version so that I can plunk in particle systems to really show it off. Here's a sample video to watch. Pay attention to the knot right at the end. You can see the material rendering in real-time. Also, ignore the box that appears when I hover over objects, that's a work in progress :)

View in High-Definition (Recommended)

Download Original (6.02 MB)

Live resource preview from Shawn Carroll on Vimeo.

Sunday, May 24, 2009

Resource Browser

I've started work on the resource browser which will hopefully make it a lot easier to find and place resources inside of the editor. Eventually, this will feature usability features such as tagging, searching, collections, and sorting but for now, it's pretty basic. There is a button in the editor to trigger the building of the thumbnails but eventually this will either be done by the asset server or by some sort of caching mechanism. For now, this works fine for me. Once you generate the thumbnails, you don't have to do it again, they just load with the editor.

Currently, you can actually drag/drop each of the mesh resources into the viewport to have them appear which is a lot easier than creating an Entity scene object and then changing the mesh reference. This is a lot more visual and fits in with the "You need to be able to build a scene with the mouse" motto that I am going for with this editor.

Wednesday, April 29, 2009

Custom Object Overlays

I've been working on adding overlays to the editor lately. Here is the design of the actual overlay that I'll be using

This will appear over objects whenever you hover over them. Any type of information will easily be displayed inside of the overlay. This will allow any object to display detailed information about itself to hopefully make it easier to find objects inside of the scene. The overlay can be toggled on and off in case it's getting in the way. It'll follow the mouse cursor around and will be shifted slightly offset as to not get in the way.

The system should be pretty automatic by allowing an OpenGL style Begin/AddTitle/AddBody/End style so the actual layout algorithm should be hidden from the user. I'll be integrating this into the actual editor over the next few days. I've also spent a bit of time scheduling out a task list for myself which should help out with getting stuff done on a regular basis. I've been really busy at home recently so I haven't done much coding in the past few weeks. That'll be changing.

Monday, April 20, 2009

MVC Patterns

I've gone back and finally implemented a model-view-controller system in my editor. I have had plans on doing this for over a year and some now but I finally got around to doing it. Basically, all of my data and algorithms on said data are stored inside of the 'model' while the 'view' of that data in terms of what the editor wants have been broken apart. The collision data for instance is something that belongs in the view since it's an interpretation of the model and only the editor cares about that. The mesh name that an entity is using belongs in the model since it is an integral part of the data. The graphical data associated with that is handled by the view since different 3D engines might represent that 3D model differently.

What this allows me to do is to work with my entire scene without having to load a 3D engine. This will work out great for tools since they can have the typed data that they want without having all of the graphical parts associated with it. We can attach different views as well for different applications.

The other important thing this allows me to do is unit test my business logic separate from my UI interactions. For example, I can now test that my terrain modeling tools provide the proper deformations or material modifications since the graphics engine doesn't need to be loaded. As I've already built up a small testing suite in NUnit, this works out really well. I can make sure that the only parts to break in the future are the UI components. If a bug is reported that is related to the business algorithms, I can fix it, write a unit test for it, and it'll never make it into the build again.

This has broken a few things that require refactoring but it'll be worth it in the end. Unit testing has proven invaluable for finding bugs in other parts that I believed my current changes couldn't possibly affect.

I'm also working on the actual resource management system again for my editor which should be pretty kick ass. I had a primitive version of what I wanted done a long time ago but I want to spend some more time on it again. It should allow for a pretty nice work flow.

Thanks to someone at work for reminding me that there is at least 1 person out there reading this. It's also nice to just have some place to ramble my thoughts off.

Sunday, February 08, 2009

Switching Back

I've been in the process of switching back to using .NET and C# to create the editor. The language itself is just much more suited to what I want to accomplish with the editor and I've always believed in using the right tools for the right job. I am now targeting the .NET platform using C# and Mogre which is a managed wrapper around Ogre.

I am also focusing my attention on usability since it will be designers and artists using the editor and not programmers. As much as the property grid is an awesome tool, it is cumbersome, unintuitive, and sometimes hard to navigate for commonly used properties. I much prefer context sensitive menu bars and toolbars. In the following shots, the green tabs are added when a specific object is clicked. This allows for the most commonly used and changed properties to be readily accessible with just a few mouse clicks. Eventually, these will become customizable so that users can drop any properties they want and remove the pre-built ones all together.

Wednesday, June 25, 2008

Per-Face Selection

So after a single nights worth of work, I now have the ability to select individual faces from objects. I haven't implemented it in anything other than the 'BoxTrigger' but the way that it works now is fairly ideal. Each object itself can determine how it will report faces back during intersections. I just have it printing out which faces were hit but I will build a 'Face Shower Object' thingy tomorrow that will have wireframes around all of the faces. The great thing is, I have factored out a bit of the SelectionManager into the concept of a SelectionSet which holds all the information about the objects/faces/vertices that are currently selected which should be fairly reusable for selection groups if I ever decide to go down that route.

I should have the implementation finished up in the next sitting or two which will hopefully be soon. I am going to be using this to finish up the 6th step from my list in the previous posting [June 21, 2008] towards my goal of a simple test room. I will allow you to select a face and then a material can be applied to it. Internally, this will most likely break the object up by adding another child sub mesh on the fly to it (I will combine them when they share the same material) and then you can use the material browser to select a material to apply. This will actually go a long way towards creating the room. The face removal should be fairly straight forward once I get face selection finished. I also plan to add support for vertex selection as well which should also be fairly straight forward since I will provide a 'helper' interface that has things like 'checkVertexForClick' which will take a matrix, a vertex, and a 'vertex size' which will check to see if a box that gets projected into screen space where the vertex is would be hit by a particular mouse coordinate. Then it should simply be a matter of looping over the vertices and feeding them in to this helper class.

Once these two steps are done, the rest of it should be straight forward implementation things which just require me to have my butt in a chair for a while. All in all, things are going well. The editor is actually shaping up to be something useful. I might just get my work to review it [part of my contract with them] before I make an official release sometime. I will probably also end up taking suggestions and contributions from the community and integrating them into the editor when I get a chance. I still want control over this since I am using this for my own personal project but I will definitely integrate items when it makes sense to do so and release that back.

Saturday, June 21, 2008


So it turns out that I actually code a lot more effectively if I have a specific set of tasks to complete. I created a step by step guide to have the basic features required to build a simple test map. The test map is nothing spectacular. It's basically got a box that's been scaled out and had a face cut out of it for a 'connection' to another room. The other room is the same thing of another box with a face cutout that is going to be snapped to the first one. Each box starts with it's normals facing out but I am going to need to invert those so that the walls face in. I am also going to have to be able to assign a texture to each wall. So that's pretty much it. I have a lot of that functionality in there but none of it is really completed. There are a few bugs with each thing but now that I've tasked out everything, I am going through 1 by 1 and making sure everything works as expected before moving on. It's really nice to have a goal to work towards and having something tangible come of it.

Here are the tasks that I've prepared in order to be able to do the test room. This is the order that I have been tackling them since yesterday so hopefully when I am finished, there won't be much else to do.

1. Clear the scene
2. Translate tool
3. Scale tool
4. Box placement
5. Simple normal manipulation [just reverse them for now]
6. Texture assignment [per face or per object]
7. Face removal from a box
8. Vertex snapping
9. Object snapping
10. Light placement [point light]
11. Sprite icons for lights
12. Color adjustment for lights
13. Player start placement
14. 'Trigger' volumes
15. Rotate tool

So I think that should more or less add the required functionality to be able to create the room I want. I think I am going to always sit down, plan out the creation of something, and break it down similarly in the future. It lets me know how long I'll be towards a target, keeps me focused on getting something useful accomplished, not just something cool, and it also gives me a specific feature to drive towards completing at any given time.

That being said, I sat down today and did some actual work. I managed to fix/implement the first 4 features of that today. Granted, almost all of the framework was there but I at least fixed some bugs and made the scale and translate tool function as they are supposed to.

As it stands now, I've given myself the weekends and 2 'work days' throughout the week to be spending on this. I also gave rough estimates for how long things will take. Based on that [which may be horribly inaccurate], it appears that I should have all of this done by mid August some time. As far as that is, I think I can pull it back into late July which will be nice.

As far as the editor is concerned, I won't be recreating Maya/Max at all but I will be allowing for simple face manipulation that will allow you to create a basic room, block off some sections with walls, and place ramps and things so you can have multiple levels. Anything more complicated than that and I'll have to allow you to import it as a mesh from your favorite modeling package. I will have to create a suite of tools to allow you to place objects easily and line things up nicely so that will probably be coming soon as one of the next few use cases.