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]

Re: CRT Combat Model


>I'm very impressed with what xconq offers, but this is one obstacle to
>wargame development that's difficult to work around.  I would also like to
>see relative attacker/defender strength based on hit-points worked in, but
>that looks even tougher to work out.

Not at all - what you are asking for is already there. There are in fact
two completely different combat models coded into the xconq kernel. Combat
model 0 is the old-style xconq code used in the "standard" game where the
outcome is determined by the hit-chance and damage tables (see the Xconq
manual for more details).

However, there is also combat model 1 which is closely modeled on the
Civilization games. In this case, the outcome is determinde by the relative
attacker/defender strengths (each unit has both an attack and a defense
value). For an example on a game that uses combat model 1, see civ2.g and
also 3rd-age.g, the base module for the "Lord of the Rings" game. I find
combat model 1, where each unit has absolute attack and defense values,
much easier to use in game development, particularly when you want to add
new units to an existing game.

Moroever, the other stuff you asked for, terrain effects, effects of
adjacent units etc. is also supported in combat model 1, but not in combat
model 0. I added the necessary code for this to the kernel already two
years ago. These are the relevant GDL tables (from table.def):

------------------------------------------------------------------

DEF_UU_TABLE("occupant-affects-attack", uu_occ_affects_attack,
	"effect that occupant has on the attack value of the transport",
	uuoccaffectsattack, constuuoccaffectsattack, 0, 100, TABHI, TABINT)

DEF_UU_TABLE("occupant-affects-defense", uu_occ_affects_defense,
	"effect that occupant has on the defense value of the transport",
	uuoccaffectsdefense, constuuoccaffectsdefense, 0, 100, TABHI, TABINT)

DEF_UU_TABLE("transport-affects-attack", uu_transport_affects_attack,
	"effect that transport has on the attack value of the occupant",
	uutransportaffectsattack, constuutransportaffectsattack, 0, 100,
TABHI, TABINT)

DEF_UU_TABLE("transport-affects-defense", uu_transport_affects_defense,
	"effect that transport has on the defense value of the occupant",
	uutransportaffectsdefense, constuutransportaffectsdefense, 0, 100,
TABHI, TABINT)

DEF_UT_TABLE("terrain-affects-attack", ut_terrain_affects_attack,
	"effect that terrain has on the attack value of the attacker",
	utterrainaffectsattack, constutterrainaffectsattack, 0, 100, TABHI,
TABINT)

DEF_UT_TABLE("terrain-affects-defense", ut_terrain_affects_defense,
	"effect that terrain has on the defense value of the defender",
	utterrainaffectsdefense, constutterrainaffectsdefense, 0, 100,
TABHI, TABINT)

DEF_UU_TABLE("neighbour-affects-attack", uu_neighbour_affects_attack,
	"effect that a friendly unit in the same cell has on the attack
value of the attacker",
	uuneighbouraffectsattack, constuuneighbouraffectsattack, 0, 100,
TABHI, TABINT)

DEF_UU_TABLE("neighbour-affects-defense", uu_neighbour_affects_defense,
	"effect that a friendly unit in the same cell has on the defense
value of the defender",
	uuneighbouraffectsdefense, constuuneighbouraffectsdefense, 0, 100,
TABHI, TABINT)

-------------------------------------------------------------------

So how do you tell your game to use combat model 1? Simple. Just add the
following line:

(set combat-model 1)

If you dont, combat model 0 is used by default.

Hans







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]