Divinity Banner
Previous Thread
Next Thread
Print Thread
Teleporting anywhere (via hex editor) #261501
01/09/04 10:41 PM
01/09/04 10:41 PM
Joined: Mar 2003
Posts: 26,510
Canada
Raze Offline OP

veteran
Raze  Offline OP

veteran

Joined: Mar 2003
Posts: 26,510
Canada

This post describes how to change your main characters' positions, using a hex editor to alter information stored in a file in the saved game folder.

Primarily, this would be useful for cases where both characters have jumped through a wall, where a section of a BF dungeon is inaccessible, or when NPCs have wandered into areas you can not get to (ie get sealed inside the parcours in the citadel when you complete that quest).

There may be easier fixes, depending on the situation.
If one character gets through a wall, they can be restored to the play area by having the other character go up/down some stairs (or a hatch, etc.), or enter and exit the BF.
There can be a slight gap at the north west outside corner of two joining walls. For example, there is a skeleton archer north west of the wall surrounding the cursed abbey that can attack you when you are inside the wall. You may be able to use this to your advantage to get into inaccessible places by tossing a teleporter stone through such a gap.



Please read this post through before attempting, and make sure you follow the steps below carefully.


You will need a hex editor for this, such as the freeware programs Frhed, XVI32 or those listed here or reviewed on this site.
I use Hackman; the latest 8.x release on the homepage introduces a low file size limit in the freeware version, making it unusable for this purpose. It is still possible to find the previous 7.x release, though; check here, or search Google for "hack704.zip" or "hack702.zip", etc.



exclamation Warning exclamation
  • A mistake, typo or out-of-range value when editing the data file can cause the game to either crash to desktop or completely lock up, forcing a re-boot. Make a backup before hex editing anything.
  • The data.000 file basically defines your characters (stats, skills, experience points etc.) and keeps track of all NPC locations and status, in addition to storing your own locations. Without a valid, working data.000 file, the saved game will be useless.

If you use this technique to explore, it could be handy to take both teleporter stones with you, in the acts that you have them. If you end up in a place you shouldn't be, you may be able to toss a teleporter somewhere and teleport out. In some cases, it may not make sense to carry both, or it may not be possible.


Procedure

1) Save the game under a new name before attempting this, or make a copy of the saved game folder. It couldn't hurt to also make a backup of the data.000 file in the newly saved/copied game folder.

2) Browse to the saved game folder you wish to modify '..\Beyond Divinity\savegames\NameOfSave', and open the data.000 file in a hex editor.



[*] the Hero's location

3) Search for the text string AgentsV (ASCII mode search).

4) A little below this will be the text string Start Agent Save. In some hex editors, if you click on a character on the text side, the corresponding hex value will be highlighted as well. If that does not work, you should be able to select the text, to have the hex value(s) selected as well. Click on the 'a' in Save, then concentrate on the hex side.

5) Immediately below that 'a' (hex value '61') the character coordinates begin. The first two bytes, 40 2B, show the horizontal (east-west) position of your character, then a constant 00 00, followed by two bytes, B0 92, showing the vertical (north-south) position.
  • The origin of the coordinate system used by the game is in the north west corner of the map, with the Y axis (vertical) being positive downwards. Increasing the value of the X coordinate (horizontal) will move your character to the east, while increasing the Y coordinate (vertical) will move south.
  • In each two byte pair of data, the second byte has a much greater effect on position than the first. This allows the game to store exact character positions, but if you are just trying get past a wall, etc. you may not need the worry about the first byte at all.
    Changing the second byte by 1 (ie 19 to 1A or 2D to 2C) will move the character about two and a half times their height, as will changing the first byte over its full range, from 00 to FF.

6) The coordinates are repeated further down in the file, where a value that indicates which map you are on is also included. In Hackman click on the arrow button at the bottom of the scroll bar to move down the file one 'page' at a time; don't try to drag the scroll bar or click below it, you will go past the spot you need.

A page or two below the first set of coordinates there will be two lines of FF. The first line may be a full row or a little less, the second will be a little more than a full row, so the ends overlap. From the second line, starting 2 rows below the first FF, the coordinates are repeated, followed by a constant 00 00 and then the map indicator 00. A map indicator of 00 is the main game; 01 is the BF. In most cases you will not need to change this value.



[*] the DK's location

7) Search for the hex string 48 65 72 6F 30 00 0D, which looks like 'Hero0' followed by a space and box symbol. You should be able to type 'Hero0' as text into the search dialog, then switch to hex to add the last 2 bytes.

8) From there search backwards for the first text instance of Start Agent Save, which should be about 5 'pages' above the 'Hero0' term.

9) At this point the DK's location coordinates follow the exact same pattern as the hero's coordinates, described above.


10) After making the required changes to both instances of the coordinates for each character you wish to move, save and close the file. You do not have to shut down the hex editor if you want to play around with this, but you should close the file so the editor and game are not trying to access the file at the same time.

11) Start Beyond Divinity (if required) and load (or re-load) the game. If all went according to plan, you should now be somewhere else, hopefully where you were aiming. wink


The screenshots below should make this procedure a little clearer. The coordinates are those from the very start of the game.












A couple locations;



[*] Act 1

X = E0 57 ; Y = B0 C3 ; map 00 - inside the parcours, a little west of the entrance, in case an NPC you need to talk to wanders in and gets trapped.



[*] Act 2

X = 80 29 ; Y = 10 AB ; map 00 - at the start of the mushroom cave in the fire forest. In an earlier version, if you found some ingredients before talking to the alchemist and moved them in your inventory, it could trigger a quest log update prematurely, preventing the cut scene that opens the mushroom cave.

X = 40 67 ; Y = F0 93 ; map 00 - at the start of the cursed abbey. In an unpatched game, if you left the imp village by trying to enter the BF, was summoned and sent to the cursed abbey, then entered and exited the BF again, you would be returned to the imp village rather than the abbey. While there were no serious consequences, this would result in missing experience, teachers and an item that can permanently boost the mana of one character.

Last edited by Raze; 30/06/18 10:15 AM. Reason: fix links
Re: Teleporting anywhere (via hex editor) [Re: Raze] #261502
05/09/04 06:25 PM
05/09/04 06:25 PM
Joined: Mar 2003
Posts: 26,510
Canada
Raze Offline OP

veteran
Raze  Offline OP

veteran

Joined: Mar 2003
Posts: 26,510
Canada
In the procedure above, when describing a value to be a line or two below another value, it is assuming the hex editor is using the standard 16 column format. After trying out XVI32's wildcard search feature, I noticed it defaults to 17 columns. You can change this in the options, or correct for that by moving left one byte for each line you move down.


BF Merchant Teleporting

A couple people have run into problems with the BF traders shifting positions. Since NPC locations are stored in the data.000 file, the above procedure can be used on NPCs where you can figure out what name the game is using for that character. Unlike in Divine Divinity, the displayed name and the internal name are not the same (probably to make translations easier). In DD, NPCs who moved around to different locations during the game had their coordinate data stored in a different format. The same may be true in BD, so likely not all NPCs can be teleported this way, even if you determine their internal name.


If you search the data.000 file for the first instance of 'BF_Trader_1', you will find a list of names, each followed by a number. Technically, the correct method to find the coordinates of an NPC would be to search for the right instance of their internal name, then search backwards in the file for the first 'Start Agent Save' term (about 4 'pages' above). However, you can skip a step by searching for the internal name of the previous NPC in the list (at least for the BF merchants).

To find a BF merchant's coordinates, search for the internal name of the previous NPC (see below). There will be 3 or 4 instances of this. The correct one has the name listed once with a number after it, then again without the number. A bit below that will be the term 'Start Agent Save', where the coordinates can be found as described above. The second location of the coordinates is not shown in the screenshot (below 2 lines of FF), but does also need to be edited.





BF MerchantInternal Name to search for

Brian

BF_Trader_1

Annabelle

BF_Trader_2

Elkar

BF_Trader_3

Kieth

BF_Trader_4

Olaf

Citadel_Samuel_Death_Knight4
Lich_Cave_Inscription
Academy_Entrance_Door
Endfight_Damian
Act 1
Act 2
Act 3
Act 4


Re: Teleporting anywhere (via hex editor) [Re: Raze] #261503
15/09/04 12:44 PM
15/09/04 12:44 PM
Joined: Jul 2004
Posts: 36
Betelgeuse IV
Beelzebubba Offline
apprentice
Beelzebubba  Offline
apprentice

Joined: Jul 2004
Posts: 36
Betelgeuse IV
This is great information. I think this and the other hex editing post about money and XP should be stickied, but that's just my opinion.



Beelzebubba
Re: Teleporting anywhere (via hex editor) [Re: Raze] #261504
22/09/04 07:24 AM
22/09/04 07:24 AM
Joined: Mar 2003
Posts: 26,510
Canada
Raze Offline OP

veteran
Raze  Offline OP

veteran

Joined: Mar 2003
Posts: 26,510
Canada

If the link above for Hackman becomes broken, Kiya has placed a copy of the program on her web site for download (3MB). Broken Link


Another set of coordinates, for Act 2;

X = C0 3E ; Y = F0 9C ; map = 00 - at the start of the Shaman's realm



BF Merchant Teleporting - take 2

When unfamiliar with the format of the data.000 file and trying to figure out the hex teleport procedure, adding someone else's shortcut to the mix isn't necessarily going to help. Below I will describe this procedure without using the shortcut of searching for the NPC name listed before the one you wish to move. This should make it easier to understand and be more applicable to different NPCs (assuming their internal name can be determined and their coordinate data follows the same pattern).


To find a BF merchant's coordinates, search for their internal name (see below). There will be 3 or 4 instances of this. The correct one has the name listed once with a number after it, then again without the number. From there, search backwards in the file for the first instance of the text string 'Start Agent Save', about 4 'pages' above. At this point the coordinates can be found as described in the original post.

BF Merchant

Internal Namethis table lists the actual internal names, rather than the 'shortcut' names used above

Olaf

BF_Trader_1

Brian

BF_Trader_2

Annabelle

BF_Trader_3

Elkar

BF_Trader_4

Kieth

BF_Trader_5

Here is a screenshot (42KB) showing the coordinate data and file structure from a save just after entering the act 1 BF for the first time. It is fairly long, so there is a link to it, rather than being displayed within the topic. The main portion of the image shows the data for Brian. On a slightly darker background, the top of the image contains the end of the data for Olaf, while the bottom shows the start of the data for Annabelle.

Last edited by Raze; 30/06/18 10:25 AM. Reason: fix image link
Re: Teleporting anywhere (via hex editor) [Re: Raze] #261505
22/09/04 11:21 AM
22/09/04 11:21 AM
Joined: Mar 2003
Posts: 19,669
Rogue Squadron
A
AlrikFassbauer Offline
veteran
AlrikFassbauer  Offline
veteran
A

Joined: Mar 2003
Posts: 19,669
Rogue Squadron
Wow !



When you find a big kettle of crazy, it's best not to stir it.
--Dilbert cartoon

"Interplay�.some zombiefied unlife thing going on there" - skavenhorde at RPGWatch
Re: Teleporting anywhere (via hex editor) [Re: Raze] #261506
25/09/04 03:52 AM
25/09/04 03:52 AM
Joined: Jul 2004
Posts: 36
Betelgeuse IV
Beelzebubba Offline
apprentice
Beelzebubba  Offline
apprentice

Joined: Jul 2004
Posts: 36
Betelgeuse IV
Wow is right. You must really get bored sometimes. I've noticed the saves tend to move the merchants a small amount every time you save, so if you quick save a lot, like I do, they can sometimes move a fair distance away from their original locations. This post helped me get Elkar back when she moved inside a building and I couldn't see her anymore. If I had quicksaved and quickloaded a few times she may have moved out the other side, but this was easier, as there were a lot of boxes and stuff below the building and I didn't feel like taking the time to get her out the hard way. Heheh... Thanks for the information.



Beelzebubba
Re: Teleporting anywhere (via hex editor) [Re: Raze] #261507
21/10/04 05:11 AM
21/10/04 05:11 AM
Joined: Oct 2004
Posts: 3
chief Offline
stranger
chief  Offline
stranger

Joined: Oct 2004
Posts: 3
Hi, hope you can help a newbie -

I'm looking for help re Elkar disappearing during ACT 2 BF. I've seen similar posts advising moving barrels, quick saving/loading and leaving the area (local & BF) and coming back - and I've tried them all but still Elkar won't appear!

This is very annoying 'cos not only does she owe me exp. for the quest I did for her: she's also the best merchant for charms!

This thread seems to be my best hope for a solution - but it means moving her out of that hut (according to the mini-map!)- I tried Raze's thing (and thanks for that, but even after downloading the Hackman 7.04 I just can't find the co-ordinates to change?)

Please help if you can - otherwise, it upsets a nice game.

v1.45 - from the start.

Re: Teleporting anywhere (via hex editor) [Re: chief] #261508
21/10/04 05:59 AM
21/10/04 05:59 AM
Joined: Mar 2003
Posts: 26,510
Canada
Raze Offline OP

veteran
Raze  Offline OP

veteran

Joined: Mar 2003
Posts: 26,510
Canada
Do you have an idea how close you are getting, or where the problem is? You should just have to open the data.000 file, search for BF_Trader_4 as described above, search backwards for 'Start Agent Save' and the coordinates are right there. It's not as easy as that sounds unless you are familiar with the procedure, though.

EDIT
When you tried editing Elkar's position, you just may not have moved him enough. With your data file I originally tried to moved him about 1 character height east, even before loading a save to check where in the shack he was. That didn't seem to have an effect, but moving him about 3 character heights east worked.

Last edited by Raze; 21/10/04 09:20 AM.
Re: Teleporting anywhere (via hex editor) [Re: Raze] #261509
21/10/04 10:01 AM
21/10/04 10:01 AM
Joined: Oct 2004
Posts: 3
chief Offline
stranger
chief  Offline
stranger

Joined: Oct 2004
Posts: 3
Thanks, I'll try changing the numbers again! (I tried changing the south upto 99 from 83...) Apologies for not replying, but I've been playing around with the co-ordinates and can't seem to load a save game yet!?!?

I saved it under data.001 as it wouldn't let me save under the original (data.000). How do I load a changed save game from the BD menu?


Re: Teleporting anywhere (via hex editor) [Re: chief] #261510
21/10/04 10:37 AM
21/10/04 10:37 AM
Joined: Mar 2003
Posts: 26,510
Canada
Raze Offline OP

veteran
Raze  Offline OP

veteran

Joined: Mar 2003
Posts: 26,510
Canada
I emailed an edited file back to you awhile ago.

In Hackman, you should just be able to click on save (floppy disk toolbar icon) or use the hotkey ctrl+s to save any changes. There may be a function to open files in read-only mode, but I don't think that is set by default.
In any case, you would need to browse to the folder in Windows Explorer and rename the data.001 file to data.000 for the game to load it (perhaps rename the original file data.bak first).

If you are changing the first byte of the coordinate, then 99 to 83 is not very far (about 1/5 character height; 00 to FF would be about 2.5 times the character height). Modifying the second byte by that much would be very far (50 times the character height).

Re: Teleporting anywhere (via hex editor) [Re: Raze] #261511
21/10/04 11:17 AM
21/10/04 11:17 AM
Joined: Oct 2004
Posts: 3
chief Offline
stranger
chief  Offline
stranger

Joined: Oct 2004
Posts: 3
Brilliant! Elkar's back in the picture and I can continue without problems!

Thank you for all your help, I don't have much experience when it comes to editing/extracting files and such, as you no doubt realised!

It has been a real pleasure to find someone so helpful (and patient!)

Kind regards

Re: Teleporting anywhere (via hex editor) [Re: Raze] #261512
10/11/04 10:34 AM
10/11/04 10:34 AM
Joined: Mar 2003
Posts: 26,510
Canada
Raze Offline OP

veteran
Raze  Offline OP

veteran

Joined: Mar 2003
Posts: 26,510
Canada

* Act 1

X = 00 07 ; Y = 90 8A ; map 00 - in the room with the crystal bag



NPC Teleporting in general

To change an NPC's location, you need to know their internal name. In some cases the internal name may correspond (in whole or in part) to the displayed name, and you may be able to find the coordinates by searching for that name. If the displayed name is not found, or occurs enough times that the right one is hard to sort out, the internal name can be found if you know the character's position. This procedure is described below.

As an example, I will use the imp Nixfix in act 4.


1) Make a backup of your latest save game folder, and/or the data.000 file within. This is a good practice before hex editing anything.

2) Open the data.000 file in a hex editor and search for the display name of the character. If it is not found, proceed to step 3b, otherwise 3a.

3a) If the name found is in a list of character names, as described above for the BF merchants, then check that it sounds reasonable (the name may indicate a certain act or location). If so, you have the internal name.

Searching for the text string 'Nixfix', the first instance will be in the name 'Academy_Tunnels_Nixfix49'. The next instance is in the pattern used to mark character data (including position), with the internal name followed by a number, then another instance of the internal name. After this there are a couple instances of 'Imp_Nixfix' and other variations, but none in the right pattern. This means the internal name is 'Academy_Tunnels_Nixfix'.

Proceed to step 4.


3b) Find a save where you have access to the NPC you want to teleport. It doesn't matter if this is from an earlier save or even from a different game. If a character moves around as part of the plot, then the save should be from a similar point as the one that requires teleporting, since they may have different internal names in different acts or locations.


* Load the save and have your hero stand as close as possible to the NPC, then save the game. In my example, I had my hero stand to the immediate right of Nixfix.


* Open the data.000 file from that new save, and search for the text string 'AgentsV' to find the hero's location. In my case it was X = 60 27 ; Y = 10 C4.


* The NPC's location is very close to the hero's. In each 2 byte coordinate, the first byte has much less of an effect, so if you can ignore it you can find the NPC's data. The hex editor XVI32 has a wildcard search feature that can allow you to do just that.

In XVI32's options on the Appearance tab, you may wish to change the 'Number of columns' from 17 to 16, and check 'Use Blank to Display Control Characters'.

The hero's location coordinates in this example are '60 27 00 00 10 C4'. The first byte of the X coordinate can be ignored simply by dropping it from the search term. In XVI32's search window, check the 'Joker char hex:' box (the default wildcard term is 2E), and replace the first byte of the hero's Y coordinate with the wildcard.

To find the coordinates for Nixfix in this example, search for the hex term '27 00 00 2E C4'. This will match the hero's coordinates and possibly other places in the data file.


* When you find the search term just under a 'Start Agent Save' (other than the hero's coordinates) then you have the coordinates of the NPC. Here is a screenshot showing what this part of the data.000 file looks like for Nixfix.

Search for the term again (hotkey F3) and you will find it under the first 'FF' in a line of 'FF' (as described above for the character coordinates). Scroll down in the data file until you come to the bottom of the character data, marked by the internal name followed by a number and then the internal name again. Here is a screenshot for Nixfix.

From the end of the character data, you find that the internal name is 'Academy_Tunnels_Nixfix'.


4) Now that you have the internal name, you can find and alter the coordinates (as described above for the BF merchants).

If searching for the displayed name worked to get the internal name, then you are already editing the data.000 file you need, and can simply search backwards in the file from the end of the character data for the first instance of 'Start Agent Save'.

If you needed a different save to determine the internal name, then you are done with that data.000 file. Open the data.000 file from the save with the missing or trapped NPC and search for the required instance of the internal name, as described above for the BF merchants.

Last edited by Raze; 30/06/18 10:33 AM. Reason: fix image links
Re: Teleporting anywhere (via hex editor) [Re: Raze] #261513
07/06/05 11:46 AM
07/06/05 11:46 AM
Joined: Mar 2003
Posts: 26,510
Canada
Raze Offline OP

veteran
Raze  Offline OP

veteran

Joined: Mar 2003
Posts: 26,510
Canada
  • Act 3

    X = 80 3F ; Y = 30 D2 ; map 00 - at the end of act 3, on the island with the entrance to the academy

  • Re: Teleporting anywhere (via hex editor) [Re: Raze] #261514
    10/08/06 12:40 AM
    10/08/06 12:40 AM
    Joined: Mar 2003
    Posts: 26,510
    Canada
    Raze Offline OP

    veteran
    Raze  Offline OP

    veteran

    Joined: Mar 2003
    Posts: 26,510
    Canada
    A couple more locations;

  • Act 1

    X = 80 3B ; Y = D0 94 ; map 00 - in the arena, near the end start of the game

    X = C0 66 ; Y = F0 D2 ; map 00 - storage room with BF key level 2

    X = E0 76 ; Y = 46 CB ; map 00 - behind armoury counter

    X = 60 56 ; Y = B0 9D ; map 00 - exit room, with stairs leading to act 2


  • Act 2

    X = 00 14 ; Y = 10 A0 ; map 00 - in the Shaman's cellar, by the entrance ladder from the secret passage

  • Re: Teleporting anywhere (via hex editor) [Re: Raze] #261515
    26/03/07 05:09 PM
    26/03/07 05:09 PM
    Joined: Mar 2003
    Posts: 26,510
    Canada
    Raze Offline OP

    veteran
    Raze  Offline OP

    veteran

    Joined: Mar 2003
    Posts: 26,510
    Canada
  • Act 2

    X = 20 70 ; Y = 90 E1 ; map 00 - at the start of the Dark Forest, for the necromancer's second task.

    X = A0 6A ; Y = 10 E2 ; map 00 - inside the Pickled Herring Tavern (the necromancer's second task).


    X = 00 58 ; Y = F0 CB ; map 00 - at the start of the Little Village, for the necromancer's third task.

  • Re: Teleporting anywhere (via hex editor) [Re: Raze] #354307
    04/08/08 12:07 AM
    04/08/08 12:07 AM
    Joined: May 2008
    Posts: 14
    C
    Charlie 2 Offline
    stranger
    Charlie 2  Offline
    stranger
    C

    Joined: May 2008
    Posts: 14
    I'm Sorry I havn't replyed sooner, but I haven't been able to play BD in awhile.
    Anyway, "Teleporting anywhere (via hex editor)" is way beyound my skills even though you so kindly
    have written it down for me.
    I don't know if I can continue on in the game without completing this quest or not. I'm only able to get to the third ranking and unable to challenge the first place rank because I would have to be in second place to do so.
    So....I'm just going to forge ahead and see what happens.
    Thanks again for all your help.

    Re: Teleporting anywhere (via hex editor) [Re: Charlie 2] #354308
    04/08/08 12:44 AM
    04/08/08 12:44 AM
    Joined: Mar 2003
    Posts: 26,510
    Canada
    Raze Offline OP

    veteran
    Raze  Offline OP

    veteran

    Joined: Mar 2003
    Posts: 26,510
    Canada

    Yes, you can skip finishing the assassin/Sigurd quest. As far as ranking points go, this is one of the lower rewards (1500), and you can miss several quests and still be able to get to second place.

    Kiya lists the ranking quests about half way through this topic, along with how many points each is worth.


    Check your messages (click 'My Stuff' in the top menu bar, then 'My Messages').


    Moderated by  Dom_Larian, Larian_QA, Lynn, Macbeth 

    Powered by UBB.threads™ PHP Forum Software 7.6.2