Uncategorized

Space Trader for XNA is GO!

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.

Uncategorized

Diamond Maze on Tempermanent Hold

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?

Uncategorized

Diamond Maze

diamondmaze_ss_200803020917.png

Well, there’s not much to it yet, but the maze is present, and the player can move about the maze.  There is nothing for him to do yet, however.

Some differences from the original version include a different screen resolution (800×600 instead of the original 640×480).  I did not change the actual number of ascii cells, which remains 40×30, it just scales the sprites to the 20×20 from the 16×16 in the bitmap.

However, the area left for the minimap has changed this time.  Originally, this area was 128×128, and it is now 160×160.  Since the minimap consists of individual pixels, and I don’t want to be scaling something like that, I’m going to  change the size of the entire map to 160×160.

Originally, the individual “rooms” of the maze were 16×16, and there was a grid of 8×8 of them.  This leaves me with a decision to make.  Stay with the 16×16 rooms and change the number of them to 100?  Or, stick with 64 rooms and make them 20×20?  Or, go with a totally different room size completely.

After that, I have a few other decisions to make.  The original game had 4 differently colored doors, and the differently colored keys to go with them.  Do I leave it at 4, or change it?  The four potions: invincibility, freeze, health, and wealth.  Keep as is or add/remove/modify the list?

In any case, the end result should be interesting, and recognizably  the same game as the original, so it really doesn’t matter what is decided as long as it keeps the game fun.

Uncategorized

Maze Generation Code and Diamond Maze

The following is the current iteration of the maze generation algorithm I’m using.  Currently, I am working on a remake of Diamond Maze with XNA.

Yes, it will be using the same ASCII style graphics as it did originally.  This is more of a “ramp up on how I’m going to do stuff in XNA” than anything else.

A colleague of mine once referred to Diamond Maze as a roguelike, which I had never really thought of it as, but I guess the term does accurately describe the game.  I usually associate a way more elaborate combat system and inventory system than what I used in DM.

This code is my implementation of Pim’s algorithm.  It isn’t terribly useful without the associated classes, but I just wanted to share it.

public void Generate(int randomSeed)
{
Random random = new Random(randomSeed);
Clear();
List<MazeCell> frontier = new List<MazeCell>();
MazeCell cell = GetCell(random.Next(Width), random.Next(Height));
cell.Frontier = false;
int direction;
for (direction = MazeDirections.First; direction <= MazeDirections.Last; ++direction)
{
if (cell.Neighbors[direction] != null && cell.Neighbors[direction].Frontier)
{
frontier.Add(cell.Neighbors[direction]);
}
}
while (frontier.Count > 0)
{
cell = frontier[random.Next(frontier.Count)];
frontier.Remove(cell);
cell.Frontier = false;
do
{
direction = random.Next(MazeDirections.Count);
}while(cell.Neighbors[direction]==null || cell.Neighbors[direction].Frontier);
cell.Portals[direction].Open = true;
for (direction = MazeDirections.First; direction <= MazeDirections.Last; ++direction)
{
if (cell.Neighbors[direction] != null && cell.Neighbors[direction].Frontier && !frontier.Contains(cell.Neighbors[direction]))
{
frontier.Add(cell.Neighbors[direction]);
}
}
}
}