• Register

Natural Selection 2 is the sequel to the popular Half-Life mod Natural Selection. It is built on our own engine and will be distributed through Valve's Steam platform.

Report RSS Effect Editor Part 1

The team take you through their recently built effect editor for their engine.

Posted by on

One of the difficulties with having such a small team is finding enough time to do everything that needs to be done. As the only engine and tools programmer, this can become a problem, since often my work can hold up other people's ability to make progress. While almost every other tool or system has been developed far enough that people can be productive, special effects is one area that hasn't gotten any of my attention thus far. This week I decided to rectify this and create the effect editor that we'll use to create all the special effects for the game.

Tools often fall into a "level of effort" category, where the amount of time they can take is unbounded; there's always one more feature you can add to make it easier to use or more powerful. Since there are lots of other tasks to be done before shipping, I decided that 5 days was the most I could afford to spend creating the effect editor. I think most people (including myself) would consider this a ridiculously aggressive schedule, but nobody said independent game development was easy!

Since this was such a short task, I decided to document the major stages of development as I progressed. I started working on the editor on Friday morning and it's now Monday afternoon. A power outage on Friday put an abrupt stop to development, but things are progressing smoothly otherwise.

The first step to building anything is creating a design. For tools, I always like to borrow ideas from other similar applications, synthesizing the best ideas from each into something even better. My hope is that by drawing on established user interface conventions, my tools will feel very familiar and immediately usable. This also speeds up the design progress by transforming it into more of an editing progress.

As a first step, I grabbed screen shots of the features I like from 3D Studio MAX and Photoshop � two tools that most artists are intimately familiar with. Normally I would have also grabbed shots from the effect editors that come with other game engines, but I didn't find anything I thought would be helpful in the ones I looked at. Typically at this stage I'd also talk to effect artists who had experience with making effects for other games, but I felt like I already had a general concept of the high level advice they'd give (e.g. make everything animatable) and I could solicit the detailed ideas later.

Like our level editor and viewer, I'm building the effect editor using our engine and the wxWidgets user-interface library. To get the basic framework of the effect editor up and running, I put together existing components with a little bit of copy and paste from our existing tools.


A solid undo feature is one of the most important components of a usable tool, and in order to make sure it worked great I started on this right away. Undo can be a little tricky, but fortunately I'd already built a good system for the level editor. I took the existing system, generalised it a bit and incorporated it into our engine library. Now the level editor, the effect editor and any tools I build in the future will all use the same system.

The next step was to start building the concept of time into the tool. Every effect editor I've seen is based around the concept of emitters which release particles into the world. The properties of the emitter and particles can be varied over their lifetimes to create all types of different effects, ranging from smoke to fire to unearthly magic Most effect editors use time varying graphs to represent and edit these properties.

While I wanted to incorporate this type of editing into my effect editor, I also wanted "key frame" based editing like you'd find in a tool like 3D Studio MAX or Maya. Since I'm still developing the tool, I don't know how well this will pan out, but my expectation is that this will make editing certain types of effects much faster and more natural. The video shows this type of key framing for the position of an emitter with a slider for scrubbing through the frames of the animation.


From this point I had a lot of details to fill in for the big functions I'd put in place. This included creating a UI for typing in values for properties, displaying the key frames on the time bar, and (optionally) rendering the trajectory of the emitter over time.


The next task was putting in the traditional curve editing user interface. In this UI you can see a graph showing the value of a parameter over time. The levels tool in Photoshop has a great graph editor that allows you to easily move, create and delete points with just the left mouse button, so I implemented a very similar mechanism in my curve window.

This final video shows the current state of the effect editor, with key framing, graph editing and manually typing in the values for emitter properties. I haven't implemented very many emitter properties yet, but with the underly framework I've built it's quite easy to add new ones.


Also noticeably missing are any actual particles. Because I have a very clear idea in my head of how this tool will work, most of my time has been spent building the infrastructure rather than trying to get something fully usable as quickly as possible. Particles will be going in very soon though! I think I'm still on track to hit my 5 day schedule.

What effect tools have you used and found useful? What would you change about them?

Post comment Comments
NullSoldier
NullSoldier - - 973 comments

Please convert your very nice useful videos to some flash based format or upload them to youtube or moddb as I along with many others don't have quick time and probably will never install that piece of trash if our lives depended on it.

Plus, streaming and live data are the future. It's so convenient. Yay bandwidth.

Regardless this is a very great article and I enjoyed reading it. I look forward to playing NS2.

Reply Good karma Bad karma+3 votes
technoblue
technoblue - - 70 comments

VLC media player plays quicktime files quite nicely.

Reply Good karma Bad karma0 votes
f0rqu3
f0rqu3 - - 206 comments

hmm what about showing some particles instead of the editor?

Reply Good karma Bad karma0 votes
Woolybear777
Woolybear777 - - 463 comments

My guess is because the finished particle effect would not necessarily reflect the quality of the the tool. If lots of work went into the editor and then the particle effect was rushed, it would look like crap. This way you can tell that the possibilities are endless.

Reply Good karma Bad karma0 votes
Arxae
Arxae - - 718 comments

*sigh* i quote

Also noticeably missing are any actual particles. Because I have a very clear idea in my head of how this tool will work, most of my time has been spent building the infrastructure rather than trying to get something fully usable as quickly as possible

they putted the most focus on the usability of the app, not the workings
and its still wip
so quit nagging >_>

Reply Good karma Bad karma+1 vote
Betelgeuze
Betelgeuze - - 872 comments

lol yeah, reading the whole update always helps...

Reply Good karma Bad karma0 votes
Armageddon104
Armageddon104 - - 3,128 comments

Very, Very cool!

Reply Good karma Bad karma0 votes
Post a comment

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