Prince of Persia 1 XML Format
Prince of Persia 1 XML Format
This document describes the Prince of Persia 1 XML format:
2014-08-08_PoP1_XML_Format.pdf
Also available as an ODT document. Page on popot.org here.
The level editor apoplexy can export levels to XML with: apoplexy -x
2014-08-08_PoP1_XML_Format.pdf
Also available as an ODT document. Page on popot.org here.
The level editor apoplexy can export levels to XML with: apoplexy -x
Re: Prince of Persia 1 XML Format
Dear,
i think there's an error on the <prince> tag, this will be closed
example
<prince room="<nr>" location="<nr>" direction="<nr>"> MISSED THE = "</prince>" or "/>" at the end
i think there's an error on the <prince> tag, this will be closed
example
<prince room="<nr>" location="<nr>" direction="<nr>"> MISSED THE = "</prince>" or "/>" at the end
Re: Prince of Persia 1 XML Format
[Looks like Polipo wrote a post while I was writing mine.]
There is a problem with the XML examples and with the XML files exported by Apoplexy.
They contain incorrectly written empty elements like this:
They have to be written like this:
(You can open such a file in a browser and it will immediately show if there are any errors.)
There is a problem with the XML examples and with the XML files exported by Apoplexy.
They contain incorrectly written empty elements like this:
Code: Select all
<links left="2" right="9" up="0" down="0">
Code: Select all
<links left="2" right="9" up="0" down="0" />
-
- Calif
- Posts: 553
- Joined: August 27th, 2011, 2:04 am
Re: Prince of Persia 1 XML Format
A new version for a bug that discovered, why not to add import xml function???
Check my Prince in C# https://github.com/salvadorc17/Prince-Monogame
Re: Prince of Persia 1 XML Format
As I wrote to you here: "Shouldn't be that complicated, but I need to find time to do it."salvadorc17 wrote:[...], why not to add import xml function???
It takes time to implement.
Re: Prince of Persia 1 XML Format
I will wait for your import xml functionallity.
Now i'm starting the develop of import the Apoplexy xml file into PrinceOfPersia.net
See my progress on
http://princeofpersiadotnet.blogspot.it ... ditor.html
Now i'm starting the develop of import the Apoplexy xml file into PrinceOfPersia.net
See my progress on
http://princeofpersiadotnet.blogspot.it ... ditor.html
Re: Prince of Persia 1 XML Format
I'm currently busy implementing apoplexy's XML import functionality and ran into another small XML export bug in apoplexy.
The guards' (looking) directions are currently being exported in 'reverse' (right is left and vice versa).
That'll be fixed in the next release (the release that adds XML import functionality).
[Edit: the new apoplexy (version 2.4) is ready. Its forum thread is here. Importing is done with: apoplexy -y]
The guards' (looking) directions are currently being exported in 'reverse' (right is left and vice versa).
That'll be fixed in the next release (the release that adds XML import functionality).
[Edit: the new apoplexy (version 2.4) is ready. Its forum thread is here. Importing is done with: apoplexy -y]
Re: Prince of Persia 1 XML Format
In a next version of this document about the XML format, I will specifically mention the <level number="(nr)"> for these five levels:
Although maybe this shouldn't be added for now, to prevent things from becoming too complicated too fast. Also, the CusPop keys (names) appear to be somewhat inconsistent. (See, for example, the upper and lower case in the sample XML code above.) And maybe it should work with ids instead. Anyhow, I'm just trowing this out here to see what you folks think.
Anyways, what I wanted to suggest is allowing an optional hacks section - similar to the optional userdata section - in the XML, with keys and values based on CusPop's princehack.xml, since some programs that work with XML levels won't use the PRINCE.EXE files of mods. It would look something like:next wrote:level12a.xml has level number 12
level12b.xml has level number 13
princess.xml has level number 14
potions.xml has level number 15
demo.xml has level number 0
Code: Select all
<hacks changes="(nr)">
<hack key="starting hit points" value="4" />
<hack key="environment level 2" value="1" />
<hack key="Older version cheat code" value="megahit2" />
((nr) fields total)
</hacks>
Re: Prince of Persia 1 XML Format
Dear,
into the XML file of Level1.xml, i don't understand
this events, location =18 is a block/wall.
Why?? the events can be applied ONLY to pressplate and upressplate.
<event number="38" room="1" location="18" next="0" />
<event number="39" room="1" location="18" next="0" />
<event number="40" room="1" location="18" next="0" />
into the XML file of Level1.xml, i don't understand
this events, location =18 is a block/wall.
Why?? the events can be applied ONLY to pressplate and upressplate.
<event number="38" room="1" location="18" next="0" />
<event number="39" room="1" location="18" next="0" />
<event number="40" room="1" location="18" next="0" />
Re: Prince of Persia 1 XML Format
Hi polipo, in the XML export, the events' information needs to be changed.
number="" must be -1 everywhere
location="" must be +1 everywhere
Example:
<event number="4" room="9" location="14" next="0" />
needs to become
<event number="3" room="9" location="15" next="0" />
I need to change apoplexy and I will clarify certain things in the PoP1 XML Format document.
I'll work on this today.
I know it may seem weird that event numbers should start at 0, but this is the only way to keep the modifiers of tiles consistent.
Also, I know it may seem weird that the apoplexy export still contains errors, but this is because I personally never ran into problems because of how apoplexy functions internally.
Thank you for bringing up this events related problem.
number="" must be -1 everywhere
location="" must be +1 everywhere
Example:
<event number="4" room="9" location="14" next="0" />
needs to become
<event number="3" room="9" location="15" next="0" />
I need to change apoplexy and I will clarify certain things in the PoP1 XML Format document.
I'll work on this today.
I know it may seem weird that event numbers should start at 0, but this is the only way to keep the modifiers of tiles consistent.
Also, I know it may seem weird that the apoplexy export still contains errors, but this is because I personally never ran into problems because of how apoplexy functions internally.
Thank you for bringing up this events related problem.
Re: Prince of Persia 1 XML Format
The unused events of the original levels are filled with junk values, and Apoplexy just exported that.polipo wrote: into the XML file of Level1.xml, i don't understand
this events, location =18 is a block/wall.
Wait, that is the exit door of level 1.Norbert wrote: <event number="4" room="9" location="14" next="0" />
needs to become
<event number="3" room="9" location="15" next="0" />
If you start counting tiles from 0, then it's tile 13. If you start from 1 then it's tile 14.
But how can it be tile 15?
It's not weird for someone who knows the level format.Norbert wrote: I know it may seem weird that event numbers should start at 0, but this is the only way to keep the modifiers of tiles consistent.
Actually, numbering them differently from what the game uses, that might confuse people: viewtopic.php?p=14795#p14795
Re: Prince of Persia 1 XML Format
See the attached files.David wrote:Wait, that is the exit door of level 1.Norbert wrote: <event number="4" room="9" location="14" next="0" />
needs to become
<event number="3" room="9" location="15" next="0" />
If you start counting tiles from 0, then it's tile 13. If you start from 1 then it's tile 14.
But how can it be tile 15?
- Attachments
-
- level1_room9.txt
- level 1, room 9
- (887 Bytes) Downloaded 91 times
-
- level 1, room 9
- level1_room9.png (7.89 KiB) Viewed 4915 times
Re: Prince of Persia 1 XML Format
I looked at them.Norbert wrote: See the attached files.
The txt only strengthens my opinion.
First, look at room 9:
Code: Select all
<room number="9">
<tile element="47" modifier="3" /> (location 1, open button)
<tile element="0" modifier="0" /> (location 2)
<tile element="0" modifier="255" /> (location 3)
<tile element="0" modifier="0" /> (location 4)
<tile element="0" modifier="0" /> (location 5)
<tile element="0" modifier="2" /> (location 6)
<tile element="0" modifier="0" /> (location 7)
<tile element="0" modifier="0" /> (location 8)
<tile element="0" modifier="0" /> (location 9)
<tile element="52" modifier="0" /> (location 10, wall)
<tile element="35" modifier="0" /> (location 11, pillar)
<tile element="33" modifier="1" /> (location 12, floor)
<tile element="51" modifier="0" /> (location 13, torch)
<tile element="48" modifier="0" /> (location 14, level door left)
[...]
</room>
That gate is in the top-right corner.
If the top-left corner is location 1, then the top-right corner is location 10.
Code: Select all
<events>
<event number="0" room="12" location="11" next="0" />
<event number="1" room="12" location="11" next="0" />
<event number="2" room="12" location="11" next="0" />
<event number="3" room="9" location="15" next="0" />
[...]
</events>
Some tiles, like torches and level doors appear one tile right from their actual position.
Take a look at the screenshot below:
Re: Prince of Persia 1 XML Format
Hah, you are right. The perspective was confusing me, good thing apoplexy uses that green stuff.
So, since you also wrote, about the event numbers, "Actually, numbering them differently from what the game uses, that might confuse people", I guess apoplexy doesn't need to be changed after all?
Should the modifiers of raise and drop tiles be +1? Then they point to the correct events, but their values would no longer be consistent with other modifiers; artificially-inflated.
So, since you also wrote, about the event numbers, "Actually, numbering them differently from what the game uses, that might confuse people", I guess apoplexy doesn't need to be changed after all?
Should the modifiers of raise and drop tiles be +1? Then they point to the correct events, but their values would no longer be consistent with other modifiers; artificially-inflated.