diffpop

Discuss PoP1 for DOS here.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5745
Joined: April 9th, 2009, 10:58 pm

diffpop

Post by Norbert »

I have just finished and released the first version (direct link) of diffpop. I've also put together a file with some sample results. This (GPL3 or later) command-line utility shows non-default settings of PRINCE.EXE files. In other words, if someone used CusPop, it is now easier to figure out what has been changed.

This utility relies on princehack.xml. A very useful file that is included in the package.
I have some small suggestions to improve it even further; I will point poirot to this post:
1. It would be easier if it uses "name" before "duplicated" for both "level to load" and "Quit when time expires".
2. Maybe add a publication date, version and copyright message inside the file.
3. It needs additional "readoperation" information for some lines of "WDA in palace", "level to load" and "Quit when time expires".

To anyone who wants to give this utility a try:
- Note that you may want to use UPackExe on your PRINCE.EXE file first.
- This is a first version, so obviously there is room for improvement.

I may release updated/improved version(s) in the future, but I'm going to continue my work on popot.org first.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5745
Joined: April 9th, 2009, 10:58 pm

Re: diffpop

Post by Norbert »

With --locations on the prince.exe of Mirages of Persia:

[ INFO ] Location: initial settings (time available and starting hit points)
[ DIFF ] starting minutes left: 300 (default: 60)
[ INFO ] Location: initial settings (time available and starting hit points)
[ DIFF ] starting hit points: 2 (default: 3)
[ INFO ] Location: (maximal number of hit points)
[ DIFF ] hit points: 13 (default: 10)
[ INFO ] Location: (maximal number of hit points)
[ DIFF ] hit points: 13 (default: 10)
[ INFO ] Location: (minimal and maximal level where you can save)
[ DIFF ] minimal level: 1 (default: 2; readoperation: add(1);)
[ INFO ] Location: guard information (guard base hit points)
[ DIFF ] level 2: 5 (default: 3)
[ INFO ] Location: guard information (guard base hit points)
[ DIFF ] level 5: 6 (default: 4)
[ INFO ] Location: guard information (guard base hit points)
[ DIFF ] level 6: 8 (default: 5)
[ INFO ] Location: guard information (guard base hit points)
[ DIFF ] level 9: 9 (default: 5)
[ INFO ] Location: guard information (guard base hit points)
[ DIFF ] level 10: 10 (default: 5)
[ INFO ] Location: guard information (guard base hit points)
[ DIFF ] level 11: 11 (default: 5)
[ INFO ] Location: guard information (guard base hit points)
[ DIFF ] level 12b: 13 (default: 6)
[ INFO ] Location: (the effect of Shift+L in non-cheat mode)
[ DIFF ] first level where shift+L is denied: 9 (default: 3; readoperation: add(1);)
[ INFO ] Location: Game messages (Time messages)
[ DIFF ] Text '%d MINUTES LEFT': %d min ostalos! (default: %d MINUTES LEFT)
[ INFO ] Location: Game messages (Time messages)
[ DIFF ] Text 'TIME HAS EXPIRED!': Pezdets!!! (default: TIME HAS EXPIRED!)
[ INFO ] Location: Game messages (Indicator messages)
[ DIFF ] Text 'LEVEL %d': Scena %d (default: LEVEL %d)
[ INFO ] Location: Game messages (Indicator messages)
[ DIFF ] Text 'Press Button to Continue': OMG!! Not Again! (default: Press Button to Continue)
[ INFO ] Location: Game messages (Indicator messages)
[ DIFF ] Text 'SOUND ON': Gromko (default: SOUND ON)
[ INFO ] Location: Game messages (Indicator messages)
[ DIFF ] Text 'SOUND OFF': Tiho (default: SOUND OFF)
[ INFO ] Location: Game messages (Indicator messages)
[ DIFF ] Text 'GAME PAUSED': Perekur (default: GAME PAUSED)
[ INFO ] Location: Game messages (Indicator messages)
[ DIFF ] Text 'GAME SAVED': Sohraneno (default: GAME SAVED)
[ INFO ] Location: level specific events (level 3 checkpoint)
[ DIFF ] location of the tile to clear: 3 (default: 4)
[ INFO ] Found 22 differences.
poirot
Developer
Developer
Posts: 394
Joined: March 24th, 2003, 8:52 pm
Location: Australia
Contact:

Re: diffpop

Post by poirot »

Great news, If you have a better version of the .xml, just send it to me so I can upload it in princed homepage. I've been thinking in creating a new tag to create custom fieldtypes that are very common (like keys).
David
The Prince of Persia
The Prince of Persia
Posts: 2848
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: diffpop

Post by David »

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5745
Joined: April 9th, 2009, 10:58 pm

Re: diffpop

Post by Norbert »

David wrote:I've ported it to Windows: [...]
Thanks, David!
Falcury
Calif
Calif
Posts: 565
Joined: June 25th, 2009, 10:01 pm

Re: diffpop

Post by Falcury »

I added some code to diffpop, so that it can export the raw offsets from princehack.xml, for the purpose of inserting them into a C source file.
Attached: changed source file, and the output file containing the offsets.
(offsets.txt will be generated if you pass -o or --output-offsets.)

My plan is to use these offsets for loading the customization settings for SDLPoP mods (as mentioned here and here).

Mind you, I have not tested if the offsets are actually correct. I guess I will find out when I try to use them.
Attachments
offsets.txt
(23.2 KiB) Downloaded 72 times
diffpop.c
(23.98 KiB) Downloaded 89 times
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5745
Joined: April 9th, 2009, 10:58 pm

Re: diffpop

Post by Norbert »

I see you even followed the coding style. :P
Interesting new sub-project you're starting.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5745
Joined: April 9th, 2009, 10:58 pm

Re: diffpop

Post by Norbert »

Falcury wrote: March 13th, 2018, 7:00 pmMy plan is to use these offsets for loading the customization settings for SDLPoP mods (as mentioned here and here).
Will this also make it possible to playtest from apoplexy using SDLPoP, and then get SDLPoP to read the PRINCE.EXE in prince/ etc.?
Falcury
Calif
Calif
Posts: 565
Joined: June 25th, 2009, 10:01 pm

Re: diffpop

Post by Falcury »

Right now, the code only tries to read from PRINCE.EXE if a mod directory is specified, for example with the 'mod' parameter. But yeah, reading the EXE if running from another working directory could also be supported.
In essence, PRINCE.EXE becomes like a glorified configuration file :P
Falcury
Calif
Calif
Posts: 565
Joined: June 25th, 2009, 10:01 pm

Re: diffpop

Post by Falcury »

Falcury wrote: April 15th, 2018, 10:04 pm But yeah, reading the EXE if running from another working directory could also be supported.
Added that in this commit:
https://github.com/Falcury/SDLPoP/commi ... cdcfa718b0

By the way, I added some changes to the code that exports the princehack.xml offsets.
The output (offsets.txt) is now a bit more informative, and also shows which offsets are missing in princehack.xml by printing the value -1 instead of some garbage offset.
Attachments
offsets.txt
(36.55 KiB) Downloaded 71 times
diffpop.c
(24.24 KiB) Downloaded 88 times
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5745
Joined: April 9th, 2009, 10:58 pm

Re: diffpop

Post by Norbert »

This is great, Falcury.
I tested your read_exe branch and from what I can tell it works as intended.

We could create princehack.xml 005 to include the three hacks I recently added to apoplexy.
- base speed: 0x4F01, 0x65B1, 0x5389, 0x5AC9, 0x4E45, 0x5F75
- fight speed: 0x4EF9, 0x65A9, 0x5381, 0x5AC1, 0x4E3D, 0x5F6D
- chomper speed: 0x8BBD, 0xA26D, 0x906D, 0x97AD, 0x8B29, 0x9C59
(in the order: p0, u0, p3, u3, p4, u4)

And then after the next SDLPoP release - assuming your work gets merged, I'll modify the "Settings here do NOT impact native (SDLPoP, MININIM)." text at the top of apoplexy's EXE screen, and I'll of course update SDLPoP-latest.zip on popot.org.

Hm, something we could think about: I guess maybe we'll have to instruct authors of new mods to avoid using apoplexy's EXE screen if they want to use SDLPoP, and use SDLPoP's in-game menu instead?
Any thoughts on this?
[Edit: Also, I guess maybe popot.org or poplaun or Total Pack could use some changes? Did you have anything in mind there?]
Falcury
Calif
Calif
Posts: 565
Joined: June 25th, 2009, 10:01 pm

Re: diffpop

Post by Falcury »

Norbert wrote: April 16th, 2018, 10:18 pm And then after the next SDLPoP release - assuming your work gets merged, I'll modify the "Settings here do NOT impact native (SDLPoP, MININIM)." text at the top of apoplexy's EXE screen, and I'll of course update SDLPoP-latest.zip on popot.org.
Yes, that message can then be removed, I suppose. (At least with regard to SDLPoP)
Norbert wrote: April 16th, 2018, 10:18 pmHm, something we could think about: I guess maybe we'll have to instruct authors of new mods to avoid using apoplexy's EXE screen if they want to use SDLPoP, and use SDLPoP's in-game menu instead?
Any thoughts on this?
[Edit: Also, I guess maybe popot.org or poplaun or Total Pack could use some changes? Did you have anything in mind there?]
I am not fully sure what you mean. There would be no special action needed to make a DOS mod work with SDLPoP, right?
Unless modders specifically want to use SDLPoP's additional capabilities, of course.
In that case, I guess one could think about adding a second configuration screen with some SDLPoP-only options.
Hm, maybe that's why you are suggesting referring people to SDLPoP's menu system?
Yeah, in that case, I guess it's a good idea if SDLPoP could spit out a configuration file that can be distributed along with a mod.
Ah, I probably need to give this some more thought.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5745
Joined: April 9th, 2009, 10:58 pm

Re: diffpop

Post by Norbert »

Falcury wrote: April 16th, 2018, 11:52 pmI am not fully sure what you mean.
What I meant is this situation:
Let's say I want to create a brand new mod, and I opt to use SDLPoP instead of DOSBox.
Then I could modify DOS's PRINCE.EXE via apoplexy's EXE screen, but this would mean having to ship DOS's PRINCE.EXE alongside SDLPoP's prince.exe?
Unless SDLPoP could be instructed to modify its SDLPoP.ini based on DOS's PRINCE.EXE.
So, wouldn't SDLPoP need a --write-ini-from-dos-exe or something that could be used, not just by apoplexy?
Or, as I suggested, perhaps modders should be modifying SDLPoP.ini via SDLPoP itself, if they want to make an SDLPoP mod.
Come to think of it, how would a modder know if in-game changes come from a modded DOS's PRINCE.EXE or SDLPoP.ini?
Norbert wrote: March 27th, 2011, 3:57 pmI have some small suggestions to improve it even further; I will point poirot to this post:
1. It would be easier if it uses "name" before "duplicated" for both "level to load" and "Quit when time expires".
2. Maybe add a publication date, version and copyright message inside the file.
3. It needs additional "readoperation" information for some lines of "WDA in palace", "level to load" and "Quit when time expires".
No idea if I - or anyone - ever did anything with this, by the way.
(Other than the version mentioned under 2.)
Falcury
Calif
Calif
Posts: 565
Joined: June 25th, 2009, 10:01 pm

Re: diffpop

Post by Falcury »

This gives me an idea. Maybe I should write a 'Mod Creator' app, or something like that. A small GUI companion program that modders can use to generate both customized PRINCE.EXE files (if creating DOS+SDLPoP mods) and SDLPoP configuration files (if creating SDLPoP-only mods).
It would be similar to CusPop, except that it would also support SDLPoP features.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5745
Joined: April 9th, 2009, 10:58 pm

Re: diffpop

Post by Norbert »

Falcury wrote: April 17th, 2018, 6:19 pmMaybe I should write a 'Mod Creator' app, [...]
Maybe we could discuss this on IRC/Steam?
I think maybe you won't have to, maybe it's not the best way forward...

[Edit: Although, of course, if you think it would be a fun project, why not go for it.]
Post Reply