Skip to content

Comments on new v2.5 pathfinding (It is bad news)

2»

Comments

  • JuliusBorisovJuliusBorisov Member, Administrator, Moderator, Developer Posts: 22,754
    Raduziel wrote: »
    2.6 was promised to last year so for my calculations, I'm using 31/12/2018 as a deadline.

    In the July blog entry (and subsequent comments), we explained why we couldn't work on the patches at all.

    I'm working on getting the information about the patch status at the moment.
  • MusaabMusaab Member Posts: 94
    When will we see this 2.6 patch?
  • RaduzielRaduziel Member Posts: 4,714
    And another week has passed...
  • DoubledimasDoubledimas Member, Mobile Tester Posts: 1,286
    Raduziel wrote: »
    And another week has passed...
    From the July update thread:
    I'm still here and I'm hearing all of you. The dev team is currently extremely busy, so, unfortunately, we can't provide any new information (and missed all the previous estimations around the blog posts and whatnot). As soon as I learn anything, I'll share it.


  • RaduzielRaduziel Member Posts: 4,714
    @Doubledimas That's not a solution neither an information, thus I'll keep waiting for either one of them.
  • DoubledimasDoubledimas Member, Mobile Tester Posts: 1,286
    Raduziel wrote: »
    @Doubledimas That's not a solution neither an information, thus I'll keep waiting for either one of them.
    I wish I had the power to give you a solution.
    It is information in the sense that you can probably keep posting your comment for a number of weeks as it seems that Beamdog will miss some more deadlines.

  • RaduzielRaduziel Member Posts: 4,714
    @Bubb My hero. For future reference, @TrentOster , that's an example of a solution.

    @Doubledimas You don't have to have that power, this task falls upon Beamdog's shoulders.
  • Minsc2017Minsc2017 Member Posts: 34
    Bubb wrote: »
    For those that are fed up with the pathfinding + happen to be playing on Windows, I've attached a WeiDU mod that does a really quick exe patch. It attempts to revert the relevant pathfinding code to how v2.3.67.3 worked - it might not function perfectly, but it seems to help on my end:

    Very nice!
  • ithildurnewithildurnew Member Posts: 277
    edited January 2020
    Bubb's exe patch does help with the crazy pathfinding, kudo for supplying this. However, I still see party members getting stuck on/near each other for a few seconds before they eventually extract themselves from the tangle.

    This is, simply put, a really horrendous bug - I can't fathom how they let this exist for so long and how people put up with it. It's especially aggravating when it happens during combat, when you send 3 melees to target a single foe and one of them ends up stuck/unable to act or attack - happens on a regular basis. I also suspect it contributes to the 'npc spawns and needs to approach party to start dialog but gets stuck and dialog is skipped' bug, which seems to happen more frequently with EE 2.5 than the originals.

    This by itself is nearly enough to make me go back to the original BG2 engine.
  • antisthenesantisthenes Member Posts: 6
    C:\Baldur's Gate II Enhanced Edition>

    ERROR: [Baldur.exe] -> [Baldur.exe] Patching Failed (COPY) (Failure("Couldn't find bad_force_point; most likely you are attempting to install on a game version where pathfinding is already fixed."))
    ERROR: Failure("Couldn't find bad_force_point; most likely you are attempting to install on a game version where pathfinding is already fixed.")
    Bubb's v2.5.16.6+ Pathfinding Revert (Restore Pathfinding) was not installed due to errors.

    Without this component the installation cannot be continued.

    You can try to repair the problem and install the component again afterwards. In this case please select "retry" after the repair.

    If you don't want to spend time on that now, you can also exit the program.
    Enter [r]etry or [e]xit.

    So this is the second time this error occurs. I restarted everything last time and tried again. When I retry nothing occurs, any suggestions?
  • BubbBubb Member Posts: 1,005
    @antisthenes: Which game are you trying to run this on, what version is it, and which storefront did you buy from? The patch should function on all games versioned v2.5.16.6 or v2.5.17.0, though maybe I missed a specific executable.
  • antisthenesantisthenes Member Posts: 6
    edited October 2020
    Gog for BG1:EE/SOD and Steam for BG2:EE. Version 2.5.17.0

    I did take both the fully installed games out of their original directories but I've always done this and it hasn't been an issue. I just gave them their own directories in my SSD drive.
  • ithildurnewithildurnew Member Posts: 277
    edited December 2021
    Bubb wrote: »
    For those that are fed up with the pathfinding + happen to be playing on Windows, I've attached a WeiDU mod that does a really quick exe patch. It attempts to revert the relevant pathfinding code to how v2.3.67.3 worked - it might not function perfectly, but it seems to help on my end:
    Clumping, (notice two characters stack near the bottom):o3atawu32k09.gif
    Patched, (notice characters not walking to the same spot + bumping each other):
    k08dp46reckk.gif

    Edit: And I should note that this is by no means the "correct" way to fix the issue - only the devs can do that. This is just a temporary hack until the next version is released.

    Anyone know if Bubb's patch works with 2.6?

    I still can't believe that they won't fix the issue with characters getting stuck on top of each other/unable to move.
  • MordekaieMordekaie Member Posts: 269
    Bubb wrote: »
    For those that are fed up with the pathfinding + happen to be playing on Windows, I've attached a WeiDU mod that does a really quick exe patch. It attempts to revert the relevant pathfinding code to how v2.3.67.3 worked - it might not function perfectly, but it seems to help on my end:
    Clumping, (notice two characters stack near the bottom):o3atawu32k09.gif
    Patched, (notice characters not walking to the same spot + bumping each other):
    k08dp46reckk.gif

    Edit: And I should note that this is by no means the "correct" way to fix the issue - only the devs can do that. This is just a temporary hack until the next version is released.

    @Bubb I had issues with the pathfinding mechanism on a vanilla BG2EE 2.6.6. I guess the problem hasn't been solved with the last version of the game. Would you also recommend your patch on the V2.6.6 ?
  • AllbrotherAllbrother Member Posts: 261
    Hey @Bubb . Sadly this now fails to install on either of the BGEE games v2.6.6.0 (on gog). Any chance for an update? Playing with a party without this patch is incredibly frustrating.

    Error below:
    Copying and patching 1 file ...
    [Baldur.exe] loaded, 7124992 bytes
    FAILURE:
    Couldn't find bad_force_point; most likely you are attempting to install on a game version where pathfinding is already fixed.
    ERROR: [Baldur.exe] -> [Baldur.exe] Patching Failed (COPY) (Failure("Couldn't find bad_force_point; most likely you are attempting to install on a game version where pathfinding is already fixed."))
    Stopping installation because of error.
    

    For the record, it's not fixed. For shame, BD. It's been 3 years
  • BubbBubb Member Posts: 1,005
    I spent a long time reversing what the engine was doing to get some more insight on this. Basically two changes broke things:

    1) Pre-v2.5.16.6 group-targeting did very little adjustment to the character placements. The only verification it did amounted to checking if the main target, (where you clicked on the map), was passable. This meant that if you clicked near a wall and half of your characters ended up with an invalid target, those characters would just give up at some point.

    v2.5.16.6+ tried to fix this. If characters ended up pathing to an impassible spot on the map it would fall back to routing them to the main target. Well, this means you can get multiple party members all walking to the same exact spot — this happens frequently in tight spaces.

    2) The bumping code was broken. I don't know the specifics here, but it appears a change to some multiplayer sync function causes characters to no longer get out of each other's way in very tight spaces. This also means that if they end up occupying the same part of the map they get stuck.

    You can see why these changes cause problems when put together.

    I've attached an updated version of my patch that works with v2.6.6.0. Since I now understand what the whole walking-to-the-same-point thing was trying to fix I've left it in, but fixed the characters not unstacking themselves.

    @ithildurnew @Mordekaie @Allbrother
  • AllbrotherAllbrother Member Posts: 261
    Awesome, thank you so much!
  • LeiluLeilu Member Posts: 67
    Beamdog, please hire Bubb or at least give him a salary.

    Once again, thank you @Bubb
  • EndarireEndarire Member Posts: 1,519
    @Bubb
    Does the 2.6 pathfinding patch also work on 2.5?

    Also @beamdog_ed, hire Bubb!
  • JohnBobJohnBob Member Posts: 204
    Hello @Bubb,

    I have two questions, if you have some time...

    - About your mod "bubb_revert_pathfinding.2.6".

    Do you have any advice about install order, rather at the end? At the beginning ?
    And particularly before or after EEex which patches the executable ?

    - And about some lines in baldur.exe, BaldursGateII, SiegeOfDragonspear.exe, SiegeOfDragonspear...

    Roll:%d +Luck:%d +SpecialAC:%d +HitMod:%d +Attack of Opportunity:4 +Attack of Opportunity:0 +Berserk:2 +Berserk:0 +Left:%d +Right:%d +Invisible:%d +Invisible Target:%d +Range:%d +Hated Race:%d +Special Target:%d +Protections:%d Roll:%d +DamageMod:%d +Hand bonus:%d *Backstab:%d +Berserk:%d +Strength:%d +Special Bonus:%d +Min Damage:%d

    Here a screenshot in-game...
    01.log.png

    Do you think it's possible to translate them, and / or, make the text more reader-friendly, without causing problems with the executables ? And do you have any hints on the method to follow ?

    If you don't have any idea, it' s fine...

    I'd like to take this opportunity to thank you for your mods and the help you give to players and modders!

  • suysuy Member Posts: 30
    I'm not Bubb, but I'm gonna dare to answer.

    This mod _does_ make a modification of the executable, on disk, so it pretty much should not matter when you install it. EEEx doesn't, as far as I know, change the executable on disk. Instead, makes you launch the game through a wrapper.

    About the lines, it should be doable to edit the strings, yes. Those are string literals in the game, so it's possible to modify them.
  • MordekaieMordekaie Member Posts: 269
    edited August 2022
    @JohnBob Check the link below about your install order question (to resume Bubb's Revert Pathfinding can go right after EET Core).

    https://www.gibberlings3.net/forums/topic/33931-baldurs-gate-install-order-list-repository/?do=findComment&comment=313871
  • BubbBubb Member Posts: 1,005
    edited August 2022
    Endarire wrote: »
    Does the 2.6 pathfinding patch also work on 2.5?

    No, download the old version for v2.5.



    JohnBob wrote: »
    - About your mod "bubb_revert_pathfinding.2.6".

    Do you have any advice about install order, rather at the end? At the beginning ?
    And particularly before or after EEex which patches the executable ?

    As suy says, this patches the exe on disk. Since EEex patches the exe in-memory and doesn't touch the pathfinding locations, there's no order requirements between the two.



    JohnBob wrote: »
    - And about some lines in baldur.exe, BaldursGateII, SiegeOfDragonspear.exe, SiegeOfDragonspear...

    Roll:%d +Luck:%d +SpecialAC:%d +HitMod:%d +Attack of Opportunity:4 +Attack of Opportunity:0 +Berserk:2 +Berserk:0 +Left:%d +Right:%d +Invisible:%d +Invisible Target:%d +Range:%d +Hated Race:%d +Special Target:%d +Protections:%d Roll:%d +DamageMod:%d +Hand bonus:%d *Backstab:%d +Berserk:%d +Strength:%d +Special Bonus:%d +Min Damage:%d

    Here a screenshot in-game...
    01.log.png

    Do you think it's possible to translate them, and / or, make the text more reader-friendly, without causing problems with the executables ? And do you have any hints on the method to follow ?

    It's possible to replace the strings with new ones, though the order in which the data is presented is fixed.

    There's two ways to change the string:

    1) Replace the strings in-place. As long as the new format string is shorter than or equal to the length of the old one you can simply overwrite the contents, making sure to place a null byte ('\0') at the end.

    2) Allocate a new string at runtime and patch the code to refer to it. For example, to replace " +Luck:%d":
    • Find every location that references the string, you'll have to use Ghidra / IDA Freeware / x64dbg for this. Then come up with a pattern for each address; I get:
      [B3LuckStringRef]
      Pattern=660F4CC8
      Operations=ADD -10
      

      Put that in InfinityLoader.db. Now we have to patch the location, (put this in a M_*.lua file):
      (function()
      
          local B3ReplaceString = function(pattern, existingInstructionSize, destRegister, newString)
              if existingInstructionSize < 5 then EEex_Error("Existing instruction too small to replace") end
              EEex_HookNOPs(EEex_Label(pattern), existingInstructionSize - 5, {[[
                  lea #$(1), qword ptr ds:[#$(2)] ]], {destRegister, EEex_WriteStringAuto(newString)}, [[ #ENDL
                  jmp #L(return)
              ]]})
          end
      
          EEex_DisableCodeProtection()
      
          B3ReplaceString("B3LuckStringRef", 7, "rdx", " +Lucky Mod:%d")
      
          EEex_EnableCodeProtection()
      
      end)()
      
      where B3ReplaceString(<pattern name>, <size of existing instruction>, <destination register>, <new string>)

      For example, using x64dbg:
      xfwd8sn3ff31.png

      The characters on the left are the instruction bytes. So <size of existing instruction> = 7, (two characters make one byte), <destination register> = "rdx".

      And for our troubles:
      ztpr1cdwwxdf.png
  • JohnBobJohnBob Member Posts: 204
    Thank you very much @Bubb, for your answer, both amazing and terrifying....

    I am neither a modder nor a coder, so i don't understand much about all that...

    BUT ! I'm trying to dig in and find a way to do it !

    So, I try !

    Ghidra.... didn't get to launch it...
    x64dbg.... Absolutely too difficult to understand...

    IDA Freeware... launch and minimal understanding !
    Capture%20d%E2%80%99%C3%A9cran%202022-08-15%20035318.png

    I pick up the lines :
    .rdata:00000001405AD303                 align 8
    .rdata:00000001405AD308 aRollD_0        db 'Roll:%d',0          ; DATA XREF: sub_14039DA50+8A↑o
    .rdata:00000001405AD310 aLuckD          db ' +Luck:%d',0        ; DATA XREF: sub_14039DA50+F3↑o
    .rdata:00000001405AD31A                 align 20h
    .rdata:00000001405AD320 aSpecialacD     db ' +SpecialAC:%d ',0  ; DATA XREF: sub_14039DA50+33C↑o
    .rdata:00000001405AD330 aHitmodD        db ' +HitMod:%d ',0     ; DATA XREF: sub_14039DA50+360↑o
    .rdata:00000001405AD33D                 align 20h
    .rdata:00000001405AD340 aAttackOfOpport db ' +Attack of Opportunity:4 ',0
    .rdata:00000001405AD340                                         ; DATA XREF: sub_14038FBF0+471↑o
    .rdata:00000001405AD340                                         ; sub_14038FBF0:loc_1403901CF↑o ...
    .rdata:00000001405AD35B                 align 20h
    .rdata:00000001405AD360 aAttackOfOpport_0 db ' +Attack of Opportunity:0 ',0
    .rdata:00000001405AD360                                         ; DATA XREF: sub_14038FBF0:loc_1403900C5↑o
    .rdata:00000001405AD360                                         ; sub_14039DA50:loc_14039DEBE↑o
    .rdata:00000001405AD37B                 align 20h
    .rdata:00000001405AD380 aBerserk2       db ' +Berserk:2 ',0     ; DATA XREF: sub_14039DA50+4AC↑o
    .rdata:00000001405AD38D                 align 10h
    .rdata:00000001405AD390 aBerserk0       db ' +Berserk:0 ',0     ; DATA XREF: sub_14039DA50:loc_14039DF17↑o
    .rdata:00000001405AD39D                 align 20h
    .rdata:00000001405AD3A0 aLeftD          db ' +Left:%d ',0       ; DATA XREF: sub_14039DA50+507↑o
    .rdata:00000001405AD3AB                 align 10h
    .rdata:00000001405AD3B0 aRightD         db ' +Right:%d ',0      ; DATA XREF: sub_14039DA50+592↑o
    .rdata:00000001405AD3BC                 align 20h
    .rdata:00000001405AD3C0 aInvisibleD     db ' +Invisible:%d ',0  ; DATA XREF: sub_14039DA50+6ED↑o
    .rdata:00000001405AD3D0 aInvisibleTarge db ' +Invisible Target:%d ',0
    .rdata:00000001405AD3D0                                         ; DATA XREF: sub_14039DA50+74F↑o
    .rdata:00000001405AD3E7                 align 8
    .rdata:00000001405AD3E8 aRangeD         db ' +Range:%d ',0      ; DATA XREF: sub_14039DA50+9BE↑o
    .rdata:00000001405AD3F4                 align 8
    .rdata:00000001405AD3F8 aHatedRaceD     db ' +Hated Race:%d ',0 ; DATA XREF: sub_14038FBF0+FED↑o
    .rdata:00000001405AD3F8                                         ; sub_14039DA50+A24↑o
    .rdata:00000001405AD409                 align 10h
    .rdata:00000001405AD410 aSpecialTargetD db ' +Special Target:%d ',0
    .rdata:00000001405AD410                                         ; DATA XREF: sub_14039DA50+A6E↑o
    .rdata:00000001405AD425                 align 8
    .rdata:00000001405AD428 aProtectionsD   db ' +Protections:%d ',0
    .rdata:00000001405AD428                                         ; DATA XREF: sub_14039DA50+ABB↑o
    .rdata:00000001405AD43A                 align 20h
    .rdata:00000001405AD440 aRollD          db 'Roll:%d ',0         ; DATA XREF: sub_14038FBF0+29E↑o
    .rdata:00000001405AD449                 align 10h
    .rdata:00000001405AD450 aDamagemodD     db ' +DamageMod:%d ',0  ; DATA XREF: sub_14038FBF0+2DD↑o
    .rdata:00000001405AD460 aHandBonusD     db ' +Hand bonus:%d ',0 ; DATA XREF: sub_14038FBF0+378↑o
    .rdata:00000001405AD471                 align 8
    .rdata:00000001405AD478 aBackstabD      db ' *Backstab:%d ',0   ; DATA XREF: sub_14038FBF0+DCB↑o
    .rdata:00000001405AD487                 align 8
    .rdata:00000001405AD488 aBerserkD       db ' +Berserk:%d ',0    ; DATA XREF: sub_14038FBF0:loc_140390A03↑o
    .rdata:00000001405AD496                 align 8
    .rdata:00000001405AD498 aStrengthD      db ' +Strength:%d ',0   ; DATA XREF: sub_14038FBF0:loc_140390B6B↑o
    .rdata:00000001405AD4A7                 align 8
    .rdata:00000001405AD4A8 aSpecialBonusD  db ' +Special Bonus:%d ',0
    .rdata:00000001405AD4A8                                         ; DATA XREF: sub_14038FBF0+102F↑o
    .rdata:00000001405AD4BC                 align 20h
    .rdata:00000001405AD4C0 aMinDamageD     db ' +Min Damage:%d ',0 ; DATA XREF: sub_14038FBF0+1054↑o
    .rdata:00000001405AD4D1                 align 4
    

    Hex View-1 too :
    00000001405AD300  31 31 00 00 00 00 00 00  52 6F 6C 6C 3A 25 64 00  11......Roll:%d.
    00000001405AD310  20 2B 4C 75 63 6B 3A 25  64 00 00 00 00 00 00 00   +Luck:%d.......
    00000001405AD320  20 2B 53 70 65 63 69 61  6C 41 43 3A 25 64 20 00   +SpecialAC:%d .
    00000001405AD330  20 2B 48 69 74 4D 6F 64  3A 25 64 20 00 00 00 00   +HitMod:%d ....
    00000001405AD340  20 2B 41 74 74 61 63 6B  20 6F 66 20 4F 70 70 6F   +Attack of Oppo
    00000001405AD350  72 74 75 6E 69 74 79 3A  34 20 00 00 00 00 00 00  rtunity:4 ......
    00000001405AD360  20 2B 41 74 74 61 63 6B  20 6F 66 20 4F 70 70 6F   +Attack of Oppo
    00000001405AD370  72 74 75 6E 69 74 79 3A  30 20 00 00 00 00 00 00  rtunity:0 ......
    00000001405AD380  20 2B 42 65 72 73 65 72  6B 3A 32 20 00 00 00 00   +Berserk:2 ....
    00000001405AD390  20 2B 42 65 72 73 65 72  6B 3A 30 20 00 00 00 00   +Berserk:0 ....
    00000001405AD3A0  20 2B 4C 65 66 74 3A 25  64 20 00 00 00 00 00 00   +Left:%d ......
    00000001405AD3B0  20 2B 52 69 67 68 74 3A  25 64 20 00 00 00 00 00   +Right:%d .....
    00000001405AD3C0  20 2B 49 6E 76 69 73 69  62 6C 65 3A 25 64 20 00   +Invisible:%d .
    00000001405AD3D0  20 2B 49 6E 76 69 73 69  62 6C 65 20 54 61 72 67   +Invisible Targ
    00000001405AD3E0  65 74 3A 25 64 20 00 00  20 2B 52 61 6E 67 65 3A  et:%d .. +Range:
    00000001405AD3F0  25 64 20 00 00 00 00 00  20 2B 48 61 74 65 64 20  %d ..... +Hated 
    00000001405AD400  52 61 63 65 3A 25 64 20  00 00 00 00 00 00 00 00  Race:%d ........
    00000001405AD410  20 2B 53 70 65 63 69 61  6C 20 54 61 72 67 65 74   +Special Target
    00000001405AD420  3A 25 64 20 00 00 00 00  20 2B 50 72 6F 74 65 63  :%d .... +Protec
    00000001405AD430  74 69 6F 6E 73 3A 25 64  20 00 00 00 00 00 00 00  tions:%d .......
    00000001405AD440  52 6F 6C 6C 3A 25 64 20  00 00 00 00 00 00 00 00  Roll:%d ........
    00000001405AD450  20 2B 44 61 6D 61 67 65  4D 6F 64 3A 25 64 20 00   +DamageMod:%d .
    00000001405AD460  20 2B 48 61 6E 64 20 62  6F 6E 75 73 3A 25 64 20   +Hand bonus:%d 
    00000001405AD470  00 00 00 00 00 00 00 00  20 2A 42 61 63 6B 73 74  ........ *Backst
    00000001405AD480  61 62 3A 25 64 20 00 00  20 2B 42 65 72 73 65 72  ab:%d .. +Berser
    00000001405AD490  6B 3A 25 64 20 00 00 00  20 2B 53 74 72 65 6E 67  k:%d ... +Streng
    00000001405AD4A0  74 68 3A 25 64 20 00 00  20 2B 53 70 65 63 69 61  th:%d .. +Specia
    00000001405AD4B0  6C 20 42 6F 6E 75 73 3A  25 64 20 00 00 00 00 00  l Bonus:%d .....
    00000001405AD4C0  20 2B 4D 69 6E 20 44 61  6D 61 67 65 3A 25 64 20   +Min Damage:%d
    

    and... I didn't retrieve your value,...
    [B3LuckStringRef]
    Pattern=[b]660F4CC8[/b]
    Operations=[b]ADD -10[/b]
    

    and... I don't have the same format that...

    wj7vs10rbsv8.png

    ...I'm not sure about what is the "Pattern" and "Operations" in this case...

    Like I said, terrifying !

    I'm gonna look further and will come back with better understanding (I hope), but it will take some times, so I wanted to thanks you !

Sign In or Register to comment.