public inbox for xconq7@sourceware.org
 help / color / mirror / Atom feed
From: Peter Garrone <pgarrone@acay.com.au>
To: xconq7@sources.redhat.com
Cc: Hans Ronne <hronne@comhem.se>
Subject: plan_transport
Date: Sun, 07 Dec 2003 00:59:00 -0000	[thread overview]
Message-ID: <20031206224329.GA473@leonardo> (raw)

 I thought I would review the current problems and proposed fixes.
 I originally planned on sending this only to some people, but I think
 others probably could provide some valuable feedback.

The problems are:
- ferries are not built as they should be
  because the normal pathway where the task return a TASK_FAILED when it
  can no longer go forward, the ai calls the impassable function and
  sets a flag so that a ferry is assigned for construction, no longer
  works. The reasons why this no longer works as well are:
  - There is a bug in the path code so transportation is forbidden
  - The pathfinding returns impassable if no ferries are available, so
    they are never scheduled to be built because no paths ever require them.
- ferries are not assigned as they should be.
  (Actually this was a problem with the pre-path code.)
  - ferries are often assigned to react to enemy intrusions, even air
    attacks over impassable terrain, or to attack battleships and
    aircraft carriers.
  - A task is assigned to a full ferry before it calls the function that
    checks where all the current occupants are going and it goes to the
    middle of an ocean before returning to drop off its occupants.
  - ferries sometimes move a hex when an occupant has been scheduled to
    board, causing the occupant to disappear into the ocean.

Proposed solution.
 A solution to these problems (attribution to Hans here) would be as follows.
 - implement a PLAN_TRANSPORT for ferries, so they are permanently
   assigned to transportation duties, though of course offensive units
   will be transported by them.
 - implement a TRANSPORT_TASK as well, so that human players can asign a
   unit to ferrying, and units will move across islands and seas without
   all that bookkeeping. So a PLAN_TRANSPORT will activate a
   TRANSPORT_TASK.
 - Have only two tasks that do movement, the moveto task and the pickup
   task. The pickup task is only used by the ferry. The hit-unit and
   occupy tasks push moveto tasks. Only the moveto task hails a ferry.
 - When the moveto task needs to board a ferry, it hails it in the task
   code, scheduling a ferry if one exists. If one doesnt, it returns a
   TASK_FAILED and higher level ai code determines the failure reason
   and schedules a ferry to be built, and reassigns the unit to another
   task.
 - ai code also inspects the schedule of units waiting for a ferry, and
   if there is too much of a queue, or any sort of a queue, ensures that
   enough ferries are being build to handle them.
 - If a ferry has been waiting round for some large number of moves
   without any action, it returns a TASK_FAILED and gets reassigned to
   something offensive.
 - Something needs to be added to the ai code so that it can distinguish
   a simple ferry from something offensive, like an aircraft carrier or
   bireme/trireme. This is asking a lot but perhaps some simple
   heuristic could fix this. So a bireme would not go onto
   PLAN_TRANSPORT, but instead grab an archer to help it in sea-battles.
 - The pathfinding would need to be somewhat extended here. It need so
   consider going from A to B using ferry type C, extending the state
   space it explores for possible solutions from simple x,y position.
 - consideration could be given to implementing refueling behavior, 
   a boring detail for the human player,
   while extending the pathfinding state space.

   This is my "wishlist". I will attempt to implement it in stages, so
   that a partial implementation may suffice for a 7.5 release, comments
   invited,
    Peter.
   

             reply	other threads:[~2003-12-06 22:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-07  0:59 Peter Garrone [this message]
2003-12-07  2:02 ` plan_transport Eric McDonald
2003-12-08  0:28   ` plan_transport Peter Garrone
2003-12-08  1:23     ` plan_transport Hans Ronne
2003-12-07  8:26 ` plan_transport Hans Ronne
2003-12-08  0:50   ` plan_transport Peter Garrone
2003-12-08  3:26     ` plan_transport Hans Ronne
2003-12-08  3:55       ` plan_transport Hans Ronne

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=20031206224329.GA473@leonardo \
    --to=pgarrone@acay.com.au \
    --cc=hronne@comhem.se \
    --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).