Knights in the Nightmare

 is a strategy-shooter role-playing game hybrid from Sting Entertainment, and the fourth episode in the "Dept. Heaven" series of video games. It was released by Atlus in North America. Sting released a special edition version of "Knights in the Nightmare", called the , and it includes a copy of "" for the Game Boy Advance.
Gameplay.
Generally, the game is divided into three separate screens: the Setup, which consists of the player preparing for the battle, the "Tactics Screen", which shows a preview of the scenario, and the actual Battle. Except otherwise noted, the game is fully controlled by the Nintendo DS' touchscreen throughout all of these areas. At its core, the general gameplay mostly resembles a turn-based strategy role-playing game, but it also extensively uses elements from several other genres, such as real-time strategy and bullet hell.
Setup.
In this screen, the player is allowed to prepare for the upcoming battle. This screen gives several options to allow the player to look up the stats and info of the playable Knights, Equipment, and special items available. This is, however, the only screen in which the player can level up the Knights (the characters used for attacking enemies) and Equipment (the items used for damaging the enemies).
The experience points gathered from the previous battles is accumulated into this screen and then given to the player to choose where to distribute, not to the Knights themselves as in most role-playing games. Those that do gain the extra levels are rewarded for more access to higher-level Equipment and a small amount of "Vitality". Similarly, Equipment are given items which can be used to "level up" in a special manner so that they are more powerful and have additional bonuses. However, this puts the potential of not having enough experience for other Knights, or the risk of losing the Knight/Equipment obtained, or simply having a bad level/upgrade.
There is also an option to "Transoul" (or "transfer one's soul") a Knight to another Knight, since all of the playable Knights are considered dead excluding the central characters. Potentially, this allows for stronger Knights at the risk of losing another and/or having a bad outcome. An extremely large amount of conditions exist in this system (such as the past life of the Knights themselves, their elemental affinities, the race of the Knights, etc.) and these conditions must be well regarded in order to have the best possible outcome. 
Tactics Screen.
This screen is done as a final preparation before each battle "turn" is actually initiated. The player can select the Knights, Items, and Equipment in use for the battle, and also look up information on the enemies that will appear in the battle. This mostly resembles common tactical role-playing games in which the player is given time to prepare.
Also in this screen is the option for the player to change the initial "Phase" of the battle. While this can also be changed during the actual battle, this can be done at will by a flick of the in-game switch. Resembling something like Ikaruga's black and white switch, the two phases can be changed to greatly affect the play of the battle, ranging from damage location to the Equipment used. Where each Equipment has an elemental affinity, each also has a Phase affinity, or, rarely, none at all. Also, each Knight has a point-based affinity to either Phase that can greatly affect the damage output while in battle. 
Battle.
The battles take place in real time on an isometric grid (see Isometric graphics in video games). The "Wisp," which resembles a small ball of light, is controlled via the touchscreen and moves around the field to give orders to allied units. When the wisp comes into contact with a unit that can be controlled, the attack must be aimed by moving around the Wisp into one of the four intermediate compass directions and then lifting the stylus off the touchscreen. However, the wisp will be under constant enemy fire, so the player must guide the Wisp to dodge the shots as well as order the allied units to attack. Normal attacks generate "Gems", which recharge the Magic Point meter. Equipment, such as swords, axes, and magical wands, can be used to generate Skill Attacks which can kill enemies and destroy objects on the field.
Despite having a timer, "time" is only deducted for charging attacks and when the player's wisp takes "damage" from on-screen bullets. Thus the player has virtually unlimited "time" to plan strategies and in this manner resembles other turn-based strategy role-playing games, but this is done instead in real time. If there is any "time" left, it can be converted in the Pause Menu to either Experience Points or Magic Points and will end the battle "turn".
To further change the pace of the battlefield, the game has a "Rush Count" system. Each time an enemy is hit, this counter ups by one and activates the condition associated with that number, as long as that number remains the same between hits and if there is one available. For example, one hit to an enemy may give a Rush Count number of replenishing to a Knight, similar to how a healing potion works in common role-playing games, while another hit may give maximum health to the enemy. 
Goals.
Excluding boss battles, the goal of each battle is not to defeat as many enemies as possible, but to align the enemy deaths in a tic-tac-toe style (that is, horizontally, vertically, or diagonally) across the "Enemy Matrix" (which is displayed at the bottom of the screen) labeled in-game by "KILL markers". This isn't accomplished in one "turn", but over multiple, since the enemies are selected manually by the player via roulette. Since boss battles always have one central enemy to kill, this system isn't used, and is instead represented by a health bar going across the bottom of the screen, but these bosses normally have extremely large amounts of health and deploy larger amounts of bullet hell-like instances.
However, there are a limited number of times the player can have in any of these battles. Permadeath exists as characters have a "Vitality" stat which decreases when they use skills, and the same applies to the Equipment, but is referred in-game as "Durability". Vitality is replenished through leveling up in the Setup screen, the "Transoul" system, and other special circumstances such as the "Rush Count" system, while Durability is similarly acquired from merging like Equipment. 
Plot.
Story.
The story in "Knights" is told in both a forward and reverse fashion, with the revelation of past events - what happened at castle Aventheim - being used to decide and explain the events of the present. The plot follows the player's wisp and a Valkyrie, the former of whom recruits fallen knights as allies to battle against monsters. These allies' pre-death stories are shown as glimpses of the Before Crisis events.
Before Crisis.
The Before Crisis flashbacks explain that the disaster at Aventheim was caused by Capehorn, who summoned the demon Zolgonark in order to gain the power to get revenge on both the Knight Kingdom who oppressed his people and the Tiamat. Though Capehorn is also of Tiamat descent, he was exiled after his discovery of the Written Law and proposal that it should be used to defeat the Knight Kingdom. He was taken in as one of Wilmgard's retainers, but betrayed the king and knights, leaving all those with no allegiance to him to have their souls taken by the demons. Capehorn's ultimate goal is to destroy the barriers between the worlds and remake the universe as he pleases.
At the same time, Zolgonark sought to escape Capehorn's control in order to conquer the world of Aventheim and make it a part of the Underworld. In order to do so, he contacted Marietta, who had been dispatched to the world to discipline the humans for recreating Kilgia Tower, which Asgard perceived as sinful for its height, but had been created by the Lemonoug as a way to plead for Asgard to save them from oppression. By promising to give Marietta the power she desired, he tricked her into removing Capehorn's barriers, and then stole Ancardia and split her soul in two, claiming one half as his servant. That half of Marietta's soul killed King Wilmgard when he returned to the castle; the king's soul was sealed inside a crucible, which was stolen by the opposing half of Marietta at the start of the game.
Characters.
Sting claims the game has over 200 characters. The vast majority are met during battle and recruited by using items obtained from previous levels. In the PSP version, another non-canon scenario is available, in which the player uses Princess Yggdra (from "Yggdra Union") in place of Maria.
Development.
Screenshots, artwork and music clips for "Knights" were revealed over two years prior to the game's release on the blog of JaJa, one of the developers. Satoko Kiyuduki reprises her design role from '. Sunaho Tobe, having worked on the first two "Dept. Heaven" titles, and Yoshinori Iwanaga, having done the monster designs for the initial release of "Riviera" also return for "Knights illustrations. Shigeki Hayashi, having composed music for both "Riviera" and "Yggdra Union" returned to compose the soundtrack for "Knights".
While the game was initially intended to be sold in July in Japan, its release date was pushed back until September. According to Ito, this is because Sting realized that a more in-depth tutorial was needed to help players learn the game's complex systems; many adjustments to the game interface were also done at this time.
Reception.
The game received "generally favorable reviews" on both platforms according to the review aggregation website Metacritic. In Japan, "Famitsu" gave it a score of 32 out of 40 for the DS version, and 31 out of 40 (8/8/7/8) for the PSP version.
The DS version reached sixteenth place in sales in its release week in Japan, and was also nominated for an excellence award at the Japan Media Arts Festival 2008. IGN's Mark Bozon praised the same DS version's depth and complexity. The most common complaint among the reviewers was the tutorial, which is almost an hour long, and its very steep learning curve.