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 article RSS Feed Spark Engine Questions and Answers #1

Many people seemed interested to learn more about the Spark Engine. Is it just the Editor? Or the entire game? Lead engine programmer Max answers these questions and gives some cool insight into how the programming workload is divided up at Unknown Worlds.

Posted by _Xero_ on Feb 4th, 2010

We often get questions about the technology we're building for Natural Selection 2. With this in mind, I've written up the first of a several part blog post to answer some of the more common and interesting questions. My initial call for questions generated quite a few, which I intend to address in depth, but first I'll start with two of the more general questions.

Andreas asks: What is the Spark engine? Is it the whole game engine or just the graphic part?

This is a great question to start with. Spark is the entire game engine and tool set we're using to build Natural Selection 2. This includes the graphics, sound, networking, physics, scripting, path finding and effects system (probably others too). It also includes tools like the Editor, Builder, Viewer and Cinematic Editor.

When Charlie and I started working on Natural Selection 2, we weren't planning on building an engine. Creating technology is a lot of work and it's also very challenging to build a game - both in terms of gameplay and artwork - when the engine isn't finished. When we ultimately decided that we were going to create our own engine, we wanted to make sure the technology was flexible enough that we wouldn't have to start again from scratch for the next game. We also wanted to make sure that other people could use our engine to make their own games. To this end, the technology is designed to be largely independent of the game. Spark is coded in C++ and provides the core functions of managing a virtual world. But Natural Selection 2, which is entirely programmed in Lua, adds the common elements of first-person shooters (players, weapons, score, etc.) and the Natural Selection-specific pieces like commander mode, tech trees, wall walking, etc.

The division of labor for the coding has always been very straightforward – Charlie writes the Natural Selection 2 code and I write the engine/tools code. A few months ago, Kurt Miller, a great programmer and a good friend of mine, joined Unknown Worlds to work on the engine and tools code as well.

For the past two months we've released weekly patches to the editor. Often people interpret these editor-specific updates to mean that we're not making progress on the game. In fact, even when we were crunching the hardest on the Editor - right before the initial release – Charlie was still devoted full-time to the game code. Now-a-days, Kurt and I spend most of our time enhancing the engine, with Kurt spending a small amount of his time implementing new features and bug fixes in the editor.

Beat Wolf asks: What platforms will be supported? (Linux, OS X, XBox, etc..) The web page still mentions Linux and OS X as target platforms, but there have been many doubts with the inclusion of Steamworks and because the question seems to be avoided for some time now.

Well let the issue be avoided no longer! Currently our engine and tools only work on Windows, and that will be the only platform Natural Selection 2 will be available on at release. However, most of the engine is not platform specific. The largest Windows-specific piece is the low level rendering code which is built on Direct3D. In the interest of having our engine run on Linux and OS X someday, this low level rendering code is wrapped up so that it's mostly separate from the rest of the engine. With a small amount of effort, we can swap out this piece with an OpenGL implementation that will work on Linux and OS X. All of our tools are built using the cross-platform wxWidgets framework, so once we get the engine working on another platform, bringing the tools over won't be too much work.

Now that I've convinced you that we've taken steps to allow us to bring our engine to other platforms, you might be wondering why we don't just go ahead and do it. The answer is simple; we don't have the time right now. As an alternative to doing it ourselves, we've considered "open sourcing" or publishing the low-level APIs for the pieces that are Windows specific and inviting community members to contribute their own implementation. If you like this idea let me know in the comments.

Now the issue of Steamworks. For those of you who don't know, Steamworks is the core technology of Steam, like the friends list, server browser and voice chat. We've integrated Steamworks into Natural Selection 2 because it saves us the effort of implementing these things ourselves, and gets the game into your hands faster. Unfortunately Steamworks (which essentially is the Steam client) only works on Windows. We've setup Natural Selection 2 to work without Steamworks, but you lose the services that it provides. For example, instead of being able to browse for a server you'd have to type in its address in the console to connect to it. For an OS X or Linux client, we'd have to substitute in our own implementation of those missing services. This certainly isn't out of the question for a post-release update to the game, but it's not something we'd delay the initial Windows release to incorporate.

I should add to this discussion, that none of this applies to running dedicated servers on Linux. Dedicated servers don't require graphics, input or any of those other platform specific things. And one of the great things about writing all of the game code in Lua is that it's inherently platform agnostic. Dedicated Linux server support will be in the initial release.

If you have more questions you'd like to see answered, feel free email me at max@unknownworlds.com. The more specific the better!

Post comment Comments
Milch
Milch Feb 4 2010, 8:54am says:

Great article!
I just have one question - why do you use LUA?
Because I though about using LUA in my current game, but I stuck to AngelScript because of the syntax and its written in C++

So what are your reasons to use LUA?

regards Milch

+1 vote     reply to comment
Soulseker
Soulseker Feb 4 2010, 3:19pm replied:

They use LUA because its a fast language you can change everything in it while running.

They are a 4 or 5 man team.

+1 vote     reply to comment
NullSoldier
NullSoldier Feb 4 2010, 3:49pm replied:

Bad explanation, can do that with AngelScript to my knowledge as well. Angelscript is more native to programmers as well since it uses a real mans syntax.

0 votes     reply to comment
Milch
Milch Feb 4 2010, 3:54pm replied:

Thats what I thought.
Atleast I think that most of the people, who can mod a game, have some experience in C++ - at least the programmers.
So whats the point on even using LUA? I tried to learn it about 2 years ago, and I gave up after 5 weeks, because the syntax is awful imo - even if I'm used to basic languages like VisualBasic.

+2 votes     reply to comment
Tallon_hunteR
Tallon_hunteR Feb 5 2010, 1:32am replied:

noob modder friendly

least thats the line they've thrown us.

+1 vote     reply to comment
pvt.Johnson
pvt.Johnson Feb 4 2010, 9:55am says:

Great read, would be cool to see it work its way over to OS X one day :]

0 votes     reply to comment
Gnostic
Gnostic Feb 4 2010, 10:35am says:

Would be amazing if this was ported to linux :)

+2 votes     reply to comment
Aimforthehead
Aimforthehead Feb 4 2010, 10:46am says:

Beautiful guys, I'm getting really excited to play this.

+1 vote     reply to comment
Colossal
Colossal Feb 4 2010, 4:41pm says:

Please add a pre-order to Steam.

I really want to pre-order. And I'm not going to pre-order from anywhere except Steam.

Also, have you guys thought about adding singleplayer? If not, at least add a mode similar to multiplayer, but it's player+bots vs. bots.

+1 vote     reply to comment
Xular
Xular Feb 4 2010, 6:20pm replied:

NS2 really isnt a singleplayergame - play NS1 and you'll know what I mean.

NS1 with bots sucks too, its just way too complex for bots

+3 votes     reply to comment
deadrawkstar
deadrawkstar Feb 4 2010, 6:51pm says:

i think it'd be more valuable to port to game consoles instead of other OSs, the biggest reason being, about the same amount of people play Console games as computer gamers, and secondly mac/linux users can always dual boot if they want to play games.

+1 vote     reply to comment
Metalspy
Metalspy Feb 5 2010, 5:58am replied:

But then they'd need to buy a copy of Microcrap's Windows.. Of course there are other ways to get Windows, but.. yeah. I'll just assume everyone still buys software.

0 votes     reply to comment
vfn4i83
vfn4i83 Feb 4 2010, 9:59pm says:

I looking forward to your OpenGL solution, hope it will be a option for Windows based also, and been OGL v3.2.

+1 vote     reply to comment
nubblecakes
nubblecakes Feb 5 2010, 3:59am says:

Kick ***. I hope you guys are successful with the other platforms. A bigger community is never a bad thing.

I gotta find the spare cash to pre order this game. It's looking mighty promising. Do you have anything to say about creating total conversion mods though? NS2's engine looks just as promising for modding as does Overgrowth's engine.

PS: I think the idea of open sourcing for linux and OS/X compatibility is a good one.

+1 vote     reply to comment
Jeffman12
Jeffman12 Feb 5 2010, 2:00pm says:

When can we expect to see the Preorder available on Steam?

+1 vote     reply to comment
Post a Comment
click to sign in

You are not logged in, your comment will be anonymous unless you join the community today (totally free - or sign in with your social account on the right) which we encourage all contributors to do.

2000 characters limit; HTML formatting and smileys are not supported - text only

Icon
Natural Selection 2
Platforms
Windows, Linux
Developer
Unknown Worlds
Engine
Spark
Contact
Send Message
Official Page
Naturalselection2.com
Release Date
Released Oct 28, 2012
Game Watch
Track this game
News
Browse
News
Report Abuse
Report article
Related Games
Natural Selection 2
Natural Selection 2 Multiplayer Real Time Shooter
Related Engines
Spark
Spark Commercial TBD
Related Groups
Unknown Worlds
Unknown Worlds Developer & Publisher with 5 members