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]

Removal of cell terrain (never a good idea!)


This may be a mistake in my GDL rather than a bug, but if I set up
"terrain-damaged-type" with the obvious (t* t* 1) to give equal
probability to all possibilities, the result is that it will sometimes
choose an auxilliary terrain type to replace a cell terrain type, and then
die with the fatal error "bad damaged type?".  That doesn't seem like the
most useful behaviour.  Unfortunately, the most obvious code solution
(just ignore it if the designer specifies that possibility, by doing
xrandom(tot) on line 2460 of combat.c) won't do, because then there won't
be a way to specify "remove entirely" as a possible outcome for damage of
border terrain.  Attached is a patch that has the effect of forcing the
table entries to 0 for cell-to-anything-else transformations; there
doesn't seem to be any case where you'd want to be able to specify a
nonzero value for "probability to kill the game with a fatal error", so it
should be safe to treat those entries as zero.  One advantage to doing it
this way instead of requiring that the entries really be zero is that then
the table can be kept simpler.  But maybe a better solution would be to
consider nonzero cell-to-other entries to be an error in the GDL, detect
them, and either abort or warn during loading - forcing the designer to
deal with it by defining nonzero probabilities only for legal
transformations.

There are other inelegancies in the design because the table is being
overloaded to specify the probabilities for both "remove the terrain"
(which only works for borders and connections) and "transform the terrain"
(which only works between two terrain types that are the same subtype).  
As a result I'm able to specify "remove cell terrain" (which is always
illegal), and in order to specify "remove aux terrain" I have to fake it
by specifying a bogus transformation to an illegal subtype.  And, by the
way, why can't I transform a border to a connection?  It seems like we
know what that would mean, and it shouldn't be difficult to implement, but
the existing code doesn't allow it.
-- 
Matthew Skala
mskala@ansuz.sooke.bc.ca                    Embrace and defend.
http://ansuz.sooke.bc.ca/

Attachment: damage.patch
Description: Text document


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