Tuesday, July 31, 2007

Making One of those Weeks episode 15, part 3

Once of the first things programmers should learn about computers is that they are very advanced state machines. A state machine is simply a machine that performs a series of actions, but the actions can vary based on the state of the machine. In the case of the computer, the actions are determined by the operation code contained at the current memory address that the program counter is pointed to. The states are the flags within the processor which are set and cleared based on the actions that the machine performs.

Puzzles within games can also be thought of as state machines. Or, if you find it easier to comprehend, a series of state machines, with some of the machines depending on the state of other machines. Instead of flags and registers, you have objects and actions. In an adventure game, the and in the case of episode 15, obtaining the nut is the state you want to put the machine into. To do this you need to have the nut. This is where having a mini-state machine within the game comes in handy. What is really interesting is that the state of the nut within the game actually helps determine the state of the rock within the game. Likewise, the nut state is dependent in part on the rock state.


The rock has four distinct states. It can be your basic rock, your rock with a husked walnut on it, your rock with a husked walnut on it, or your basic rock that has husk remains around it. The second state depends on the player having the husked walnut. The third state depends on the player having the rock. The fourth state is when the player picks the walnut off the rock.

The nut has three visible states, but internally has five states, one of which is shared with the rock. You have the in tree state, the husk state, the husk on rock state, the walnut state (which could arguably be broken into on rock and in inventory states), and the given to squirrel state.

Monday, July 30, 2007

Making One of those Weeks episode 15, part 2

If you have not solved the episode, the solution is fairly simple. First you pick up the rock that is in the room that you start in. Then you head west (left) and pick up the stick. Next you head to the far eastern room (right twice) where you can use the stick on the tree in order to get a walnut. The nut still has it's husk on it. You can try giving the husked nut to the squirrel, but it won't accept it and you will lose points doing so. Instead head back to the room with the big rock in it. Put the husked nut on the rock. Use the rock on the husked nut. Pick up the walnut and then give the walnut to the squirrel.

Once the ending sequence is shown, you are taken to the scoring screen. Scoring is done as follows:

  • 5 points for getting the walnut out of the tree
  • 5 points for putting the walnut on the rock
  • 5 points for using the rock on the walnut to remove the husk
  • 5 points for giving the walnut to the squirrel
  • -5 points if tried to give husked walnut to squirrel
  • -20 points if squirrel forced to kill you (yes this can happen)
  • -5 points if squirrel was forced to give you more than one warning to keep away from oranges

The lowest possible score that can be achieved is -25. There are two ways of dying in the episode. The easiest way is to simply throw a rock at the squirrel. While I do not track this action (way too much work would be required as I would have to have the game make a call to a server side page that counts the number of hits it gets) I suspect that a large percentage of the people who have played the episode tried doing this if only to see what happens. That is one of the nice things about games is that the consequences for your actions can be erased by simply re-starting the game. Sometimes I wish that the real world had a restart button. Anybody lucky enough to be born into a wealthy family already knows, it already has cheat codes.

The other way of dying is simply by pissing off the squirrel by not heeding it's warning. If you try to grab an orange three times, the third time the squirrel will make a lethal throw. Picky people might notice that it throws a rock for this and may point out that it has no way of getting your rock. My answer to this is to point out the obvious fact that there is more than one rock in the universe and that the squirrel obviously is smart so has a rock with it just in case Colbert (you will have the opportunity to meet Colbert in a future episode) pesters him.

Friday, July 27, 2007

Making One of those Weeks episode 15, part 1

After exploring the forest, you crossed the river and are close to an orchard that contains the hermit's Sun Fruit. For those of you who have not figured out this episode on your own, the solution is presented in the next section though as always I do urge you to try and figure out the solution yourself. In this section we will take a look at our surroundings.



As you can see from the map, the episode is broken into four separate areas which in adventure game tradition we will refer to as rooms. The start room leads to the other three rooms. On the ground in this starting room is a rock. Obviously, you can pick up the rock.

West of the starting room is a room with a big rock in it. This rock is obviously way too big to pick up. On the ground in this room is a stick that can be picked up. It is possible to interact with the big rock. You can try using the stick or the rock on the big rock if you wish. As is often the case in adventure games, when you can interact with an object in the game then that object serves some purpose. Sometimes the object is a red herring (something put into a game just to confuse the player). Other times it is part of an easter egg or inside joke. Most often it is part of the solution to a puzzle in the game.

East of the starting room is a funny looking walnut tree. You can tell that it is a walnut tree by the cluster of walnuts hanging from the topmost branches of the tree. Why would there be so few walnuts on the tree? One would have to assume that someone or something on the island likes walnuts even though they are such a pain to deal with. Could this be the sun fruit that the hermit was talking about? No, as nuts and fruits are different things.

North of the starting location is an orchard of oranges. It appears that this quest will be easier than you thought. Or not! That squirrel must be the beast that the hermit was talking about. It certainly does not like your presence in the orchard.

Thursday, July 26, 2007

Paper Coffee Quest

Just a quick post today. The vote about taking part of the Coffee Quest Revenge time to learn PaperVision 3D resulted in 92% of the vote for taking the time. I can only assume that people want the game in 3D as soon as possible. I am hoping that the game will be at least half as good as the game in my mind is, though development is taking a lot longer than I thought. Granted, a vast amount of the time is spent creating general purpose code that will hopefully be used by many future projects.

Wednesday, July 25, 2007

FLOSS - The Public Domain

To understand what the public domain is, you first need to know a little bit about copyrights. The copyright system has changed quite a bit over the years, and seems to be more focused on corporate interests than on public interests. Basically, when you create something you automatically gain copyrights on the item that you created. You can not copyright ideas, just the particular implementation of an idea. Copyrights last a set period of time. The particular amount of time varies by country, with the US being the life of the creator plus 70 years but corporation owned copyrights last only 95 years from publication or 120 years from creation (whichever is shorter) due to the fact that corporations are legal entities that can theoretically live forever. For the duration of the copyright, the owner controls what can be done with the work, though there are some exceptions for educational use.

When the copyright term expires, the material enters something that is known as the Public Domain. This simply means that anyone who wants to can take the public domain material and do whatever they want with it. To be perfectly blunt, the vast majority of material that has reached public domain status is too old to be of any real use. this is one reason a lot of people want shorter copyright terms. I personally would like to see 10 year copyrights that can be perpetually renewed for another 10 years for a small fee and the renewal information would be publicly accessible so it would be easy to see if something was still under copyright. The advantage of such a system is that anybody would be able to keep their copyrights forever if they desired, but less valuable material would fall into the public domain sooner so that there would be a much greater chance that it would be useful to society.

While the vast majority of the public domain is so old that it is not relevant to modern society, there is still a lot of material that can be used. For instance, Shakespeare has stood up to the test of time quite well. While you can still pay for a printed copy of a Shakespeare play, many archive sites have free copies of the plays that you can download. If you want to put on a play, you don't have to pay any type of public performance fee for using the material. In fact, you can even modify the play however you like. And that is where the problem is.

Tuesday, July 24, 2007

Save Points

I was going to past my second FLOSS entry today but yesterday Sega actually released a RPG on the Wii virtual console. Shining Force is the second game in the shining series of games, though I have never played any games in the series. I am probably going to be playing this entry as soon as I finish Paper Mario.

Since I am talking about consoles anyway, I might as well talk about save points. A lot of players don't like them, but from a development standpoint they are a rather nice way of dealing with the problems of saving a game. Saving a game, while sounding like an easy thing to do, can be a challenge. When you have memory restrictions on how much information can be in the save file, as you do when you are creating a console game, this becomes a major factor. This is why a lot of games reset rooms once you have left the area. By not having to track the state of the monsters in the room you can then eliminate having to save that information. This means that when you are saving the game all you need to save is the player's location, the player stats, and the key game flags.

Key game flags are bits of information that reflect what the player has done in the game. For instance, if you have a treasure chest, you don't want that chest to be magically re-filled every time the player exits then re-enters an area. To solve this problem you just assign a game flag to hold the chest state. If the chest has been opened, then the flag gets set and the next time you enter that area, the chest will already be opened. Of course, this also applies to switches, traps, bosses and any other game state information.

The thing is, if you are going to have the ability to save the game, why require it be done only from key points in the game? Could you not simply use the same flags and stat storage with a slightly larger field for allowing any game location to be the location? If so (and as a programmer I know it IS so) then you could very easily allow the player to save anywhere. All that would have to be done is saving a slight bit more information that contains the monsters in the particular room that the player is in. Even though the number of monsters in a room could vary, you just need to reserve enough memory to hold the maximum number of monsters that appear in a room. There are other reasons why this might not be done which I will discuss in a future post.

Monday, July 23, 2007

Level Limits

Sorry for not posting this earlier (I forgot) but the poll results for last week's Blazing Games poll were 100% for working on Coffee Quest Revenge until the 1.0 version is ready. As the few readers of this Blog already know, I am playing Paper Mario. Now that I am back to work, I will be limiting the amount of time I play to roughly an hour a day, so it will be a while before I finish the game. That being said I did run into one element of the game that I absolutely hate and in the future will ensuring that my own games will not have this major flaw.

The game started off fairly easily so I was just following the plot not building up my character other than through normal solving of the game. Then I hit the Dry Dry Desert, where I found the game a bit too challenging for my liking. For that reason, I decided it was time to build up my character. While I explored the desert, I was fighting all the monsters in an attempt to build up my character. This worked real well and I got to the point where the monsters were no longer a burden but I wanted to build up my character a couple more levels anyway to make the future areas a bit easier. After gaining a level, then went into combat and noticed that I never got experience. There are level limits in the game! Once you have reached a certain level, you no longer gain experience (star coins) from defeating a monster. This means that unless you need money, the fighting of low-level monsters is pointless. I should point out at this time that the money is capped at 999 coins, so once you reach that, picking up extra coins does nothing!

While I have no problem with games that reduce the amount of experience from defeating easier monsters, eliminating it is just wrong. None of my RPGs do this so I am not being a hypocrite on this subject. I must admit, however, as a lot of my RPGs do not have re-spawning monsters (something that most of my future RPGs will have) the lack of new monsters acts as a way of limiting how much a character can be built up. This is a bit different as you at least will always gain experience when you defeat a monster, so none of the fighting in my games is pointless.