Holes

June 14, 2008 by playdeezgames

Years ago, I wrote a little game in Pascal for DOS that I called “Holes”.

Lately, I’ve been thinking about it (and a related game called Helium Baloons v. Water Baloons).

Holes is played on a 8×8 board with two players.

Each player has 8 pieces on the board.

The board has 16 holes in it.

During setup, the players take turns placing pieces and holes.

The player first places a piece. He may not place it on a hole, nor on any other piece.

The player then places a hole. He may not place a hole on any square next to his opponent’s pieces (he can place it diagonally adjacent)

Once all of the pieces and holes are placed, game play begins.

Each player performs one action per turn.

An action can be a regular move or a special move.

A regular move is to shift the holes in one column one square up or down, or one row one square to the left or right. If a player makes a normal move, his opponent may not manipulate that row or column on his next turn.

If a hole shifts to a position off of the board, it appears on the other side.

A special move manipulates the all the holes on the board. The special moves are:

Shift all holes up one square(I)

Shift all holes down one square(I)

Shift all holes left one square(II)

Shift all holes right one square(II)

Flip all holes vertically(I)

Flip all holes horizontally(II)

Rotate holes 90 degrees clockwise(III)

Rotate holes 90 degrees counterclockwise(III)

Rotate holes 180 degrees(III)

Unsure about these, as they may be way unbalanced.:

Add a hole, But Sacrifice a Piece(IV)

Remove a hole, But Opponent Adds a Piece(IV)

Move a hole(IV)

Each of the special moves has a category. If a player plays a special move, his opponent may not immediately make a move with that same category. Also, a player may not make two consecutive special moves.

Sound a little gooballish?

It is, but it might also be fun.

More Widgetbox Stuff

June 11, 2008 by playdeezgames

http://www.widgetbox.com/widget/pdg-pipes

http://www.widgetbox.com/widget/pdg-connect

I also made these into facebook apps, so I’m trying my first foray into that realm. We’ll see how it goes.

The widgetbox versions are effectively identical to the ones on playdeez.com, as they are using the same code, but are in a different webpage without all of the green ookiness of the rest of the site.

Guess My Number on WidgetBox

June 6, 2008 by playdeezgames

http://www.widgetbox.com/widget/pdg-guess-my-number

So, I tried it out.  The widget above was a strictly javascript in html widget.

I think if there are any future widgetbox widgets, I’ll be using the “make a webpage into a widget” option instead.

Widgetbox is vastly faster in approving widgets than yahoo widgets, and has the additional advantage of running practically everywhere.

Seven Essential Elements of a Tile Based Rendering Engine

May 31, 2008 by playdeezgames

In looking over my old articles and attempting to determine just how to revamp them (they are in pretty sorry shape, sadly), I also wound up thinking about my first book (which covered the same topics and then some), and I came up with a rather distilled version of my first book: Seven Essential Elements of a Tile Based Engine.

Keep in mind that when I’m talking “engine” here, I’m strictly speaking of a RENDERING engine.

The first essential element is image management. It is absolutely essential to be able to refer to every image (sprite, tile or whatever, the difference is mainly semantic) by a simple id number, and I should be able to render that image onto any graphical context I wish, using only a single x and y value.  I should not have to do any sort of voodoo to get my warrior sprite to render on my isometric grass tile. i use the same x and y value, and they are correctly rendered with the feet of the warrior in the middle of the isometric tile, because the image manager loads this information from the image itself, as in the extended sprite templates.

The second essential element is a board, which represents the game world. In tile based games, there is almost invariably some sort of grid, be it square, isometric, hexagonal or whatever.  Within the grid are the objects that comprise the world.  Depending on need, the grid locations might be as simple as a bit or number, but may be rather complex lists of stacks of object existing within the grid, not to mention other aspects that describe the grid itself.

The third essential element is a plotter. Once you’ve got a board that abstractly represents the world and images that show what those abstract elements might look like, you need to be able to convert from a grid coordinate to a rendered coordinate.  For this element, we completely forget about the screen, and pretend that we can render the entire gameworld in an abstract worldspace.  The main issue solved here is that you may have a 8×8 grid of tiles that represents a game of reversi.  When I render grid location (0,0), what sort of spacial relationship will it have with grid location(1,0) or (0,1) in order for the graphics in each to render correctly?

The fourth essential element is a scroller, which has very little to do with graphics, and everything to do with math. A scroller takes the output of a plotter, which is a coordinate in an abstract and boundless worldspace, and converts it to a sceen coordinate.  In a game where the grid does not extend beyond the bounds of the screen, the scoller is of less importance, but the use of separate world and screen spaces still has value.

The fifth essential element is a mapper, which takes a screen coordinate and determines the grid location corresponding with it, typically for pointing device input.

The sixth essential element is a walker, which allows movement from one grid location to another grid location based on starting location and a direction of movement. Typically less important in square coordinate systems (as they are elementary), but in isometric and hexagonal grid systems, these can be quite useful.

The seventh essential element uses all of the other six, and is called a renderer.  It may redraw the entire screen each frame, or it may use dirty rectangles.  The important thing is that each update, it knows what grid locations need to be redrawn.

The above, if you were to sprinkle in a bunch of code dumps, would be my first book.

Old Articles for a New Book

May 30, 2008 by playdeezgames

I recently got two copies of a form email from John Hattan regarding two of my older articles still sitting there on GameDev.net:

http://www.gamedev.net/reference/articles/article747.asp

http://www.gamedev.net/reference/articles/article1122.asp

747 (my old isohex article) is around 10 years old, and 1122 (about a trick i do with sprite graphics) and is slightly less than 10 years old.

Both were pre-book, and the concepts in both were the foundations of my first book.

In fact, I would say that if I had not written those articles, I likely never would have written a book, would have never participated in the formation of Sweet.Oblivion, nor the successor GameDev.net.  So, these articles (especially 747) were written at a pivotal moment in my life.

I actually got paid $50 for 1122 by Gignews. 747 landed me the role of “isometric guy” for quite some time.

And both articles, as I read them now, are pretty much garbage.  747 uses pascal (PASCAL!) and 1122 uses ripped off SpriteLib graphics.

But! The folks at gamedev.net are looking for folks who to revamp their old articles for inclusion in a new book.  These are articles they would like revisions of for inclusion.

Which says something, I think, about the articles themselves.  If you read them now, they are badly out of date, but still have something to say, and still are useful.  10 years is a LOOOOOOONG time in computer land, especially internet land.

So, it looks like it is time to dust off those articles.  Plus, I am told that doing so will earn me a modest sum of money and a copy of the book.

Hey… why not?

Indiana Jones

May 23, 2008 by playdeezgames

I saw the new Indiana Jones movie last night.  I could do an old fashioned fanboy rant here, but I’ll spare you.  I’m certain that you can read those sorts of things elsewhere.

I will simply state that I didn’t like it, and that one of the reasons I did not like it is that I don’t feel it necessary to tie up all of the hanging threads of the original movie with a pretty pink bow.

I will continue to hallow Raiders of the Lost Ark as one of the worlds nigh perfect movies.  Temple of Doom has earned my respect on its own terms.  The other two movies, in my opinion, are lumped into the same category as all of the Highlander stuff after the original movie.

I also saw Iron Man, which I felt was pretty good, especially when it immediately follows Indiana Jones.

Running Season

May 6, 2008 by playdeezgames

I have a Rat Terrier, which is a fine smaller dog with a good temperament, but is a little hyper.  He’ll be three this summer.  His name is Porkchop.

Over the last three years, he has gone through a number of different chew toys.  We determined early on that any chew toy made of cloth or rope would last approximately 2.3 seconds.

His first year, we found a bone shaped piece of blue rubber at wal-mart that he couldn’t manage to destroy.  Sure, there were teethmarks in it, but it held up surprisingly well for an entire year.  Chances are, it would still be holding up to Porkchop’s abuse, but he lost it.  My guess is that he buried it somewhere.

We had a replacement blue bone, and that one got lost too.  Now we have a black bone, but after last year, he has chewed the ends down a bit.  I would have bought a new blue bone, but last time I was shopping for one, they no longer had them.

In any case, now that the weather is nicer, my dog likes to play fetch, so we enter what I call “Running Season”.  Each day, I throw the bone out into the middle of my yard fifty times or so.  Its sort of a competition… will my arm give out before the dog gets tired of running around?

When we first played this “game”, my arm would tire first.  Now, while my arm isn’t what it was by the end of last year just yet, I keep throwing until the dog quits, which with a high energy rat terrier can take a while.

By the end of summer, my dog will be totally buff, like he was last year.  He had gotten flabby over the winter.  Not as much fetch can be played when the snow is higher than the dog.  However, it did not keep him from playing fetch those few times we did during the winter when the snow with knee high.  He was a determined dog, too… digging trenches in order to find it.

Again, Rat Terrier is highly recommended.  Good with kids, doesn’t shed, easy to train, high energy, and kills vermin(so far a number of mice, moles, a bullfrog and a rabbit).

Satisfaction Guaranteed

April 29, 2008 by playdeezgames

I was eating a bag of candy, and I happen to read the back.

To paraphrase: if you don’t like the candy, take the unused portion with the packaging plus a reason you are returning it, and mail it to the address below, and we’ll give you a new one or a different candy that we make.

This is a nice idea, I suppose, but I sat and thought about it (my wife was driving, so I had time to be pensive).

The weight of a full bag is 7.5 oz. It cost 99 cents. I figure at most, I will have eaten half of it before deciding that I don’t like it (most likely, I’ll dislike it on first bite, but we’ll use half for the rest of the exercise).

I did a postage calculation. If i sent it in a large envelope, I could get it mailed for $1.31, which is more than I paid for the candy in the first place.

So, for $2.30, I can have one and a half bags of candy, and I won’t like the half bag.

Last Weekend

April 29, 2008 by playdeezgames

This past weekend, I helped some folks I know from church to move from their old apartment to their new house.

I have been involved in a lot of moves. On a scale from 1 (meaning nothing was packed and absolutely nothing was ready to go) to 10 (meaning everything was ready to go and the move went like a well oiled machine), I’d have to honestly give the move I participated in a 6.5.

Last year, I participated in moving each of my in-laws. Everybody was either buying a new house or buying their first house last year. About six month before that, we moved to a new house.

My wife had prepared our house for moving perfectly. She had most of our stuff packed up before we ever even started looking for a new house. We purchased the new house while still owning the old one (we didn’t want to put a house sale contingency, as we could afford - barely - two mortgages), so we had about a month or so where we lived in the one and were fixing up the other. During that time, most evenings I would drop off some boxes I had loaded up that morning. When actual moving day came, we just had a few boxes and the big furniture items. My own move, as organized by my wife, is the yardstick by which I measure all other moves. Was it a perfect 10? Probably not, but it was close. I’d give it a 9.5.

So, what are some of the hallmarks that I think make for a well done self move?

  1. Donuts before and Pizza after. Feed your crew. No, it doesn’t have to be donuts and pizza, but some sort of tasty treat to start out with, and end with a meal.
  2. Serve coffee, water, and soda.
  3. Do not serve the pizza until after the move is completed. IMPORTANT!
  4. Have your truck in front of your house before the people helping you move get there. Do not gather everyone together, then go get the truck.
  5. Have your boxes piled up in front of the door that is closest to where you will be loading onto the truck. This will allow for a chain of people to quickly load your boxes into the truck. You want to load the boxes first.
  6. Speaking of boxes… have everything that you possibly can boxed up before the people to move them arrive. You cannot possibly maintain a fully functioning household if you are going to move and expect the move to go smoothly.
  7. Reduce to a bare number of dishes, silverware, pots, pans, toiletries, towels, washcloths, blankets, pillows, and so on, and pack the rest up!
  8. Switch to paper or styrofoam plates, bowls, and cups and plastic flatware for the last week at the old place.
  9. Use old ratty towels and washcloths(that you are chucking anyway) in the shower for the last week, and throw them out on move day.
  10. You don’t need all of your clothes in your closet until moving day. Pick out a minimal set that you can deal with for a week or two, and pack the rest up.
  11. Moving is a perfect time for going through your junk drawer. Do not simply shovel all of the contents of the drawer into a box, then dump the box into a new drawer in the new place.
  12. PACK UP YOUR KID’S TOYS!
  13. Empty your dressers, armoires, and cabinets.
  14. Pack up game systems, dvd players, computers and associated wires before the move begins.
  15. Have the following tools handy: hammer, flathead screwdriver, phillips screwdriver, measuring tape, work gloves, hex wrench set, vice grips, straps/bungie cords/rope.twine, packing tape (preferably lots), duct tape is always useful..
  16. Most helpers will help with a single trip from the old place to the new place. People who will help for two trips are rare. People who will help for more than two trips are nearly unheard of. You will find out who your friends are when you move.
  17. In phase one, the primary goal is to get stuff from the old place into the truck. It does not have to be ideally placed perfectly in the truck. Nobody cares.
  18. In phase two, the primary goal is to get stuff from the truck into the new place. It is not to put everything where it goes.
  19. In the new place, there should be a place designated for a pile of boxes. It doesn’t matter that it says “kitchen” on the label. You can sort it all out later. Put it in a pile that is out of the way.
  20. For large heavy multiple lifter items, the best you should hope for is it getting into the room that it will be going, but not into the position and facing it will be in. You can fix that later, too.
  21. Paths into and out of the old and new place should be kept clear of debris, children, and pets.

That scratches the surface, anyway.

Chumby Yahoo! Widget

April 26, 2008 by playdeezgames

I’ve run into a few snags regarding my Chumby Yahoo! Widget.

I added preferences to it so that one could specify the UUID that specifies a virtual profile (thus allowing the user of the widget to view any virtual chumby).

I also felt it was a good idea to allow various sizes that matched those specifiable on the chumby site itself.

Apparently the flash object in the Yahoo! Widget Engine is a bit finicky. It throws exceptions periodically that I don’t have the ability to catch, which interferes with the smooth updating of my widget after the preferences are saved.

I also added a context menu item to refresh the widget just in case the preferences don’t work correctly, but this is rather hackish, and that means that, unless I find a way to modify the flash object without having exceptions thrown, I will not be submitting this widget to the YWE gallery, since it obviously isn’t ready for primetime.

Which is a shame, really.  It was almost a really cool widget.

I’ll try a few more things that I’ve thought of, and then I will post a message on the YWE forums (which is rather hit or miss regarding matters like these), but I’m not holding my breath.