Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Neverwinter Nights: Enhanced Edition has been released! Visit nwn.beamdog.com to make an order. NWN:EE FAQ is available.
Soundtracks for BG:EE, SoD, BG2:EE, IWD:EE, PST:EE are now available in the Beamdog store.
Attention, new and old users! Please read the new rules of conduct for the forums, and we hope you enjoy your stay!

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 Posts: 1,242

    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: 913

    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: 586
    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: 586
    I said don't embarrass me... :s

    TR

    JuliusBorisovProont
  • DrHappyAngryDrHappyAngry Member Posts: 816


    "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 Posts: 1,242
    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: 816
    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: 913
    Well, we know we are getting a 64bit exe and the game already featured some of it.

  • SherincallSherincall Member Posts: 330
    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,261



    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: 913
    Would it help however in case of packs such as the PRC?

  • GreenWarlockGreenWarlock Member Posts: 1,350
    @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: 586
    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,261

    @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,350
    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,261

    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,261
    Parasitic mining in commercial game code would be an innovation I guess...

    Savant1974
  • JuliusBorisovJuliusBorisov Member, Administrator, Moderator, Developer Posts: 17,043


    "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: 644
    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: 816


    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,350
    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: 913
    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?

«1
Sign In or Register to comment.