This is the mail archive of the xconq7@sources.redhat.com mailing list for the Xconq project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Big unit images


>I notice that stacks of units are still drawn by subdivision.
>It would be worthwhile to make both of these into user preferences,
>since they're really choices about how one wants to play, and not
>an intrinsic property of a game, similar to drawing solid-color vs
>images for terrain.  These also interact with isometric drawing,
>where subdivision doesn't work very well in any case.

True. I've been thinking about doing this and then having something like
the small Civ2 activate unit popup, which handles both stacked units and
occupants. I didn't go for it on the Mac since we already had the closeups,
which are unit-based and not cell-based. What I did, though, was to tighten
up units that are drawn in the same cell (see hack in xform_unit) so that
they would not protrude outside the cell. Things didn't look too bad after
that. One advantage of drawing stacked units by subdivision is that it is
easier to see who is an occupant of what (a problem in Civ2). Consider
units that are stacked with a transport/city but still outside it. Without
subdivision drawing, it looks like they are all inside the city.

>> Since the tcltk version does not have closeups yet, things work as
>> previously over there, i.e. occupants are drawn within grouping boxes, and
>> you can access them directly by selecting them on the map. Things get a
>> little crowded with the big icons, but you can still play the game.
>
>I'm looking at the code right now, and from what I can tell, "big icons"
>just means images that are larger than the standard unit image (32x32, etc)
>but still smaller than a cell (44x48, etc), right?  So everything that
>uses uw and uh parameters needs to be tweaked.

Actually, the necessary tweaking has already been done in the kernel
(xform_unit, xform_unit_view) and is enabled also for the tcltk version
when g_bigicons is set. I made only four minor hacks in the Mac interface
(look for g_bigicons). They were all concerned with eliminating the drawing
of grouping boxes and occupants. Basically, they ensure that drawing at
larger mags is done the same way as at 16x16 or lower. The hacks that
prevent scaling and positioning of occupants (and their clickable areas)
within the box are also in the kernel (xform_occupant, find_unit_or_occ,
find_unit_or_occ_view). However, they are only enabled on the Mac right now
in order to keep the tcltk version playable.

There is one thing that has to be tweaked in the tcltk interface, though.
At 16x16 the big icons are drawn at quarter size rather than half size.
There must be some kind of test against uw or uh that causes this. I think
this problem appeared only after the isometric stuff was added, but I'm not
100% sure. Then there is some cosmetic stuff, such as ensuring that big
unit images in the help window and the unit list are drawn full-sized. I
just increased the sizes of the target rects for CopyBits in the relevant
Mac code. Works fine both with the old and the new images.

The main reason why I wanted to get rid of both selection boxes and
grouping boxes is that the big icons fill up the whole cell. This means
that if you draw an enclosing box its corners will protrude outside the
cell. This in turn causes problems since adjacent cells are not redrawn,
thus leaving the box corners after the unit moved or got deselected. It is
possible to fix this by shrinking the boxes so that they are smaller than
the units they are supposed to enclose, but this looked rather ugly. In
fact, the boxes as such look somewhat out of place with the new unit
images. This was another reason why I started to experiment with blinking
current units and selection masks instead.

As I see it, three things needs to be done in the tcltk code in order to
adapt it for the use of big icons. First, the minor tweaks discussed above.
Second, it would be good to have selection masks and blinking current units
(or some other alternative that doesn't use boxes). Third, closeups would
make it possible to dispose of the grouping boxes. However, since this
would involve a lot of work, perhaps one should go for the Civ2-type
activation popups as at least a temporary solution? They should be easier
to code than closeups. The important things is that there is a way to
select a unit that is not drawn on the map. The remaining kernel hacks
cannot be enabled for the tcltk version until that problem has been solved.

Hans

P.S. The See-All option works fine now! I have a feeling that there has
been a recent slowdown in the tcltk interface, though. However, the Mac
interface seems just as fast as before.















Hans Ronne

hronne@pp.sbbs.se



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]