Pacman Diary

20th December, 2016

Thought I’d lost this blog forever, but thanks to the Internet Archive I’ve managed to retrieve most of it. Missing some of the original images though, sadly. Most of the old links are missing too, but I’ve relinked them to the Web Archive versions where I could.

As to the game, well it was no longer working on modern Windows PCs, so I’ve debugged it and it now runs in a proper window (it was full-screen, low resolution previously which is probably what was causing the problem). It looks small now on a high resolution screen, but still seems to work okay! If you want to try it you can download it here. The BlitzPlus source code is included in the download.

13th August, 2003

Found the edible ghost sound! Checked everything was running smoothly and provided a download. 18 months in the making and Wobman is finally complete! Go play!


12th August, 2003

I’ve managed to resolve all the issues I had and Wobman is running like a dream now. I’ve made the latest version (v1.13) available for download which includes the executable.

I had to make one decision regarding the high score which is now saved to file. In the original arcade version the score clocked at 100000 points. I was tempted to make mine go higher, but in keeping with the object of this project, I’ve kept it just like the original. If anyone manages to clock it, they probably need locking up anyway.

The only thing left to do before I release the final (?) version v1.2 is to make a last effort to get the edible ghost sound and tidy up the code a bit and that’s it!

8th August, 2003

I did some more work on Wobman last night. Odd things still seem to occur with the sound even with the latest version of Blitz (v1.35). However, I’ve managed to overcome what I think is a bug in Blitz and got the sound working. Compiled the exe and everything still runs okay!

I’ve got a few things to fix before I release the full compiled version on you poor people.

1. Need to fix the siren sound change which get more frantic as the number of pills remaining reduces. Was working previously, but doesn’t seem to be at the moment.
2. Blanks are appearing in the score at certain points
3. Shadow’s speed-up towards the end of a round doesn’t seem to be working

That’s all I know of at the moment anyway. So you could see the release of a compiled (final?) version this weekend.

6th August, 2003

Errr…this diary is waaaayyyy behind. A year and half since I last posted here? Where does time go? Anyway, since my last post I’ve rewritten the whole shebang in Blitz3D, and most recently I’ve tried it with the new BlitzPlus which is designed specifically for 2D games.

The game has been revamped a lot and I’ve now included the full intro sequence as seen in the arcade version, 2-player mode, high scores, well….everything really! I’ve also decided to leave out the banner surround on the new Blitz version of Wobman. I think it was a bit tacky.

I think I’ve now fixed the sound bug that was plaguing me a few months back when I stopped working on it. I think it was just caused by a typo. Duh! The other big issue, keyboard controls, well, it’s a non-issue with Blitz. Nice one.

31st January, 2002

I extend the ‘eating ghosts’ code so that when you eat them a sound plays and the amount you’ve scored for eating it is displayed. I want it look just like the arcade version. The game now has a brief pause when you eat a ghost, this is basically to display the amount of points you’ve just received.

Hmmm…the overall look of the screen doesn’t feel quite right. I decide to create a ‘Wobman’ banner at the top of the screen. This takes a while but it improves the overall look somewhat.

I think it’s time to add some sort of title screen. At the moment the game goes straight into the action. I want the title screen to show all the ghosts and points you can score. This really requires some animation, but since it’s getting late I just implement a static title screen for the moment. Looks okay. It displays a message telling you to press a key to start. Have to re-code the game loop a bit to take into account this new page.

I have to play around with the fonts quite a bit before finding satisfactory ones. I think about recreating the character set used in the game, but decide this isn’t really necessary. Maybe later if I feel it needs it. I use standard ‘Arial’ for the text and ‘Courier New’ for the digits, both in bold. This looks pretty much like the original game.

Arrggg….just found a bug. Why does this always happen just as I’m about to give up for the night.

IF (about to go to bed)
generate really annoying bug
run perfectly

I must remove this bit of code. If you eat the red ghost and then consume the last pill before his eyes get back to the hut, he starts the next level with his eyes disembodied from his body by 200 pixels! Looks rather amusing, but not really desirable. I manage to fix this by resetting any offsets before starting a new level.

30th January, 2002

Well, tomorrow is here. Changed quite a few things cosmetically! There’s now a picture surrounding the maze on a dark blue background. The only black area now is in the game area itself. There was a reason for this. The only way I could think of implementing the passageway was to place a couple of coloured block sprite outside the exits. This way, when Wobman or the ghosts pass into the exit they actually pass behind this sprite which gives the appearance of them vanishing off the screen. I then just make them reappear behind the other sprite at the other side of the screen so they appear to slide into the game area. The effect is just right – I’m a genius!

I add some code to display smaller Pacmen to represent the number of lives, and fruit to determine your level at the bottom of the screen. I have to make some decisions here as there is a limit to how many fruit can be displayed! I think 14 fruit in 2 rows of 7 is enough, so any levels beyond that won’t show any more fruit. I’d really like to know what happens in the arcade version. If anyone knows please let me know.

Spending a lot of time doing minor bug fixing and general tidying up of code. Want it all to feel just right. The program really feels like a game with the added sound effects.

29th January, 2002

I decide to rewrite a lot of the code to do with moving the ghosts. It’s just getting too messy. I’ve now included more arrays so I can configure each individual ghost more easily. As it was, there was no easy way to control the individual speed of each ghost sprite. I also fixed the problem with the eyes.

I also decide to put in some sound effects. Found .wav files for most of the original sound effects including the background siren effect which rises in pitch as the amount of dots eaten increases. While playing around with the wave files I found a cool editing utilitly on the web called Cool Edit. Check it out if you need one.

Went back and looked at the keyboard controls. This is proving to be a BIG annoyance and is taking up a lot of development time. I can’t seem to get around the fact that holding down a key stops Wobman in his tracks. Searched the DarkBasic (product is now discontinued) forums, but to no avail. I have improved them somewhat, but there must be a way to make control smoother…there must!

My first attempts at implementing the passageway to transport from one side of the maze to the other fails miserably. I realise I’m going to have to make some changes to the way the bitmap currently looks to implement this. Oh man, look at the time….will have to wait until tomorrow.

28th January, 2002

Oh my, and I thought last night was bad. Things start off okay, I manage to implement the ghosts changing into just eyes when you eat them. Simple enough, just hide the appropriate sprite leaving just the eyes. The problem started when I began programming them to go back to the hut when eaten and re-spawn when they get there. Unfortunately, they decide they don’t actually want to re-spawn, they’re perfectly happy just being eyes and they have no intention of coming out.

Of course, such behaviour is not acceptable. It takes me over an hour of scrutinizing my code and pulling my hair out to discover the problem. The ghosts target variable is being overwritten as soon as it enters the door to the hut. So they never know that they’ve actually arrived. Adding an ‘eaten’ flag to the hut check fixes the problem instantly.

At least one pair of eyes is still refusing to go back to the central hut, but I’m too tired to check it out right now. Despite these problems and the feeling of treading water I think I’m quite pleased with the overall progress.

Also, I found a nice website called Sounds of Eating with lots of Pacman information on it including which graphic is displayed for each level up to 255! In fact, levels 13-255 have the same Key icon. At least I can complete my Sprites bitmap now! Oh, and the article on Billy Mitchell really has to be read to be believed.

27th January, 2002

I would like to get the Power Pills working tonight. They have have a different code from standard pills in the array so I know when one has been eaten. Changing the ghost sprites to the blue edible ones is a little tricky, but not too bad. I change the collision routines so that you don’t die when you come into contact with an edible ghost and add a timer.

I also want them to start flashing between the blue and the white ghosts sprites for the last few seconds which acts as a warning to the player that they are about to become deadly again. I spend quite a lot of time fine tuning this so it performs like the original arcade. Still not sure if it’s quite right, but it’ll do for now.

Don’t seem to have achieved too much tonight, never mind. Maybe tomorrow will be better.

The latest code is available for download.

26th January, 2002

My main task for this evening is to add some Artificial Intelligence (AI) to the ghosts. At the moment they’re just picking random directions and they’re not even doing that very well. My plan is to let them know the coordinates of Wobman so they have a ‘target’ to head for.

I have to rewrite the ghost movement code to take this ‘targeting’ into account. I don’t feel any nostalgia over deleting the random movement code. The targeting proves more complex than I anticipated. It isn’t just a case of looking at Wobman’s coordinates and moving in that direction, as that direction may not be available to the ghost. So, what I did was try to move towards him and if that isn’t possible, choose a random direction. This direction can be any except the one opposite to that in which you are currently moving. So, if the ghost is going left, he can’t decide to go right. This should stop them from jiggling backwards and forwards like idiots.

I try this code out. Whoa! They chase you like bloodhounds. All four of them homing in on me like Wobman seeking missiles. Maybe I’ll make this Level 20 or something. For now, I’ll have to make them a bit dumber. I add an ‘intelligence’ setting for each ghost. This just says how often to check on Wobman’s coordinates. The higher the number, the dumber they are. After a few tweaks (it’s amazing how little you have to check), I have a level one-ish setting. The ghosts seem fairly individual in their tracking methods, which is good.

I add in the collision detection, which is extremely simple, between Wobman and the ghosts, and code in 3 lives and a game loop. I now have a pretty much complete game done in less than a week!

25th January, 2002

Pills, pills…I need some pills! Well, at least for my game anyway. As I discovered earlier, the best method is to have the pills in the with the maze bitmap. I edit it in paint ( I will order PSP, I’m just too busy at the moment). Okay, load it in. Looks okay. Now to use that dirty word ‘collision’ again. I have to check when he’s eaten a pill. I have a couple of ideas on how to implement this, but I decide on setting up another array to mimic the layout of all the pills. I then use the same array coords I use for collision checking (with some offsets) to check if there’s a pill at that point. After some jiggling around with offsets this seems to work just fine. I realize I need a blank out for the pills so this gets added to the sprite bitmap too.

I need to check it properly so I add in a score above the maze. Hmmm….how much for a pill? 10 points is a nice round number. I must check out the original Namco Pac-Man in M.A.M.E to see what you get. Oh yeah, baby. Now I can move around the maze eating pills and getting loads of points. Cool! My red ghost is still wondering around aimlessly and keeps getting himself locked in the central holding area. Oh well, serves him right for being so dumb.

Anyway, I’m on a roll today. Time to stick in some animation. This proves to be rather easy in DarkBasic (now discontinued). Just load in the frames and update the sprite frame displayed as you move. Takes about 10 minutes to code it.

Right, might as well add the other 3 ghosts. Before I do that, I make the ghost movement subroutine generic so that I can use it for all the ghosts – why write the same thing 4 times? This takes a while but is worth it in the long run. Now adding the other ghosts is a breeze. Each one takes only 5 minutes to code in. Now I have 4 animated ghosts wondering around, Pacman is animated and eating pills, and the score is toting up as you play. Am I good or what? And it’s only 10pm!

As a special treat you can now download today’s source and executable from the downloads section. Right, now I’m in the unfortunate position of choosing between adding Pacman/ghost collision detection and animation or playing WWII Online with my virtual friends. WWII Online wins…

24th January, 2002
Found a problem with the maze collision. Pac-Man…err…I mean Wobman is able to turn a corner when he isn’t fully in the corridor. After some investigation I discover this is due to the calculations being in done purely in Integers – thus, positions like 17.5 are rounded to 17. This is what is making the program think it’s a valid move.

I change parts of the positional calculations to use Real numbers and after adding some brain-numbing (to me anyway) math, I manage to get it fixed. At last, perfect maze movement. Still the annoying fiddly keyboard controls when moving from a horizontal corridor into a vertical one. I must look into that later. Hmmm…I’m sure I’ve said that before somewhere.

Stage 2

Time to add a ghost to the scene. I grab the red ghost and a pair of eyes from my sprite bitmap. They’re sharing coordinates so only one set needed. I’m just going to put in random direction changes for now.Deciding when he reaches a wall and has to turn is easy enough, however, it proves much more difficult to know when he’s at a junction part way along a corridor. My first attempt and the ghost moves around as if he’s got a firework up his rear end. He’s moving backward and forward like a yo-yo. I decide to put in some code to stop him reversing on himself.This smooths out his movement nicely and also makes it easier for me to judge those junctions. Oooh, starting to look a bit like a game now!

23rd January, 2002

I spend some time screen dumping from M.A.M.E. to capture all the animations for Pac-Man and the ghosts. Pac-Man has 15 different poses. At first I’m fooled into thinking the ghosts are a complete sprite, then I realize that the eyes are actually a separate sprite overlayed onto the ghosts.

This reduces the number of ghost sprites I need to create considerably – only 2 frames of animation in 4 different colours and 4 more for the edible ghosts (2 blue/brown, 2 white/red). 12 sprites every ghost frame! Nice. The eyes take up 4 sprites for looking up, down, left and right. Having these as a separate sprite also enables you to create the eyes only animation that occurs after you’ve eaten a ghost.

Sprite Sheet

Wobman Sprite Sheet

I also get the pills, but now I’m wondering whether the pills should be pre-drawn in the main bitmap. Hmmm. I think so. I’ll fix that later. I manage to get the cherry and strawberry, but due to my very mediocre skills at Pac-Man I fail to get beyond the 2nd level. I need more practice before I can get the rest of the fruit!

I’ve also decided on a name for my Pac-Man clone. It’s going to be called…tune in tomorrow to find out! Only joking, it’s going to be called Wobman. Don’t ask.

22nd January, 2002

Today is collision detection day. Mmmm…my favourite. I use the term ‘day’ loosely, as it’s actually 10pm. I have to go to work you see, and this takes up all my day when I could be doing….anyway, I digress.

Suddenly, I have a remarkable brain wave – why not create a second bitmap of the maze made of simple white solid blocks, then just use the POINT command to check for collisions! I later discover that this amazing technique has been used in platform games for years and I’m humbled again. Anyway, how will DarkBasic cope with it? Not very well as it turns out. The POINT command seems to be extremely slow. At first I thinks it’s just because I’m switching bitmaps to do the check – but no, it’s just as slow when checking the same bitmap. This is BAD NEWS. I make a mental note to post a query on the forums. I have to think up an alternative before I go to bed or I’ll never sleep.

I spend an hour creating DATA statements for the maze to read into an array which I’ll can use for collision checking instead. This is considerably faster. Success at last! Pac-Man is now plodding around my maze without going off in any illegal directions. It’s only when I’m nodding off that I realize I could have just read the bitmap to create the array data rather than typing it all in. Oh well, live and learn.

21st January, 2002

I’m not sure why, but I’ve decided to keep a diary of my development of a clone of Namco’s original Pac-Man using DarkBasic (deveopment later changed to BlitzPlus. DarkBasic is now a discontinued product).

Who knows, maybe someone will find it interesting or useful!

Ok, first things first. I ran the original Namco Pac-Man (or is it Puckman?) in M.A.M.E and took a screenshot so I could nab the bitmap of the maze. Then I loaded it into Paint (my 30 day trial on PSP finally ran out on day 358!), and cleared all the pills and ghosts to leave just the plain maze. Using the default 640×480 mode I loaded this into DarkBasic and ran it. Good… fine, just need to centre it on the screen. Also nabbed one frame of Pacman himself, it’s the full circle frame so he’s just a yellow ball at the moment. I’ve decided to store all my sprites in another bitmap as 16×16 tiles as this fits exactly into the corridors of the maze.

Stage 1

Added some keyboard reads so I could move him around the maze pretending that all the colliision detection is in place. Keyboard control seems a bit fiddly, must look into that later.