Natural Selection 2 News Update - On NS2 performance

FlayraFlayra Game Director, Unknown Worlds EntertainmentSan Francisco Join Date: 2002-01-22 Member: 3Super Administrators, NS2 Developer, Subnautica Developer
Please post comments on the topic Natural Selection 2 News Update - On NS2 performance here
«134

Comments

  • DJPenguinDJPenguin Useless Join Date: 2003-07-29 Member: 18538Members
    not much to say really. those with even the smallest sense of rationale knows you guys will pull through.
  • internetexplorerinternetexplorer Join Date: 2011-10-13 Member: 127255Members
    It's a pretty good explanation of the computing concepts at work, but the pessimist in me says nobody who complains really loudly will read that far...
  • peregrinusperegrinus Join Date: 2010-07-16 Member: 72445Members
    Really good read. You made the right decision to hire NS2HD!
  • playerplayer Join Date: 2010-09-12 Member: 73982Members
    Good to know they're going to work on the fundamentals. The polishing of the Lua-scripts will yield speed-ups, but I gather it won't be sufficient all on its own. And I'm still quavering with regards to the figures NS2HD is qouting, for servers (as of the latest build), I'm inclined to say we need a 500-1000% speed-up.

    but the pessimist in me says people will be satisfied with a 4-5GHz 30-tick server.
  • internetexplorerinternetexplorer Join Date: 2011-10-13 Member: 127255Members
    You know what I'd like to read about? What the server framerate actually <i>means</i>. CSS, TF2, Quake etc would be unplayable with a 30 tickrate. How does their stuff relate to NS2's rates?
  • playerplayer Join Date: 2010-09-12 Member: 73982Members
    CS:S and TF2 can run without problems on 60 ticks (in fact they do by default). L4D goes as low as 30 (though not as fast-paced a game of course). Judging the animations and hit-reg on NS2-servers, I'm thinking they should be closer to 60 than 30. I guess I have the competitive-scene in the back my head when contemplating these issues, and I feel like 60-100 should be the target.
  • rebirthrebirth Join Date: 2007-09-23 Member: 62416Members, Reinforced - Supporter, Reinforced - Silver, Reinforced - Shadow
    edited April 2012
    Personally i couldn't be more happy about Spark's performance, i like how CPU intensive it is for a change.
    Let's assume that Spark and as such NS2 is here to stay for a while.
    And CPU's are usually there to stay and have an higher lifetime in terms of "performance" then GPU's have.

    So a PC game being mostly CPU limited is always an good thing to me, means that down the line many people will be able to play on "average computers" as CPU speeds/core numbers keep increasing at high rates. So future PC's will have an easier time running this baby without having to depend too much on an "high end gaming GPU" being inside that same PC.

    Kinda reminds me of Raytracing in some ways and why it would be a great thing to use for videogames.

    I also like how the NS2 seems to outsource a lot of logic to the server CPU, this is akin to the general trend of cloud computing that outsources a lot of logic/workload to the server side to remove some strain on the client side calculations. But i don't have any deep programming experience so i'm not sure how stupid/wrong the correlations and observations i'm making here actually are ;)
  • playerplayer Join Date: 2010-09-12 Member: 73982Members
    Except that NS2 demands vertical-performance (single threaded, high clock-speed), while CPUs are moving towards horizontal-performance (as you pointed out, an increase of cores). CPUs will still remain as fast or become faster in single-threaded work with each passing generation, but the focus is shifting away from it.
  • XariusXarius Join Date: 2003-12-21 Member: 24630Members, Reinforced - Supporter
    Good article, very understandable for people with absolutely no coding background, and great to hear that big improvements are on the way.
  • rebirthrebirth Join Date: 2007-09-23 Member: 62416Members, Reinforced - Supporter, Reinforced - Silver, Reinforced - Shadow
    edited April 2012
    <!--quoteo(post=1925468:date=Apr 14 2012, 11:54 PM:name=player)--><div class='quotetop'>QUOTE (player @ Apr 14 2012, 11:54 PM) <a href="index.php?act=findpost&pid=1925468"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Except that NS2 demands vertical-performance (single threaded, high clock-speed), while CPUs are moving towards horizontal-performance (as you pointed out, an increase of cores). CPUs will still remain as fast or become faster in single-threaded work with each passing generation, but the focus is shifting away from it.<!--QuoteEnd--></div><!--QuoteEEnd-->

    They are still getting faster overall, you can't ignore that "clock speeds" between architectures also don't translate seamlessly in terms of performance.
    Newer architectures usually work more efficient/performant with slower clockspeeds compared to older architectures at the same speeds. Regardless of number of cores.
    And as such a CPU limited game usually tends to be one with more "lasting appeal".

    Most office and budget PC's cut down on the GPU as the GPU is an piece of hardware that iterates more often compared to the CPU. But performance jumps between GPU generations are usually not the drastic compared to performance jumps with new CPU generations. Anyway, it's great how many sentences we can write and end up basicly arguing for the same thing ;)
  • JibrailJibrail Join Date: 2009-04-16 Member: 67200Members
    Great article and very well written I enjoyed that thanks Hugh.

    On another note I am asking this because I have no background in programming but say if I wanted to create a game using this engine and LUA, and the game logic isnt as complex as the one in NS2 ( I am talking about the whole layer so including UI, how structures work, weapons etc ) lets say something like Counter Strike for argument's sake will the client/server run smoother if it has less lines of code giving that it is allso well optimized? and will it be a huge difference or very small and barely noticeable?
  • DeadzoneDeadzone Join Date: 2003-07-03 Member: 17911Members, Reinforced - Shadow
    Great article, Hugh! I really enjoyed reading it. It explained a lot in simple terms, which I appreciate since I'm not a coder.

    It's also great to hear you've got the main culprit of the performance issues pinned down! I'm sure you'll figure a way to make it work before summer's over.
  • WilsonWilson Join Date: 2010-07-26 Member: 72867Members
    <img src="http://i.imgur.com/NMCEC.jpg" border="0" class="linked-image" />

    Just trolling :P
  • croncron Join Date: 2010-06-21 Member: 72122Members
    I wonder how much work it would be to migrate parts of the game, that are rock solid decided and not subject to change, to C++ code. You already have the Lua scripts communicating with C++ code through some interface; in every program there are those functions that are called much more often than others and eat up much more time, I imagine that is very much so the case with game logic and I wonder how much of an impact it would have to migrate just the top 1% hungry functions to precompiled code.
    As I remember the Luajit approach did not work out and I see how migrating some parts of the game code to another language is neither a clean solution nor does it help the ease of modding that you want to pursue, but if there is no other way to squeeze out performance, would that be possible?
    Migrating just the most called functions like line of sight-tracing or the pathing of AI entities to precompiled code sounds like last measure method with a huge potential.

    Apart from that, which networking model is NS2 using? I have recently seen an interesting talk from one of the programmers at Bungie about their networking with a priority system based on analyzed player stats where many entities would not even be considered for a refresh for several seconds. I imagine such a priority system would be possible to write pre-compiled as modders really don't need to touch that (assuming the server is written entirely in Lua atm).
  • Super Angus BoySuper Angus Boy Join Date: 2012-04-01 Member: 149771Members
    Great read, very informative :)
  • sickboysickboy Join Date: 2003-09-13 Member: 20804Members, Constellation
    Very nice read, thanks for writing it up! Now lets just hope the constant complainers will shut their traps and be patient.
  • WheeeeWheeee Join Date: 2003-02-18 Member: 13713Members, Reinforced - Shadow
    edited April 2012
    dealing with the server issues would solve 50% of the client issues. The game is fun enough that i can deal with frame dips in combat. what kills the experience is those godawful 2-3 second stutters where the server decides to ###### itself because it's overloaded.
  • JowJow Join Date: 2011-06-23 Member: 106032Members
    edited April 2012
    <!--quoteo(post=1925463:date=Apr 14 2012, 06:34 PM:name=player)--><div class='quotetop'>QUOTE (player @ Apr 14 2012, 06:34 PM) <a href="index.php?act=findpost&pid=1925463"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->CS:S and TF2 can run without problems on 60 ticks (in fact they do by default). L4D goes as low as 30 (though not as fast-paced a game of course). Judging the animations and hit-reg on NS2-servers, I'm thinking they should be closer to 60 than 30. I guess I have the competitive-scene in the back my head when contemplating these issues, and I feel like 60-100 should be the target.<!--QuoteEnd--></div><!--QuoteEEnd-->

    Quake 3 was a 30 tick game and Quake Live only uses 40, I've always wondered why Source games ran at such high tickrates to feel good for hitreg.
  • YuukiYuuki Join Date: 2010-11-20 Member: 75079Members
    <!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->In fact, it is perfectly accurate to call Natural Selection 2 a mod of the Spark engine. Spark is the in-house engine developed as the brain-child of Max 'm4x0r' McGuire. Spark is written in C++, a fast low level language. NS2 sits on top of Spark, written entirely in easily accessible Lua. It is possible to mess with the game without ever having to deal with the C++ engine.<!--QuoteEnd--></div><!--QuoteEEnd-->

    What about the dot functions (e.g. Alien.GetFrictionForce), are those written in lua ? I'm a bit confused because methods are normally called with colon in lua (Alien:GetFrictionForce).

    I'd love to have more technical informations about the lua vm optimization, sounds like an interesting subject.
  • ObraxisObraxis Subnautica Animator & Generalist, NS2 Person Join Date: 2004-07-24 Member: 30071Super Administrators, Forum Admins, NS1 Playtester, Forum Moderators, NS2 Developer, Constellation, NS2 Playtester, Squad Five Silver, WC 2013 - Supporter, Subnautica Developer, Pistachionauts
    Being CPU bound is better than being GPU bound. They know where the problems are, and are working to speed things up dramatically. They're long-term plans but like a fine wine, the product will be fantastic.
  • MuYeahMuYeah Join Date: 2006-12-26 Member: 59261Members
    That was interesting. Thanks for writing it.
  • ZehtukaZehtuka Join Date: 2010-07-26 Member: 72853Members
    I don't understand why everybody is getting so mad at the performance. Yes it is not that amazing right now but considering the quality of their programmers this will be resolved before launch. Like Hugh said they're using the beta as an instant-feedback tool to find out what works and what doesn't. When they've found the "sweet spot" with the gameplay they can optimize it to infinity, it is not unrealistic to expect a 200 to 300% performance increase as we draw closer to launch.
  • Dragon-GuardDragon-Guard Join Date: 2011-07-25 Member: 112159Members
    Nice read!

    offtopic but this line instantly made me think of a piece of art.

    "...and explains where we are, how we got here, and where we're going."


    Paul Gauguin - Where Do We Come From? What Are We? Where Are We Going?
  • croncron Join Date: 2010-06-21 Member: 72122Members
    <!--quoteo(post=1925592:date=Apr 15 2012, 01:27 PM:name=Dragon-Guard)--><div class='quotetop'>QUOTE (Dragon-Guard @ Apr 15 2012, 01:27 PM) <a href="index.php?act=findpost&pid=1925592"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Paul Gauguin - Where Do We Come From? What Are We? Where Are We Going?<!--QuoteEnd--></div><!--QuoteEEnd-->

    Let's just hope UWE don't suddenly have enough of all of us and run away to Polynesia with no money but lots of talent.
  • MJR_1MJR_1 Join Date: 2012-04-15 Member: 150486Members
    Hello, this is my first post, but I had to write it because I am really concerned about the whole LUA thing.

    I am a big fan of NS1 and preordered NS2 already back in 2009 (for me and a friend) and want NS2 to succeed.

    In my opinion you should consider extrem drastic actions like getting rid of LUA/FLash/etc almost entirely (except for some perfomance uncritical parts)
    and rewirtting the code in C++.

    I know that this is a lot of work and would also make modding very hard, but you should always keep in mind that the shooter part of your game is only fun if it is fluent and it makes up for a big part of the gameplay.

    98% of all mods will be something like siege maps for NS1 that dont need a lot of LUA scripting to make them.

    If the server start lagging with 16 player and you dont get a fluent FPS experience with a typical high end pc, then the rest of the game does not matter any more.

    Short Version:
    Modding capabilities should always come second to the perfomance of NS2


    (excuse my bad english :>)
  • w0dk4w0dk4 Join Date: 2008-04-22 Member: 64129Members, Constellation, Reinforced - Shadow
    <!--quoteo(post=1925602:date=Apr 15 2012, 01:03 PM:name=MJR_1)--><div class='quotetop'>QUOTE (MJR_1 @ Apr 15 2012, 01:03 PM) <a href="index.php?act=findpost&pid=1925602"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Hello, this is my first post, but I had to write it because I am really concerned about the whole LUA thing.

    I am a big fan of NS1 and preordered NS2 already back in 2009 (for me and a friend) and want NS2 to succeed.

    In my opinion you should consider extrem drastic actions like getting rid of LUA/FLash/etc almost entirely (except for some perfomance uncritical parts)
    and rewirtting the code in C++.

    I know that this is a lot of work and would also make modding very hard, but you should always keep in mind that the shooter part of your game is only fun if it is fluent and it makes up for a big part of the gameplay.

    98% of all mods will be something like siege maps for NS1 that dont need a lot of LUA scripting to make them.

    If the server start lagging with 16 player and you dont get a fluent FPS experience with a typical high end pc, then the rest of the game does not matter any more.

    Short Version:
    Modding capabilities should always come second to the perfomance of NS2


    (excuse my bad english :>)<!--QuoteEnd--></div><!--QuoteEEnd-->

    Kinda agree here. This:

    <!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->That is what Max is spending much of his time on right now. In fact, a programmer who shall not be name believes that the new 'Lua Virtual Machine' could cut Lua CPU usage in NS2 by 50%. This would yield a performance improvement of 25% at least, and likely more. Add that to the 'Hydra' style Lua optimisation and the improvement numbers start to look very, very attractive.<!--QuoteEnd--></div><!--QuoteEEnd-->

    So, <b>at best</b>, this will result in a 25% performance increase (btw. I thought this was already done).
    Of course this increases FPS and playability, but i.e. on the server side, at least a 100% perf. increase is needed (which is your goal for release apparently).

    I hope you can pull it through but I also urge to think about more drastic actions. And the argument that being CPU bound is a good thing must be the joke of the week. CPU being the bottleneck is the worst thing that can happen to your game, since players can not "fix" it by lowering the graphics settings (especially important for competitive scene).
  • YuukiYuuki Join Date: 2010-11-20 Member: 75079Members
    I think chunks of code have already been moved to C++. C.f. my previous question :

    <!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->What about the dot functions (e.g. Alien.GetFrictionForce), are those written in lua ? I'm a bit confused because methods are normally called with colon in lua (Alien:GetFrictionForce).<!--QuoteEnd--></div><!--QuoteEEnd-->

    Rewriting everything would probably take way too long. But I agree that performance is more important that moddability; if the game don't run well nobody will want to mod it anyway.
  • JibrailJibrail Join Date: 2009-04-16 Member: 67200Members
    if they decide to go with C++ may that be everything or just some parts would that mean they have to rewrite a certain part of the engine to call code from c++ instead of LUA? or can they just start doing it?

    allso can someone with knowledge of programming answear my question on the first page post nr: 12
  • BacillusBacillus Join Date: 2006-11-02 Member: 58241Members
    edited April 2012
    <!--quoteo(post=1925569:date=Apr 15 2012, 10:46 AM:name=Obraxis)--><div class='quotetop'>QUOTE (Obraxis @ Apr 15 2012, 10:46 AM) <a href="index.php?act=findpost&pid=1925569"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Being CPU bound is better than being GPU bound.<!--QuoteEnd--></div><!--QuoteEEnd-->
    Why? Unless you're going to provide some arguments to back you up, I'm going with w0dk4's argument:

    <!--quoteo(post=1925604:date=Apr 15 2012, 01:10 PM:name=w0dk4)--><div class='quotetop'>QUOTE (w0dk4 @ Apr 15 2012, 01:10 PM) <a href="index.php?act=findpost&pid=1925604"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->CPU being the bottleneck is the worst thing that can happen to your game, since players can not "fix" it by lowering the graphics settings.<!--QuoteEnd--></div><!--QuoteEEnd-->

    ---

    If there are problems, let's be honest about them and see what can be done about them rather than trying to see a silver lining in places where it doesn't exist.
  • zeepzeep Join Date: 2002-11-01 Member: 3367Members
    Okay okay, i shall bug you no more with performance related posts.
    You've explained it to the bone.
Sign In or Register to comment.