Development Blog Update - Multi-threading dev video

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 Development Blog Update - Multi-threading dev video here

Comments

  • derWalterderWalter Join Date: 2008-10-29 Member: 65323Members
    edited January 2012
    would have a server available with 2x12 cores @2,6ghz... but unfortunately i was told that the server needs a single core with 4-5ghz because of its lack of multithreading.

    so it got rejected by ensl.org :(



    btw.: for HalfLife there is a metamodplugin which bypasses the hardcoded 1000fps limit from the server
    and a friend of mine runs a cs server on an i5 with 3,4ghz at around 40 000 fps!
  • KrizzenKrizzen Join Date: 2011-12-16 Member: 138181Members
    I really enjoy the more technical videos, and I think they should be even more technical. It's very interesting to peer into the thought process and design goals going into NS2.
  • bobthesobbobthesob Join Date: 2011-12-09 Member: 137195Members
    where is the Multi-threading dev video?
  • playerplayer Join Date: 2010-09-12 Member: 73982Members
    <!--quoteo(post=1897117:date=Jan 24 2012, 06:48 PM:name=derWalter)--><div class='quotetop'>QUOTE (derWalter @ Jan 24 2012, 06:48 PM) <a href="index.php?act=findpost&pid=1897117"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->btw.: for HalfLife there is a metamodplugin which bypasses the hardcoded 1000fps limit from the server
    and a friend of mine runs a cs server on an i5 with 3,4ghz at around 40 000 fps!<!--QuoteEnd--></div><!--QuoteEEnd-->
    Counter-Strike doesn't have a lot going on in comparison to NS1\2, so while Lua does bugger up NS2's performance generally, it's gameplay-mechanics are still pretty heavy. If it was written in C\C++ like CS we certainly wouldn't be seeing performance anywhere near (a hypothetical) 40.000 FPS.

    As for the multi-threading, the video told most of it pretty much, everything that is easily threaded already is at this point (level-loading, physics, netcode, file-IO), the thing that is really holding the performance down is the game-logic (eg. the Lua-script), and multi-threading that in a conventional manner is neigh impossible. Well... strictly speaking not impossible, in fact pretty easy, keeping the cores buzy with USEFUL work however (eg. not waiting for mutex-locks all the time) demands very clever engineering-design.

    Multi-threading would be a preferred method, as something along the lines of LuaJIT with FFI might still not yield enough performance in terms of C interacting with Lua (which is a pending problem with Spark, and I've started to really run into it myself).
  • KrizzenKrizzen Join Date: 2011-12-16 Member: 138181Members
    Link to the NS2HD video on YouTube:

    <a href="http://www.youtube.com/watch?v=Dt8_lShjatg" target="_blank">http://www.youtube.com/watch?v=Dt8_lShjatg</a>
  • yimmasabiyimmasabi Join Date: 2006-11-03 Member: 58318Members
    edited January 2012
    For this game,

    Im against using multi threading on online changes, server processes and some other sync based cloud operations which must be sync between server and clients. Because that makes line busy, much more lags, chokes, regs etc. That is important point.

    On the otherhand multi-threading, multi-core, multi-cpu, multi-gpu is highly needed for;
    - Physics (all collisions, kinematics, particullar eftects etc.)
    - Rendering and Lighting
    - Water effects (3D waving or some navier-stokes equation applications, shining, transparency)
    - Gas and some other effects
    - Other matrix based real-time effects or calculations (may be in infestation effects etc.)
    are the must.

    In conclusion multi-threading is only good if its results are not used in online send packages.

    Also this slogan can be used (with a good grammer) :D

    "NS2 is not only powerfull by its engine but also by its multi-treading."

    PS: I listen video but I didnt understand all cuz u speak too fast :D Forgive me if I miss something
    PS2: Please enable Physics-GPU, Thanx
  • juicejuice Join Date: 2003-01-28 Member: 12886Members, Constellation
    +1 for crowd-sourcing "MaxOS"
  • TinCanTinCan Join Date: 2006-12-11 Member: 59010Members
    I am not clear what happens to old school rigs like mine that only have one core. Will it just take longer/run slower or am I in the market for a new computer and didn't even realize it?
  • InertInert Join Date: 2008-02-03 Member: 63569Members
    edited January 2012
    When will we get to see the first build with multi threading enabled? (besides the loading screen)
  • playerplayer Join Date: 2010-09-12 Member: 73982Members
    <!--quoteo(post=1897150:date=Jan 24 2012, 09:31 PM:name=TinCan)--><div class='quotetop'>QUOTE (TinCan @ Jan 24 2012, 09:31 PM) <a href="index.php?act=findpost&pid=1897150"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I am not clear what happens to old school rigs like mine that only have one core. Will it just take longer/run slower or am I in the market for a new computer and didn't even realize it?<!--QuoteEnd--></div><!--QuoteEEnd-->
    Single cores can do any kind of multi-threading (even slightly faster, due to the lack of overhead, eg. scheduling et cetera). Multi-threading however is very often less efficient, and makes up for that by throwing a lot of power (cores) into the process, thus allowing in the end a better performance than single-cores (but again, worse efficiency). Simply put, if single-threaded code is re-written\designed for multi-threading, chances are a single-core CPU will indeed experience worse performance (due to the less efficient design, which is capable of utilizing multiple cores, but that advantages does you no good with just 1 core).
  • yimmasabiyimmasabi Join Date: 2006-11-03 Member: 58318Members
    edited January 2012
    <!--quoteo(post=1897150:date=Jan 24 2012, 09:31 PM:name=TinCan)--><div class='quotetop'>QUOTE (TinCan @ Jan 24 2012, 09:31 PM) <a href="index.php?act=findpost&pid=1897150"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I am not clear what happens to old school rigs like mine that only have one core. Will it just take longer/run slower or am I in the market for a new computer and didn't even realize it?<!--QuoteEnd--></div><!--QuoteEEnd-->

    Yes, multi-threading must be available for multi core, gpu systems. If there is one core, all effects should be off or should be low with users options.
    And multi-threading can be done with many single core cpu based PCs via internet, but it is not usefull for an online game like NS2,CS, HL games :D
  • yimmasabiyimmasabi Join Date: 2006-11-03 Member: 58318Members
    <!--quoteo(post=1897166:date=Jan 24 2012, 10:38 PM:name=player)--><div class='quotetop'>QUOTE (player @ Jan 24 2012, 10:38 PM) <a href="index.php?act=findpost&pid=1897166"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Single cores can do any kind of multi-threading (even slightly faster, due to the lack of overhead, eg. scheduling et cetera). Multi-threading however is very often less efficient, and makes up for that by throwing a lot of power (cores) into the process, thus allowing in the end a better performance than single-cores (but again, worse efficiency). Simply put, if single-threaded code is re-written\designed for multi-threading, chances are a single-core CPU will indeed experience worse performance (due to the less efficient design, which is capable of utilizing multiple cores, but that advantages does you no good with just 1 core).<!--QuoteEnd--></div><!--QuoteEEnd-->

    U dont need to write whole code for multi threading. i.e. u can write for only water calculations. Engine of this game is really heavy for a single core in comparision with MW3, Skyrim, BF3 .
  • playerplayer Join Date: 2010-09-12 Member: 73982Members
    The Lua-scripts are what is causing an immense load upon CPUs currently, that's what I was talking about as an option to multi-thread, and if it is truly designed around a multi-threading principle, single-cores will suffer. But if it can be done, it should be done, it is one of only a few options remaining. Though I can't really think of any game that actually has its core game-logic multi-threaded, it seems yet another problem too big really for an indie-team to surmount.
  • OnosFactoryOnosFactory New Zealand Join Date: 2008-07-16 Member: 64637Members
    edited January 2012
    Yus, at last.....NS2 OS...."A Gorge has bile bombed your memory, you get the green window of death.....please wait whilst a Fade hacks the S**t out of your last known stable install"

    PS: Please remember, while most of us have multi core CPUs, most of us don't have multicore GPUs....and I wouldn't expect that to change by time of release. Maybe one of those '1 year later out of the blue shock my socks off patches' for multi GPU, and just focus (pardon the game pun) on multi core CPUs in the mean time?
  • korvokorvo Join Date: 2009-11-19 Member: 69427Members, Squad Five Blue
    Didn't saw the video, but isn't Multithreading a de-facto standard and very ordinary practice in high end game programming, what's not even worth to mention?
  • DghelneshiDghelneshi Aims to surpass Fana in post edits. Join Date: 2011-11-01 Member: 130634Members, Squad Five Blue, Reinforced - Shadow
    <!--quoteo(post=1897321:date=Jan 25 2012, 07:34 PM:name=korvo)--><div class='quotetop'>QUOTE (korvo @ Jan 25 2012, 07:34 PM) <a href="index.php?act=findpost&pid=1897321"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Didn't saw the video, but isn't Multithreading a de-facto standard and very ordinary practice in high end game programming, what's not even worth to mention?<!--QuoteEnd--></div><!--QuoteEEnd-->
    It is standard for anything you want to run fast, but most people seem to think it's just a magic line of code "multithread this", while it is actually a very complex problem.
  • playerplayer Join Date: 2010-09-12 Member: 73982Members
    <!--quoteo(post=1897321:date=Jan 25 2012, 06:34 PM:name=korvo)--><div class='quotetop'>QUOTE (korvo @ Jan 25 2012, 06:34 PM) <a href="index.php?act=findpost&pid=1897321"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Didn't saw the video, but isn't Multithreading a de-facto standard and very ordinary practice in high end game programming, what's not even worth to mention?<!--QuoteEnd--></div><!--QuoteEEnd-->
    It is for physics\file-IO\networking\sound and such, not for game-logic.
  • lunsluns Join Date: 2010-12-05 Member: 75502Members
    all i have to say about this, I shouldn't need to buy 3k pc just to be able to run/play this game. Even though I have an old pc, I run other games fairly well compared to ns2. And this game still did not post recommended spec requirements, if I missed it, some one post a link to those specs.

    now back on topic, "When will we get to see the first build with multi threading enabled?"
  • playerplayer Join Date: 2010-09-12 Member: 73982Members
    Would you be willing to give up NS2's modding-capability for a good performance in return?
  • AlignAlign Remain Calm Join Date: 2002-11-02 Member: 5216Forum Moderators, Constellation
    <!--quoteo(post=1897339:date=Jan 25 2012, 08:28 PM:name=luns)--><div class='quotetop'>QUOTE (luns @ Jan 25 2012, 08:28 PM) <a href="index.php?act=findpost&pid=1897339"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->And this game still did not post recommended spec requirements,<!--QuoteEnd--></div><!--QuoteEEnd-->
    This is because they're not finalized yet. If there had been a requirements list for just a few versions ago, it would have been much higher than for build 19x.
  • ZeikkoZeikko Join Date: 2007-12-16 Member: 63179Members, Squad Five Blue, NS2 Map Tester
    <!--quoteo(post=1897339:date=Jan 25 2012, 10:28 PM:name=luns)--><div class='quotetop'>QUOTE (luns @ Jan 25 2012, 10:28 PM) <a href="index.php?act=findpost&pid=1897339"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->all i have to say about this, I shouldn't need to buy 3k pc just to be able to run/play this game. Even though I have an old pc, I run other games fairly well compared to ns2. And this game still did not post recommended spec requirements, if I missed it, some one post a link to those specs.

    now back on topic, "When will we get to see the first build with multi threading enabled?"<!--QuoteEnd--></div><!--QuoteEEnd-->
    PC capable of running 60fps cost me 420 €. Not including peripherals, monitor, etc. 3k is quite an overstatement if you speak in euros or dollars.
  • derWalterderWalter Join Date: 2008-10-29 Member: 65323Members
    isnt there a middle way? lets say, compile lua to machine code?
    you have the slow debug mode with live lua and the gaming mode with compiled lua...
    so you can play with a little bit of stuttering to develop and debug
    and then play fast with compiled code...
  • TinCanTinCan Join Date: 2006-12-11 Member: 59010Members
    <!--quoteo(post=1897150:date=Jan 24 2012, 09:31 PM:name=TinCan)--><div class='quotetop'>QUOTE (TinCan @ Jan 24 2012, 09:31 PM) <a href="index.php?act=findpost&pid=1897150"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I am not clear what happens to old school rigs like mine that only have one core. Will it just take longer/run slower or am I in the market for a new computer and didn't even realize it?<!--QuoteEnd--></div><!--QuoteEEnd-->
    Further research suggests it will run as long as your CPU is capable of HTT [Hyper-Threading Technology] (Make sure it is enabled in your BIOS) but if your single core is not capable of HTT it will crash.
  • playerplayer Join Date: 2010-09-12 Member: 73982Members
    Multi-threaded applications don't crash single-cores, in fact we've had multi-threaded apps long before multi-cores became mainstream, they'll just context-switch now and then to mimic multi-tasking.
Sign In or Register to comment.