Lost games: Ancient Mariner

Posted on November 15th, 2013 in games | No Comments »

The Ancient Mariner In September 1987 I bought my first copy of Computer and Video Games magazine. Alongside reviews of Road Runner and Solomon’s Key and a feature on the newly released Sega Master System, there were a few astonishing screenshots which awakened in me a new sense of what was possible in computer games.

These screenshots were from a game called Ancient Mariner.

Although I couldn’t have explained it at the time, they helped form the original vision that got me into game development in the first place; a vision that one day technology might allow us to externalise our imaginations and let us experience them with all the intensity of physical life.

Ancient Mariner - woman Ancient Mariner pirate

Described in one preview as “what could be the most grand and impressive game so far”, Systems Architects’ Ancient Mariner swashbuckled its way through the games press inspiring excitement and wonder before vanishing, unreleased and without explanation. One year later, in response to a reader’s inquiry, a Games Machine staffer wrote: “As for the legendary Ancient Mariner, we’ve heard nothing of it recently, seen nothing of it and can’t make contact with Systems Architects themselves.”

As anyone who follows the games industry will know, cancelled titles and vanishing companies are nothing out of the ordinary. But some unreleased games seem to stand out as talismans of creative potential, symbols of what gaming could become. These games often appear during the axial ages of the industry, when technological shifts raise up new continents of possibility, inspiring developers to embark on foolhardy voyages in search of distant visions.

Ancient Mariner appeared at the beginning of one such age, at the time when the Amiga and Atari ST really began to make their mark on game design. Up til then, many 16-bit games still bore the impressions of the 8-bit era; some were little more than C64 games with a few more colours. But from 87-89 developers began to get to grips with the new technology and started to design games which broke with the past.

ancientmariner5

The game was programmed by Manuel Caballero, who previously wrote Imhotep for 8-bit legends Ultimate: Play the Game. C&VG quotes him as saying that Ancient Mariner is probably the first Atari ST game written completely in assembly language.

The artwork was produced by Mike Jary and Emma Hughes. I suspect they had a background in traditional animation; the artwork has a confidence and expansiveness rarely seen in games of that time. The most impressive shots don’t seem to restrict their lines to the axes of movement like so much game art. This is partly what made these images so evocative. You can’t quite see what the game mechanics will be just by looking at them.

ancientmariner4

So what kind of game was Ancient Mariner? According to C&VG, it was meant to be a trilogy, with each part coming on three disks. The player takes the role of an “impoverished 16th century seadog whose lands have been lost through gambling and bad business deals. To regain his former status in life he must trade – both legally and illegally – all over the world”.

The game “will contain play that will appeal to the traditional adventure game player” as well as combining “fast arcade-action with icon-controlled elements”. The arcade sequences would have included “battles in the Spanish main, skirmishes against cannibals, raiding and boarding parties and hand to hand combat”.

ancientmariner7-smallancientmariner6-small

It seems to me that Ancient Mariner might have been something like a cross between Sid Meier’s Pirates and a Cinemaware game, perhaps with something of the eccentricity and high art of Captain Blood mixed in.

Sid Meier’s Pirates needs no introduction, It’s probably the best known and best loved pirating game there is. It was released in 1987, and reviewed two months after Ancient Mariner was previewed so I’m not sure how much of an influence it would have been. Pirate games were definitely in the air that year. The C&VG review of Sid Meier’s masterpiece compares it favourably to others available at that time, such as Cascade Software’s Pirates of the Barbary Coast.

Sid Meiers Pirates (1987)Pirates of the Barbary Coast (1986-87)
Left: Sid Meier’s Pirates. Right: Pirates of the Barbary Coast

Cinemaware however, might be less familiar to the gamers of today. Cinemaware were one of the outstanding developers of the early 16-bit period; their games had production values few others could match at that time and had a distinctly American “bigness” which still counted for something in my corner of eighties Britain.

Rocket Ranger - Amiga (1988)King of Chicago - Amiga (1987)
Cinemaware’s Rocket Ranger (1988) and King of Chicago (1987) 

Their games were early attempts at interactive movies, and usually featured arcade, puzzle and strategy sub-games within a well-animated linear narrative.

Ancient Mariner sounds very much as if it could have been a moodier Cinemaware game, taking its cues from European comics and animation rather than Hollywood.

And that is pretty much everything I have discovered about this mysterious game. If anyone knows more, or has even played Ancient Mariner, please let me know.

Submit to reddit

Making a heat map effect for Toxin

Posted on June 20th, 2013 in game development, iPhone, programming, Toxin | No Comments »

Toxin Heatmap

As you might already know my forthcoming iOS game, Toxin involves shooting rapidly dividing toxic cells which eventually fill the playfield or burst to spawn flying enemies.

Now, not long ago I read an article about generating heat maps to display web statistics, and I thought it would be cool to use this technique to colourise the ever changing clumps of cells in Toxin. After finding out how they work, I knocked up a prototype in Processing before adding the effect to the game.

Generating heatmaps is pretty simple. Take a 2d grid of values, perform a Gaussian blur on it, then use each resulting value as an index into a gradient of colours.

For Toxin, the first step was to create a simple array of numbers representing the current state of the cell grid. Toxin cells can be different sizes. To simplify things, I store each big cell as several small cells.

Each cell is given an initial value of 255. When we draw our cells, we use a range from black to white, where values of 0 are black, 255 is white and values in between are shades of gray.

heatmap-initial
The cells are represented as a grid of numbers. Each cell is given the initial value of 255

The next step is to apply a simple box blur to this grid of numbers. Normally heat maps use Gaussian blur, but since Toxin’s grid is such a low resolution we can get away with using a simpler algorithm which is much faster to calculate. To learn more about blurring techniques, I recommend Alex Evan’s article on Gamasutra.

Toxin heat map blur
The cell grid after being blurred. Notice how the values have changed

Now look what happens when we draw our original cell grid using the values from the blur operation. Cells in the middle of large clumps have higher values than solitary cells.

Toxin heat map grayscale
Drawing the original grid with the blurred values

The final step is to colourise these grayscale values so they look cool. We do this by mapping these values onto a gradient I made in Photoshop. Values of 0 map onto the left of this gradient, 255 to the right, and the others to the colours in between.

Toxin heat map gradient

When we draw the grid with the colours from the gradient we get our heatmap!

Toxin final heat map

Submit to reddit

Temporary hiatus

Posted on May 24th, 2013 in Uncategorized | No Comments »

Sorry I haven’t posted in a while, but I’ve taken a break to deal with a sad family situation. I will be back soon.

I want to get Toxin out the door as soon as possible, and get started on my next game, which has been brewing in my mind for over a year now. I also have a radical web development tool I’ve been working on as a side-project.

I’m also working on some more serious, philosophical articles on game design. I’m hoping to start a bit of a shit-storm with those to be honest!

Till the next post…

rjd

Submit to reddit

Using a 19 year old art program for IPhone development

Posted on April 14th, 2013 in game development, iPhone, photoshop, Toxin | No Comments »

I’ve been feeling rough this weekend so I decided to work on one of the easy jobs that I’ve been neglecting during Toxin’s development; finishing off the front end.

For some reason the front end design is something that I absolutely must get right before I can envision the whole game. At the start of a project, I will spend hours trying to make a title screen and find the right font. If I get that right, everything else will follow. The design elements that I choose for the title screen seem to become the foundation for the graphical style of the whole game.

Toxin title screen

Needless to say, Toxin’s title screen, like everything else in this supposedly simple abstract shooter was a struggle to get right. It was really just lucky experimentation that lead me to the nice animated effect I use for Toxin’s title screen. This effect warrants a detailed blog post of its own, and I’ll write one soon. Today I want to write about how I made the buttons for the main menu using a 19 year old graphics program.

Toxin menu screen
Toxin’s main menu. What you can’t see from this screenshot is how the glowing colours shift and change using multiple blended layers.

The icons on each button are simple pixel art images which were vectorised, loaded into 3D Studio Max, then extruded. My first icons were made by extruding text using the Topaz font, which was the default font on AmigaOS back in the day. I found it impossible to signify everything using text glyphs alone, so I decided to do some pixel art.

I found Photoshop too frustrating to use for pixel art. It’s just not geared for that kind of work. You can’t delete quickly, and when you’re zoomed in the cursor does not snap to the pixel grid. So I decided to go full oldskool – I started up my Amiga Emulator, WinUAE, and loaded Deluxe Paint 4.

In a couple of minutes I had knocked up some simple 16*16, 1 colour icons ready to be imported into 3DS Max.

dpaint-toxin-icons
DPaint 4 running on the WinUAE Amiga emulator. Drawing sprites inside a 16*16 checkerboard is an old technique from the Amiga days

For those who don’t know, Deluxe Paint (invariably referred to as DPaint) was the de-facto standard graphics program on the Amiga computer, just like Photoshop is for today’s machines. It was also the industry standard for video game art up until the start of the 3D era. (At least it was in the west. I have no idea what was used by the Japanese games industry to create such pixel art masterpieces as Seiken Denetsu III and Final Fantasy 6. If you know, send me a message).

It was developed by EA, believe it or not, back when they released interesting creative software like the Deluxe Music Construction Set, and published games like The Bards Tale. The first version was released in 1985, and was in development until 1994, which was probably the beginning of the end of the Amiga era.

I still have my copy of DPaint I. I bought it for £5 in 1991 when I was a poor schoolkid saving my dinner money to buy games. By that time it was already six years old and two versions behind, but I spent hours on it drawing cyberpunk cityscapes and trying to copy Street Fighter characters from magazines.

dpaint1

Submit to reddit

Toxin – Advanced Sprite Techniques

Posted on March 24th, 2013 in game development, photoshop, Toxin | No Comments »

toxin-sprites

Creating good looking graphics for an abstract game like Toxin is harder than it first appears. Not only are your images stripped bare of most signifying information, requiring a real eye for the principles of graphic design, but creating the artwork itself – giving each line the right balance of sharpness and glow, demands careful image processing and a great deal of experimentation.

When I started making Toxin, the graphics were a real struggle. It took me an enormous amount of work to develop the look of the game. To give you an idea, I have a folder on my laptop with all of Toxin’s artwork in, and it weighs in at 967meg! All for a little mobile game!

Eventually all my experimentation began to pay off, and I developed some powerful techniques for creating animated multicoloured abstract sprites. In this post I want to describe one of my favourite methods.

I start by creating our sprite out of spline shapes in 3D Studio Max. Unlike many 3D programs, Max can render splines at various thicknesses, animate them, and can even apply texture maps and materials to them.

I then use gradient maps to mask out areas of the shapes that I want to be different colours. These gradient maps are then animated, so the different coloured areas can actually move around the shape.

Then, I do two sets of renders. First I render the shape with the masks on, so there’ll be a hole wherever the coloured area will be. Then I do another render with the mask inverted, so that only the coloured area is visible.

make-a-spiker
This diagram shows each step in the creation of one frame of animation for a Toxin sprite. The total animation is 64 frames long. This intricate process is largely automated using Photoshop scripts

Then its time to start up Photoshop. After deciding what colours I am going to use, I run each set of sprites through a Photoshop script that colourises them and adds a glow. To create the glow, I duplicate the image into another layer, Gaussian blur it, then additive-blend it on top. Sometimes I use several glow layers with different Gaussian blur parameters. I also find that using image->adjustments->Hue/Saturation to colourise gives me the best results.

The final step is to compose the two sets of colourised renders into a single sprite. I do this with another Photoshop script. The end result is a lot more interesting than the basic Geometry Wars style sprites everyone else is using, I think.

Submit to reddit

The Next Photoshop

Posted on February 24th, 2013 in photoshop, programming | No Comments »

If you’ve read this blog for very long you’ll know that I am a big fan of Photoshop scripting and procedural graphics. Toxin, the iPhone game I’ve been working on, uses procedural art and animated image processing effects extensively. I don’t think the game would be possible without Photoshop scripting.

However, Photoshop’s scripting system is far from perfect. You cannot access pixel data from within scripts, nor can you draw lines or circles or anything like that. These limitations have become really frustrating to me.

For example, on the day I started work on Toxin, I needed to draw an ellipse with precise dimensions. The whole game takes place inside an ellipse, you see. I couldn’t do it in Photoshop by clicking and dragging, it was too inaccurate, so I wrote a C program using the Allegro game library to create the precise shapes I needed. These were then loaded into Photoshop and used as guides while I created the game artwork.

Later I discovered Processing, which is much quicker to develop in than C. I soon developed a workflow where I would go back and forth between Photoshop and Processing, generating procedural content then processing it or running it through scripts until I got the desired result.

Processing, however has some frustrating quirks of its own. As a simplified front end to Java, you often get Java errors that are incomprehensible without digging into the underlying platform. Also, it cannot effectively save semi-transparent PNGs which means that the anti-aliased sprites I was creating all had a solid background which had to be removed. I ended up redesigning my workflow and using the excellent Ghost and AntiGhost plugins from Flaming Pear to overcome these problems.

From graphics app to graphics platform

All these issues got me thinking about what I really want from a high end graphics program. What I want is something like a programmable, graphical Lisp Machine; a powerful graphics programming platform with the UI of an art application, not an art application with a bolted-on scripting system.

I want the ability to programmatically control every aspect of Photoshop from both external scripts and from a real-time REPL inside Photoshop that works like the command line used in some CAD programs.

I want to be able to type line(10,10,100,100) and have a line appear on my presently selected image. I want to be able to open the REPL and assign my current selection to a variable which I can later re-select with a simple command. I want to be able to access the pixel data in my images, and write my own filters in Javascript within the scripting system itself. I think anyone in high-end graphics or scientific imaging would love something like this.

A true graphics platform like I have described would likely have to be written from the ground up with programmability built in. Nevertheless I did spend some time finding out how far I could go with Photoshop’s native capabilities.

I had the idea of writing a Photoshop plugin that contained a number of drawing functions which could be called from scripts via a Javascript library that integrates with the Photoshop document model. So you could write PSDraw.line(10,10,100,100); in ExtendScript Toolkit, and my Javascript library would construct a call to the plugin which would draw the line.

Unfortunately, it’s not possible to get information from a plugin back to the Photoshop script thats running it, so it wouldn’t be possible to do a getPixel() or anything like that. At best, this plugin/script combo would give us a somewhat clunky way of drawing programmatically but little else that would justify the effort involved. (have you ever seen the Photoshop plugin API?)

As a secondary option I thought about actually embedding V8 inside a plugin which would contain an editor and debugger. Besides the ugliness of having 2 distinct Javascript engines running in the same app, the plugin architecture put paid to this idea. Photoshop plugins are one-shot operations. Load the plugin, set the parameters, perform the operation, then shutdown. My idea would only be effective if the plugin was a persistent part of the Photoshop environment.

So the only options then, would be for Adobe to integrate scripting more completely, or for someone else to start making what would be a true sucessor to Photoshop.

 

Submit to reddit

Game Design for Space Exploration

Posted on February 7th, 2013 in game design | No Comments »


The longing for the infinite must always be a longing
–Friedrich Shlegel

When the Kickstarter campaign for Elite: Dangerous was announced, it not only inspired me to write these recent posts on exploration in video games, it made me think back to the hours I spent playing its predecessor, Frontier: Elite II.

Frontier was a magnificent achievement. In 1993 there was no game that could offer similar scale or freeform gameplay. The elegant graphics were also something of an accomplishment since the Amiga and Atari ST were not natural 3d machines.

Despite this, I always felt that Frontier never capitalised on the exploration potential of its vast universe.

There was little incentive to leave the inhabited systems and head out into the unknown. You could mine planets, and extract hydrogen from gas giants to fuel your explorations, but these were difficult operations, restricting exploration to very experienced players.

In spite of the rumoured existence of an alien warship hidden in deep space, there simply wasn’t enough mystery out there to entice explorers. The procedural planetary systems of 1993 lacked detail and variety and you could see most of what the game had to offer without going very far at all. None of this really detracted from a game that offered so much, but those of us who longed for the unmarked places on the map were left nursing our imaginations.

So what kind of space exploration game could we make in 2013 with what we now know about procedural world generation? There hasn’t been much information yet on what the procedural worlds of Elite: Dangerous will be like, but we can get an idea of the contemporary state of the art by looking at Space Engine, a procedural universe simulation created by Vladimir Romanyuk.

Space Engine was originally inspired by Noctis, the cult freeform space exploration game that I wrote about in my previous post. At the moment it doesn’t really contain any gameplay besides the ability to move around and take screenshots of its graphically impressive universe, but there are plans to create a full game out of it, hopefully remaining faithful to Noctis’ vision of a “dreamable space simulator”.

As you can see from the Space Engine galleries, it is capable of generating varied and detailed landscapes, with plains, craters, mountains, lakes and oceans. Different atmospheric compositions alter the appearance of each alien world. The planetary orbits are physically realistic, and it appears likely that physics that effects the player such as gravity and atmospheric drag are in the pipeline.

All of this procedural detail combines to create a web of systems that can provide gameplay, if they can be given as being of concern for the player.

And because we don’t know exactly what the procedural generators will create, but we do know *what* they create we can set goals for exploration that provide meaningful feedback while remaining open ended.

We can challenge the player to find the tallest mountain, the deepest ocean, the richest ore field, the largest planet that is the closest to its sun. All these goals are specific enough to be put into achievement systems, and yet they remain open. A taller mountain may be discovered tomorrow. Achievements then become, literally, world records.


It’s gonna be a rough landing! A Space Engine landscape from the EDGE Review

The technical challenge in this is in creating tools that can scan and interpret the procedural world in order to recognise mountains, ore fields etc. This is the price you have to pay for meaningful feedback; the computer must be made to understand what you mean. The challenge for game designers is to make these knowledge extraction tools fun and interesting for the player to use.

If I were Vladimir Romanyuk, or I had access to his source repository, this is the game I would make with Space Engine.

Imagine an advanced race of spacefarers. War and material gain are irrelevant concepts for them, what they care about is knowledge. When they come of age they set out in lonely ships to traverse the universe. (If you wanted to give the game an end condition you could make it so they were allowed to return home once they had gained enough knowledge. [Perhaps you could even throw them Proteus style into the world with very little contextual knowledge, and make players figure that out by themselves?])

Their ships are equipped with different types of scanning equipment and the means to mine and extract chemicals from planets and asteroids etc. This equipment takes skill to use; for example scanning a mountain formation might involve landing probes in the area surrounding it, in a certain configuration.

The gravity of the planet, the atmospheric composition and the layout of the terrain all effect how easy this is to do. Some planets may be extremely difficult to scan or land on. All this creates gameplay and the potential for informal competition and legendry amongst players.

Perhaps the player flies a living ship, a bit like Moya from Farscape. This living ship grows and develops in response to the knowledge the player can attain from the universe. “knowledge” here is given a more mystical and active significance here than the ordinary intelligibility of human life.

The ship can develop its capabilities using material from the universe in conjunction with knowledge, enabling the player to travel further and do more things.

This creates an economy of progression without requiring any shops or civilisations (less work for the indie developer!) and is in keeping with the wholly alien atmosphere we are trying to evoke.

So there you have it. We’ve now created a basic outline of an exploration game with progression and well defined goals which remains open ended and mysterious. I’d really like to know what you think about these ideas and the thinking behind them. If I had a bit more time and money I’d take a shot at developing it. Maybe in the future.

Submit to reddit

The Gameplay of Exploration

Posted on January 25th, 2013 in game design | No Comments »

Palomar II (2002)

One of the things I love most about video games is their potential for exploration. Like immersion, exploration in games is as much about mood and feeling as it is about the logic of game mechanics. It imparts a watchful, meditative air, a constant openness to emerging possibility that serves as a nice contrast to the intensity and solidity of ordinary gameplay.

This kind of peaceful, yet fully engaged play is something I have always looked for, yet it seems to be a hard thing to find. Too often, explorativity (is that a word? It is now) is simply a side effect of a large game world; there is nothing in the game that acknowledges that exploration takes place. There’s no feedback for anything you do, besides your own satisfaction.

Of course, this lack of feedback may be the entire point. One of the greatest space exploration games, Noctis IV, developed by Alessandro Ghignola from 1996 to 2001, simply presents you with its grainy, expressionistic universe and invites you to explore.

Writing for The Escapist, Philip Scuderi describes Noctis as having an essential “air of tragedy” and loneliness, a sense that there are “no messages to receive or send; no voices to contrast with the endless vacuum.”

Like The Sentinel, that primordial deity of computer generated worlds, the procedural universe of Noctis presents a blank and pitiless face. Without the presence of meaning within the world, this universe reveals itself to the player as a kind of grand, inhuman unfolding of geometry; a “worldless” world, as Heidegger might say.

Many of the older open-world games like Mercenary, Hunter and Midwinter II have a similar quality of rigorous bleakness which overwhelms the entire game, almost in spite of the developer’s intentions. Hunter, for example is ostensibly a Schwarzenegger-style action adventure, going by the back story and box artwork, but all that is lost in the angular silence of its fractal world.

It is interesting to compare these games with Proteus, which as of this writing, is still in public beta. Like Noctis, Proteus simply places you inside a computer generated world, a beautifully stylised island in this case, and leaves you to explore. In fact Proteus gives you even less to go on than Noctis. There is no backstory, no explanation as to what you might be able to do. You begin the game knowing how to move and sit down, and nothing else.

As your eyes open upon the world you begin to scan the environment. Trees, birds, life, weather patterns weave unnamed and mysterious systems around you. “How do they work?”, “What is my place within them?”, “Who is here?”. Exploration begins.

Proteus avoids the bleakness of other exploration games by filling the world with sound and with significant systems. Everything hums and jangles as you explore; each tree, each type of terrain lends its song to your experience. Animals hop about the forests and react to your approach, the weather changes, seasons pass. Everything seems to effect everything else and you are right in the middle of it trying to figure it all out.

And it gives so little away that you always retain the possibility of being surprised, of something new appearing that casts the whole world in a different light. It takes me back to the days when my friends and I knew so little about games that the most implausible rumours grew up around them. I wouldn’t be surprised to find Sheng Long living in that lonely house on Proteus Island.

For some time now I’ve thought that the mystification of game mechanics, the introduction of other kinds of intelligibility to the hard-edged logics of ordinary games are essential steps in moving game design forward. Proteus is an important step in that direction.

Next time, I am going to write something about space exploration in generative universes, so stay tuned.

*The image at the top of this post is not Proteus! It’s the cover of Palomar II, the 2002 album from NY indie band Palomar. I just thought it evoked the qualities I’ve been talking about in this post. Oh, and I am desperate for a copy of Palomar’s impossible to find first album, so if you can help, please let me know.

Submit to reddit

AtlasMaker 0.7 – Make Texture Atlases in Photoshop

Posted on November 24th, 2012 in AtlasMaker, game development, photoshop | 42 Comments »

In game development it is common to have hundreds if not thousands of texture maps and animation frames in a single project. Keeping track of all these images is taxing for both the developer and the computer, so what we do is arrange the images into texture atlases.

A texture atlas is an image that contains many other images. Usually, all the animation frames for a single sprite, or all the textures for a single object are arranged into a single image. The game code then looks at a smaller portion of this image when it needs to draw a particular sprite or texture.

AtlasMaker is a Photoshop script that lets you create these atlases inside Photoshop. It takes a directory of individual textures and arranges them on a single image. It can be used both for atlases of different sized images, and for tile grids which are commonly used in 2d games. Earlier versions of this script were released in 2009. I know I promised an update long ago, but I have been working on my iPhone game, Toxin. I have been using this script throughout Toxin’s development, but never got round to tidying it up for public release.


AtlasMaker main window. A tile grid for a 2d game is being created

Features

  • Cross platform – tested in Photoshop CS3,CS4,CS5 on Windows and Mac OSX.
  • Open Source
  • Create texture atlases or tile grids for 2d games.
  • Several image sorting algorithms. Find the most efficient one for your textures.
  • Add a margin to each image.
  • Custom data file export.
  • Extendable – It’s easy to add your own rectangle packing algorithms and sorting methods.


Generated with AtlasMaker: Left, a texture atlas with variable sized images. Right, a tile grid. Images used are randomly generated test textures.

Installing AtlasMaker

There are two ways to running AtlasMaker in Photoshop.
Unzip atlasmaker-v0.7.zip to your photoshop scripts folder. On windows this is usually: C:\Program Files\Adobe\yourphotoshopversion \Presets\Scripts
On a Mac this folder is at: Applications/yourphotoshopversion/Presets/Scripts

When you next start Photoshop, AtlasMaker should appear in the File->Scripts menu.

Alternatively, you can run the script without installing by unzipping the atlasmaker folder somewhere, then selecting Scripts->Browse from the file menu and then selecting AtlasMaker.jsx.

Quickstart guide

The first thing to do is select a directory of images by clicking “browse” at the top of the window. Once you have done this, AtlasMaker will scan through the images and collect size information about them.

Next, you want to select your packing method. If your images are texture maps of different sizes then you want to select the “Atlas Maker”. If you are making a traditional 2d game where the sprites are all the same size, then you want to select the “Tile Grid”

You’ll notice that some text will appear underneath “Number of Files”. This is a notification from the Tile Grid Packer telling you how many rows and columns your images will take up given the default document size. Different packing methods provide different notification messages according to their nature.

Then you can optionally select a sorting method. Sorting the images in different ways can improve the efficiency of the texture atlas. Some packing methods do not allow sorting, and will disable this option if they are selected.

You can also add a margin here if you want a gap between your textures. Margins are added on to the width and height of each image just like CSS margins.
Next, click “Document Settings” and you will be able to set the size of the texture atlas you are going to create. You can also set the document name here, and choose if you want to flatten all the layers into one, once the atlas is complete.

Now click “Create Atlas” and you’re done.

Custom data file export

One of AtlasMaker’s most powerful features is the custom data file export. You can export a text file for each texture atlas containing information about each image on the atlas. This might be XML or JSON to be loaded by a game engine, or you could use it to directly generate source code to be pasted into your application.


AtlasMaker custom data file panel. Here an XML fragment will be generated for each texture in the atlas. filenames and texture positions are substituted into the text using tags

Tags are used to substitute information about each image into the text:

  • #i – Image index (0.. number of images in directory)
  • #filename – Filename of source image
  • #width – image width
  • #height – image height
  • #x – X position of top left corner on atlas
  • #y – Y position of top left corner on atlas
  • #p – page number

If you click the “Reorder export file” button, you can rearrange the order in which textures are listed in the export file. Just select filenames from the list and click “up” or “down” to reorder them. You can select multiple filenames by shift-clicking.

The zip file contains a readme.txt which describes every option in detail.

AtlasMaker is designed to be extensible. It is easy to add new packing methods and sorting algorithms. I have written the code to be more or less self explanatory in this regard, but if you want me to write something about it, please let me know.  And let me know if you find any bugs!

Download AtlasMaker version 0.7.3 (Last update 8th Feb 2014)

Submit to reddit

Toxin – Creating sprites in Processing

Posted on November 18th, 2012 in game development, Toxin | No Comments »

One of the most powerful graphical tools I am using to make Toxin is Processing, a Java based platform used to create generative art. Processing provides you with a basic IDE, a graphics API and a simplified front end to Java that lets you get things up and running with a minimal amount of work. It’s great for doing experiments or when you need to create art programmatically rather than with a graphics program.


Processing provides a simplified front end to Java, ideal for quick experiments

The green cells in Toxin were all generated using a Processing program. Each cell is a circle made up of a number of connected spline segments. I animate the cell by displacing the spline control points using Perlin noise. The cells are then resized and colourized in Photoshop.


Left, a cell being rendered in Processing. Right, the finished result

As you can see, the finished product does not look exactly like the original Processing output. I had to do a lot of tweaking, re-rendering and reprocessing until I got them looking right. It was very time consuming. There were many moments where I wondered if I was going to get useable results at all.

Many of Toxin’s graphical effects have their origins in experiments I did with Photoshop blend modes. I discovered that certain combinations of layers and modes resulted in nice abstract animations when the layers were dragged around. I wrote photoshop scripts to perform these movements and spit out animation frames. Unfortunately these scripts revealed many bugs and inaccuracies in Photoshop and its scripting system. You only have to look through the source of my AtlasMaker Photoshop script to see how many strange workarounds are required to accomplish straightforward tasks.

To solve these problems I implemented Photoshop’s blending modes in Processing, and use this to create my animations. Below are a few frames from Toxin’s shot animation that demonstrate the technique. The way the colours shift throughout the animation is down to the movement of multiple layers blended into a simple white shot sprite. You can get a better idea of how this looks in the game by looking at the screenshots I posted a couple of weeks ago.


Many of Toxin’s sprites use animated image processing effects


I also used Processing as a test bed to work out algorithms before implementing them in the game. For example, Toxin has a weapon which freezes the edges of groups of cells. It didn’t take long to prototype this in Processing.


Testing a powerup that uses a flood fill algorithm to find edge cells

Stay tuned for more posts on Toxin, and a new version of my texture atlas Photoshop script which is in final testing…

Submit to reddit