How is NS2 programmed?

duke_Qaduke_Qa Join Date: 2007-09-22 Member: 62405Members, Reinforced - Shadow
I joined the forums back while this still was a hl2 project. And now I'm a bit intrigued by this new engine development, although there doesn't seem to be alot of information about it. I'm far from an expert on programming, but I have a fascination for trying to figure out the bits and pieces of programming 3d games and how the different elements of the engines.

"Last week we announced that we've been working for the past five months on a new engine for Natural Selection 2. [...] This week we just passed 80,000 lines of C++ code for the engine and tools (not including all of actual the NS2 game code)" -Max, "engine_questions_and_answers" july 18 2008

This is what interests me. you've programmed your own engine, something that it seems very few game-developers do these days. Even less so with a small team <img src="style_emoticons/<#EMO_DIR#>/nerd-fix.gif" style="vertical-align:middle" emoid="::nerdy::" border="0" alt="nerd-fix.gif" />

You've created tools for viewing models. Animation blending. Made a graphics engine that smoothly does all the fancy modern stuff, Normal maps, dynamic lighting and dynamic infestation( Or did this get lost with hl2?). All in all, i would like to know more about how this engine is nailed together. Did you get any free ware code from the internet that did half the job, what are the biggest problems when you program your own game engine, how do things stick together? How many lines are you up to now? these sort of things would be fun to learn more about.

Comments

  • killkrazykillkrazy Join Date: 2007-09-10 Member: 62238Members
    edited March 2009
    It would be nice to know all this, but the guys are busy, there's only 4 of them (full-time employees) and apart from twitters here and there with snippets of info / musings they really won't have time to go into so much detail.

    I'd just use the information in the blogs and casts and put the picture together yourself...
    <ul><li>Freeware code? not sure it if was free, but they've adopted a 3rd party physics system and Max studied some other developer's ideas on lighting and textures (early on)</li><li>Biggest problem? was trying to mould and morph a different engine to their needs, building their own fixed this</li><li>things stick together? they have a base of engine for the rendering and physical side of the game (solids, effects, particles, lighting) and all the actual gameplay code is in a scripting language called <a href="http://en.wikipedia.org/wiki/Lua_(programming_language)" target="_blank">LUA</a> (for stuff like movement, weapons, game modes)</li><li>Lines of code? well, the engine was a ways done when they said 80,000 so if I had to take a stab in the dark I'd guestimate 130,000 engine code, and possibly 20,000-40,000 LUA (lua is pretty streamlined from what the casts and blogs show)</li></ul>
    I cant say all my info is 100% accurate, but I've been watching this site daily for the last 2/3 years so that's what I recollect.
    The developers are quite in touch with the community, but if they took the time to answer every post like this with a fair amount of detial no work would get done <img src="style_emoticons/<#EMO_DIR#>/smile-fix.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile-fix.gif" />
  • duke_Qaduke_Qa Join Date: 2007-09-22 Member: 62405Members, Reinforced - Shadow
    Yeah I don't expect an answer to every question asked, but I think spending a few minutes of my time to make a post like this can have positive outcome. This thread is more or less a wish to see something akin to the article on Occlusion Culling on the other parts of this engine. If that doesn't happen, c`est la vie. at least I got a reply from someone <img src="style_emoticons/<#EMO_DIR#>/tounge.gif" style="vertical-align:middle" emoid=":p" border="0" alt="tounge.gif" /> .

    I had a longer OP to begin with where I went through what I knew about the game as of yet where I mentioned LUA being used, but it was getting long and boring so I cropped it out. Its as you say where the gameplay mechanics are programmed(scripted is prolly the right definition on the LUA-part, since its not running as its own program but giving commands to a different program on how to behave. it is probably a advanced level of scripting though, so the difference on scripting and programming is probably not that big here).

    The twitters are nice to read to get your fix of whats happening in the here and now. And I've gone through the discussion thread around them to see what people have found interesting.
Sign In or Register to comment.