public inbox for xconq7@sourceware.org
 help / color / mirror / Atom feed
From: Hans Ronne <hronne@comhem.se>
To: Peter Garrone <pgarrone@acay.com.au>
Cc: xconq7@sources.redhat.com
Subject: Re: pathfinding refueling
Date: Mon, 22 Dec 2003 11:46:00 -0000	[thread overview]
Message-ID: <l03130301bc0b42cf78d1@[212.181.162.155]> (raw)
In-Reply-To: <20031221073829.GA652@leonardo>

>> Yes. But we must still check the treasury in order to decide what materials
>> should at all be considered as fuel.
>
>I am planning on testing all materials for all materials, once at the
>start. If any materials are consumed and required per turn or per move,
>then it is a fuel. If any fuels have a receive-from distance of zero,
>then it is a controlled fuel. The controlled fuel giving the shortest
>range is the one that is controlled in the path-finding. But all
>refueling points must be able to replenish all fuels required, otherwise
>it is ignored as a refueling point. I am not planning to do a global
>treasury check. Actually I am not completely sure what you mean, which
>is why i am reiterating the proposed algorithm, hopefully it covers what
>you mean.

After looking at the code, I can understand if you were puzzled by my
comment. The way the treasury is supposed to work, a unit will take the
difference between the material it needs for any type of action and its own
supply from the treasury. However, this is not implemented for move
actions: consume_move_supplies only uses the unit's supply. This is clearly
a bug, which I will fix.

In any case, a material that is consumed per turn or per move and has a
receive-from distance of zero can still have a treasury. So once the bug
has been fixed, the algorithm would have to check the treasury. Or to be
more specific: check if a treasury exists for m and if
um_takes_from_treasury is greater than zero. In that case, m should
probably not be considered a controlled fuel.

I say probably, because it is possible to have some units give material to
the treasury and some hoard it (depending on um_gives_to_treasury). If the
units who produce m also hoard it, then we a situation resembling the
normal case. I don't think any games use this possibility now, however, so
we can perhaps worry about this complication later.

Hans


  reply	other threads:[~2003-12-21 13:16 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20031218063340.GA733@leonardo>
2003-12-18 21:54 ` Eric McDonald
2003-12-19  1:43   ` Peter Garrone
2003-12-19  4:12     ` Eric McDonald
2003-12-20  6:44       ` Peter Garrone
2003-12-20 23:00         ` pathfinding refueling 2 (was Re: pathfinding refueling) Eric McDonald
2003-12-20  6:43     ` pathfinding refueling Eric McDonald
2003-12-20  6:43       ` Peter Garrone
2003-12-20 22:50         ` Eric McDonald
2003-12-20 23:00           ` Hans Ronne
2003-12-21  2:36             ` Peter Garrone
2003-12-20 23:21           ` Peter Garrone
2003-12-21  7:27             ` Mark A. Flacy
2003-12-20  6:43     ` Hans Ronne
2003-12-20 16:09       ` Peter Garrone
2003-12-20 17:08         ` Hans Ronne
2003-12-20 23:31           ` Peter Garrone
2003-12-21  7:22             ` Hans Ronne
2003-12-21 23:07               ` Peter Garrone
2003-12-22 11:46                 ` Hans Ronne [this message]
2003-12-23  4:08                 ` Lincoln Peters
2003-12-23  4:25                   ` Peter Garrone
2003-12-17 10:28 Peter Garrone
2003-12-18  5:30 ` Eric McDonald
2003-12-19  0:12 ` Jim Kingdon
2003-12-20 11:55   ` Peter Garrone

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='l03130301bc0b42cf78d1@[212.181.162.155]' \
    --to=hronne@comhem.se \
    --cc=pgarrone@acay.com.au \
    --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).