From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14000 invoked by alias); 22 Aug 2004 01:47:39 -0000 Mailing-List: contact xconq7-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: xconq7-owner@sources.redhat.com Received: (qmail 13991 invoked from network); 22 Aug 2004 01:47:37 -0000 Received: from unknown (HELO av7-2-sn2.hy.skanova.net) (81.228.8.109) by sourceware.org with SMTP; 22 Aug 2004 01:47:37 -0000 Received: by av7-2-sn2.hy.skanova.net (Postfix, from userid 502) id E4C6C37E43; Sun, 22 Aug 2004 03:47:36 +0200 (CEST) Received: from smtp2-1-sn2.hy.skanova.net (smtp2-1-sn2.hy.skanova.net [81.228.8.177]) by av7-2-sn2.hy.skanova.net (Postfix) with ESMTP id D317437E42 for ; Sun, 22 Aug 2004 03:47:36 +0200 (CEST) Received: from [212.181.162.155] (h155n1fls24o1048.bredband.comhem.se [212.181.162.155]) by smtp2-1-sn2.hy.skanova.net (Postfix) with ESMTP id 9FE9F37E43 for ; Sun, 22 Aug 2004 03:47:36 +0200 (CEST) X-Sender: u22611592@m1.226.comhem.se Message-Id: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Sun, 22 Aug 2004 02:46:00 -0000 To: xconq7@sources.redhat.com From: Hans Ronne Subject: Improved combat code X-SW-Source: 2004/txt/msg00984.txt.bz2 Steps 1 and 2 on my revised agenda for an improved combat code have been completed. There are now two new tasks, TASK_ATTACK and TASK_FIRE, which act as subtasks to TASK_HIT_UNIT. If the view of a targeted unit is bad, these tasks will still schedule an attack or fire into the empty cell (which the side should do, since it wrongly thinks that something is sitting there). The attack against the empty cell is mediated by a new action, ACTION_ATTACK_CELL, which works like ACTION_OVERRUN but without moving into the cell. For firing into the empty cell, ACTION_FIRE_INTO is used. Importantly, the new tasks will clear the bogus view at a rate that can be set by clear-unit-view-rate. This rate is 50% by default, so each shot at a bogus view has a 50% chance of clearing it. This fixes the bug that would cause the AI to cycle indefinitely under certain conditions, and which prompted this entire overhaul of the combat code. It should be noted that the AI code deals with attack and fire, but then sets a hit-unit task at the end, without specifying how to hit. So the task execution code has to partly redo the job, and figure out what the AI wanted it to do. It is my intention to eventually get rid of this duplication, and have the AI set TASK_ATTACK or TASK_FIRE directly. Other changes and fixes: 1. Several other bugs that would cause buzzing in the AI code have been fixed. See the ChangeLog for details. 2. The end-of-turn process has been speeded up significantly by reducing pointless plan executions for units that cannot do anything. 3. Unit images are now updated correctly when a unit is wrecked or changes type. 4. I have long been frustrated by the stupid behaviour of units within transports, which act as sitting ducks in the presence of an enemy. I have therefore added code that makes a unit disembark before a fight if its fighting ability is significantly reduced as an occupant. 5. Finally, I have added a new table, hp-on-creation, which makes it possible for a unit to get more than 1 hp on creation. This is useful in games where units are created outside the creator, and therefore more vulnerable to attack before they have been completed. Hans