Another hour of coding and re-coding. Now we have a multi-layer background, and the enemy ships explode when shot. Left Right and [Z]. Click here to launch.
Tag: game development
The Game, Day 2
Another hour of coding, and the .swf is up to a whopping 3.97k. Now the enemies fire back. As before, left and right arrow keys to move, [Z] to fire. Reload the web page to restart the game. Click here to launch.
Is the Player Part of the Game
…Continuing my train of thought from my post of January 16…
I guess the primary difference between Choose Your Own Adventure (CYOA) games and Interactive Fiction (IF) games is the role of the player. Is the player in the world, or of the world? Is the player a (semi) independent agent, or little more than a glorified bookmark within the story?
In the simplest CYOA game, the player will always be in a particular state when in a particular location. If you have chosen to open the Big Wood Door, and you go to page 52, you will always be in the same state on page 52. It doesn’t matter how you got there; if you are on page 52 then you got there through exactly This Route. There are variations on the CYOA games where you may Open The Door after you Acquire The Sword, and that takes you to page 111. This is still a completely deterministic approach as you do not have the option of, say, Dropping The Sword once you are in the room. Where you are is no different from what you are. You cannot interact with the environment. You are embedded within the story. While the story may be remarkably complex it is still mapped as a two-dimensional flowchart with exactly 1 entrance and n exits, and every possible route from the entrance to those n exits is written out before you make your first decision.
Some of the CYOA -type books are meant to be played along with a random number generator (dice) and a tally sheet (inventory), but this is a bad hack-ish attempt to duplicate the behavior of an IF game without resorting to either a computer or a live storyteller.
And you cannot interact with the environment. For all intents and purposes, you as a player do not exist.
IF-type games allow interaction with the environment around the player. You are in a room. There is a sword on the ground. You pick up the sword. You go to another room. When you go back to the first room, the sword is no longer there on the ground. You have interacted with the environment.
There are objects in the world which are separate from the player, and separate from the world. The objects are in the world, not of the world.
And this is the point where the story ceases being linear and is suddenly multi-dimensional. It is non-linear (or less-linear). Decisions and actions become conditional. You are in a room with a troll. If you have picked up the sword then you can kill the troll. Otherwise the troll kills you.
The game is still linear in that it has a single entrance point and n outcomes, but the path between beginning and end can be enormously convoluted. At this point we begin to differentiate between ending the game and winning the game. And depending on the complexity of the game, it becomes increasingly unlikely that any two sessions of play will be identical.
Another Thing To Do
In my never-ending quest to rid myself of all possible loafing time, I have decided to dive back into the world of game programming. This time I will attempt to make a generic text adventure engine, for the purpose of re-creating great games like Zork, Adventure, and Leather Goddesses of Phobos in a Flash environment.
This is the core of creating a consistent game: figuring out how all the pieces and parts fit together. Making things react differently in different environments. Defining those environments. Setting up the localized laws of cause-and-effect.
Probably the simplest type of text adventure is the choose-your-own adventure, which is essentially a mostly linear, occasionally branching, multiple choice quiz:
You are clinging to a vine halfway down the side of a cliff. At the top of the cliff a tiger is waiting to eat you. At the bottom of the cliff another tiger is waiting to eat you. Two mice are chewing through your vine. You notice a strawberry plant bearing a single, perfect, ripe strawberry growing out of the cliff next to your head.
Do you want to:
A) Climb up
B) Climb down
C) Eat the mice
D) Eat the strawberry
Quite simple, and with a predetermined path to the outcome. These adventures tend also to go in one direction. Once you pick something up, you cannot put it back down.
The text adventures a la Zork use simple language parsing which allows the player to state, in simple, precise sentences, exactly what he/she wants to do at any particular moment:
Go North
Open Door
Get Key
Unlock Door With Key
Open Door
Drop Key
Go East
Close Door
…and so forth. Suddenly we are not just moving through the environment, we are interacting with it on a significant (if limited) level When I picked up the key, I removed it from one environment (a room) and made it a part of another (me).
So now I am in an environment. In a one-person game this is a useless statement, since there is not another autonomous thing which will act within that environment in a way that will affect me. I can change my surroundings, but they cannot change me. Sure, a troll may kill me, or a thief may steal steal the key before I get a chance to use it to open a door. These are triggered, programmed events. They are part of a solvable system. The only way to make the system non-solvable is to introduce another outside agent: Another player.
This takes us into the realm of the MUD, or Multi-User Dungeon; essentially a text adventure with 1 or more players interacting with each other and the environment… and here we get far beyond the scope of what I can hope to accomplish in any reasonable amount of free time.
By the by, this genre of games is commonly referred to as Interactive Fiction
. Here are a few helpful websites:
The Brass Lantern
The Interactive Fiction Archives
Seton Hill University notes on Interactive Fiction
Play Infocom text adventures online !!! (Java applet)
Biomorphs III: A Guiding Hand
Probably should have posted this one before the previous one. Clicking on one of the biomorphs causes the other 8 to become duplicates. From there they each continue to mutate individually.
Biomorphs II:Build Your Own
Click here to see the biomorphs.
Clicking a biomorph makes it the “base”. The other 8 critters become clones of the clicked biomorph, then evolve one generation. By clicking around the different critters you can direct the evolution toward a specific phenotype.
Biomorphs I
Here is the first round. Click the movie to (re)run the experiment.
Less Play, More Build
So I was playing Diablo II last night for the eighty-twelfth time and I decided it was past time to stop playing games eighty-twelve times and start building them instead. To that end, I am slowly gathering together notes from the past couple of years when I have really *meant* to start building games, along with various books on the subject, notes and code from the Adventure Game section of this site, and printouts of the source code from completed games, written in BASIC, and played to death on my old Commodore-64, twenty (egads!)years ago.
But my ideas have evolved over the past couple of years, and I have been playing around with artificial evolution and exploring the possibilities therein.
And I have discovered something.
I have spent over half my life playing adventure/role playing games of various kinds. The object of these games is to make your character more powerful, usually by earning points of various kinds and using them to enhance one or more out of a broad group of possible characteristics.
In artificial evolution experiments, particularly in things like biomorphs , the chromosome starts out simple, then gradually increases in complexity as more and more generations are born.
The characteristics of an RPG character can be considered genes. The genes used to describe a biomorph can be considered characteristics. The points used to advance a character are analogous to the increasing complexity in an evolving organism. The only real difference is, the biomorph is Darwinian evolution, and the RPG character is Lamarckian.
In other words, level advancement == increasing complexity.
Knowing this, why not simply create a gene pool from which can be created a near-infinite number of creatures? Evolve the genotype, rather than building the phenotype! Keep things from getting out of hand by defining what proportions of one group of genes to another makes a critter an animal, a plant, or a whatever is needed to fit the storyline of the game. Need more variety? Make the chromosome larger! Need the game to be science fiction rather than fantasy? Change the code which interprets the chromosome, create some new graphics, and now you have a near-infinite variety of robots.
Once the genotype and phenotype engines are completed, the user can play God or Nature and go in and modify a specific instance of the chromosome to create a specific creature. Mutations of this creature can then be created to suit specific needs.
There. Now that my big idea is made public, I need to start building something.
The Fractal Nature of Space
Lately I have been working on this game which I have had stuck in my head forever. More specifically, I have been building the tools which I will eventually use to build the game. Doing so has forced me to learn a lot in the way of data architecture.
My primary influences for this game are Nethack , the early Ultima games, and Diablo . All of these are adventure games, but there the similarities end. Nethack is – not to belittle it at all – a straightforward dungeon crawl, very simple graphics, simple rules, and astoundingly complex gameplay. Ultima (c. the Commodore-64 era) is middle of the road. Slightly more complex graphics, simpler gameplay, but a much more complicated world. It also gives you the option of controlling multiple characters.
Diablo – specifically Diable II – is an interesting blend of extreme complexity (the size of the world) and extreme simplicity (you play by clicking on stuff).
For the mechanics of the game I am building, Ultima IV – which cost me many a grade-point in college – has the most to teach me.
The interface was quite simple: Your character was always in the center of the screen, and the world shifted around you. Every time you hit a doorway, a city, the entrance to a dungeon, a teleport trap, or any number of other things, you would find yourself somewhere else.
One of the goals for my game is that absolutely all of the data for the game be held in XML files. Flash, while improving with every release, still chokes on huge files, so I had to come up with ways of [1] keeping files small, [2] keeping things modular, [3] keeping things consistent, and [4] keeping things interchangeable. This meant, to coin a phrase, “small pieces, loosely joined”.
Later I decided that, not only did everything have to be saved as XML, but even the images had to be built in XML. And that included multiple-frame animations.
So now I needed a logical system of creating maps and maintaining the internal logic of “When I exit room [1]at door [a] i need to appear in room [2] at room [b]”. How to connect all of these XML documents in a manner which maintains logic at the administration level, the file level, and the gameplay level?
Then it hit me: portals.
In Ultima IV, every time you hit a door, or a cave entrance, or a city, you were dumped into a new map in a specific place. That meant that there was something about the thing you activated which knew where to send you. It didn’t matter WHAT that thing was; every portal, no matter what it looks like, does the same thing: sends you somewhere else. Therefore each door, pit trap, ladder and trampoline has a set of coordinates identifying an XML document and an X and Y coordinate within the map which is built by that document. Scope and scale don’t matter; only the target. Let the new map take care of physics and context once you arrive at the new location.
So this long train of thought has made me think about the various portals in day-to-day life. The door of a house. The door of a car. A stairway. A slide. Each leads (for practical purposes) to a space with its own rules. Inside to outside. Rest to motion. Down here a fall will bruise me. Up there a fall will kill me. Out there is bright and cold. In here smells funny.
Portals, as initiators of action, rest in an indeterminate state. They are neither here nor there, and at the same time are both; like a shoreline. I imagine Schrödinger came up with his famous theorem after watching his cat stand halfway out the door for fifteen minutes. The cat was neither in the state of being inside or outside, but was half of each, yet it was a single cat, so logically it must be oscillating between one state and another. Yet the cat itself isn’t moving, so it must instead be in neither state until it makes up its damn mind.
My next big random train of thought will be on the object-ness of events, and consensual reality with reference to discrete units of time.
Side Tracks
Where have I been? Working on a Flash game . At least, the beginning of one. Miles to go before I sleep, and all that.