Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Creature Isle Pathing
#1
Hey!

I recently finished porting all of the Black & White story into the Creature Isle engine and during this, I noticed that the pathing for the villagers is...strange.

There are a good few times where the villagers fail to get up or down hills and can get constantly stuck in a loop. They even sometimes starve to death since they can't get out of this loop. Obviously, Black & White never had this problem.

I think it could be related to how Creature Isle changed how landscapes worked slightly, as loading the Isle map into Black & White causes an insane amount of movement issues since the Isle is disconnected at a part and the game doesn't know what to do. The disconnected island (where you fight the Crocodile) is what causes the issues.

Have you guys ever noticed something like this? And if so, is there any fix for this? Such as loading the original Black & White pathing instead?
Reply
#2
Hi,
In Creature Isle villagers don't go on steep hills and try to run around them (in B&W they could move on any height). This feature was not implemented well. That is the reason for the problem.
I have no idea how to fix this and if it can be fixed at all.
Reply
#3
I may have found a potential fix but I need some help.

After having a dig into the Creature Isle Mac files, I found the following function: Living::MoveToPos((void))
Here's the IDB code for that function in CI:

Code:
seg000:000509D0 # Living::MoveToPos((void))
seg000:000509D0                 .globl .MoveToPos__6LivingFv
seg000:000509D0 .MoveToPos__6LivingFv:                  # CODE XREF: Animal::MoveToPos((void))+C↓p
seg000:000509D0                                         # 00194574↓p ...
seg000:000509D0                 mflr      r0
seg000:000509D4                 stw       r31, -4(sp)
seg000:000509D8                 stw       r30, -8(sp)
seg000:000509DC                 mr        r30, r3
seg000:000509E0                 stw       r0, 8(sp)
seg000:000509E4                 stwu      sp, -0x40(sp)
seg000:000509E8                 lbz       r0, 0x24(r3)
seg000:000509EC                 extrwi.   r0, r0, 1,26
seg000:000509F0                 beq       loc_509FC
seg000:000509F4                 li        r3, 0
seg000:000509F8                 b         loc_50A28
seg000:000509FC # ---------------------------------------------------------------------------
seg000:000509FC
seg000:000509FC loc_509FC:                              # CODE XREF: Living::MoveToPos((void))+20↑j
seg000:000509FC                 bl        .MoveTo__13MobileWallHugFv # MobileWallHug::MoveTo((void))
seg000:00050A00                 mr        r31, r3
seg000:00050A04                 cmpwi     r31, 0xA
seg000:00050A08                 bne       loc_50A24
seg000:00050A0C                 mr        r3, r30
seg000:00050A10                 lbz       r4, 0x8D(r30)
seg000:00050A14                 lwz       r12, 0(r30)
seg000:00050A18                 lwz       r12, 0x950(r12)
seg000:00050A1C                 bl        sub_63ABE0
seg000:00050A20                 lwz       rtoc, 0x14(sp)
seg000:00050A24
seg000:00050A24 loc_50A24:                              # CODE XREF: Living::MoveToPos((void))+38↑j
seg000:00050A24                 mr        r3, r31
seg000:00050A28
seg000:00050A28 loc_50A28:                              # CODE XREF: Living::MoveToPos((void))+28↑j
seg000:00050A28                 lwz       r0, 0x48(sp)
seg000:00050A2C                 addi      sp, sp, 0x40
seg000:00050A30                 mtlr      r0
seg000:00050A34                 lwz       r31, -4(sp)
seg000:00050A38                 lwz       r30, -8(sp)
seg000:00050A3C                 blr
seg000:00050A3C # End of function Living::MoveToPos((void))

After some debugging in game and forcing villagers to use many other variations of MoveToPos, it seems that each variation inherits from the code above. Even animals don't ignore altitude. I even tried forcing villagers to use the football variation of MoveToPos, but it still checked for altitude.

If the MobileWallHug::MoveTo((void)) function can be skipped, this may avoid checking altitude and make the villager just go to the position instead, which is what we want.
The only problem is, I'm struggling to find this function within the Creature Isle .exe equivalent. Even finding it within the more documented Black & White .idb is pretty tough. Any ideas how I could find this function in CreatureIsle.exe?

This pathing issue ruins playthroughs of Creature Isle, particularly my mod as it uses the Creature Isle engine as a base. Would really appreciate some help with this!
Reply
#4
If you succeeded in finding "Living::MoveToPos" in the .exe file, then why are you failing with the "MobileWallHug::MoveTo"? The first one is calling the second one. So just check what the first one is calling.
And what "more documented Black & White .idb" do you mean?
What did you use to disassemble the mac version? The free version of Ida Pro seems to not be able to do that.
Reply
#5
Sorry, I wasn't clear. I found all that code in the Mac files, not the .exe. I was hoping to get some help finding it in the CreatureIsle.exe. Even if I knew where it was in the runblack.exe, that would be a huge help!

It's a .IDB I got from the OpenBlack project, it's the only .IDB I know that exists for Black & White. Unless you have one to share?

Also I'm using IDA Pro 7.0, not the free version.
Reply
#6
Can you send me this .IDB file?
Also, as far I as know, IDA Pro is pretty expensive... Did you buy it?
Reply
#7
Sure, here's the MAC IDBs for both Black & White + Creature Isle: https://mega.nz/file/O0MHGQxS#U5opwF5WXw...AAT1lETjTA

Also no, I didn't buy it! The version I have can disassemble as much as I want though.
Reply
#8
I tried to open it in IDA Free versions 5 and 7, not working... Do you know any other free disassembler for mac version?
And by the way, how did you force the villagers to use many other variations of MoveToPos, if you didn't find the location?
Reply
#9
I don't know any free disassembler, sorry. You should grab a cracked version of 7.0 though, that will do the trick. (DM me if you want help with this).

Villager enums can be changed by editing the info.dat file. In Info5.txt, there is a value for each villager known as MoveState:ENUM_VILLAGER_STATE, and this seems to handle the default move enum that is used (when not using a path movement state etc.).
By default, this is set to VILLAGER_STATE_MOVE_TO_POS, so changing this to something like VILLAGER_STATE_FOOTBALL_WALK_TO_POSITION will force the villager to now use this as their default one.
Once I made the enum change, I would compile a new info.dat and hex compare it to a clean info.dat. After finding the new change (usually a single hex value changed), I'd then find the same hex equivalent in the CI info.dat and manually make the changes in that.  I had to do this because we can't compile new info.dat files for CI. 
I experimented with every move state available and they all had the same behaviour of not ignoring altitude.

Do you and "." have any sort of documentation for Black & White functions? Even if you guys had an .idb for Black & White, that would be seriously helpful.
Reply


Forum Jump:


Users browsing this thread: 6 Guest(s)