Static Guards

Second part of the best game ever made.

Moderator: English Moderator Team

Post Reply
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 3075
Joined: April 9th, 2009, 10:58 pm
Contact:

Static Guards

Post by Norbert » December 1st, 2013, 4:53 pm

I found a 4th skeleton type. Nothing too special, but here's the information about it.
As listed in the (static) Guards pop-up of Pr2LevEd, the skeleton "Comes to life", "Came to life" or "Won't come to life", and these are also all the variants used in the original PoP2 game.
On page 25 of the Specifications of File Formats, someone (probably Enrique (poirot) or Brendon (RoomShaker 1/2)) made a guess about other types, but without mentioning any unique characteristics.
The 4th may have values (in integers) 255 0, 0 255 or 1 255.
It's similar to 0 0, so a skeleton that is sleeping and wakes up, but the difference is that if the prince jumps, the skeleton doesn't move (wobble).
This means mod authors can create skeletons that don't move when the prince jumps and thus don't give away whether they'll awaken or not.
The concept PoP2 guards screen for apoplexy that I posted in October already shows the fourth type.
(In the actual apoplexy 2.0 release, the images will look a tad different.)

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

Re: Static Guards

Post by Norbert » December 2nd, 2013, 11:01 pm

I also finally understand the difference between the static guard subtypes "black/lev. door" and "black/norm." of Pr2LevEd.
That level door variant (int 0) is only used for the skeletons in rooms 26, 27 and 28 of level 4. If the level door is open and the prince is on the left of them, they awaken.
So that's a 5th skeleton type then. I'm going to ignore that one for apoplexy 2.0. Maybe after that release I'll get back to it.

David
The Prince of Persia
The Prince of Persia
Posts: 1435
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Static Guards

Post by David » December 8th, 2013, 8:36 pm

Norbert wrote:The 4th may have values (in integers) 255 0, 0 255 or 1 255.
I checked all combinations of 0,1 and 255, and it seems that every combination produces this special type, except 0 0, 1 0 and 255 255.
Most probably the value is used as a (little-endian) 2-byte signed integer, so the above combinations mean 0, 1 and -1.
I also checked 2,0 (2) and 254,255 (-2), they also produce this 4th type.
Norbert wrote:So that's a 5th skeleton type then.
It can be combined with the other 4, although some combinations won't make sense. (For example, if the skeleton won't wake up, then there's no point in changing the subtype.)

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

Re: Static Guards

Post by Norbert » December 8th, 2013, 11:23 pm

David wrote:
Norbert wrote:So that's a 5th skeleton type then.
It can be combined with the other 4, although some combinations won't make sense. (For example, if the skeleton won't wake up, then there's no point in changing the subtype.)
In addition to that, there's the option to give them infinite hit points (as the skeleton on the bridge).
I read that in the Pr2LevEd manual.
That manual also mentions two snake types, but not the difference between them.
From what I can tell the difference is that frame 175 means the snake comes out of a hole in the ground (as the snake in room 12 of level 9).
Still need to test that hypothesis.

[Edit: What I wrote may be true, but the EXE appears to ignore those 'frame' settings and just looks at the level+room numbers. Frame can be 0 (or 175 or whatever) everywhere and nothing changes.]

David
The Prince of Persia
The Prince of Persia
Posts: 1435
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Static Guards

Post by David » December 13th, 2013, 9:56 pm

Norbert wrote:From what I can tell the difference is that frame 175 means the snake comes out of a hole in the ground (as the snake in room 12 of level 9).
I just found out that for that one snake, byte 17 is set to 1, and for all other snakes it's 255.
This is the same byte that stores whether a skeleton wakes up.
And, if I set the "comes to life" dropdown to "came to life" (remember, this means 1), it changes the snake so that it comes out of the ground.

In the manual I just collected the numbers I saw on the original levels. It seems that the frame is ignored.

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

Re: Static Guards

Post by Norbert » July 6th, 2014, 11:20 am

I created this in December 2013, apparently I didn't share it yet?
Not even sure if it's interesting/useful in any way, but I wanted to link to this document from another thread and now I can.
Norbert wrote:So that's a 5th skeleton type then. I'm going to ignore that one for apoplexy 2.0. Maybe after that release I'll get back to it.
Apparently it's a special event in PRINCE.EXE.
Attachments
static_guards.xls
static guards
(143.5 KiB) Downloaded 18 times

realXCV
Sheikh
Sheikh
Posts: 26
Joined: November 4th, 2011, 12:04 am
Location: Right here
Contact:

Re: Static Guards

Post by realXCV » July 7th, 2014, 5:52 am

It's interesting.

More infos about snakes and skeletons:

I'm counting three possibilities for the initial state of a snake. All of them being based on the value of act1:
<0: sequence 170
=0: sequence 175
>0: sequence 172

Here are all the snake sequences (or frames if you want to call them that way) that I'm aware of:
170: moving snake
171: snake entering hole
172: snake exitting hole (followed by 170)
173: snake attacking (followed by 175)
174: snake being cut
175: snake... Trying to be scary (not moving)
176: transition 170-175
177: transition 175-170

With skeletons, believe it or not, there are still only three possibilities!
-1: won't come to life
0: will come to life
1: is alive

But there's more:
Of course, there's nothing else to add about -1 and 1. But for the third one, there's one additional thing:

act2 is in fact a timer for the delay between shakes. So if you set it to an extreme value, it will take a lot more time before it shakes. The number of shakes is calculated from the skill (or something like that) but stored in one of the unk.
Everytime a skaking has finished (and assuming more are to come), the delay gets randomized

David
The Prince of Persia
The Prince of Persia
Posts: 1435
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Static Guards

Post by David » July 7th, 2014, 10:00 am

There is one more interesting field of the static guards:
It is column P (labeled "unk"). It is 255 for the "special" skeletons on level 4 and the skeleton on the bridge.
In the disassembly I called it "can_jump", (search for "static_guard_type") because, when a dynamic guard is spawned, it is copied from the "can_jump" field of the dynamic guard data. (around seg030:0B3E)
But perhaps it actually determines if the guard can *run* -- based on where it is set to 255.

Okay, I hex-edited level 4 and this seems to be the case.
realXCV wrote:Here are all the snake sequences (or frames if you want to call them that way) that I'm aware of:
Someone should really document how sequences work. (Both for PoP1 and PoP2.) Either me or you or both of us together.
(Some of it is documented in Mechner's "PoP1 Technical Information": http://www.popot.org/documentation.php?doc=OldDocuments -- And of course in the Apple II source.)
I already have a big auto-generated HTML file showing all sequences, though it's only for the kid.

realXCV
Sheikh
Sheikh
Posts: 26
Joined: November 4th, 2011, 12:04 am
Location: Right here
Contact:

Re: Static Guards

Post by realXCV » July 8th, 2014, 6:35 am

How they work is quite simple. What we need is a full listing which include how, where and when each one is used. Just take the falling sequences: there are many of them. One is for falling after a run jump, another for after a jump forward.
That's the kind of infos that should be included. Also, some of them are made to start from another sequence at a very specific frame. This should also be included.

Post Reply