Supernova engine merge

Hello, the last week was really busy for me. Because I had a lot of personal stuff to take care of, I sometimes struggled to work as much as I should (that’s the reason, why I am a day late with the blog post), but in the end, I think, I managed. Last week I planed to implement the outro, test the game, fix all the bugs I find and prepare to merge the supernova engines into one. I managed to complete everything I wanted, but I not only prepared the engines for the merge, I actually managed to merge them. The merge is not finished yet, I still have to do a lot of refactoring, testing and fixing bugs I made when merging the engines, but the games can be played on the single engine and they seem to work.

So the plan for next week is to mainly finish the merge. After that, there is not much left to do, so I will work on enhancing the translation.

Right now, we are able to load custom images from a .dat file that are in .pbm format, which is a simple format with only two colors per image. This format is enough to save for example newspaper images like this one:

But there are images in the second game that should be translated, for which only two colors aren’t enough, like this one:

which is in grayscale and with only two colors, I don’t think I can get it much better then this:

Another problem with images is, that the engine uses a format of images, that contain “sections”, that are rendered on top of each other, so we right now have no way to translate this:

Because in this room, you have to push the right letters to write a password. After a letter is pushed, it is highlighted and that is done by rendering different sections of the image.
So the task after I finish the merge will be figuring out and implementing a way to load custom images similar to the original ones (containing sections and a color palette).

Nearing the finsh

Hi, it’s been another busy week and the finish line for the Supernova2 engine is pretty near. Last time I wrote a post I had 22 out of 71 rooms implemented. Now I have finished implementing all of the rooms and the only thing missing is the outro. The game is playable from start to end, so my work for the next week will at first be, implementing the outro, then a lot of bughunting and once I can’t find any more bugs, preparing to and eventually merge the supernova and supernova2 engines.

Implementing rooms is pretty boring and repetitive task, but still one interesting thing happened. There is a part of the game, where the player is supposed to steal a dinosaur skeleton from a museum. There are pressure sensors, cameras and a security guard wandering around the museum and player has to evade all of that in order to not get caught and not trigger the alarm. The implementation of the alarm sound in the original code is pretty simple, it’s a few rows of assembly using the OUT instruction to send frequencies between 1500 Hz and 1800 Hz and thus make a siren sound. So there isn’t any file containing the sound and because of that it has to be generated. So I tried using the PCSpeaker class which can play tones of given frequency. Using the class I managed to play the sound, but unfortunately between every tone, there was a slight “tick” sound. So the solution was to write my own code to generate a raw sound stream with the siren sound. Should be easy, right? Well, it is, but because I have no experience with sound it took me longer than it should. At first I was pretty surprised that generating a stream that has every byte of the same value produces no sound. Fortunately it was enough to google “raw sound” (which took me a few hours) and then I remembered I actually took course this winter semester which part was about this. So I wrote the code just to end up with the same problem I had when using the PSSpeaker class, a “tick” sound between every tone change. I had to higher the audio rate up to 80000 (a lot for just a siren sound) to get rid of it. But thanks to Criezy’s advice we managed to modify the code so it is able to generate a good enough siren sound even on 44000 audio rate.

Second week: it’s starting to look interesting

Hello, another week passed and a lot of progress was made on the Supernova 2 engine. On Monday I started with 4 out of 71 rooms programmed, now I am at around 22 rooms.

There was also a small change in the schedule. Originally I wanted to leave sound to the end, since I think it is the least important part of the engine and it wouldn’t be that bad if I didn’t manage to add it before the end of Google Summer of Code. Because now I am not that worried that I don’t finish the engine in time, I am adding the sound alongside with everything else.

Today I got stuck on pretty interesting problem. I was working on a labyrinth inside a pyramid (it was labyrinth in game but also a labyrinth in code, so I had no idea about the overall layout of the labyrinth). Everything looked quite good, I could walk around and it looked like in the original game. But then I added a special room with puzzle:

and I thought it would be a good idea to actually try if the puzzle works by solving it. So I turned on the game, went to the pyramid and tried to find the puzzle. After like 30 minutes of wandering around with no success I started making a map. So thanks to that after a few more minutes I found the puzzle room. Now I just have to solve it, which is easy, right? It took me like an hour. Not that it was that hard, but while solving, I accidentally swapped 2 similar pieces (third row, second and forth column on the image) and couldn’t figure out what was wrong. Overall I spend like 2 hours just doing this. But thanks to that I have pretty detailed map, so next time I won’t get lost anymore.

That’s all for this week, next week I hopefully manage to finish the pyramid and start working on museum, which is the last part of the game, that will be missing.