This is a diary I kept while I was making the game.
Rapunzel Perform Dialogue10th Dec 2004
Gave Rapunzel and the Prince the ability to perform dialogue today. I'm quite pleased with this because the way I did dialogue in Merlin's Revenge 2 was to actually animate it on a timeline. This involved an awful lot of fiddling about with a huge number of text boxes and multiple rewatchings to make sure the amount of time that each bit of speech stayed on screen for was ok. What I had noticed while I was doing that was that the amount of time needed was roughly proportional to the number of characters in the line, perhaps with an amount added on as a basic minimum.
So for Rapunzel, I decided to try to automate the process of performing dialogue. As well as lessening the amount of time it took to change a script into a performance it also has the advantage of allowing scripts to be performed in game.
The way it works in Rapunzel is that the Handsome Prince, whilst sleeping, behaves the same way as a powerup except that his collision area is quite a lot larger than he is. When Rapunzel "collects" him, he doesn't dissappear; he goes into "awake" mode and tells the the game to perform the script. The game then hands each character a line at a time from the script and the character calculates how long to "say" each line for based on the number of characters in the line. The character then tells the game when it has finished the line so game knows to move onto the next one.
In order to save typing, the script also contains a "cast list" (labelled "players") at the top of it explain which in-game characters are referred to in the script. Then come the lines themselves (labelled "lines"). The script for Rapunzel meeting the Prince looks like this:
#playerCharacter - r:
#handsomePrince - p:
r: OI WAKE UP!!
p: egad! 'tis a dragon!
r: Thanks very much.
p: Oh, it's you - what are you doing here?
p: aren't you supposed to be...
p: ...you know...
p: ...up there?
r: Yes well...
r: ...I got tired of waiting for you to wake up...
r: ...so I rescued myself.
p: Oh, jolly good. Shall we go then?
r: hmm... dunno, it doesn't seem right to just walk off.
r: it's not right for the, you know, idiom thing.
p: ah yes, that...
p: ...it's a prob innit?...
r: exactly. Hmm..
p: look, here's what I suggest -
p: I've noticed that the evil witch is nearby...
p: ...she's about eight screens up from here...
p: ...why don't you pop yourself up there, defeat her...
p: ...and then dangle your hair off the balcony...
p: ...so I can climb up it?
p: That's still a sort of a rescue...
p: ...and you get to kick some more butt!
r: Hey, I like that!
r: Yep! Sounds good to me! Let's do it!
p: Well, you do it, there's a love...
p: ...I'll just have little nap.
r: Good grief.
Any changes can be made to the text: the characters will adapt instantly. the only thing I had to look out for was keeping the lines short enough that they didn't dissappear off the edge of the screen or spill over onto two lines, which looks a bit wierd.
Rapunzel Handsome Prince9th Dec 2004
Added the handsome prince today. Here he is:
Rapunzel Finishing Off8th Dec 2004
Little touches today.
Made sure the counters reset before the game starts so they don't appear showing the values from the last game initally only to reset when Rapunzel come on the screen.
Put in the "end of game detector", which in this case is a giant Hair Conditioner. When Rapunzel collects this the game knows it's the end and goes to a screen that says "Well Done!"
Also embedded the fonts. This just means that your computer doesn't have to have the same fonts on it that mine does in order for the game to display properly.
Rapunzel Sound FX6th Dec 2004
Started the sound effects for Rapunzel today. I wanted to keep the "retro" feeling that I had aimed for with the graphics so I elected to make all the sound effects on a C64 emulator running SEUCK (the Shoot Em Up Construction Kit). This was a great little package that gave me my first taste of making games back when I was ooohhh about 11. 'Corse the problem with it was that I had the tape version which meant that approximately 1 in 5 times that I saved the game I was working on it wouldn't load back in again. Never mind, it was all great fun!
Anyway, back to the present day, I used the SFX editor on SEUCK to generate the sounds and then recorded them using the emulator's (CCS64) recording function that outputs the sound as WAVs. Then I loaded it into a freeware sample editing program called Audacity to remove the areas of blank sound, increase the volume of the samples (they were very quiet) and to add echos and things to some of them to make them sound nicer. You might say that's cheating but Rapunzel is a modern game with a retro feel, not a retro game, so I say it's ok.
The only sound effect I didn't produce this way was the frying pan sound. That was a gong sound I downloaded from www.flashkit.com, which I then speeded up a shortened to make it sound like a frying pan.
Rapunzel Bug Fixing2nd Dec 2004
Hit a big bug today, which caused a very long debugging session to find out what the problem was.
When I exported the movie to shockwave, all I got was a black screen! This was odd for two reasons, the first is that this obviously not what was supposed to happen. The second is that this is not how "non playing" errors usually mainfest themselves: When there is a problem with the movie not running all together, an error message usually pops up blaming me (the author) and when there is a problem with the script side of things, shockwave plays the movie as if it were an animation - it flicks through the screens really quickly. Since neither of these two things were happening it meant that the movie *was* playing in some sense, yet it was sitting there apparantly doing nothing.
The first thing I did was attempted to do was display a message on the screen of the shockwave version (remember the game worked fine in the authoring enviornment): that worked, so I then displayed a number in this box that showed which frame we were on. That worked too, the number increased rapidly so I knew that the frame was updating as it should. So this was most odd - the movie was "playing" properly but nothing was actually happening. I then embarked on a long process of having each bit of each program send messages to the little text box letting me know what each bit had managed to do. Eventually, I discovered that part of the initialisation for one of the programs wasn't working properly because an image that it was looking at was coming through as a blank. I then realised that I had changed the block images for the maps to being linked images so that I didn't have to keep importing them everytime I changed something (which happened quite often). Linked images are kept outside of the director file and are read in from your hard drive each time the movie is run. I had assumed that Director would import the images before exporting to shockwave, but clearly this was not the case. Once I had imported the images, everything was fine.
Rapunzel Playtesting1st Dec 2004
Since Nov 25 I have been playing through and through Rapunzel finding bugs glitches, design problems and the like and sorting them out. There are too many to list here and it would make for tedious reading I'm sure, but just to give you an idea of the sorts of bizzare and varied problems that crop up, here is a sample list:
Corridor #2 enemies too hard
goblinSoldier "sitting" above the ground
Rap gets "heavy" upon second life
Corridor right end, block off under stairs
(it was possible to get under the stairs without having first cleared the screen - thereby getting stuck)
Powerups sometimes rotate
(this one took ages to fix!)
Bad weapon bug
(turned out to be linked with the rotating powerups)
Enemies unable to jump up onto platforms
Keep Rap in screen when dying
(Rap would sometimes fly off the side of the screen)
Secret room - cannot collect all gems
(the top two rows were inaccesible)
Lounge - cannot get back up
(this was a problem in many rooms - once you had gone down, there was no way back up)
Goblins die by jumping
(At one point, the goblin would take damage just from jumping - you could defeat them by standing on a platform and waiting...)
Rapunzel Background GFX finished24th Nov 2004
Been doing the background graphics over the last few days and have finished them off today. I won't put up screenshots here of all the different areas, you can see that easily enough by playing the game. Instead, I'll just say a little bit about the way the maps are made and displayed.
In time-honoured computer game fashion, the maps are made up of "blocks" in the case of Rapunzel, each block is 32 pixels wide by 32 high. These block images are then repeated in different formations to create the different rooms that we see in the game. As well as allowing big pictures to be made from small ones (imagine how long it would take to load an image the size of the entire map!) it also simplifies technical issues like collision detection and allows the player an easy way to know what s/he can do where. For example, there are few types of solid block so it doesn't take much learning for the player to recognise a solid block and expect it to be solid. That simplicity allows him/her to concentrate on killing enemies!
The map is drawn in three layers. Passive, Active, Objects.
The passive layer is "pure" background. It's there just for aesthetics and doesn't have any impact on anything in the game. The Active layer contains blocks that affect the characters, solid, ceiling and platform blocks all restrict the characters movement and are arranged to create pathways through the screens. These two layers are combined into a single image for display on the screen. That there are two layers allows any active component to be placed over any passive component without the need for redrawing. This was not the case for MR2. If I wanted to show the same type of tree over grass and dirt, I would have to construct two seperate images in a paint package. In Rapunzel, the game simply comes up with the required effect with no extra input from me. Most handy! Because of this there are also graphics included in the active layer that are not actually "active" but are passive elements that need to appear in front of other passive elements and so are included in the active layer just for convenience.
The object layer is not drawn but instead is used as starting points for the various items that will appear in that screen such as enemies, weapons and powerups.
This is a sample of what the blocks for the different layers look like. The white colour is treated as transparent by the program. Usually, games use purple for transparent but doing this in director/shockwave means that some of the more advanced ink effects do not work properly, so I use white as transparent and use a very light grey when I want something to appear white:
Rapunzel Background GFX started17th Nov 2004
Well, it's time to populate this big empty map with some sort of places of interest. I printed out a grid representing what I had so far which was a very rough idea of the tower, the roof, the basement and outside.
That's fine as far as it goes, but the tower needs more detail to it that just a load of similar looking rooms so I sat down with a printout of the map and blocked in different groups of rooms that would function as different areas of the tower. These are: Rap's bedroom, Attic, Roof, Witch's Bedroom, TV room, Witch School, Main Corridor, Observatory, Kitchen, Little Witch School, Computer Room, Secret Room, Dining Room, Goblin Armoury, Front Hall, Basement, Outside, Balcony.
Naturally all these area will need graphics drawn for them. Today, I did the witches bedroom and the chemical store.
> witches bedroom > chemical store
Rapunzel Hair Conditioner16th Nov 2004
As noted earlier, the Hair Potion only restores the hair by one segment per potion until it reaches it's original length. In order to grow new hair, collect the Hair Conditioner. This will strengthen the hair, avoiding split ends and thereby allow it to grow longer.
> Hair Potion > Hair Conditioner
Rapunzel Powerup Adjustments12th Nov 2004
Added the Hair Potion powerup today to replace the Hair Drops. With the Hair Drops, you had to collect 5 to grow a new bit of hair - with the Hair Potions, every one you collect will retore your hair back to it's full length. If your hair is already at full length the hair potion will be stored for later, you can use it by pressing "space".
In order to increase the speed the game runs at, I altered all powerups not to move (be affected by gravity) this means that a lot of proccessor time is saved not having to check for collisions between powerups and collision zones. It also means that I can arrange powerups rather more artistically on screen and not have to give them platforms to sit on.