Sunday, April 24, 2011

Tile Graphics....

ok, so what is this “Tile Graphics” deal?  I know, I know… Tile graphics were used in the ultima games to allow a player to travel throughout the land of Brittania. 
Well, here is the funny thing… NO ONE KNOWS WHAT TILE GRAPHICS REALLY ARE!
I search throughout the web googling tile graphics, Ultima tiles, Ultima graphics and nothing out there really explains what tile graphics are and how you get them to work!  Ok, so I did some research on my own and found this little blurb in “The Official Book of Ultima” by Shay Addams.  Oh, and by the way this book is freakin expensive on eBay! I’m so glad I had my original copy from long ago.  Actually, everything concerning Ultima is expensive on eBay!  But I digress…
In Shay’s book on page 13 under the paragraph titled “The First Tile Graphics”!
Richard talks about creating the shapes, not tiles, in the game.
   “Tile graphics, so called because they’re square and placed on the surface of the game world one by one like pieces of tile, are essentially little pictures of everything that appears in the game.  Several tiles that look like grass-covered land, for example, would be placed side by side to fabricate a meadow, while a string of other tiles would form a mountain range.”
   “We had to actually enter all the shapes in HEX”
   “First he and Ken Arnold would draw them out on graph paper, then convert the graphs into binary, which in turn had to be reversed because the pixels appeared on the screen backwards.  After converting it into HEX, they entered the tile as data, stored in on the disk, and then ran it to see if it looked right on the screen.”
See, so they didn’t create tile graphics per say, they created Shapes!  On the Apple IIe you can create shapes and shape tables to make images almost similar to icons.  These shapes could be from 7x8 pixels to multiple scales of this size.  The process is archaic at best!  Here is a little example of what you have to do to create a simple shape of a box that is 5x5!
First, you draw out the box on a piece of graph paper.  The box is 5 pixels wide by 5 pixels high.  Then you start in the middle of the box and write numbers and arrow starting with 1 to describe the path of the points that will be plotted for the shape of the box.  To create the box you have to tell the computer how you are plotting the points by moving in vectors. 
You have create draw vectors and move vectors.
Draw vectors           100     up
                             101     right
                             110     down
                             111     left
Move vectors           000     up
                             001     right
                             010     down
                             011     left

The numbers are the binary code for the direction.  These codes must be entered into a byte of 8-bit word.  So back to the example, you start from the middle of the box and plot each draw and move vector.

1              move down/no plot        010
2              move down/no plot        010
3              move right/plot             101
4              move right/plot             101
5              move up/plot                100
6              move up/plot                100
7              move up/plot                100
8              move up/plot                100
9              move left/plot               111
etc…

You do this until you have the entire box plotted.  Once you have all the binary codes for the box you have to place them in the 8-bit word.

          00010010
          00101101
          00100100
          00100100
          00111111
          00111111
          00110110
          00110110
          00101101
00000000= 0

Now, you have to convert this information into HEX!  So the byte information in HEX is as follows:

          0001 0010     = 12
          0010 1101     = 2D
          0010 0100     = 24
          0010 0100     = 24
          0011 1111     = 3F
          0011 1111     = 3F
          0011 0110     = 36
          0011 0110     = 36
          0010 1101     = 2D
          0000 0000     = 00

This information is the definition of the box shape which needs to be saved on disk and entered into memory.  This shape can be retrieved from memory and a DRAW function can place in on the screen!

Wow!  Was that one big pain in the A$$!  All that work for just a simple 5x5 box!  Now image having to create 16x16 size shapes like the trees, mountains, water, dungeon entrances, player characters, monsters and so on…

Richard must have been incredibly patient because just imagine how much work went into creating all those shapes!  Just off the top of my head I can picture over 40 shapes.
Well this is exactly what I have to do!  I have to recreate all the shapes used in Ultima 1!  I must first plot them out on graph paper one at a time and then figure out the draw and move vector pattern, then create the binary draw and move numbers, convert these numbers to HEX and then save these shapes to disk!  Whew, what a mouthful!

So as you can see this is going to take quite a while and the one good piece of news is at least I won’t have to do it all by hand.  I have a program called “Shapes in Color” for the Apple IIe.  This little baby is going to make my life much easier.  This program is used to not only create shapes but is places them all in a shape table for you and saves them onto disk!  I still need to create the initial plots on graph paper so I can see what they look like but after that it’s Shapes in Color time!
So I’m off to start recreating all the shapes, excuse me, Tiles for my Ultima 1 program!  I will update you all when I have the shapes created and saved in a shape table.  After this I need to figure out how he got them to move so smooth across the screen but we will work on that later.

Well there you have it, Tile Graphics is really just Shapes created and organized in a massize grid! Go figure.
For now its shape time!

No comments:

Post a Comment