| View previous topic :: View next topic |
| Author |
Message |
parksbanyon

Gunner 
Posts: 564 

 
13127 Gold -

|
Posted: Sun Aug 04, 2013 9:44 pm Post subject: blank |
|
|
I GREATLY appreciate it! I have to admit I have been going thru the savegame, landscape.ini, exe code, and your maps..........and well even when I was coding daily I'm pretty sure it was still over my head.
It's far easier to just write your own code from scratch than to RE somebody elses.
I've seen and read enough of the exe and yourself, bridger, dogcigar, and others work to see Pirates! was coded so as not to be decifered easily. |
|
| Back to top |
|
 |
jlangsdo

Cutthroat 
Posts: 398 

 
11012 Gold -

|
Posted: Mon Aug 05, 2013 1:45 am Post subject: |
|
|
Tada:
show_landmarks.zip
This zip file has 3 files in it - the script show_landmarks.pl, a helper module graphics_formats.pm, and a bmp file with a simple, free, font. The helper module and the bmp file should be in the same directory as the script to make it work.
I ran it like this from the savegame directory, your paths will be different:
show_landmarks.pl -pst slot1 -map6 /Applications/Sid\ Meier\'s\ Pirates\!/PiratesData/Assets/caribbeanmap6.bmp
Note that you have to provide a path to the pst file (must be unpacked) and a full path to caribbeanmap6.bmp.
You can get caribbeanmap6.bmp either by unpacking an FPK file, or from a few mods like East Indies, or either of the mods under thread Mods for world map background
By default it displays landmarks that you have sailed near, but I added a switch to have it display all landmarks. Note that if you switch savegames, you will want to clear the annotations because they will be wrong. Rerunning the script without a -pst switch removes the annotations.
It only shows the adjectives for each landmark, because the nouns are tricky... I never conclusively worked out the formula. If the formula can be worked out, the code is set up so the nouns could be added in just a line or two of code.

Last edited by jlangsdo on Fri Aug 23, 2013 9:08 am; edited 1 time in total |
|
| Back to top |
|
 |
parksbanyon

Gunner 
Posts: 564 

 
13127 Gold -

|
Posted: Sat Aug 10, 2013 12:08 am Post subject: Thanks a million! |
|
|
Thanks a million. Will give it a workout now. |
|
| Back to top |
|
 |
parksbanyon

Gunner 
Posts: 564 

 
13127 Gold -

|
Posted: Sat Aug 10, 2013 12:19 am Post subject: dogcigar a question |
|
|
Dogcigar, back on 28 July u mentioned using the cheat engine to look at what accesses the address https://dl.dropboxusercontent.com/u/3742149/exetreasuesection1.png. Not working for me, a basic rundown perhaps? I'm obviously doing something wrong. I attach the debugger list the address unpause Pirates and .... nothing |
|
| Back to top |
|
 |
dogcigar

Swabbie 
Posts: 82 

 
542 Gold -

|
Posted: Sat Aug 10, 2013 10:57 am Post subject: |
|
|
Actually I had a peek at it yesterday after reading this topic. I had a look on the map and saw what accessed rutters. ON my version at least I can confirm that the Spanish Rutter does do absolutely nothing as the game only asks if the rutter item is zero or not.
Anyway to get into what you want you would have to find where the game stores all the data for settlements, havens,cities etc. I am assuming there may be values for things like if the town/village/whatever has been viewed or not. Probably a 1 or 0. Once you find this place you could see how the game accesses it. Then you could substitute it for the list of where the game stores the landmarks. Hopefully having enough bytes to work with to change things around to get a workable patch. Possibly...to do things this way you would have to give up viewing settlements or havens or something if the game cares about having a finite number of settlements. Actually I`m really getting into the hypothetical and don`t know what I`m talking about. You don`t really know untill you get into the code and try to change it.
It helps a lot to have the starting positions though. I don`t know where all that data is but I do know where the game accesses the closest city data and could try to backtrack through that because it would copy from the more permanent registers. Sometimes it`s hard to do because it often loads this stuff through temporary addresses. With perseverance you can get there though. |
|
| Back to top |
|
 |
dogcigar

Swabbie 
Posts: 82 

 
542 Gold -

|
Posted: Sat Aug 10, 2013 12:11 pm Post subject: |
|
|
Sorry, I don`t think I really answered your question. Have you used the program much? Like I said you need the starting addresses. Not connected to this thread a simple example would be to find the address where swords are stored. I happen to know this is a 1 byte value (from Phalyzr`s trainer readme file)
1 Connect up the cheat engine to SMP
2 Load a savegame that has 2 swords
3 search for value 2 (there will be 100s of Ks)
4 load another game with 1 sword or 0
5 do second search for this value
6 repeat 2-5 untill you narrow down the search. operate the game for a while and use lots of not changed values to get rid of irrelevant values.
7 Once you think you have the value try changing it to confirm.
Then once you have an address or even a line of code you view in the dissasembler connect the debugger to find out what writes or reads from the address. Yesterday I thought that the map would read the value of the Rutters so I asked what read from the Rutters, loaded up the map and a code came up. I then viewed this in the disassembler to see what was happening. Clicking on the "more info" button is really useful too. With this you can see what is happening as it will tell you what all the values of the ECX,EAX,ESI and other registers are. For example the reading of the rutter may be something like-
Movzx Eax,[Ecx + Edx]
mov the value at the position of Ecx +Edx into the Eax register
Ecx would probably be a high general pointer and Edx may be a small number like 5 as the rutter is the 5th item8 with swords being 0)
After this it may compare this value to zero. like
Cmp EAX,00 (or test EAX,EAX)
Hope this was useful to ya |
|
| Back to top |
|
 |
parksbanyon

Gunner 
Posts: 564 

 
13127 Gold -

|
Posted: Sun Aug 11, 2013 9:14 pm Post subject: Thanks dogcigar |
|
|
Thanks for the runthru. I'm actually taking a break and going play for a day or 2. Modded almost all my music and I was going to try out Jlangsdo's mod on this thread. |
|
| Back to top |
|
 |
dogcigar

Swabbie 
Posts: 82 

 
542 Gold -

|
Posted: Sun Aug 18, 2013 4:06 pm Post subject: |
|
|
Doing something else I stumbled onto the data for a Jesuit mission.
7C 01 00 00 81 00 00 00 01 01 01 00 06 06 05 00 19 00 00 00
7C 01 00 00 81 00 00 00 was the location near San Juan
06 06 05 00 has information like settlement type and ownership I assume with missions always being 06 in the code
01 01 01 00
first 01 [I don`t know]
2nd 01- the map read this value and when I made it 0 it wouldn`t show. This could be the way the game knows if a settlement has been viewed or not.
3rd 01- shows if an immigrant or amnesty mission has recently spawned |
|
| Back to top |
|
 |
parksbanyon

Gunner 
Posts: 564 

 
13127 Gold -

|
|
| Back to top |
|
 |
jlangsdo

Cutthroat 
Posts: 398 

 
11012 Gold -

|
Posted: Fri Aug 23, 2013 9:07 am Post subject: |
|
|
Ah, I see, the oldest porting problem in the book. Unix uses "/" and Windows uses "\". Thanks for the excellent picture clips.
I've just posted a fixed version of the zip file and will momentarily change the link in the earlier post. |
|
| Back to top |
|
 |
parksbanyon

Gunner 
Posts: 564 

 
13127 Gold -

|
Posted: Fri Aug 23, 2013 9:03 pm Post subject: Thanks once again |
|
|
UR a lifesaver as always. I'm rerading up on both PERl and Ruby so I can ask less and do more, can be a little confusing trying to remember which is which. |
|
| Back to top |
|
 |
parksbanyon

Gunner 
Posts: 564 

 
13127 Gold -

|
Posted: Fri Aug 23, 2013 9:33 pm Post subject: workaround |
|
|
Still didn't work so I changed line 72 of show_landmarks.pl to:
my $font = &graphics_formats::read_graphics_file("lekton-font.bmp", "bmp", 0,1);.
and away we go.
On vista and win7 I have found sometimes the various path variables don't always work, thats why I always temp dump everything into the root easy to type and the scripts always find them. There is functionality in win 7 so I should not have to type the xxx.pl extension when running PERL, bit have never gottem it to function. Windows= an imperfect world. |
|
| Back to top |
|
 |
AdamMil

Cutthroat 
Posts: 279 

 
4759 Gold -

|
Posted: Tue Mar 04, 2014 5:35 am Post subject: da formula |
|
|
| jlangsdo wrote: | | It only shows the adjectives for each landmark, because the nouns are tricky... I never conclusively worked out the formula. If the formula can be worked out, the code is set up so the nouns could be added in just a line or two of code. |
It's necromancy Monday, so here you go. :-)
| Code: | my @adjectives = qw(
Skull Blood Devil's Black Knife Cutlass Hangman's Gallows Lookout Dagger Blade
Powder Captain's Governor Anchor Shark Jellyfish Thunder Rum Cutthroat);
my @nouns = qw(Rock Point Stone Head Reef Shallows Cape);
my $n = ($x*33 + $y*47) % 1000;
my $adjective = $adjectives[$n % 20];
my $noun = $nouns[$n / 20 % 7]; | Note that the arrays are different too, not just the formula. |
|
| Back to top |
|
 |
jlangsdo

Cutthroat 
Posts: 398 

 
11012 Gold -

|
Posted: Thu Mar 13, 2014 3:43 pm Post subject: |
|
|
Wow. Awesome. Amazing. Incredible!
Did you work that out from assembly language? |
|
| Back to top |
|
 |
AdamMil

Cutthroat 
Posts: 279 

 
4759 Gold -

|
Posted: Thu Mar 13, 2014 7:28 pm Post subject: |
|
|
| jlangsdo wrote: | | Did you work that out from assembly language? | Yes. I've been impressed with what you've been able to accomplish just by examining save and data files. That must have taken a lot of hard work! I'm too lazy, so I take the easy way out. :-P (Although this 'easy' way has absorbed 200 hours of my time so far...) |
|
| Back to top |
|
 |
|