ToolsApoplexy level editor
Apoplexy Level Editor: How to Build and Test Prince of Persia Levels
Apoplexy is the fan-made editor for laying out Prince of Persia levels on screen. This page covers what it edits, where it runs and how a finished level reaches the game.
What the Apoplexy level editor is
Apoplexy is a level editor for Prince of Persia, written for the community that keeps modifying the 1989 game. A fan listing on popuw.com describes it as an editor for Prince of Persia 1 on DOS and on the Super Nintendo, and for Prince of Persia 2 on DOS, and credits it to Norbert de Jonge. It is free software under the GNU General Public License, version 3 or later.
A level in these games is a small grid-based puzzle: rooms made of tiles, guards, traps, doors and the switches that open them. An editor that works visually spares the modder from changing raw data by hand. Apoplexy is built to do that job visually, and it can save a level as XML, which other tools read. The Apoplexy level editor is the counterpart to PR: PR changes what the game looks and sounds like, and Apoplexy changes what the player has to do.
When version 2.0 came out in December 2013, news sites reported it as a free and open-source editor that had gained the ability to edit levels of the sequel. Level editing for the first game had come before that. Players interested in that sequel can read about it on the Prince of Persia 2 page.
Platforms, versions and where it lives
The popuw.com listing offers version 3.8 for Windows as a zip archive and for GNU/Linux as a tar.gz archive. Version numbers have kept going beyond that figure: the SDLPoP readme refers to features added in Apoplexy 3.0, 3.5 and 3.16, which are fake tiles, coloured torches and teleports. The numbering therefore shows how long the Apoplexy level editor has been maintained, and the version shown inside the program is the one to trust when comparing builds.
The project’s own site was named in the PrinceJS readme as apoplexy.github.io, so the editor has lived on GitHub Pages. Wherever a build comes from, the sensible habit is to take it from the project’s own page or from the community listing.
Rooms and room links
A level in the first game is built out of rooms, and each room has to say what lies beyond its four sides. The popot.org documentation on the XML level format puts it plainly: every room holds 30 tiles and has four room links, and a zero means that no room is attached on that side. Those four numbers are what lets a player walk from one screen to the next.
The concept matters to anyone building a level: the screen-sized rooms only form a coherent castle if their connections agree with each other. If room A says that B lies to its right, then B should say that A lies to its left. Checking those pairs after editing is part of testing a level.
How a level mod is built and tested with SDLPoP
SDLPoP is the usual place to try a level. Its readme explains that the open-source port can load a whole mod from a folder, and that the folder needs to contain only the files that differ from the original data. Choosing the mod is a matter of changing the levelset option in the SDLPoP.ini file to the name of the mod folder, or starting the game with the mod command. Hall of fame and save files are then kept in that folder, so the experiment does not disturb the main game.
The same readme states that Apoplexy supports the extra tiles of SDLPoP, and names the versions mentioned above. A modder who wants to use fake tiles, coloured torches or teleports should therefore use a recent build of the editor, since an older one will not offer them. Details on the port are on the SDLPoP page.
A typical round runs like this. The designer edits a level, saves it, copies the result into the mod folder and starts the game on that level. SDLPoP accepts a level number on its command line, so the level under test can be opened directly instead of by playing through the earlier ones. After a run, the designer goes back to the editor and adjusts. The cycle repeats until the level plays the way it was planned. Anyone who wants graphics and sound to match the new levels can add edited resources with the PR tool, and the way those containers are built is covered on the DAT files page.
Other ways a finished level is used
The XML that Apoplexy saves is also read by other projects. PrinceJS, a Prince of Persia reimplementation for web browsers, describes a path in its readme: save the level as XML in Apoplexy, run its conversion command, and open the game with the new level number in the address. Custom level numbers there start above 100, and the readme notes that special events do not carry over in the converted levels. The route is useful for sharing a level with people who prefer a browser, with that limitation in mind.
More about the original game that these levels belong to is on the 1989 game page, and the whole set of programs is gathered on the tools overview.
Frequently asked questions
Which versions of the games does Apoplexy support?
A popular fan listing describes it as an editor for the first game on DOS and on the Super Nintendo, and for the second game on DOS. Support for the sequel arrived with version 2.0 at the end of 2013, according to the news coverage of that release.
Is Apoplexy free to use?
Yes. It is free software released under the GNU General Public License, version 3 or later, according to the listing that carries its downloads. The version 2.0 release was likewise reported as free and open source.
Can a level made in Apoplexy run in other projects?
Sometimes. The browser reimplementation PrinceJS documents a route that starts with saving a level as XML in Apoplexy and converting it with a script, although its readme notes that special events are not supported in converted levels.
What does a room link do?
It tells the game which room lies on each side of the current one. A community document on the first game's XML level format says each room holds 30 tiles and has four room links, and that a zero means no room is attached on that side.