4D Prince of Persia Question

Questions like: "I can't find the sword" should go here.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: 4D Prince of Persia Question

Post by Norbert »

MoonlightShadow wrote:Anyone have a solution?
The version at popot.org is now fixed, I think. Please check it out and let me know if everything works:
http://www.popot.org/custom_levels/software/0000002.zip
MoonlightShadow
Efendi
Efendi
Posts: 18
Joined: August 26th, 2012, 7:20 am

Re: 4D Prince of Persia Question

Post by MoonlightShadow »

Norbert wrote:
MoonlightShadow wrote:Anyone have a solution?
The version at popot.org is now fixed, I think. Please check it out and let me know if everything works:
http://www.popot.org/custom_levels/software/0000002.zip
No it still doesn't work. Nothing happened when I stepped on the button.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: 4D Prince of Persia Question

Post by Norbert »

MoonlightShadow wrote:No it still doesn't work. Nothing happened when I stepped on the button.
The KIRILL.DAT file (that is being used as LEVELS.DAT) of this mod is corrupt in most packages.
In the package at popot.org, this corruption is fixed.

However, it seems there is another problem with level 11.
That particular raise button should activate the 5th tile from the right in the middle row of room 24.
What it's doing is activate the 4th tile from the right in the middle row of room 24.
That's why the level exit door doesn't open.

level11.plv should be changed as follows:
- at 0000 05B3 from 90 to 8F (the event location)
- at 0000 0012 from 20 to 21 (the level checksum)
I will message David and ask him if he knows how to change the levels file without using PR (since only these two bytes need to be changed and PR would add other information in the level11.plv file).
MoonlightShadow
Efendi
Efendi
Posts: 18
Joined: August 26th, 2012, 7:20 am

Re: 4D Prince of Persia Question

Post by MoonlightShadow »

Norbert wrote:
MoonlightShadow wrote:No it still doesn't work. Nothing happened when I stepped on the button.
The KIRILL.DAT file (that is being used as LEVELS.DAT) of this mod is corrupt in most packages.
In the package at popot.org, this corruption is fixed.

However, it seems there is another problem with level 11.
That particular raise button should activate the 5th tile from the right in the middle row of room 24.
What it's doing is activate the 4th tile from the right in the middle row of room 24.
That's why the level exit door doesn't open.

level11.plv should be changed as follows:
- at 0000 05B3 from 90 to 8F (the event location)
- at 0000 0012 from 20 to 21 (the level checksum)
I will message David and ask him if he knows how to change the levels file without using PR (since only these two bytes need to be changed and PR would add other information in the level11.plv file).
I wish I could understand what you're talking about :lol: Hope David can fix this :D

Anyone else has this problem?
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: 4D Prince of Persia Question

Post by Norbert »

You can use the attached KIRILL.DAT to fix the problem.
(It's a temporary solution, I've used a level editor to fix the problem.)
Attachments
KIRILL.DAT
KIRILL.DAT with working level 11
(36.16 KiB) Downloaded 135 times
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: 4D Prince of Persia Question

Post by David »

Norbert wrote:level11.plv should be changed as follows:
- at 0000 05B3 from 90 to 8F (the event location)
- at 0000 0012 from 20 to 21 (the level checksum)
I will message David and ask him if he knows how to change the levels file without using PR (since only these two bytes need to be changed and PR would add other information in the level11.plv file).
I extracted KIRILL.DAT (from http://www.popot.org/custom_levels/software/0000002.zip), and in level11.plv, the byte at 0x0012 is 0x80, not 0x20. So the change should be from 0x80 to 0x81.
The bytes in KIRILL.DAT can be found at 0x631C (0x80->0x81) and 0x68BD (0x90->0x8F).
You can find where levels are stored in LEVELS.DAT by examining the table at the end of the file, or by searching for part of the data from the PLV in LEVELS.DAT with a hex-editor.
(No offense, Norbert, but have you tried looking into KIRILL.DAT with a hex-editor?)
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: 4D Prince of Persia Question

Post by Norbert »

David wrote:I extracted KIRILL.DAT (from http://www.popot.org/custom_levels/software/0000002.zip), and in level11.plv, the byte at 0x0012 is 0x80, not 0x20. So the change should be from 0x80 to 0x81.
Ah, I think when you use PR it changes every time, because the end of level11.plv contains time information? :)

No, I did not open KIRILL.DAT, because I've always relied on PR to give me the level files.
I wrongfully assumed the level information inside the DAT file was packed in some way.
Thanks for looking into it and for mentioning the two bytes that need to be changed.
I'll update the KIRILL.DAT file on popot.org, so nobody - who downloads the mod there - runs into the level 11 problem again.
[Edit: Done, it's updated/fixed.]
MoonlightShadow
Efendi
Efendi
Posts: 18
Joined: August 26th, 2012, 7:20 am

Re: 4D Prince of Persia Question

Post by MoonlightShadow »

Thanks David and Norbert for fixing this problem. Now I can complete the level :D
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: 4D Prince of Persia Question

Post by David »

Norbert wrote:Ah, I think when you use PR it changes every time, because the end of level11.plv contains time information? :)
No, the checksum in the PLV is the same as in the DAT file. Because metadata at the end of PLV files is not present in DAT files, the checksum does not cover the metadata.
Norbert wrote:I wrongfully assumed the level information inside the DAT file was packed in some way.
Well, images are packed, but levels are not. At least not in the DOS version.
User avatar
Zaknafein
Sheikh
Sheikh
Posts: 48
Joined: May 1st, 2014, 11:40 pm
Location: Menorca

Re: 4D Prince of Persia Question

Post by Zaknafein »

Zaknafein wrote: Being more precise, i understand a level is BRL if it cannot be represented in a Cartesian plane (where rooms have integer coordinates and linked rooms have adjacent coordinates).
David wrote: To be more precise, I would add the following:
Different rooms must have different coordinates.
You have reason, I thought it unconsciously as a matrix indexed in Z^2 and with integer values, so an element must have only 1 value, with it's the room number (if the level has no BRL).
I didn't opened the levels.dat of prince4d, but i guess that the name means that some level cannot be embebed in R^3, but it can in a 2-variety of R^4. So maybe it can be embedded in a torus, or in a Klein bottle. Thinking a level as a graph, i think any level (with or without broken room links) can be embebed in a compact with no border 2-variety of R^4, which can be always embedded in R^4.

Maybe its name it's explained with the time as a 4th dimension, and the level can be represented in a variety of R^3. I didn't played that level so much, so i'm probably wrong.
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: 4D Prince of Persia Question

Post by David »

Zaknafein wrote:[...] but i guess that the name means that some level cannot be embebed in R^3, but it can in a 2-variety of R^4. [...] Thinking a level as a graph, i think any level (with or without broken room links) can be embebed in a compact with no border 2-variety of R^4, which can be always embedded in R^4.
(Oh, topology!)
Maybe I'm overlooking something, but http://en.wikipedia.org/wiki/Graph_embedding writes:
"It is well known that any graph can be embedded in 3-dimensional Euclidean space R^3".
Or are you considering only 2D-surfaces (2-manifolds) within 3D/4D spaces?
(I guess that by "2-variety" you mean "2-manifold", because http://en.wiktionary.org/wiki/manifold#Translations says "variedad" is Spanish for "manifold". Tricked by a false friend?)

I made a map of level 4:
4d_level4.png
There is a non-symmetric link at 22->right->5. Room 22 is linked to itself at the bottom, but you can't go that way because of the wall.
The middle part is a torus, as mentioned here, but the rooms above and below don't fit into it.
User avatar
Zaknafein
Sheikh
Sheikh
Posts: 48
Joined: May 1st, 2014, 11:40 pm
Location: Menorca

Re: 4D Prince of Persia Question

Post by Zaknafein »

Zaknafein wrote: that the name means that some level cannot be embebed in R^3
You're right, there is a mistake here (i wanted to write R^2). You can always make an embedding of a finite graph in R^3, but not always in R^2. I don't know if it's proved or if it's right, but i think you can always make an embedding of a graph (or a level of PoP1) in a compact with no border 2-manifold of R^4 (not variety :oops: ).

Seeing your map, i guess that it can't be embebed in such a manifold which is embebed in R^3 (orientated manifold), but it's possible to find it in that kind of non-orientated manifold in R^4. It will explains the name of that mod.

I still remember the day i discovered topology :shock:
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: 4D Prince of Persia Question

Post by David »

Zaknafein wrote:Seeing your map, i guess that it can't be embebed in such a manifold which is embebed in R^3 (orientated manifold)
I think it can be embedded into a double torus.
The 8×2 rooms should be around the first hole, and the others around the second.
Zaknafein wrote:I don't know if it's proved or if it's right, but i think you can always make an embedding of a graph (or a level of PoP1) in a compact with no border 2-manifold of R^4
I suppose that this can be done in R^3: (At least for finite graphs.)
Start with a sphere and draw all vertices of the graph.
Then start to draw the edges. When an edge can't be drawn onto the sphere (without intersection), add a handle to the sphere and lead the edge through it.
(Of course this is not a proof!)
User avatar
Zaknafein
Sheikh
Sheikh
Posts: 48
Joined: May 1st, 2014, 11:40 pm
Location: Menorca

Re: 4D Prince of Persia Question

Post by Zaknafein »

David wrote:I suppose that this can be done in R^3
Yep! It seems to be true, so you can embed a graph in a k 1-handle 2-sphere (which is the bound of your 3-ball, and it's a 2-manifold). It's seems to be also the "related junction" (idk if it's a well translation) of k torus. So you don't need to embed your 2-manifold in R^4, and then idk the explanation of 4D in the name of the mod... Maybe it's the time, in a visual effect of a certain level, like in repetition of time?

The concept of level without BRL it seems to be different of a graph in R^2, or maybe it's a planar graph with more properties, like that every node has at most 4 edges, but it needs something more, because you can't make an edge of an horizontal level between the opposite nodes, because it would mean that you have a cylinder. (like a ...-1-2-1-2-... level).

If anybody is interested, it's possible to make a test function which it tells you when a level can be well represented in a plane, (it could exist in real life).

Good luck! :)
User avatar
Zaknafein
Sheikh
Sheikh
Posts: 48
Joined: May 1st, 2014, 11:40 pm
Location: Menorca

Re: 4D Prince of Persia Question

Post by Zaknafein »

Here is a solution to decide when a connected level has some BRL (broken room links)

Solution:
Spoiler: show
A level has no BRL if it has all that 4 properties:

0)If there is a left-link from N to M, there is a right-link from M to N. Similarly...

1)2 different nodes has different coordinates. So it's well defined.

2)There isn't any node in 2 different coordinates (a room can't be in 2 different locations)
Then we don't have connections like that:
...-1-2-1-2-...

3)(Optional) 2 nodes with adjacent coordinates have the associated link between these nodes. It makes that if a node can have a well defined link with an adjacent node to make a closed path, then it's connected with it.


Modifications for level with no directed graphs

We can make the BRL condition weaker, deleting conditions 0 and 3.

Algorithm
Spoiler: show
Let L be a PoP level with rooms and a set of all four directed links of each room.

1) Start from a room X=(N,(0,0)) number N. It will be our tree T, with only one leaf,
which it's the same room. That will be our old leaves (OL).

2) Find adjacent rooms of every old leaf of T. We have now new leaves (NL). (*)
  • If there is some return non well-defined link of every new leaf (see 0 property), we have some BRL
    • return 1
    If every new leaf is equal to some room of T, the level has no BRL.
    • return 0
    If there is some new leaf different to all room of T, for each of that new leaf (N,(x1,x2)) test if
    • There is (N,(y1,y2)) in T with new leafs, with (y1,y2) different of (x1,x2)
      There is (M,(x1,x2)) in T with new leafs, con M different of N
    If there exist some of that rooms, the level has BRL.
    • return 1
    If there aren't any of that rooms,
    • OL=NL, our old leaves in the next step will our new leaves of actual step .
      T=union(T,NL), our tree in the next step will be the growing tree.
      go to 2
(*) Find adjacent rooms
If (N,(x1,x2)) has a right-link to M, then an adjacent to N will be (M,(x1,x2+1)). Similarly...

[Add 3rd property]
Post Reply