Archive for the ‘Game Development’ Category

Pipes! (Again)

March 26, 2008

I don’t know what it is about this game, but folks seem to like it enough that they decide to make new art for it  Maybe its because my “programmer art” is so atrocious.  That’s probably it.
http://ozzpot.com/stuff/Snaps/Pipes-Redux.jpg

http://ozzpot.com/stuff/Snaps/Pipes-Redux2.jpg

Above are some links two two new skins for the game.

I have contacted the designer, and have made some steps towards “themifying” the YWE version of Pipes! to use his art.

Here is his site: http://www.ozzdesign.com/

When merging Ozz’s designs with my code, I had a sort of “peanut butter in my chocolate/chocolate in my peanut butter” kind of moment.  My game, which was fun but not very pretty, has really become something more like it should with the new art.

Anyway, we’ll see how things go.

World’s First Sandbox Script “Game”

March 23, 2008

http://ernestpazera.googlepages.com/SandboxGuessMyNumber.xml

http://ernestpazera.googlepages.com/SandboxScript.rar

Yes, it is spaghetti code.  It doesn’t even make use of my new <call>, <return> or <end> commands.

The nice thing about a scripting language built on top of XML is that the interpreter is super easy to write.  I can use FirstChild and NextSibling much of the time for navigating to the next statement.

I wound up needing a stack to keep track of which block I was in (for <if>/<while>).  As it turns out, <if> and <while> wind up being essentially the same  code-wise.  The only difference is that the node pushed to the block stack is the NextSibling in <if>, and the same node in <while>.

At this point, I have 9 total “commands”, but several of them, <if>, <while>, and <set> are rather complex.  The engine can deal with both text variables and number variables (stored in C#’s decimal type).  In fact, a number variable and a text variable can have the same name, as they are stored in different dictionaries, and escaped differently in text output.  I suppose a third “namespace” would be labels, which can again have duplication.

There are no reserved words.  There are no limitations on the names for things, other than a general prohibition on using # and $ in variable names unless you know the side effects of using them.

So, what is this good for?

At the moment, not much.  Yes, it can run a script file, but that’s about it.  It does text input and output.

However, with a small amount of work (mainly making certain methods visible), an application could conceivably load a script, set some text and number variables, run the script, and then examine some text and number variables.

For a slightly greater amount of work, it could have hooks for input/output and setting variables.

Or, if I never find a use for it, at least I can say I’ve made a general purpose scripting language.

IF Player, Rough Cut

March 17, 2008

Download

Keep in mind it is rough, even though I have added some error checking robustness code, which nearly doubled the LOC.

Comes with a sample xml file with an incredibly annoying but simple “adventure”. The script does showcase all that the interpreter can do.

Oh, and if you want to make an adventure that ends, have an option with a destination of “end”, or simply a room with no options (although this is not tested).

Interactive Fiction Player

March 16, 2008

Today, I invented a new scripting language for interactive fiction.

I also wrote a console application in C# to play these scripts.

The script is XML based and has a schema like the following:

<rooms start=”">
<room name=”">
<include name=”"/>
<set flag=”"/>
<clear flag=”"/>
<if flag=”">
</if>
<ifnot flag=”">
</ifnot>
<text></text>
<option destination=”"></option>
</room>
</rooms>

The player is about 150 LOC, does practically no error checking, but implements the full schema.

This was an idea I had some time in the last week.  After reading Atwood’s CYOA post (where he quit his job), I thought about all of the Choose Your Own Adventure books I had as a kid, and similar books which are now referred to as interactive fiction.

And so I came up with a minimal set of functionality I would need to make my own IF language.  I figured I needed:

  1. A way to inform the player of his current state.
  2. A way for the player to change his current state.
  3. The ability to have conditions that can be set, cleared, and tested

So, at the moment, I have a total of nine tags that the player can process.

  • rooms: this is the root tag of the document, and contains all of the rooms.
  • room: this represents a story node.
  • text: the contents of this tag will be displayed to the user
  • option: this represents a choice the player can make.
  • set: this will set a flag variable
  • clear: this will clear a flag variable
  • if: this will execute the commands within it if a flag variable is set
  • ifnot: this will execute the commands within it if a flag variable is clear
  • include: this will execute the commands inside of another room

The “include” tag is not strictly necessary, but I put it in there to ease writing of scripts.

So, basically, I have written an interactive simple preprocessor.

Once I have a demo-able script, I’ll share it.

The “THING” class

March 16, 2008

As stated previously, I am porting a version of Rogue from 1984 originally written in C for DOS into C#.

Many things wind up easy to port.  Most #defines wind up as const or readonly fields.  Everything winds up a static field or method of a single Program class.

However, the THING “class” was the strangest bit to port thus far.

THING represents either a monster or an item.

It is a union.

Each of the two substructs in the union contain pointers to other THING variables.

So, its a linked list *AND* a union.

Now, I’m attempting to do a “faithful” port, which means it is my goal to get as close to the original as possible (within reason), so I’ve got a kind of ugly re-representation of THING in my code.  It works, anyway.

When porting old code like this, I don’t typically question these things too heavily.  I have to rely on the good faith of the developer twenty four years ago.  He had a perfectly good reason for choosing a union.  I just don’t see what it was.

Rogue Port

March 15, 2008

So what if I don’t have focus?

Along side other things, I am doing a port of Rogue into C#.  In particular, I’m doing a port of the Epyx version 1.48 for DOS.

The method of porting is very similar to the method I use to port old BASIC games into C#.  First, I move all of the code into C# file with every line commented.  Then I go and slowly replace the commented lines with equivalent C# code.

Rogue, however, is rather unlike the BASIC games I have ported.  In BASIC, there was typically only a single listing/file to port.  Rogue has dozens of C files.

So I decided to abuse the “partial class” feature of C#.  Each of the C files went into a CS file with the same name.  There is a namespace around the code, and the code exists within “partial class Program”.  Yes, I have a Program class that spans nearly 40 files.

I can hear the C# people cringe.

But it just goes to show… a language like C# doesn’t force anybody into object oriented programming.

Space Trader for XNA is GO!

March 12, 2008

Space Trader is a game for Palm, and it is my desire to port it to XNA.

Of course, it has periodically been my desire to port it to the Yahoo! Widget Engine, JavaScript, and plain C#. I have taken up the project a number of times, and failed at it. I’ve got lots of stray code to show for it.

The original was written in C, and is heavily forms based (as one might expect for a Palm app). Fortunately, all of the resources for the UI, strings, alerts, bitmaps, etc were recoverable using the PalmOne tools (they extract them into a nice XML file).

It is also GPL, which means I don’t even need to talk to the author to do this port. And I haven’t.

There is already a C# port for windows, but it has some differences in it that I don’t like, including the “put all of the screens on one window” thing that I don’t care for.

The screens are all 160×160, which really can’t give too much information at a time. Currently, I’m working on it in 800×600.

One of the first things I did was to make a utility app to scan in the resource xml files. I did this mainly for the large number of string and alert resources. The forms I just have to duplicate by hand, since they need to grow in size anyway.

Which brings me to control issues. The Palm version used (duh) the stylus, for which the windows equivalent would be the mouse. However, in XNA the target controller should be the 360 controller and the keyboard (the two controllers that both windows and the 360 support) but more importantly, everything should be doable from a game pad. It’ll be interesting to see what I can come up with for equivalent controls.

Diamond Maze on Tempermanent Hold

March 12, 2008

So, the new XNA Diamond Maze is checked into SVN, but now entering tempermanent hold status.

The word tempermanent is one of my pet words, like complexibility. In the case of tempermanent, it means “something that is meant to be ‘temporary’ but will in all likelihood become ‘permanent’”, which is kind of like income tax and the tolls on the freeway in Chicago.

But! The code is there if I should ever want to pick it back up.

Speaking of backing up, I am still missing a crucial step in my backup scheme. Yes, I have a repository on my external HD, and I keep my stuff checked in. If my computer takes a dive, and the external HD doesn’t I’m good. If the external HD takes a dive, and my computer is fine, I’ve got the local copy I can revert to, and make a new repo on a new external HD.

But! If both fail, then what?

Some Stuff

March 10, 2008

I figure I’m due for blogging about blogging, so here I go.

Why do we actually make blogs? There are lots and lots of them, and for the most part, I don’t care about very many of them.

Typically, when I am regularly doing a blog or blog like thing, I will get discouraged at some point because I’ll take a look at the stats, and it becomes patently obvious that few are reading, and even fewer are commenting, which indicates that, just like I don’t care about most blogs, mine is just another one hidden in the woodwork.

But then again, am I saying anything worth reading? Not really… I mostly blither on and on about the development of my games.

Lately, with Diamond Maze, some things have been happening:

1) I am mildly disinterested in progressing because I am pretty much doing a clone of a game I already created. Sure, I changed the number of types of keys in the game, but that doesn’t exactly make it a different game, you know?

2) I’m having another “why am I writing games in the first place?” moments. I don’t play my games. My wife plays Connect!, but Diamond Maze has not, to my knowledge, been heavily played by anyone.

3) The group project I joined on sourceforge has dried up. Good luck next year, Tom.

4) I decided to actually play some games. I like Castle Wars although I’m not entirely certain it has been properly balanced. I played the first Submachine game, and I found out that Stick RPG has been finished, so I played that a little, but quickly lost interest.

5) The desire to write one of the big three games is back again. For those who don’t know, the big three are Dungeon Delver, Island Interloper, and Medieval Micro-manager.

And really, anymore, I would divide Dungeon Delver into multiple distinct games:

A) A text-based interactive fiction design tool and player

B) A roguelike game

C) A graphical adventure creation system and player (a la ACS on the C64), something Inaria-esque.

Island Interloper could also be Interstellar Interloper, and the game would basically be the same, it is still a “travel between outposts and trade commodities” games. I would also like to port Space Trader to XNA. Basically, it is turn based Elite. Of course, I have a long history of starting ports of this game but never finishing.

Medieval Micromanager is like Hammurabi on steroids.

There are also a number of BASIC listings of games that need to be brought up to the current generation of tools.

My Dev Setup

March 3, 2008

 image_169.jpg

Above is a picture of my computer setup at home.

The setup consists of:

1) the screen(83″ 4:3) Cost: $150

2) the projector inside of a tv stand modified into a roll cart.  the bottom part of the cart contains most of the wires for the rig. Cost: $500 for projector, and I think $50 for the cart, the casters, and various extension cords and power strips.

3) the computer, which does not fit inside the cart. I need to figure out some way to attach it. Cost: $450, plus $80 for the video capture card, plus another $30 for the wireless ethernet card.
4) a 36″ piece of 2×12 (sits across the arms of the recliner I sit in) Cost: can’t remember, but this was a part of a 10′ section at one point. The rest of this particular piece of lumber is a base for my bathtub.

5) wireless keyboard and mouse . Cost $25

6) external hard drive  where my SVN repository is (inside the cart) Cost $100

A little less than $1400, and I can develop software on my wall with my feet up.

I also watch tv with it, and I’ve got a gamecube connected into it.

Truly, the only way to develop software.