tarvitz / dsfp

Dark Souls save file parser
MIT License
31 stars 3 forks source link

NPC Hostility #3

Open zagarachi opened 8 years ago

zagarachi commented 8 years ago

Firstly Great project, admire the amount of work put in for what is now a very old game :P

I have been playing DS for a while now and accidentally ended up in the situation where I have an attacked both an npc that I wish I had not and also the npc that gives Absolution so I am somewhat stuck in terms of resetting their status. (dodgy mouse... :P )

Since I am a software dev by trade I decided to start breaking down the save files to see if I could reset it there. (I imagine it must be stored there somewhere)

My current process involves going to a shrine near an npc, copying the save file, and then attacking the npc and returning to the shrine and copying the file again. I am then using a diff tool to compare the two files and see if I can see anything obvious.

So far I have come up empty, so I thought I would reach out to you to see if you had any ideas of where to look :p

Any help would be awesome :)

zagarachi commented 8 years ago

Ah I have just found the bit in the template that you make as Sin, I wonder if thats what I am looking for

zagarachi commented 8 years ago

looking at my saves it seems the sin section does not change

zagarachi commented 8 years ago

I am guessing there will be a large amount of data around npc's. as things like dialoge state (i.e. has something new to say), sins, stock(for vendors) must be stored somewhere.

tarvitz commented 8 years ago

Yep, saves have states for npc. Their attributes (hostile or not, dialogs passed or something). Probably there was no direct goal to achieve that states. But still it's possible to make.

  1. Using 010 editor upon saves with ds template (it shows already investigated data), but it'd pretty hard as amount of data changing everyting is big.
  2. Using python script watcher and action-save technique:
    • run watcher as base README says
    • perform some action
    • press menu button and return in game via that button again, look for modifications

Unfortunately, I have no time to complete this quest and still I don't have any idea then i get back to discover hidden knowledge.

zagarachi commented 8 years ago

Hy tarvitz thanks for the info, got the spy.py script running but not seeing any output.. just says modified: 0 [16:07:19] then exits.

Whych menu button do you mean ?

tarvitz commented 8 years ago

It should be start button, that invokes top right menu bar. Spy watches for block of data modifications that have been given via user range and stored into json configuration file:

python ./scripts/spy.py -f remote/draks0005.sl2 -w json/watch.json

Look closer into json/watch.json. 010editor would help your to identify blocks of save data already known or yet undiscovered :).

tarvitz commented 8 years ago

@zagarachi, is there any positive progress there?

zagarachi commented 8 years ago

Hey, I had another look at the spy python script at the weekend, it looks like its throwing an error on the textwrap.wrap(old_data, word_size) line, the exception message is a bytes-like object is required, not 'dict' a quick check of type(old_data) shows it as being of type bytes so I am not sure whats going wrong.

I am using python 3.3 so maybe thats the reason?

tarvitz commented 8 years ago

@zagarachi It could be 3.x python branch script incompatibility (i didn't port scripts to python 3, sad but true), Will fix it this weekend, I'm gonna have pretty hard pre-weekend days :)

tarvitz commented 8 years ago

@zagarachi, there's some progress here.

I fixed some parts of spy process so on my windows python3.5 spy works well. There's json/inventory.json file table that could help you to figure out how to configure spy :).

I strongly suggest to use 010editor (6.x version) and current templates (templates/includes/DarkSouls_PTDE.bt) to identify block of data you want to "inject" and investigate. Use file offsets/sizes from there.

Sorry I can't provide full and totally descriptive process how to work fast and proper with given tools, but I think you can handle it by yourself ;)