The Sorcerer’s Dungeon

Download The Sorcerer’s Dungeon from itch.io

Watch Gameplay video

Last month’s theme was TUNNELS. I gave a good amount of thought what game I would like to make, and I decided I will remake an old Commodore 64 game called Loopz. This is a puzzle game where the player get different shaped pieces and have to place them so they form a closed loop, disappearing and giving score. The goal of the game is to survive as long as possible getting as much score as possible. So, this was the base of my game, with some small modifications. I put a little story behind the game with a cutscene at the start and end of story mode. The apprentice calls the sorcerer “shalafi” wich was a title in Dragon Lance books, meaning master, at least as far as I remember. This was a nod to those books as I like that world very much. Also, this mode have a timer, and after that counted down, (though I never actually told in the story, only implied) the apprentice character’s spell finally works, and teleports the sorcerer into the dungeon level, putting him in harms way. The game also has monsters, and those walk around, and if they happend to be inside a loop (tunnels) when it closes, they give a nice sum of points. As do the sorcerer if he’s closed, as the story mode ends with his demise.

The game features a short timer too, it shows how long a tunnel piece can be held with magic and moved around. If it runs out before the tunnel piece manually placed, the tunnel automatically drops. If there is no previously placed tunnels there (indicated by a tunnel icon), now there will be the one you moved around. If there is another piece under it (indicated by a skull), it’s game over: The sorcerer shoots at the apperentice, killing him. There is an ever increasing target score: this shows, should you get as many scores, the level resets, removing the unused tunnel pieces. I also made an infinity mode, no timer, and therefore no sorcerer at the end, only the target score and your wits and luck.

Actually, I finished the base game one week before deadline. Not that it was easy: I struggled to make a working loop checker, I run to it four times with three variants when finally I was able to make it work. I wanted to make a small object that runs through the loop/half loop, and if it gets back to it’s original place, the loop is complete. I tried to use small spikes at the end of each tunnel piece, making them connect. Finally I made a ds_list of every piece that are able to hit the next one, putting on the list, fidgeting around, seeing if a new connection is made, until it hits the starting object. The loop is then complete, they disappear and give score. For this to work I used mask sprites that are thinner than the pieces themselves (basically the inside part of them). I also had to break down a U shaped piece to 3 smaller ones so the loop checker works properly. It can be seen, if you remember where you put it when the sorcerer runs around, as he destroys placed tunnel pieces, and the U shaped suddelny turns out to be a small corner, a small L corner and a small straight piece.

I also spend much time with the monster AI. It seems simple enough, but it’s 600 lines of code. I didn’t used any built in pathfinding, as I knew I have to navigate the monsters outside AND inside the tunnels. So, instead I move them around, and when not bothered by special cases, they choose a path where they don’t go back to their previous position (so if they stepped from the right, they go only left,up or down). Special cases are the level borders and the tunnel walls, they turn around or even back from those. And also, if they wander inside, or you deliberately trap them in tunnels, they are forced to go inside until they reach the other end – or close them in a full loop and get extra points. I hope I actually managed to cover every situation that can be combining tunnels, level borders and tunnel insides, and they behave accordingly. This may seem as a lot of processing, but these checks and decision makings happen only if a monster reach the grid’s middle, so depending on it’s speed in every half a second or so. They need some special attention by the player, as they as easily step out of a tunnel as they can be trapped inside. But if the player realize their behaviour, they can be herded and trapped near almost finished loops, as you have to do with the sorcerer. When we had a live show and tell, it was interesting to see how only one guy was able to get to the sorcerer and trap him in a loop… after a good five minutes of pursuing.

So as I mentioned, I finished somewhat early. I also spend some time to start to build up an asset park, with stuff I use frequently. Combined with the fact that I moved to 2.3, I see now why functions are good. I made importable assets for crawling text, some draw surface effects, sparks, save-load functions, flash shader, flying text, updated/repaired HP bars, keyboard and gamepad controls, laser effect and projectile, timer, the excellent tweens, and my old viewport camera system. I also made a text typer, arcade style, where you get a screen with a bunch letters and characters, choose a character and “type” in a name. It works as a skipcode (I used it’s predecessor in The Black Lamp) or a highscore name enterer. I also made a highscore handler, finally dinamically handling the inserting of a new highscore and a name.

All in all, I did a lot. Sometimes I still feel I don’t know much in GM. And it was just yesterday when my permanent subscription was terminated and basically converted to a 17 month free sub. I am not particularly happy with this turn of events. I was OK with the desktop export one-time-fee version, and I was thinking about a web export license. Now they combined desktop, web, mobile, uwp, and some other stuff under indie license, monthly or yearly sub. And they have a much more expensive license for consoles. The free version is also returned, as it was a month long only for a time, now it’s just free, but you cannot export to anything. We’ll see where this thing going.