Level editor for the SNES version

A modern Prince of Persia 1 for SNES level editor for Windows.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5755
Joined: April 9th, 2009, 10:58 pm

Re: Level editor for the SNES version

Post by Norbert »

David, I just wondered how Pr1SnesLevEd detects the ROM's region.
apoplexy does this by checking the byte at 0x7fd9 (0x00: JP, 0x01: US, 0x02: EU).
I just did a case-insensitive grep for "7fd9" in all files of your package, but it yielded no results.
David
The Prince of Persia
The Prince of Persia
Posts: 2859
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Level editor for the SNES version

Post by David »

It does not detect the region itself.

The closest thing is that it detects the number of resources in the first table:
(This is needed because the last resource, the Konami logo is not present in the Japanese version. See here.)

Code: Select all

		if(!i){
			ndata=(ad-0x20000)/3;
			sa=new unsigned __int32[ndata+1];
		}
This relies on that the first resource (i==0) starts immediately after the address table.
So, "ad" contains the end of the table, 0x20000 is the beginning, and 3 is the length of a single address.
"ndata" is the number of resources.

This is not displayed to the user, it is used only internally.
David
The Prince of Persia
The Prince of Persia
Posts: 2859
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Level editor for the SNES version

Post by David »

Here is the new version.

Changes:
* Renamed the old readme.txt to ChangeLog.txt .
* Made the source more readable:
- Replaced many short identifiers with better ones.
- Added typedefs for byte and word.
- Added comments.
- Moved variable declarations to the innermost block.
* Added Hacks editor:
- Here you can change things that otherwise require hex-editing. For example, level-specific special events.
- The hacks are in the Hacks.txt and Hacks_lists.txt files. You can add new hacks to them, and the changes appear when you reopen the Hacks editor.
* Shift + arrow keys move between rooms. Shift + page up/down move to the previous/next room.
* Door events disappear when the current tile is not a button.
* When opening Jaffar's level, the editor jumps to room 0.
* Added File -> Quit.
* Added "Quit?" dialog.
* Removed "Guard skill" menu item. This setting didn't do anything.
* When you select a background tile, the animation group textbox will update itself.
* When you change a property of the current foreground tile, the new foreground tile will appear in the first dropdown.
* Added a "Room links" right-click menu to the room link buttons.
* You can select an item from pop-up lists by double-click. (level, guard type)
* Renamed "girl" to "amazon".
Attachments
Pr1SnesLevEd_2016-01-01.zip
(415.21 KiB) Downloaded 725 times
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5755
Joined: April 9th, 2009, 10:58 pm

Re: Level editor for the SNES version

Post by Norbert »

Very cool, the new hacks editor (and other changes too).
Also, small things like a quit option/dialog and being able to use Shift for room navigation have a big, positive usability impact.
(I'll make sure to announce your new release later today. [Edit: Done.])
salvadorc17
Calif
Calif
Posts: 553
Joined: August 27th, 2011, 2:04 am

Re: Level editor for the SNES version

Post by salvadorc17 »

New version for new year!! Thanks!!
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5755
Joined: April 9th, 2009, 10:58 pm

Re: Level editor for the SNES version

Post by Norbert »

I suggest the following.
If "floor" is checked and the user checks "wall", remove the check from "floor".
Similarly, if "wall" is checked and the user checks "floor", remove the check from "wall".
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5755
Joined: April 9th, 2009, 10:58 pm

Re: Level editor for the SNES version

Post by Norbert »

Another small suggestion: if one of the four room-change buttons has a broken room link, make it a different color.
This will allow users to quickly see that a link isn't the same up/down or left/right.
User avatar
spartacus735
Wise Scribe
Wise Scribe
Posts: 221
Joined: November 20th, 2011, 12:41 pm
Location: France

Re: Level editor for the SNES version

Post by spartacus735 »

Hey David it is possible to add a "export/import color tileset" like the "export level" option please ?

I have another question, I don't know if this question has already been posted but I wanted to know if with the graphics editor you could use elements of several levels like for example the prison walls with the palace floor.
>>>>>>>>>>>>>>>>>>>> http://www.youtube.com/user/spartacus735 <<<<<<<<<<<<<<<<<<<< the channel of prince of persia snes mod
David
The Prince of Persia
The Prince of Persia
Posts: 2859
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Level editor for the SNES version

Post by David »

Here is a new version.

Changes I made in the 5 1/2 years since the previous release:
* Made the source more readable.
* Fixed some of the hacks.
* Added support for hacks which change the value of multiple bytes, among more than two possibilities. It's used for the "Drinking kill potion" hacks from this old post by Kaslghnoon. (This specific hack was requested by salvadorc17 here.)

A change I made today:
* Added support for enlarged PoP1 ROMs. (Suggested by Shauing here.)
Attachments
Pr1SnesLevEd_2021-06-20.zip
(422.8 KiB) Downloaded 533 times
User avatar
Shauing
Calif
Calif
Posts: 435
Joined: April 5th, 2018, 10:38 pm
Contact:

Re: Level editor for the SNES version

Post by Shauing »

David wrote: June 20th, 2021, 12:49 pm Here is a new version.

Changes I made in the 5 1/2 years since the previous release:
* Made the source more readable.
* Fixed some of the hacks.
* Added support for hacks which change the value of multiple bytes, among more than two possibilities. It's used for the "Drinking kill potion" hacks from this old post by Kaslghnoon. (This specific hack was requested by salvadorc17 here.)

A change I made today:
* Added support for enlarged PoP1 ROMs. (Suggested by Shauing here.)
Awesome! I would have added an extra suggestion had I know you were going to release a new version of the editor. It would be nice if editing the guard skill was possible like it was on the 2015-06-03 version; of course the hack for it has to be applied, but it would be nice to have this option available again for this new version that reads expanded roms.
NEW UPDATE! Prince Of Persia: 30th Anniversary Port v1.1.5. Download it today!: viewtopic.php?p=29053#p29053
NEW UPDATE! Prince Of Persia: The Queen Of Light v2.6. Download it today! viewtopic.php?p=33174#p33174
David
The Prince of Persia
The Prince of Persia
Posts: 2859
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Level editor for the SNES version

Post by David »

Shauing wrote: June 24th, 2021, 9:47 am It would be nice if editing the guard skill was possible like it was on the 2015-06-03 version; of course the hack for it has to be applied, but it would be nice to have this option available again for this new version that reads expanded roms.
Done.
I also added the needed hack to the Hacks window.
Attachments
Pr1SnesLevEd_2021-06-26.zip
(423.44 KiB) Downloaded 534 times
Post Reply