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]
Other format: [Raw text]

Major change to the unit view code


I have checked in a major change to how the unit view code works in see-all
games. Previously, a simplified code was used in such games. A major
problem with this was that the simplified code was unable to handle views
of occupants or several units in one cell (stacked units). This would not
be obvious to the player, since the interface code cheats and draws real
units instead of unit views in see-all games. However, unit views are used
also by the kernel and ai. The inability to view occupants and stacked
units in see-all games therefore caused a large number of bugs affecting
building, combat etc. Several of these bugs surfaced in the last few weeks,
which prompted this fix.

The new code handles unit views in the same way, whether or not see-all is
true. This means that occupant views and stacked unit views are now always
represented correctly in the kernel, and it is therefore safe to use unit
views instead of real units everywhere.

To see the difference, you can force the interface to always draw unit
views (even in see-all games) by hacking the first line in draw_units
(tkmap.c):

Just change:

    if (vp->show_all) {

to:

    if (0 /*vp->show_all*/) {

and then start a see-all game. With the old code, you will see that no
occupants or stacked units are ever drawn (though a unit is still drawn at
half size if there are other units in the same cell). With the new code,
occupants and stacked unit views are drawn correctly in see-all games.

Since this is a major change to how the kernel works, there may be bugs,
and bug reports are welcome. Some changes in game behaviour may also follow
from the fact that previously broken kernel code that used unit views now
works again.

Hans



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