I was pretty sure that neither existed but, having once taken apart Hobgoblin and created level (and sprite) editors for it, I was curious if I could make sense of the Qwak level data and maybe even remember how to do anything useful with it. I knew that sbadger claimed to have cracked the level format (when creating a NuLA version of the game) - or that I could possibly even reach out to the game author - but I wanted to challenge myself.tnash wrote:Does anyone know if anyone has done a level designer/ alt levels for Qwak?
Was able to easily identify where the data was stored by loading the game into screen memory. Then it was easy then to break it down into the 16x12 block format which the levels use. This was the first simplistic MODE 7 recreation of it:
It became apparent that each byte of map data is used to store two blocks for the levels. The lower bits are the left hand block and the high bit is the right block. Eg. the value of &B1 breaks down to B (11) and 1, which translates as a solid block (thing 1) on the left and a spike (thing 11) on the right.
I could almost create game-realistic MODE 2 recreations of each map layout at that point - although it was a little slow, as I was plotting the sprites using BASIC - but a couple of key parts were still missing, and required me to sift through a bit more data.
Monster info is stored in pairs in the next 16 bytes (after the initial &60 bytes used for the map). The X/Y coordinates are encoded - as above - into the first byte, and the monster type (0-4) is stored in the following byte. Any type value above 4 means that the byte pair is ignored. The 16 byte limit here means that only 8 monsters may be present on a given level.
Of the 16 bytes that follow (before the start of the data for the next level) only the first two bytes are utilised, and these are used to specify the "theme" of each level. The first byte specifies which sprite to use for the blocks in the level and the second tells the game which type of score item - red apple, green apple, cherries or lollipop - is to be found on the level.
Soon had the basics of the editor down, with cursor movement, sprite selection, etc. There were some ticky parts - mostly around monster placement and removal (as the data is handled differently) - but I've now got something which - while a bit clunky in places - I think has all the required bells and whistles, and am very pleased with. Load and save are implemented, level order can be switched around, the variant blocks (which have different behaviours) are clearly represented, and I switched the slow BASIC sprite plot routine over to machine code
I've included instructions in a text file with the SSD, and the (slightly different) Electron levels are also included, there are also a couple of layouts which I was messing with, and also 3 levels which I "ported" from the Amiga version of the game. When I say ported, I mean that I took screenshots of a video on youtube and created (very) rough analogues. I may continue to tinker with levels myself, and look forward to seeing anything that others come up with