public inbox for xconq7@sourceware.org
 help / color / mirror / Atom feed
From: Hans Ronne <hronne@comhem.se>
To: Lincoln Peters <sampln@sbcglobal.net>
Cc: <xconq7@sources.redhat.com>
Subject: Re: Bug in acp-independent action code
Date: Tue, 15 Jun 2004 07:18:00 -0000	[thread overview]
Message-ID: <l03130303bcf44fc1b439@[212.181.162.155]> (raw)
In-Reply-To: <1087275319.18372.3130.camel@odysseus>

>I remember the discussion.  However, the last time I checked, I still
>needed to set material-to-build (and other material-to-... tables)
>because otherwise a unit could continue doing whatever it was doing,
>even if it ran out of the required material(s).

In that case something else must be wrong with your module. None of the
other games with acp-independent units use material-to-build.

>> 1. The easiest fix is to get rid of material-to-build, at least until it is
>> supported for acp-independent units.
>
>I suppose I could re-configure the module so that only
>non-acp-independent units (conjurers and necromancers) are affected by
>material-to-build.  They need the material-to-build code because
>otherwise they could continue to build after they exhaust their supply.

check_build_action checks that the supply needed by build_step_consumption
is available, so if the unit-consumption-per-build tables are set
correctly, material-to-build should not be needed. If it is, we may have a
bug in the build code.

>> 3. The third fix would be to get rid of the safety valve in task execution
>> and allow units to retry forever with the failed task. Granted, tasks may
>> be temporarily impossible, in which case going into reserve and retrying
>> next turn make sense. However, as you can see in the above code, the unit
>> goes into reserve only after it killed the task. I think it might make
>> sense to instead save the task (whether a build task or a move task) and
>> try again next turn when the conditions have changed.
>
>In that case the cure may be worse than the disease.  Imagine the
>frustration in the standard game if a battleship or carrier (or a
>similarly expensive unit in another game) ran out of fuel because
>something blocked its path to the supply point, and the player never
>caught it because the plan was never canceled.

There is another safety valve in execute_plan that cancels the plan it
after 1000 failed attempts. And then there is code in the mplayer that will
put the unit in reserve if things don't work out. The question is how many
of these safety valves we need and where they should be. I would prefer one
only, so that errors are handled in a predictable way.

Hans


  reply	other threads:[~2004-06-15  7:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-11  6:17 Lincoln Peters
2004-06-11  6:40 ` Hans Ronne
2004-06-12  6:45   ` Lincoln Peters
2004-06-12  9:01     ` Hans Ronne
2004-06-13 21:45     ` Hans Ronne
2004-06-14 23:34     ` Hans Ronne
2004-06-15  4:55       ` Lincoln Peters
2004-06-15  7:18         ` Hans Ronne [this message]
2004-06-15 20:51           ` Lincoln Peters
2004-06-16  4:08             ` New Wreck-Type Options Elijah Meeks
2004-06-16 13:49               ` Eric McDonald
2004-06-16 21:00             ` Bug in acp-independent action code Hans Ronne
2004-06-15  5:19       ` Eric McDonald

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='l03130303bcf44fc1b439@[212.181.162.155]' \
    --to=hronne@comhem.se \
    --cc=sampln@sbcglobal.net \
    --cc=xconq7@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).