Skip to content

Request: Multithreading support. Can't believe so few mentioned it yet.

Back in 2002 NWN showed already that it could consider multithreading as a viable possibility for performance. With this re-release and the promise of getting a 64bit exe, why shouldn't it be possible for better and more multithreading to happen for this re-release?
RAM021ShadowMGrymlordetfox
«1

Comments

  • cacodaemoncacodaemon Member Posts: 3
    Does it really need it? You don't need much of a PC to run this game.
  • voidofopinionvoidofopinion Member, Moderator Posts: 1,248

    Does it really need it? You don't need much of a PC to run this game.

    The serve client on the other hand...
    Dark_AnsemRAM021dTdtfox
  • cacodaemoncacodaemon Member Posts: 3

    Does it really need it? You don't need much of a PC to run this game.

    Maybe you don't need it NOW. But again, it could be more resource-intesive with prettier VFX, light effects and, more importantly, heavy scripting.
    If I don't need it now maybe that explains why it shouldn't be a priority. Not saying it isn't a good idea, everybody likes the idea of better performance...but focus is probably better spent in other areas.

  • Dark_AnsemDark_Ansem Member Posts: 992

    Does it really need it? You don't need much of a PC to run this game.

    Maybe you don't need it NOW. But again, it could be more resource-intesive with prettier VFX, light effects and, more importantly, heavy scripting.
    If I don't need it now maybe that explains why it shouldn't be a priority. Not saying it isn't a good idea, everybody likes the idea of better performance...but focus is probably better spent in other areas.

    "640K ought to be enough for anybody." - Bill Gates
    couldn't have put it better myself.
    voidofopinionRAM021dTdtfox
  • TarotRedhandTarotRedhand Member Posts: 1,481
    If there were a Trello board item for this I'd vote for it (and don't embarrass me by saying "why there is and it's right here..." B) .

    TR
  • TarotRedhandTarotRedhand Member Posts: 1,481
    I said don't embarrass me... :s

    TR
    JuliusBorisovProont
  • DrHappyAngryDrHappyAngry Member Posts: 1,577


    "640K ought to be enough for anybody." - Bill Gates

    He didn't actually say that. Nobody can cite the original source. Wired debunked it back in '97 https://www.wired.com/1997/01/did-gates-really-say-640k-is-enough-for-anyone/

    I'm curious about something, and I think only somebody familiar with the code would be able to answer it. Maybe @JuliusBorisov could answer? Would multi-threading actually help? Like can the AI and server deal with running as more than one thread? Would it actually show a benefit, say allowing more players to be on a server, or for massive battles with hundreds of AI controlled combatants? Just wondering before I vote for precious developer resources to be used on something.
    RAM021
  • voidofopinionvoidofopinion Member, Moderator Posts: 1,248
    edited January 2018


    "640K ought to be enough for anybody." - Bill Gates

    He didn't actually say that. Nobody can cite the original source. Wired debunked it back in '97 https://www.wired.com/1997/01/did-gates-really-say-640k-is-enough-for-anyone/
    It really doesn't matter if it was taken out of context or if he even said it at all.

    Much like many popular "quotes" actively used today It has become allegorical and serves its purpose regardless.

    NWN being single threaded is a bottleneck the community has no ability to mod around it.

    "Judge me by my intent. Not my shotgun." - Ghandi
    RAM021Proonttfox
  • DrHappyAngryDrHappyAngry Member Posts: 1,577
    I'm not disagreeing that multithreading is something the community can't work around, I'm just asking would it actually be beneficial? A lot of programs still to this day don't thread out well or require a huge amount of refactoring things to make multi-threading happen without crapping themselves. If it's a massive undertaking for a 5% boost to performance in some edge cases, I might rather vote for something else. If it results in us being able to have massive battles of with hundreds of AI creatures or scales up the server to handle more connected clients, awesome, I'm all for it.


    voidofopinionRAM021Savant1974Proont
  • Dark_AnsemDark_Ansem Member Posts: 992
    Well, we know we are getting a 64bit exe and the game already featured some of it.
  • SherincallSherincall Member Posts: 387
    64bit has some benefits (obvious ones being that Apple will stop supporting 32bit apps), but don't expect the game to be faster because of it. None of the critical paths I've seen are heavy on register use, so the larger register file will not be utilized. As for extra memory... I've never known NWN to hit the 2GB mark, let alone the 3GB limit.

    In fact, it is perfectly possible the 64bit program will be _slower_ than the 32bit one, due to more data needing to be transfered in some cases. This won't be noticeable if it happens, but neither will be any speedup from the 64bit.
    GreenWarlockFaydark
  • FinneousPJFinneousPJ Member Posts: 6,455



    In fact, it is perfectly possible the 64bit program will be _slower_ than the 32bit one, due to more data needing to be transfered in some cases. This won't be noticeable if it happens, but neither will be any speedup from the 64bit.

    Interesting. Do you have sources?
  • Dark_AnsemDark_Ansem Member Posts: 992
    Would it help however in case of packs such as the PRC?
  • GreenWarlockGreenWarlock Member Posts: 1,354
    @FinneousPJ A 64-bit build of identical software simply has to move more bits around, as some data (e.g., pointers) are now twice as large. There is no magical speed-up coming from elsewhere, and if we are not benefitting from being able to store more data in RAM, then the simple act of copying data from memory is going to lead to a slight slow-down. This is not only the act of moving more bits across the memory buffer, but also memory caches, notably in the CPU itself, now holding less data (as the data is bigger).

    Whether the actual impact itself will be observable is unknown without hard measurements. We may get some 'magical speedups' simply compiling with a more modern compiler that has a better optimizer, although the same would be true for 32-bit code as well. The slow-down, if any, would be best observed measuring against a 32-bit build with the same compiler.

    So in practice, I doubt we will see much actual impact on performance going to 64-bits on software of this era, although it is fun to speculate.
  • TarotRedhandTarotRedhand Member Posts: 1,481
    I voted for this change simply with an eye to the future. It is true that the current set-up of the game may well not show any improvements. Having the possibility that there might be at some point in the future though swung it for me. The same for 64 bit. For example it may turn out that a cure for the infamous "spawn-in stutter" may necessitate the use of more memory than 32 bit allows (doubtful but never say never). Or there could be other scenarios that arise because of BD's vision for this game. Who knows?

    TR
    Proont
  • FinneousPJFinneousPJ Member Posts: 6,455

    @FinneousPJ A 64-bit build of identical software simply has to move more bits around, as some data (e.g., pointers) are now twice as large. There is no magical speed-up coming from elsewhere, and if we are not benefitting from being able to store more data in RAM, then the simple act of copying data from memory is going to lead to a slight slow-down. This is not only the act of moving more bits across the memory buffer, but also memory caches, notably in the CPU itself, now holding less data (as the data is bigger).

    Whether the actual impact itself will be observable is unknown without hard measurements. We may get some 'magical speedups' simply compiling with a more modern compiler that has a better optimizer, although the same would be true for 32-bit code as well. The slow-down, if any, would be best observed measuring against a 32-bit build with the same compiler.

    So in practice, I doubt we will see much actual impact on performance going to 64-bits on software of this era, although it is fun to speculate.

    Yeah the address is twice as large but is not the address bus also twice as large in hardware, moving twice as many bits on the hw level
  • GreenWarlockGreenWarlock Member Posts: 1,354
    It is the same bus when compiling for 32-bit or 64-bit, so you can move two 32-bit pointer or one 64-bit pointer for the same cost. And as I said, likely the more significant effect will be larger data filling the cache lines of your CPU, so you will get more cache misses, requiring a fetch of data from slower memory.

    Probably the biggest issue is that game code is notoriously full of very specific performance hacks, and all of those hacks will be optimized for 32-bit data layouts. On the other hand, if they are designed to make most efficient use of cache memory on the CPU, modern caches dwarf those of the era when the infinity engine was created, which is why I doubt the effect will be observable in practice.
  • FinneousPJFinneousPJ Member Posts: 6,455

    It is the same bus when compiling for 32-bit or 64-bit, so you can move two 32-bit pointer or one 64-bit pointer for the same cost.

    I am not an expert in desktop CPUs but I know this is not automatically or necessarily the case
  • FinneousPJFinneousPJ Member Posts: 6,455
    Parasitic mining in commercial game code would be an innovation I guess...
    Savant1974
  • JuliusBorisovJuliusBorisov Member, Administrator, Moderator, Developer Posts: 22,714


    "640K ought to be enough for anybody." - Bill Gates

    He didn't actually say that. Nobody can cite the original source. Wired debunked it back in '97 https://www.wired.com/1997/01/did-gates-really-say-640k-is-enough-for-anyone/

    I'm curious about something, and I think only somebody familiar with the code would be able to answer it. Maybe @JuliusBorisov could answer? Would multi-threading actually help? Like can the AI and server deal with running as more than one thread? Would it actually show a benefit, say allowing more players to be on a server, or for massive battles with hundreds of AI controlled combatants? Just wondering before I vote for precious developer resources to be used on something.
    That is a kind of question for a livestream :)
  • FreshLemonBunFreshLemonBun Member Posts: 909
    I doubt you want asynchronous scripts for npc behavior introducing race conditions, path finding on the other hand....

    https://software.intel.com/en-us/articles/the-secrets-of-parallel-pathfinding-on-modern-computer-hardware
    GreenWarlock
  • DrHappyAngryDrHappyAngry Member Posts: 1,577


    That is a kind of question for a livestream :)

    Problem is I'm always working then. Hopefully somebody else can bring up the question of "What benefits would multithreading bring for NWN?" during the next live stream.
  • GreenWarlockGreenWarlock Member Posts: 1,354
    edited January 2018
    @FreshLemonBun nice reference, thanks. Interesting to note that article is almost 8 years old, wonder how much the state of the art has advanced since then?

    *Edit* for example, C++ did not get standard support for concurrency/parallelism until 2011, a full year after the article, and parallel algorithms were added only a month or two ago when the new standard was published.
  • seronxseronx Member Posts: 6
    edited January 2018
    What type of multi-threading(multi-tasking/multi-processing) style are we talking about?

    Process? (mostly symmetrical)
    Thread? (mostly cluster - type 1 asymmetrical)
    Threadlet? (mostly grid - type 2 asymmetrical)
  • Dark_AnsemDark_Ansem Member Posts: 992
    Out of curiosity, I've noticed game performance drop significantly during Hordes of the Underdark (Eye Tyrant bridge VFX, specifically). Wouldn't multithreading help in that regard?
Sign In or Register to comment.