Dat file differences, which version uses apoplexy?

Discuss PoP1 for DOS here.

Moderator: English Moderator Team

Post Reply
salvadorc17
Calif
Calif
Posts: 521
Joined: August 27th, 2011, 2:04 am

Dat file differences, which version uses apoplexy?

Post by salvadorc17 » January 20th, 2017, 9:24 pm

Hi, just want to have more info about the dat files, and the differences from 1.0 to 2.0. Also want to know which version uses apoplexy, this all to work in my level converter...

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

Re: Dat file differences, which version uses apoplexy?

Post by Norbert » January 21st, 2017, 1:02 am

salvadorc17 wrote:Hi, just want to have more info about the dat files, and the differences from 1.0 to 2.0.
For general differences between 1.0, 1.3 and 1.4, see here.

If you mean the tiles used (level layouts), then the answer is: there are no differences.
salvadorc17 wrote:Also want to know which version uses apoplexy, this all to work in my level converter...
The apoplexy package includes PoP1 1.0.

However, when it comes to the tiles used (level layouts), there are no differences between 1.0, 1.3 and 1.4.
Spoiler: show
I should also link to this.
It contains key information on how to convert DOS tiles used (level layouts) to SNES.
But it's complicated and I prefer not to answer any questions related to it.
Because each answer will lead to more questions, I just know it. ;)

salvadorc17
Calif
Calif
Posts: 521
Joined: August 27th, 2011, 2:04 am

Re: Dat file differences, which version uses apoplexy?

Post by salvadorc17 » January 24th, 2017, 9:17 pm

That info contain the layout for levels format, but how to find each level offset into the dat files, cant find that information in document...

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

Re: Dat file differences, which version uses apoplexy?

Post by Norbert » January 25th, 2017, 12:25 am

salvadorc17 wrote:how to find each level offset into the dat files
If you want to make things slightly easier for yourself, you could work with XML files.
Run "apoplexy -x" and use the XML files from the xml/ directory.
I think you work with C#, maybe this or this can help you parse XML files.

[Edit: You should ignore all the stuff in the spoiler. I wrote it but then realized it's not a good way to find offsets.]
Spoiler: show
If you prefer to work directly with the LEVELS.DAT file instead, read on.

When you start apoplexy and click the left prince, PoP1 for DOS editing will start.
If you then close apoplexy, you will find PLV files in the levels/ directory.
You can use these PLV files to find where levels are in LEVELS.DAT.

As an example we will look at level1.plv.
Ignore the first 18 bytes.
After these 18 bytes, you see: A2 00 00 00 21 01 21 21 etc.
Open LEVELS.DAT and search for these bytes.
In the LEVELS.DAT of PoP1 1.0, they are at offset 0x908.
That's where level 1 starts.

Of course, then you need to know what the bytes mean.
The first byte (A2 in this case) is a checksum.
What the bytes after the checksum are is explained in the table at the bottom of page 10 of this document.
It starts with 720 "pop1_foretable" bytes.
Then 720 "pop1_backtable" bytes.
And so on.

Byte 1 of these 720 "pop1_foretable" bytes
+
Byte 1 of these 720 "pop1_backtable" bytes
=
The tile in the top left of room 1.

Byte 2 of these 720 "pop1_foretable" bytes
+
Byte 2 of these 720 "pop1_backtable" bytes
=
The second tile in room 1.

And so on.

Door I and door II are events, links are the room links, and so on.
I can't explain everything to you, of course. :)

salvadorc17
Calif
Calif
Posts: 521
Joined: August 27th, 2011, 2:04 am

Re: Dat file differences, which version uses apoplexy?

Post by salvadorc17 » January 25th, 2017, 9:19 pm

Norbert wrote:
When you start apoplexy and click the left prince, PoP1 for DOS editing will start.
If you then close apoplexy, you will find PLV files in the levels/ directory.
You can use these PLV files to find where levels are in LEVELS.DAT.

As an example we will look at level1.plv.
Ignore the first 18 bytes.
Yes i have parsed apoplexy xml levels correctly in editor, but i dont want to have to convert all prince.dat mods to apoplexy to be able to after convert to snes file format, is like redundant work. So plv files are extracted ones from dat??

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

Re: Dat file differences, which version uses apoplexy?

Post by Norbert » January 27th, 2017, 2:02 am

salvadorc17 wrote:So plv files are extracted ones from dat??
Extracted with PR; apoplexy uses (relies on) PR for this.

Unfortunately, I cannot keep answering questions related to your project.
Every answer I will give you will lead to more questions.
I'm too busy with other things, sorry.

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

Re: Dat file differences, which version uses apoplexy?

Post by David » January 28th, 2017, 5:10 pm

salvadorc17 wrote:That info contain the layout for levels format, but how to find each level offset into the dat files, cant find that information in document...
See this document: http://www.popot.org/documentation.php? ... ifications
The part you need is "3.1.2 Index structures".

salvadorc17
Calif
Calif
Posts: 521
Joined: August 27th, 2011, 2:04 am

Re: Dat file differences, which version uses apoplexy?

Post by salvadorc17 » February 2nd, 2017, 9:25 pm

David wrote: The part you need is "3.1.2 Index structures".
Do you know about the Amiga version format, does its similar to this one?

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

Re: Dat file differences, which version uses apoplexy?

Post by David » February 4th, 2017, 10:30 am

salvadorc17 wrote:Do you know about the Amiga version format, does its similar to this one?
Let's see, I looked into that in 2012...

The "DAT" (resource container) format is all different, and most resources are compressed.
Images are in a totally different (planar) format.
And for some reason the images of the Prince are cut into top and bottom halves...
Levels are in the same format as on DOS, but they are compressed, too.

I might post details in our wiki if someone is interested enough.

salvadorc17
Calif
Calif
Posts: 521
Joined: August 27th, 2011, 2:04 am

Re: Dat file differences, which version uses apoplexy?

Post by salvadorc17 » February 5th, 2017, 9:36 pm

David wrote:
Levels are in the same format as on DOS, but they are compressed, too.

I might post details in our wiki if someone is interested enough.

Yes, that could be useful information, for knowing all the versions dat differences...

salvadorc17
Calif
Calif
Posts: 521
Joined: August 27th, 2011, 2:04 am

Re: Dat file differences, which version uses apoplexy?

Post by salvadorc17 » February 14th, 2017, 9:38 pm

Which are the differences in Prince.dat, any way to edit change this file??

salvadorc17
Calif
Calif
Posts: 521
Joined: August 27th, 2011, 2:04 am

Re: Dat file differences, which version uses apoplexy?

Post by salvadorc17 » March 9th, 2017, 9:32 pm

Norbert wrote:
salvadorc17 wrote:So plv files are extracted ones from dat??
Extracted with PR; apoplexy uses (relies on) PR for this.

Unfortunately, I cannot keep answering questions related to your project.
Every answer I will give you will lead to more questions.
I'm too busy with other things, sorry.
Where i can get more info about other dat files used in game..

Post Reply