Documentation (Prince of Persia 1 Guard Types)

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

Re: Documentation (Prince of Persia 1 Guard Types)

Post by Norbert »

What you write is (mostly) incorrect.
What it says in the document is correct.
You can test this yourself by using RoomShaker to place guards with certain skills, and then opening these levels with apoplexy.
RoomShaker's 1-10 is apoplexy's 0-9.
kj-5349 wrote:Hi Norbert, I've recently tried out your apoplexy 3.0 RC2.

Just a small thing to mention:
- Apoplexy type 9 is Roomshaker type 9, not 10. Numbers in the PDF aside, I did recall there is a consistent blocking-attacking chain with the default Jaffar and he rarely improper blocks.
- Apoplexy type 8 (the passive non-attacking guard) is unavailable in Roomshaker, and thus, not 9.
- Apoplexy type b is Roomshaker type 10. Behaviour-wise it is a combination of the Fat Guard & Apoplexy type 6.
- Apoplexy type a is not in Roomshaker. This is the "worst" but most fearsome guard type as he is similar to the SNES Jaffar, and the only way of defeating him is to block, then a short delay and attack (still not sure of the technique's name). Examples I've seen are in robert's The Tricky Tower and princeomkar's Guard Revolt.
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Documentation (Prince of Persia 1 Guard Types)

Post by David »

I think KJ refers to this bug: viewtopic.php?f=71&t=3348
Note that the bug happens only if you use "Guard Here" in RS and not "Change Skill".
User avatar
kj-5349
Sultan
Sultan
Posts: 165
Joined: January 26th, 2010, 11:43 am

Re: Documentation (Prince of Persia 1 Guard Types)

Post by kj-5349 »

David wrote:I think KJ refers to this bug: viewtopic.php?f=71&t=3348
Note that the bug happens only if you use "Guard Here" in RS and not "Change Skill".
Agreed, David. Didn't realise that and RS "Change Skill" follows Apoplexy's skill pool.
Norbert wrote:What you write is (mostly) incorrect.
What it says in the document is correct.
You can test this yourself by using RoomShaker to place guards with certain skills, and then opening these levels with apoplexy.
RoomShaker's 1-10 is apoplexy's 0-9.
Apologies, Norbert. Actually I got confused as I was testing out both editors, but for RS I've always used "Guard Here".
So it means the document refers to RS "Change Skill".

Anyway, what I previously wrote was if RS Guard Here was used.
User avatar
yaqxsw
Wizard Scribe
Wizard Scribe
Posts: 727
Joined: June 18th, 2012, 3:35 pm
Location: Germany

Re: Documentation (Prince of Persia 1 Guard Types)

Post by yaqxsw »

Is possible create own guard type? I want look, what happen if

c/ /60 (48***)/255 /255 /255 /255 /10 (8***)/0/0

And it possible, this guard can make -2 damage? :)
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: Documentation (Prince of Persia 1 Guard Types)

Post by Norbert »

yaqxsw wrote:Is possible create own guard type?
This could be added to CusPop.
yaqxsw wrote:I want look, what happen if [...]
You could already try out these things with PoP1 for SNES.
For example with apoplexy, on the EXE screen (F2).
On the right, you will see 9 tabs, including for instance "strike prob.".
Guiguins
Scholar Scribe
Scholar Scribe
Posts: 4
Joined: October 4th, 2017, 4:20 pm

Re: Documentation (Prince of Persia 1 Guard Types)

Post by Guiguins »

Alright so I found recently this post and its been a very long time since i've touched this game but I like to tinker and experiment things.
Your post has been very helpful.
I've been trying to adjust guard AI by tweaking their values accordingly and I know what they do after some testing:
Strike = Probability the guard will strike immediatly when the player is closing the distance or is in range.
restrike= Probability to strike directly after a successful parry.
Block = Probability to block the first attack from the player.
Impblock = Probability to reblock if the player successfully engaged a duel.
adv = probability to advance ( agressivness )
refrac = frames to hold when hit.

I working on a little mod and I have some rather balanced difficulty progression going on so im sharing an little sneak peak:
In the video I test all the guards up to the amazone ( who kills me). You can see the increasing level of skills.
https://youtu.be/F-NhEJw6heQ

I have a request however, I want to know how i can extract the prince's sprites for modification, what tool i need to use to open the SFC and to repack it ( If such a tool exists).
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Documentation (Prince of Persia 1 Guard Types)

Post by David »

Guiguins wrote: October 4th, 2017, 5:12 pm I have a request however, I want to know how i can extract the prince's sprites for modification, what tool i need to use to open the SFC and to repack it ( If such a tool exists).
What is SFC?

To edit PoP1 DOS images, you can use PR: https://www.popot.org/other_useful_tools.php?tool=PR
Guiguins wrote: October 4th, 2017, 5:12 pm In the video I test all the guards up to the amazone ( who kills me). You can see the increasing level of skills.
https://youtu.be/F-NhEJw6heQ
Oh, wait, you wrote about the SNES version?

There is a tool to extract SNES graphics, but there is no tool for putting them back to the ROM.
You can find the extractor and the extracted graphics here: viewtopic.php?p=11368#p11368
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: Documentation (Prince of Persia 1 Guard Types)

Post by Norbert »

David wrote: October 7th, 2017, 12:17 pmWhat is SFC? [...] Oh, wait, you wrote about the SNES version?
Guiguins does, yep. As you know, in Japan the system is called the Super Famicom.

Related: Japanese SNES mod Sunshine Remix by elveskz has filename
"Prince of Persia Sunshine Remix (Japan) 5.3 By Elveskz.sfc"

Also, lines 1925-1932 of apoplexy.c v3.0 are:

Code: Select all

          if ((toupper (sExtension[1]) == 'S') &&
            (toupper (sExtension[2]) == 'M') &&
            (toupper (sExtension[3]) == 'C'))
            { iFound = 1; } /*** Super Magicom ***/
          if ((toupper (sExtension[1]) == 'S') &&
            (toupper (sExtension[2]) == 'F') &&
            (toupper (sExtension[3]) == 'C'))
            { iFound = 1; } /*** Super Famicom ***/
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: Documentation (Prince of Persia 1 Guard Types)

Post by Norbert »

If this document ever gets updated, "*** For DOS." should be changed to "*** For DOS 1.0.".
T0mmiTheGreat
Sheikh
Sheikh
Posts: 25
Joined: February 22nd, 2021, 8:48 pm
Location: Czech Republic

Re: Documentation (Prince of Persia 1 Guard Types)

Post by T0mmiTheGreat »

Guard skill 10 (a) is used in Prince of Persia for the kid AI in demo level:

Code: Select all

seg006:0D49			 ; void __pascal far do_demo()
seg006:0D49			 do_demo	 proc far
seg006:0D49 83 3E 6E 4C 00			 cmp	 checkpoint, 0
seg006:0D4E 74 11				 jz	 loc_7A11
seg006:0D50 0E					 push	 cs
seg006:0D51 E8 AC 00				 call	 near ptr release_arrows
seg006:0D54 A2 06 46				 mov	 control_shift2, al
seg006:0D57 B0 FF				 mov	 al, 0FFh
seg006:0D59 A2 12 46				 mov	 control_x, al
seg006:0D5C A2 A8 42				 mov	 control_forward, al
seg006:0D5F EB 23				 jmp	 short locret_7A34
seg006:0D61			 ; ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
seg006:0D61			 
seg006:0D61			 loc_7A11:
seg006:0D61 80 3E 2E 3D 00			 cmp	 char.sword, 0
seg006:0D66 74 13				 jz	 loc_7A2B
seg006:0D68 C7 06 68 43 0A 00			 mov	 guard_skill, 10	; <-- This sets the kid's skill
seg006:0D6E 9A 76 07 68 03			 call	 autocontrol_opponent
seg006:0D73 C7 06 68 43 0B 00			 mov	 guard_skill, 11
seg006:0D79 EB 09				 jmp	 short locret_7A34
seg006:0D7B			 ; ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
seg006:0D7B			 
seg006:0D7B			 loc_7A2B:
seg006:0D7B B8 22 0F				 mov	 ax, offset demo_moves
seg006:0D7E 50					 push	 ax		 ; moves_ptr
seg006:0D7F 9A 3F 0F 68 03			 call	 do_auto_moves
seg006:0D84			 
seg006:0D84			 locret_7A34:
seg006:0D84
seg006:0D84 CB					 retf
seg006:0D84			 do_demo	 endp
A guard skill of 11 (b) appears here too, but the value doesn't seem to be used anywhere further.

Code: Select all

seg006:0D73 C7 06 68 43 0B 00			 mov	 guard_skill, 11
I had tried to "jump" it and nothing changed, so I assume it's actually unused. On the other hand, changing the 0A value to 00 makes the kid unable to block, changing it to 08 completely prevents him from fighting, and so on.
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Documentation (Prince of Persia 1 Guard Types)

Post by David »

T0mmiTheGreat wrote: August 24th, 2021, 7:18 pm Guard skill 10 (a) is used in Prince of Persia for the kid AI in demo level:
[...] changing the 0A value to 00 makes the kid unable to block, changing it to 08 completely prevents him from fighting, and so on.
Correct.
T0mmiTheGreat wrote: August 24th, 2021, 7:18 pm A guard skill of 11 (b) appears here too, but the value doesn't seem to be used anywhere further.

Code: Select all

seg006:0D73 C7 06 68 43 0B 00			 mov	 guard_skill, 11
I had tried to "jump" it and nothing changed, so I assume it's actually unused.
What do you mean by "jump"?

If I change 0B to 08 then the guard will not fight.

If I change it to 07 then the prince will often push the guard into the next room, where he falls off the ledge.
When this happens, the prince puts his sword away and keeps standing there forever.

So, this value is used for the guard's skill on the demo level, overriding whatever skill is set for him in the level data.
T0mmiTheGreat
Sheikh
Sheikh
Posts: 25
Joined: February 22nd, 2021, 8:48 pm
Location: Czech Republic

Re: Documentation (Prince of Persia 1 Guard Types)

Post by T0mmiTheGreat »

David wrote: August 26th, 2021, 11:11 am What do you mean by "jump"?
Do an unconditional jump:

Code: Select all

seg006:0D61			 loc_7A11:
seg006:0D61 80 3E 2E 3D 00			 cmp	 char.sword, 0
seg006:0D66 74 13				 jz	 loc_7A2B
seg006:0D68 C7 06 68 43 0A 00			 mov	 guard_skill, 10
seg006:0D6E 9A 76 07 68 03			 call	 autocontrol_opponent
seg006:0D73 EB 0F				 jmp	 short locret_7A34	; <-- Like this
IDK, to me it seemed like an obvious way to shorten "insert an unconditional jump before it". :)
David wrote: August 26th, 2021, 11:11 am If I change 0B to 08 then the guard will not fight.

If I change it to 07 then the prince will often push the guard into the next room, where he falls off the ledge.
When this happens, the prince puts his sword away and keeps standing there forever.

So, this value is used for the guard's skill on the demo level, overriding whatever skill is set for him in the level data.
Oh, I'm dumb. I only tried to exclude the instruction, not to change its parameter. You're right, it is used for the guard.
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Documentation (Prince of Persia 1 Guard Types)

Post by David »

T0mmiTheGreat wrote: August 26th, 2021, 1:56 pm Do an unconditional jump:
[...]
IDK, to me it seemed like an obvious way to shorten "insert an unconditional jump before it". :)
Ah, jump over it.
I get it now. :)
T0mmiTheGreat wrote: August 26th, 2021, 1:56 pm Oh, I'm dumb. I only tried to exclude the instruction, not to change its parameter. You're right, it is used for the guard.
If you exclude it, guard_skill will keep its previous value 10, from the previous MOV.
I.e. the guard will use skill 10 instead of 11.
I think there isn't much visible difference between skill 11 and 10, that's why you didn't notice any change.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: Documentation (Prince of Persia 1 Guard Types)

Post by Norbert »

[Edit:]
Never mind, I checked the .lst files of David's disassemblies, and found:
1.3, kid: C7 06 66 45 [0A] 00
1.4, kid: C7 06 38 43 [0A] 00
1.3, guard: C7 06 66 45 [0B] 00
1.4, guard: C7 06 38 43 [0B] 00

Spoiler: show
T0mmiTheGreat wrote: August 24th, 2021, 7:18 pm Guard skill 10 (a) is used in Prince of Persia for the kid AI in demo level:

Code: Select all

[...]
seg006:0D68 C7 06 68 43 0A 00			 mov	 guard_skill, 10	; <-- This sets the kid's skill
[...]
I'm unable to find C7 06 68 43 0A 00 in PRINCE.EXE versions 1.3 and 1.4.
Any chance you can also provide the hex string(s) or offset(s) for these versions?
David wrote: August 26th, 2021, 11:11 am
T0mmiTheGreat wrote: August 24th, 2021, 7:18 pm A guard skill of 11 (b) appears here too, but the value doesn't seem to be used anywhere further.

Code: Select all

seg006:0D73 C7 06 68 43 0B 00			 mov	 guard_skill, 11
I had tried to "jump" it and nothing changed, so I assume it's actually unused.
[...T]his value is used for the guard's skill on the demo level, overriding whatever skill is set for him in the level data.
I'm also unable to find C7 06 68 43 0B 00 in PRINCE.EXE versions 1.3 and 1.4.
The same question here, any chance you can also provide the hex string(s) or offset(s) for these versions?
Post Reply