Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 74fbd0eb33bb08f719b79951bc4e329e > files > 69

xconq-7.5.0-1.20050612.5mdv2009.1.i586.rpm

<HTML>
<HEAD>
<!-- This HTML file has been created by texi2html 1.39
     from ./xcdesign.texi on 12 June 2005 -->

<TITLE>Designing Games with Xconq - Designing the Graphics</TITLE>
</HEAD>
<BODY>
Go to the <A HREF="xcdesign_1.html">first</A>, <A HREF="xcdesign_22.html">previous</A>, <A HREF="xcdesign_24.html">next</A>, <A HREF="xcdesign_61.html">last</A> section, <A HREF="xcdesign_toc.html">table of contents</A>.
<HR>


<H2><A NAME="SEC85" HREF="xcdesign_toc.html#SEC85">Designing the Graphics</A></H2>

<P>
<I>Xconq</I> is fundamentally a graphical game; but fortunately, you don't
have to do gnarly graphics hacking to get the pretty pictures!  The
basic graphics handling is built into the interface subroutines of
<I>Xconq</I>.  What you <I>do</I> have to do is to choose or design the basic
images.

</P>
<P>
<I>Xconq</I> will always attempt to generate some sort of default display
for your new game design, but it's likely to be pretty ugly.  So your
goal here is just to make the display look good.  First off you should
decide about the overall appearance.  Do you want things to be generally
light or dark?  Garish or subtle?  Conventional or exotic?  This is a
good time to cruise the image libraries and to look at the graphics of
other games.  Sometimes the theme decides a lot for you - how could you
display anything other than a red star on a Soviet tank?  You also need
to think about whether you want to concentrate on b/w or color displays,
although again <I>Xconq</I> will try to do something reasonable for both.

</P>
<P>
You have to choose three sets of images: terrain patterns or images,
unit icons, and side emblems.  The terrain patterns have to tile
properly, since they may be used to fill in large areas, while both unit
icons and side emblems are single icons.  You can optionally choose
solid colors for terrain, and to "colorize" unit icons and side
emblems.

</P>
<P>
Once you have chosen and specified a set of images, you have to try them
out in various combinations in real games.  What you'll most likely
discover is that they don't always mix like you imagined.  That
cool-looking emblem for a side disappears against the background of
space, or two unit icons are nearly indistinguishable on the map.  At
this point, you have to start making some choices.  Either substitute
some different images, or design new ones of your own.

</P>
<P>
Color choices are tricky.  Again, the total effect can be quite
different from what you imagined, plus you should be careful about the
variety of displays that your game runs on, or you may be getting
complaints about how your "olive" more closely resembles "puke
gray"!

</P>
<P>
Here is an example of unit icons:

<PRE>
(add (infantry town city) image-name ("soldiers" "town20" "city20"))
</PRE>

<P>
In general, an icon name should describe the literal appearance of the
image, instead of the type that you want it to represent.  The
<CODE>"soldiers"</CODE> icon, for instance, just shows a row of soldiers; in
one game the icon can be used to represent infantry, in another, armies
in general, and in another, the national guard.  There is an
<CODE>"infantry"</CODE> image also, but it is the standard "crossed
bandoliers" symbol, and is really only sensible for specialized
military games.

</P>
<P>
Here is an example of a terrain pattern:

<PRE>
(terrain-type plains
  (color "green") (image-name "plains") (char "+")
  )
</PRE>

<P>
The <CODE>"plains"</CODE> is defined in <CODE>terrain.imf</CODE>, as basically
a blank 8x8 tile with two pixels turned on, which textures things
somewhat:

<PRE>
(imf "plains" ((8 8 tile)
  (color (pixel-size 1) (row-bytes 1)
   (palette (0 7969 46995 5169) (1 0 25775 4528))
   "00/40/00/00/00/04/00/00")
  (mono "00/40/00/00/00/04/00/00")))
</PRE>

<P>
For extra fine control on color displays,
you can also set the colors of unseen terrain
and the grid separating cells, via the globals <CODE>grid-color</CODE>
and <CODE>unseen-color</CODE>.

</P>
<P>
Note that some display systems (such as the X Window System)
allow users to customize
most or all of their colors, so individuals may override your choices.
Not much you can do about that though!

</P>

<UL>
<LI><A HREF="xcdesign_23.html#SEC86">Image Format</A>
<LI><A HREF="xcdesign_23.html#SEC87">Image Design Tools</A>
<LI><A HREF="xcdesign_23.html#SEC88">Image Design Hints</A>
</UL>



<H3><A NAME="SEC86" HREF="xcdesign_toc.html#SEC86">Image Format</A></H3>


<PRE>
(imf "example" ((8 8) (mono "0011223344556677")))
</PRE>

<P>
[describe when fleshed out]

</P>
<P>
It may happen that you will want to add an image that is similar to an
existing image.  While you can replace the existing image, you may alter
the appearance of some other game for the worse (perhaps its image
colors have been designed to work together).

</P>
<P>
The first rule of image naming is to choose the name to describe the
image literally.  For instance, you may have designed an anchor image
that is to represent a port.  However, you should name the image
"anchor" and not "port", so that it may be used in other games.  Second,
if the image should have a difference appearance in different eras or
contexts, you should append that as a qualifier to the basic image name;
so a soldier image from the American Civil War era (1861-1865) would be
"soldier-acw".

</P>
<P>
Some images are more symbolic than pictorial, such as standard military
symbology.  In those cases the order should be function-size-individual,
so as to get images with names like <CODE>inf-bn</CODE> for an infantry
battalion or <CODE>armor-div-7th</CODE> for an image representing the 7th
Armored Division specifically.

</P>
<P>
If you want your image to be specific to a particular game, and not
to share with any other games (or be affected by image changes to
accommodate them), prefix your image with the name or abbreviation
for the game.

</P>
<P>
To summarize, here are the recommended name formats:

<PRE>
[&#60;game&#62;-]&#60;picture&#62;[-&#60;era&#62;]
[&#60;game&#62;-]&#60;function&#62;[-&#60;size&#62;][-&#60;era&#62;][-&#60;side/individual&#62;]
</PRE>

<P>
Finally, if your image has no obvious way to distinguish it, then you
must append a distinguishing number.  So multiple generic dragon images
are "dragon", "dragon-2", "dragon-3", and so forth.

</P>
<P>
None of these naming rules are enforced by the software; they exist to
bring some semblance of order to a large and complicated image library.

</P>


<H3><A NAME="SEC87" HREF="xcdesign_toc.html#SEC87">Image Design Tools</A></H3>

<P>
Whether you use platform-specific paint/draw programs, or
you collect images in other formats, you will need to translate these
into imf format, and then integrate into the existing library.
Typically, each platform includes a tools to help with this;
for instance, the Unix program <CODE>x2imf</CODE> reads X11 bitmap files and
produces imf files, while the Mac program <CODE>IMFApp</CODE> allows both
previewing of images and translation between imf files and Mac resources.

</P>
<P>
As an additional aid, the program <CODE>imf2imf</CODE> is a Unix program that
transforms a single imf file with many images into a set of files each
with one image, and vice versa.  This is useful when merging sets of images
together:

</P>

<PRE>
imf2imf foo.imf --explode -o tmp

&#60;copy other files into tmp dir&#62;

imf2imf tmp/*.imf &#62;newfoo.imf
</PRE>



<H3><A NAME="SEC88" HREF="xcdesign_toc.html#SEC88">Image Design Hints</A></H3>

<P>
The design of each graphical image can and should be somewhat
independent of the basic game design; this allows for reuse of pictures.

</P>
<P>
The first thing you should do is to check the image library on your
machine.  The image you're looking for may already be there, but perhaps
under a different name.  Even if you don't find it, you may notice an
image that is close enough to be a good starting point.  The <I>Xconq</I>
image library presently includes hundreds of images, so the chances are
pretty good that you'll find something useful.

</P>
<P>
The second thing to do is to look around for images in some other
format, and to massage them into a usable form. 

</P>
<P>
Designing images from scratch should be your last resort.
Designing good images and patterns is a specialized and demanding
category of artwork that I'm not going to go into here.  My best advice
is to learn from the pros, and don't be afraid to experiment.

</P>
<HR>
Go to the <A HREF="xcdesign_1.html">first</A>, <A HREF="xcdesign_22.html">previous</A>, <A HREF="xcdesign_24.html">next</A>, <A HREF="xcdesign_61.html">last</A> section, <A HREF="xcdesign_toc.html">table of contents</A>.
</BODY>
</HTML>